Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
…912cdd6b-5c7d-d5a7-a2ba-d0f0cdb91641
  • Loading branch information
juliantenney committed Dec 8, 2011
1 parent 959056e commit 7b7f740
Showing 1 changed file with 1 addition and 108 deletions.
109 changes: 1 addition & 108 deletions modules/xerte/parent_templates/Nottingham/models/flickr.rlm
@@ -1,108 +1 @@
<PG title="enter page title" name="flickr">
<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);
}

imageIndex = 0;
imageCount = 0;

if (pageIcon.templateData.flickr[0].narration != undefined){
narration = pageIcon.templateData.flickr[0].narration;
rootIcon.broadcast('showAudio');
}
]]></SCR>
<DIS tabIndex="-1" id="panel" h="474" w="520" name="panel" x="260" y="20" type="ext" url="templatePath + 'common/whitePanel.swf'"><![CDATA[]]></DIS>
<DIS id="myImg" name="image" x="panel._x + 10" y="panel._y + 10" type="ext" url="--loadedByCode--"><![CDATA[]]></DIS>
<DIS textColour="#333333" id="orientation" name="orientation" x="280" y="464" w="180" h="10" type="text"><![CDATA[Loading...]]></DIS>
<INT id="imageInteraction" name="getNewImage" perpetual="1">
<RES toolTip="Previous Image" rs="btnPrev" swf="templatePath + 'common/leftButton.swf'" name="previousImage" type="button" x="725" y="464" label="Back" erase="1" exit="0">
<SCR name="prev"><![CDATA[if (imageIndex > 0){
imageIndex--;
imageInteraction.broadcast('getImage');
}

]]></SCR>
</RES>
<RES toolTip="Next Image" rs="btnNext" swf="templatePath + 'common/rightButton.swf'" name="nextImage" type="button" x="750" y="464" label="Next" erase="1" exit="0">
<SCR name="next"><![CDATA[if (imageIndex <= imageCount || imageCount == 0){
imageIndex++;
imageInteraction.broadcast('getImage');
}]]></SCR>
</RES>
<RES name="getImage" type="event" eventName="getImage" icon="imageInteraction" erase="1" exit="0">
<SCR name="getNewData"><![CDATA[//disable controls
btnPrev.setEnabled(false);
btnNext.setEnabled(false);

//show status
orientation.setText("Loading...");

//to search
url = "http://api.flickr.com/services/rest/"
url += "?api_key=8f6f38d31f048a90c436583a6ac92e47";
url += "&method=flickr.photos.search";
url += "&text=" + pageIcon.templateData.flickr[0].keywords;
url += "&per_page=500";
url += "&safe_search=1";
url += "&l=cc";//creative commons
//url += "&group_id=31917163@N00"; //color fields

reqXML = new XML("<myXML/>");
myImg.sendAndLoad(reqXML, url);]]></SCR>
<INT name="firstHandler" perpetual="0">
<RES name="onS&L" type="event" eventName="onSendAndLoad" icon="myImg" erase="1" exit="1">
<SCR name="getID"><![CDATA[id = myImg.templateData.rsp[0].photos[0].photo[imageIndex].id;

imageCount = myImg.templateData.rsp[0].photos[0].photo.length;

orientation.setText('Image ' + (imageIndex + 1) + ' of ' + imageCount);

url = "http://api.flickr.com/services/rest/"
url += "?api_key=8f6f38d31f048a90c436583a6ac92e47";
url += "&method=flickr.photos.getSizes";
url += "&photo_id=" + id ;

reqXML = new XML("<myXML/>");
myImg.sendAndLoad(reqXML, url);



]]></SCR>
</RES>
</INT>
<INT name="secondHandler" perpetual="0">
<RES name="onS&L" type="event" eventName="onSendAndLoad" icon="myImg" erase="1" exit="1">
<SCR name="getSource"><![CDATA[img = myImg.templateData.rsp[0].sizes[0].size[3].source;
myImg.loadImage(img);]]></SCR>
</RES>
</INT>
</RES>
<RES name="onLoadImage" type="event" eventName="onLoad" icon="myImg" erase="0" exit="0">
<SCR name="positionImage"><![CDATA[//resize image
myImg.constrain(500,400);

myImg._x = panel._x + 260 - myImg._width / 2;
myImg._y = panel._y + 237 - myImg._height / 2;

btnPrev.setEnabled(true);
btnNext.setEnabled(true);
]]></SCR>
</RES>
<RES name="[Untitled]" type="hotObject" rs="myImg" click="1" cursor="1" erase="1" exit="0">
<SCR name="[Untitled]"><![CDATA[getURL(myImg.templateData.rsp[0].sizes[0].size[3].url, "_blank");]]></SCR>
</RES>
</INT>
<DIS scrolling="auto" id="textBlock" h="480" name="text" x="20" y="20" w="230" type="text"><![CDATA[{pageIcon.templateData.flickr[0]}]]></DIS>
<SCR name="initialise"><![CDATA[imageInteraction.broadcast('getImage');

]]></SCR>
</PG>
<PG title="enter page title" name="flickr"> <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);}imageIndex = 0;imageCount = 0;if (pageIcon.templateData.flickr[0].narration != undefined){ narration = pageIcon.templateData.flickr[0].narration; rootIcon.broadcast('showAudio');}]]></SCR> <DIS tabIndex="-1" id="panel" h="474" w="520" name="panel" x="260" y="20" type="ext" url="templatePath + 'common/whitePanel.swf'"><![CDATA[]]></DIS> <DIS id="myImg" name="image" x="panel._x + 10" y="panel._y + 10" type="ext" url="--loadedByCode--"><![CDATA[]]></DIS> <DIS textColour="#333333" id="orientation" name="orientation" x="280" y="464" w="180" h="10" type="text"><![CDATA[Loading...]]></DIS> <INT id="imageInteraction" name="getNewImage" perpetual="1"> <RES toolTip="Previous Image" rs="btnPrev" swf="templatePath + 'common/leftButton.swf'" name="previousImage" type="button" x="725" y="464" label="Back" erase="1" exit="0"> <SCR name="prev"><![CDATA[if (imageIndex > 0){ imageIndex--; imageInteraction.broadcast('getImage');}]]></SCR> </RES> <RES toolTip="Next Image" rs="btnNext" swf="templatePath + 'common/rightButton.swf'" name="nextImage" type="button" x="750" y="464" label="Next" erase="1" exit="0"> <SCR name="next"><![CDATA[if (imageIndex <= imageCount || imageCount == 0){ imageIndex++; imageInteraction.broadcast('getImage');}]]></SCR> </RES> <RES name="getImage" type="event" eventName="getImage" icon="imageInteraction" erase="1" exit="0"> <SCR name="getNewData"><![CDATA[//disable controlsbtnPrev.setEnabled(false);btnNext.setEnabled(false);//show statusorientation.setText("Loading...");//to searchurl = "http://api.flickr.com/services/rest/"url += "?api_key=8f6f38d31f048a90c436583a6ac92e47";url += "&method=flickr.photos.search";url += "&text=" + pageIcon.templateData.flickr[0].keywords;url += "&per_page=500";url += "&safe_search=1";url += "&license=4,6,5";//creative commonsreqXML = new XML("<myXML/>");myImg.sendAndLoad(reqXML, url);]]></SCR> <INT name="firstHandler" perpetual="0"> <RES name="onS&L" type="event" eventName="onSendAndLoad" icon="myImg" erase="1" exit="1"> <SCR name="getID"><![CDATA[id = myImg.templateData.rsp[0].photos[0].photo[imageIndex].id;imageCount = myImg.templateData.rsp[0].photos[0].photo.length;orientation.setText('Image ' + (imageIndex + 1) + ' of ' + imageCount);url = "http://api.flickr.com/services/rest/"url += "?api_key=8f6f38d31f048a90c436583a6ac92e47";url += "&method=flickr.photos.getSizes";url += "&photo_id=" + id ;reqXML = new XML("<myXML/>");myImg.sendAndLoad(reqXML, url);]]></SCR> </RES> </INT> <INT name="secondHandler" perpetual="0"> <RES name="onS&L" type="event" eventName="onSendAndLoad" icon="myImg" erase="1" exit="1"> <SCR name="getSource"><![CDATA[img = myImg.templateData.rsp[0].sizes[0].size[3].source;myImg.loadImage(img);]]></SCR> </RES> </INT> </RES> <RES name="onLoadImage" type="event" eventName="onLoad" icon="myImg" erase="0" exit="0"> <SCR name="positionImage"><![CDATA[//resize imagemyImg.constrain(500,400);myImg._x = panel._x + 260 - myImg._width / 2;myImg._y = panel._y + 237 - myImg._height / 2;btnPrev.setEnabled(true);btnNext.setEnabled(true);]]></SCR> </RES> <RES name="[Untitled]" type="hotObject" rs="myImg" click="1" cursor="1" erase="1" exit="0"> <SCR name="[Untitled]"><![CDATA[getURL(myImg.templateData.rsp[0].sizes[0].size[3].url, "_blank");]]></SCR> </RES> </INT> <DIS scrolling="auto" id="textBlock" h="480" name="text" x="20" y="20" w="230" type="text"><![CDATA[{pageIcon.templateData.flickr[0]}]]></DIS> <SCR name="initialise"><![CDATA[imageInteraction.broadcast('getImage');]]></SCR> </PG>
Expand Down

0 comments on commit 7b7f740

Please sign in to comment.