Skip to content

Commit

Permalink
Bug fix to audioSlideshow & perspectives models
Browse files Browse the repository at this point in the history
git-svn-id: https://xerteonlinetoolkits.googlecode.com/svn/trunk@231 912cdd6b-5c7d-d5a7-a2ba-d0f0cdb91641
  • Loading branch information
FayCross committed Nov 10, 2011
1 parent c9a2dea commit dda16a4
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 103 deletions.
8 changes: 8 additions & 0 deletions modules/xerte/parent_templates/Nottingham/data.xwd
Expand Up @@ -1276,6 +1276,7 @@
<newNodes>
<movie><![CDATA[<movie txt="Enter text for the page here" src="Select a Video" name="Video"></movie>]]></movie>
<sound><![CDATA[<sound txt="Enter text for the page here" src="Select a Sound" name="Sound"></sound>]]></sound>
<image><![CDATA[<image txt="Enter text for the page here" src="Select an Image" name="Image"></image>]]></image>
</newNodes>

</perspectives>
Expand All @@ -1293,6 +1294,13 @@
<img type="media" label="Image" optional="true"></img>
<tooltip type="TextInput" height="300" label="Tooltip" optional="true"/>
</sound>

<image duplicate="true" menuItem="Image" remove="true" icon="icImage">
<name type="TextInput" label="Title"/>
<txt type="TextArea" height="300" label="Text"/>
<src type="media" label="Image File"/>
<tooltip type="TextInput" height="300" label="Tooltip" optional="true"/>
</image>


</wizard>
103 changes: 1 addition & 102 deletions modules/xerte/parent_templates/Nottingham/models/audioSlideshow.rlm
@@ -1,102 +1 @@
<PG title="enter page title" name="audioSlideshow">
<SCR name="getPageID"><![CDATA[pageIcon = icon.parentNode.clip();

if (extXML == undefined){
// 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);
}

itemCount = pageIcon.templateData.audioSlideshow[0].nestedPage.length);

panelWidth = pageIcon.templateData.audioSlideshow[0].panelWidth;
if (panelWidth == "Small"){
panelW = 300;
textW = 440;
} else if (panelWidth == "Medium"){
panelW = 450;
textW = 290;
} else if (panelWidth == "Large"){
panelW = 600;
textW = 150;
} else {
panelW = 760;
textW = 0;
}

if (pageIcon.templateData.audioSlideshow[0].narration != undefined){
narration = pageIcon.templateData.audioSlideshow[0].narration;
rootIcon.broadcast('showAudio');
}
]]></SCR>
<DIS h="474" w="panelW" tabIndex="-1" id="panel" name="panel" x="780 - panelW" y="20" type="ext" url="templatePath + 'common/whitePanel.swf'"><![CDATA[]]></DIS>
<INT name="loadPanel" perpetual="0">
<RES name="onLoad" type="event" eventName="onLoad" icon="panel" erase="1" exit="1">
<SCR name="calculate"><![CDATA[//ok to move on



]]></SCR>
</RES>
</INT>
<DIS scrolling="auto" id="textBlock" h="480" name="text" x="20" y="20" w="textW" type="text"><![CDATA[{pageIcon.templateData.audioSlideshow[0].text}]]></DIS>
<INT name="[Untitled]" perpetual="1">
<RES name="[Untitled]" type="timeLimit" secs="0" reset="0" erase="1" exit="0">
<SCR name="[Untitled]"><![CDATA[if (pageIcon.templateData.audioSlideshow[0].nestedPage[0].synch == 0){
snd.nextPage();
}]]></SCR>
</RES>
</INT>
<SCR name="makePages"><![CDATA[if (icon.attributes.built != 'true'){
icon.nextSibling.childNodes[0].duplicate(itemCount - 1);
icon.attributes.built = 'true';
}
icon.nextSibling.firstChild.attributes.rs = 'initButton';
icon.nextSibling.attributes.controls = panel._x + ',' + (panel._y + panel._height - 20) + ',' + panel._width;

//make the synch points...
for (i = 0; i < itemCount; i++){
icon.nextSibling.childNodes[i].attributes.synchPoint = pageIcon.templateData.audioSlideshow[0].nestedPage[i].synch * 1000;
}
]]></SCR>
<SND eraseChildren="1" id="snd" controls="0,0,400" name="sound" type="ext" url="{pageIcon.templateData.audioSlideshow[0].sound}" play="0" loop="0" wait="0">
<PG synchPoint="2000" name="protoPage">
<SCR name="setSize"><![CDATA[if (pageIcon.templateData.audioSlideshow[0].nestedPage[icon.parentNode.index() - 1].url == undefined){
icon.nextSibling.nextSibling.attributes.tabIndex = -1;
}
if (pageIcon.templateData.audioSlideshow[0].nestedPage[icon.parentNode.index() - 1].controls == 'Control Bar'){
icon.nextSibling.nextSibling.attributes.controls = '1';
}
if (pageIcon.templateData.audioSlideshow[0].nestedPage[icon.parentNode.index()].tip != undefined){
icon.nextSibling.nextSibling.attributes.toolTip = pageIcon.templateData.audioSlideshow[0].nestedPage[icon.parentNode.index()].tip;
icon.nextSibling.nextSibling.nodeValue = '{' + pageIcon.templateData.audioSlideshow[0].nestedPage[icon.parentNode.index()].tip + '}';
}
]]></SCR>
<DIS textColour="#333333" id="desc" name="protoText" x="panel._x + 20" y="40" w="panelW - 40" h="10" type="text"><![CDATA[{'<b>' + pageIcon.templateData.audioSlideshow[0].nestedPage[icon.parentNode.index()].name + '</b><br>' + pageIcon.templateData.audioSlideshow[0].nestedPage[icon.parentNode.index()].text}]]></DIS>
<DIS transition="fadeIn(10)" id="graphic" name="protoGraphic" x="0" y="desc._y + desc._height + 20" type="ext" url="{pageIcon.templateData.audioSlideshow[0].nestedPage[icon.parentNode.index()].url}"><![CDATA[]]></DIS>
<INT name="loadGraphic&Resize" perpetual="0">
<RES name="onLoad" type="event" eventName="onLoad" icon="graphic" erase="1" exit="0">
<SCR name="resize&Position"><![CDATA[space = panel._height - 80 - desc._height;
graphic.constrain(panelW - 40, space);

if (pageIcon.templateData.audioSlideshow[0].nestedPage[snd.getPageIndex()].align == 'Bottom'){
desc._y = 40 + graphic._height + 20;
graphic._y = 40;
}
graphic.fade('in',1,'None','easeNone');

if (pageIcon.templateData.audioSlideshow[0].nestedPage[snd.getPageIndex()].initObject != undefined){
obj = expression(pageIcon.templateData.audioSlideshow[0].nestedPage[snd.getPageIndex()].initObject, engine);
graphic.clip.init(obj);
}
graphic._x = panel._x + panel._width / 2 - graphic._width / 2;]]></SCR>
</RES>
</INT>
</PG>
</SND>
</PG>
<PG title="enter page title" name="audioSlideshow"> <SCR name="getPageID"><![CDATA[pageIcon = icon.parentNode.clip();if (extXML == undefined){ // 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);}itemCount = pageIcon.templateData.audioSlideshow[0].nestedPage.length);panelWidth = pageIcon.templateData.audioSlideshow[0].panelWidth;if (panelWidth == "Small"){ panelW = 300; textW = 440;} else if (panelWidth == "Medium"){ panelW = 450; textW = 290;} else if (panelWidth == "Large"){ panelW = 600; textW = 150;} else { panelW = 760; textW = 0;}if (pageIcon.templateData.audioSlideshow[0].narration != undefined){ narration = pageIcon.templateData.audioSlideshow[0].narration; rootIcon.broadcast('showAudio');}]]></SCR> <DIS h="474" w="panelW" tabIndex="-1" id="panel" name="panel" x="780 - panelW" y="20" type="ext" url="templatePath + 'common/whitePanel.swf'"><![CDATA[]]></DIS> <INT name="loadPanel" perpetual="0"> <RES name="onLoad" type="event" eventName="onLoad" icon="panel" erase="1" exit="1"> <SCR name="calculate"><![CDATA[//ok to move on]]></SCR> </RES> </INT> <DIS scrolling="auto" id="textBlock" h="480" name="text" x="20" y="20" w="textW" type="text"><![CDATA[{pageIcon.templateData.audioSlideshow[0].text}]]></DIS> <INT name="[Untitled]" perpetual="1"> <RES name="[Untitled]" type="timeLimit" secs="0" reset="0" erase="1" exit="0"> <SCR name="[Untitled]"><![CDATA[if (pageIcon.templateData.audioSlideshow[0].nestedPage[0].synch == 0){ snd.nextPage();}]]></SCR> </RES> </INT> <SCR name="makePages"><![CDATA[if (icon.attributes.built != 'true'){ icon.nextSibling.childNodes[0].duplicate(itemCount - 1); icon.attributes.built = 'true';}icon.nextSibling.firstChild.attributes.rs = 'initButton';icon.nextSibling.attributes.controls = panel._x + ',' + (panel._y + panel._height - 20) + ',' + panel._width;//make the synch points...for (i = 0; i < itemCount; i++){ icon.nextSibling.childNodes[i].attributes.synchPoint = pageIcon.templateData.audioSlideshow[0].nestedPage[i].synch * 1000;}]]></SCR> <SND eraseChildren="1" id="snd" controls="0,0,400" name="sound" type="ext" url="{pageIcon.templateData.audioSlideshow[0].sound}" play="0" loop="0" wait="0"> <PG synchPoint="2000" name="protoPage"> <SCR name="setSize"><![CDATA[if (pageIcon.templateData.audioSlideshow[0].nestedPage[icon.parentNode.index() - 1].url == undefined){ icon.nextSibling.nextSibling.attributes.tabIndex = -1;}if (pageIcon.templateData.audioSlideshow[0].nestedPage[icon.parentNode.index() - 1].controls == 'Control Bar'){ icon.nextSibling.nextSibling.attributes.controls = '1';}if (pageIcon.templateData.audioSlideshow[0].nestedPage[icon.parentNode.index()].tip != undefined){ icon.nextSibling.nextSibling.attributes.toolTip = pageIcon.templateData.audioSlideshow[0].nestedPage[icon.parentNode.index()].tip; //icon.nextSibling.nextSibling.nodeValue = '{' + pageIcon.templateData.audioSlideshow[0].nestedPage[icon.parentNode.index()].tip + '}';}]]></SCR> <DIS textColour="#333333" id="desc" name="protoText" x="panel._x + 20" y="40" w="panelW - 40" h="10" type="text"><![CDATA[{'<b>' + pageIcon.templateData.audioSlideshow[0].nestedPage[icon.parentNode.index()].name + '</b><br>' + pageIcon.templateData.audioSlideshow[0].nestedPage[icon.parentNode.index()].text}]]></DIS> <DIS transition="fadeIn(10)" id="graphic" name="protoGraphic" x="0" y="desc._y + desc._height + 20" type="ext" url="{pageIcon.templateData.audioSlideshow[0].nestedPage[icon.parentNode.index()].url}"><![CDATA[]]></DIS> <INT name="loadGraphic&Resize" perpetual="0"> <RES name="onLoad" type="event" eventName="onLoad" icon="graphic" erase="1" exit="0"> <SCR name="resize&Position"><![CDATA[space = panel._height - 80 - desc._height;graphic.constrain(panelW - 40, space);if (pageIcon.templateData.audioSlideshow[0].nestedPage[snd.getPageIndex()].align == 'Bottom'){ desc._y = 40 + graphic._height + 20; graphic._y = 40;}graphic.fade('in',1,'None','easeNone');if (pageIcon.templateData.audioSlideshow[0].nestedPage[snd.getPageIndex()].initObject != undefined){ obj = expression(pageIcon.templateData.audioSlideshow[0].nestedPage[snd.getPageIndex()].initObject, engine); graphic.clip.init(obj);}graphic._x = panel._x + panel._width / 2 - graphic._width / 2;]]></SCR> </RES> </INT> </PG> </SND> </PG>
Expand Down

0 comments on commit dda16a4

Please sign in to comment.