Skip to content

Commit

Permalink
Found a couple of lines with missing semicolons, so added them.
Browse files Browse the repository at this point in the history
git-svn-id: https://xerteonlinetoolkits.googlecode.com/svn/trunk@427 912cdd6b-5c7d-d5a7-a2ba-d0f0cdb91641
  • Loading branch information
Johnathan Kemp committed Sep 12, 2012
1 parent b406a8e commit 294110b
Showing 1 changed file with 1 addition and 113 deletions.
114 changes: 1 addition & 113 deletions modules/xerte/parent_templates/Nottingham/models/title.rlm
@@ -1,113 +1 @@
<PG title="Title" name="title">
<SCR name="getPageID"><![CDATA[pageIcon = icon.parentNode.clip();

if (rootIcon.projMode == "dev"){
// Page Wizard
pageIcon.templateData = pageIcon.extXML.toObject();
pageIcon.templateData = pageIcon.templateData.pageWizard[0];
} else {
// Toolkits
myXML = new XML(extXML.firstChild.childNodes[rootIcon.getPageIndex() - pgOffset]);
pageIcon.templateData = myXML.toObject();

}
rootIcon.setTitleText(templateData.learningObject[0].name);

// handle multiple page data definitions in a project
if (rootIcon.projectPageIndex == undefined){
rootIcon.projectPageIndex = 0;
}
// check if this page has a definition for the current project index and default to 0 if not
if (pageIcon.templateData.title[rootIcon.projectPageIndex].name == undefined){
projPI = 0;
} else {
projPI = rootIcon.projectPageIndex;
}

icon.parentNode.getChildByName('text').attributes.textSize = pageIcon.templateData.title[projPI].size;

if (pageIcon.templateData.title[projPI].bgImage == undefined && icon.built != 'true'){
icon.nextSibling.removeNode();
icon.built = 'true';
}

if (pageIcon.templateData.title[projPI].bgImageAlpha != undefined){
icon.nextSibling.attributes.initObject = '{_alpha:' + pageIcon.templateData.title[projPI].bgImageAlpha + '}';
}

titleStr = '<p align="center">' + pageIcon.templateData.title[projPI] + '</p>'
if (pageIcon.templateData.title[projPI].titleHAlign != undefined){
titleStr = '<p align="' + pageIcon.templateData.title[projPI].titleHAlign + '">' + pageIcon.templateData.title[projPI] + '</p>'
}
if (pageIcon.templateData.title[projPI].titleTextColour != undefined){
icon.parentNode.getChildByName('text').attributes.textColour = pageIcon.templateData.title[projPI].titleTextColour.split('0x').join('#');
}

if (pageIcon.templateData.title[projPI].narration != undefined){
narration = pageIcon.templateData.title[projPI].narration;
rootIcon.broadcast('showAudio');
}

]]></SCR>
<DIS id="backgroundImage" h="516" w="800" name="backgroundImage" x="0" y="0" type="ext" url="{pageIcon.templateData.title[projPI].bgImage}"><![CDATA[]]></DIS>
<DIS id="txt" name="text" x="20" y="200" w="760" h="475" type="text"><![CDATA[{titleStr}]]></DIS>
<SCR name="centreY"><![CDATA[//top
if (pageIcon.templateData.title[projPI].titleVAlign == '20' || pageIcon.templateData.title[projPI].titleVAlign == ''){
txt._y = 20;
}
//middle
if (pageIcon.templateData.title[projPI].titleVAlign == '200' || pageIcon.templateData.title[projPI].titleVAlign == undefined){
txt._y = 200 - txt._height / 2;
}
//bottom
if (pageIcon.templateData.title[projPI].titleVAlign == '400'){
txt._y = 514 - txt._height - 20;
}
]]></SCR>
<INT name="loadImage" perpetual="0">
<RES name="onLoad" type="event" eventName="onLoad" icon="backgroundImage" erase="1" exit="0">
<SCR name="resize"><![CDATA[// set up defaults
bgMaxWidth = 1000;
bgMaxHeight = 1000;
bgConstrain = false;

// constrain the image if required
if (pageIcon.templateData.title[projPI].bgImageVConstrain != undefined){
bgMaxHeight = pageIcon.templateData.title[projPI].bgImageVConstrain;
bgConstrain = true;
}

if (pageIcon.templateData.title[projPI].bgImageHConstrain != undefined){
bgMaxWidth = pageIcon.templateData.title[projPI].bgImageHConstrain;
bgConstrain = true;
}

if (bgConstrain) {
backgroundImage.constrain(bgMaxWidth, bgMaxHeight);
}

// position background image
if (pageIcon.templateData.title[projPI].bgImageVAlign == "top"){
backgroundImage._y = 0;
}
else if (pageIcon.templateData.title[projPI].bgImageVAlign == "bottom"){
backgroundImage._y = 514 - backgroundImage._height;
}
// default is to centre image
else {
backgroundImage._y = 257 - backgroundImage._height / 2;
}

if (pageIcon.templateData.title[projPI].bgImageHAlign == "left"){
backgroundImage._x = 0;
}
else if (pageIcon.templateData.title[projPI].bgImageHAlign == "right"){
backgroundImage._x = 800 - backgroundImage._width;
}
// default is to centre image
else {
backgroundImage._x = 400 - backgroundImage._width / 2;
}]]></SCR>
</RES>
</INT>
</PG>
<PG title="Title" name="title"> <SCR name="getPageID"><![CDATA[pageIcon = icon.parentNode.clip();if (rootIcon.projMode == "dev"){ // Page Wizard pageIcon.templateData = pageIcon.extXML.toObject(); pageIcon.templateData = pageIcon.templateData.pageWizard[0];} else { // Toolkits myXML = new XML(extXML.firstChild.childNodes[rootIcon.getPageIndex() - pgOffset]); pageIcon.templateData = myXML.toObject();} rootIcon.setTitleText(templateData.learningObject[0].name); // handle multiple page data definitions in a project if (rootIcon.projectPageIndex == undefined){ rootIcon.projectPageIndex = 0;}// check if this page has a definition for the current project index and default to 0 if notif (pageIcon.templateData.title[rootIcon.projectPageIndex].name == undefined){ projPI = 0;} else { projPI = rootIcon.projectPageIndex; } icon.parentNode.getChildByName('text').attributes.textSize = pageIcon.templateData.title[projPI].size;if (pageIcon.templateData.title[projPI].bgImage == undefined && icon.built != 'true'){ icon.nextSibling.removeNode(); icon.built = 'true';}if (pageIcon.templateData.title[projPI].bgImageAlpha != undefined){ icon.nextSibling.attributes.initObject = '{_alpha:' + pageIcon.templateData.title[projPI].bgImageAlpha + '}';}titleStr = '<p align="center">' + pageIcon.templateData.title[projPI] + '</p>';if (pageIcon.templateData.title[projPI].titleHAlign != undefined){ titleStr = '<p align="' + pageIcon.templateData.title[projPI].titleHAlign + '">' + pageIcon.templateData.title[projPI] + '</p>';}if (pageIcon.templateData.title[projPI].titleTextColour != undefined){ icon.parentNode.getChildByName('text').attributes.textColour = pageIcon.templateData.title[projPI].titleTextColour.split('0x').join('#');}if (pageIcon.templateData.title[projPI].narration != undefined){ narration = pageIcon.templateData.title[projPI].narration; rootIcon.broadcast('showAudio');}]]></SCR> <DIS id="backgroundImage" h="516" w="800" name="backgroundImage" x="0" y="0" type="ext" url="{pageIcon.templateData.title[projPI].bgImage}"><![CDATA[]]></DIS> <DIS id="txt" name="text" x="20" y="200" w="760" h="475" type="text"><![CDATA[{titleStr}]]></DIS> <SCR name="centreY"><![CDATA[//topif (pageIcon.templateData.title[projPI].titleVAlign == '20' || pageIcon.templateData.title[projPI].titleVAlign == ''){ txt._y = 20;}//middleif (pageIcon.templateData.title[projPI].titleVAlign == '200' || pageIcon.templateData.title[projPI].titleVAlign == undefined){ txt._y = 200 - txt._height / 2;}//bottomif (pageIcon.templateData.title[projPI].titleVAlign == '400'){ txt._y = 514 - txt._height - 20;}]]></SCR> <INT name="loadImage" perpetual="0"> <RES name="onLoad" type="event" eventName="onLoad" icon="backgroundImage" erase="1" exit="0"> <SCR name="resize"><![CDATA[// set up defaultsbgMaxWidth = 1000;bgMaxHeight = 1000;bgConstrain = false;// constrain the image if requiredif (pageIcon.templateData.title[projPI].bgImageVConstrain != undefined){ bgMaxHeight = pageIcon.templateData.title[projPI].bgImageVConstrain; bgConstrain = true;}if (pageIcon.templateData.title[projPI].bgImageHConstrain != undefined){ bgMaxWidth = pageIcon.templateData.title[projPI].bgImageHConstrain; bgConstrain = true;}if (bgConstrain) {backgroundImage.constrain(bgMaxWidth, bgMaxHeight);}// position background imageif (pageIcon.templateData.title[projPI].bgImageVAlign == "top"){ backgroundImage._y = 0; }else if (pageIcon.templateData.title[projPI].bgImageVAlign == "bottom"){ backgroundImage._y = 514 - backgroundImage._height; }// default is to centre imageelse { backgroundImage._y = 257 - backgroundImage._height / 2;}if (pageIcon.templateData.title[projPI].bgImageHAlign == "left"){ backgroundImage._x = 0; }else if (pageIcon.templateData.title[projPI].bgImageHAlign == "right"){ backgroundImage._x = 800 - backgroundImage._width; }// default is to centre imageelse { backgroundImage._x = 400 - backgroundImage._width / 2;}]]></SCR> </RES> </INT> </PG>
Expand Down

0 comments on commit 294110b

Please sign in to comment.