Skip to content

Commit

Permalink
Merge remote-tracking branch 'upstream/develop' into remove-mysql
Browse files Browse the repository at this point in the history
  • Loading branch information
DavidGoodwin committed May 9, 2014
2 parents e919a8c + ea1836b commit 81d982c
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
@@ -1 +1 @@
<PG title="flickr" name="flickr"> <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.flickr[rootIcon.projectPageIndex].name == undefined){ projPI = 0;} else { projPI = rootIcon.projectPageIndex; } // set up display textif (pageIcon.templateData.flickr[projPI].nextTipTxt != undefined){ nextTipTxt = pageIcon.templateData.flickr[projPI].nextTipTxt;} else { nextTipTxt = "Next Image";}if (pageIcon.templateData.flickr[projPI].priorTipTxt != undefined){ priorTipTxt = pageIcon.templateData.flickr[projPI].priorTipTxt;} else { priorTipTxt = "Previous Image";}if (pageIcon.templateData.flickr[projPI].loadingTxt != undefined){ loadingTxt = pageIcon.templateData.flickr[projPI].loadingTxt;} else { loadingTxt = "Loading...";}if (pageIcon.templateData.flickr[projPI].imageTxt != undefined){ imageTxt = pageIcon.templateData.flickr[projPI].imageTxt;} else { imageTxt = "Image {i} of {n} images";}imageIndex = 0;imageCount = 0;ccLicenses = new Array();ccLicenses.push('');ccLicenses.push({desc: 'Creative Commons Attribution-NonCommercial-ShareAlike License', url:'http://creativecommons.org/licenses/by-nc-sa/2.0/'});ccLicenses.push({desc: 'Creative Commons Attribution-NonCommercial License', url:'http://creativecommons.org/licenses/by-nc/2.0/'});ccLicenses.push({desc: 'Creative Commons Attribution-NonCommercial-NoDerivs License', url:'http://creativecommons.org/licenses/by-nc-nd/2.0/'});ccLicenses.push({desc: 'Creative Commons Attribution License', url:'http://creativecommons.org/licenses/by/2.0/'});ccLicenses.push({desc: 'Creative Commons Attribution-ShareAlike License', url:'http://creativecommons.org/licenses/by-sa/2.0/'});ccLicenses.push({desc: 'Creative Commons Attribution-NoDerivs License', url:'http://creativecommons.org/licenses/by-nd/2.0/'});ccLicenses.push({desc: 'No known copyright restrictions', url:'http://flickr.com/commons/usage/'});if (pageIcon.templateData.flickr[projPI].narration != undefined){ narration = pageIcon.templateData.flickr[projPI].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 + 30" type="ext" url="--loadedByCode--"><![CDATA[Tooltip]]></DIS> <DIS textColour="#333333" id="orientation" name="orientation" x="panel._x + 10" y="panel._y + 10" w="450" h="10" type="text"><![CDATA[{loadingTxt}]]></DIS> <INT id="imageInteraction" name="getNewImage" perpetual="1"> <RES toolTip="{priorTipTxt}" rs="btnPrev" swf="templatePath + 'common/leftButton.swf'" name="previousImage" type="button" x="725" y="464" label="{priorTipTxt}" erase="1" exit="0"> <SCR name="prev"><![CDATA[if (imageIndex > 0){ imageIndex--; imageInteraction.broadcast('getImage');}]]></SCR> </RES> <RES toolTip="{nextTipTxt}" rs="btnNext" swf="templatePath + 'common/rightButton.swf'" name="nextImage" type="button" x="750" y="464" label="{nextTipTxt}" 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(loadingTxt);//to searchurl = "http://api.flickr.com/services/rest/"url += "?api_key=8f6f38d31f048a90c436583a6ac92e47";url += "&method=flickr.photos.search";url += "&text=" + pageIcon.templateData.flickr[projPI].keywords;url += "&per_page=500";url += "&safe_search=1";url += "&license=";//creative commonsif (pageIcon.templateData.flickr[projPI].content == 'all use'){ if (pageIcon.templateData.flickr[projPI].deriv == 'unrestricted'){ url += '1,2,3,4,5,6'; } if (pageIcon.templateData.flickr[projPI].deriv == 'non-derivative'){ url += '3,6'; } if (pageIcon.templateData.flickr[projPI].deriv == 'share alike'){ url += '1,5'; }} else if (pageIcon.templateData.flickr[projPI].content == 'non-commercial use'){ if (pageIcon.templateData.flickr[projPI].deriv == 'unrestricted'){ url += '2'; } if (pageIcon.templateData.flickr[projPI].deriv == 'non-derivative'){ url += '3'; } if (pageIcon.templateData.flickr[projPI].deriv == 'share alike'){ url += '5'; }} else { url += '1,2,3,4,5,6';}//debug(url);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="getLicense"><![CDATA[id = myImg.templateData.rsp[0].photos[0].photo[imageIndex].id;imageCount = myImg.templateData.rsp[0].photos[0].photo.length;displayTxt = imageTxt;if (imageCount == undefined || imageCount == 0){ imageCount = 0; displayTxt = replace(displayTxt, "{i}", imageCount);} else { displayTxt = replace(displayTxt, "{i}", imageIndex + 1);}displayTxt = replace(displayTxt, "{n}", imageCount);orientation.setText(displayTxt);url = "http://api.flickr.com/services/rest/"url += "?api_key=8f6f38d31f048a90c436583a6ac92e47";url += "&method=flickr.photos.getInfo";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="getID"><![CDATA[//build attribution infoccInfo = myImg.templateData.rsp[0].photo[0].title;ccInfo += ' © ' + myImg.templateData.rsp[0].photo[0].owner[0].realname + ', ' + myImg.templateData.rsp[0].photo[0].dates[0].taken.split('-')[0] +'\r';ccInfo += '<a href="' + ccLicenses[myImg.templateData.rsp[0].photo[0].license].url + '" target="_blank">' + ccLicenses[myImg.templateData.rsp[0].photo[0].license].desc + '</a>';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="thirdHandler" perpetual="0"> <RES name="onS&L" type="event" eventName="onSendAndLoad" icon="myImg" erase="1" exit="1"> <SCR name="getSource"><![CDATA[// loop through the size array to find either the first picture that is large enough,// or the largest availablemaxWidth = 0;for (i = 0; i < myImg.templateData.rsp[0].sizes[0].size.length; i++){ if (myImg.templateData.rsp[0].sizes[0].size[i].width >= 500 || myImg.templateData.rsp[0].sizes[0].size[i].height >= 400){ sizeIndex = i; break; // we have a picture big enough } else { if (myImg.templateData.rsp[0].sizes[0].size[i].width >= maxWidth){ // we have a new largest picture sizeIndex = i; maxWidth = parseInt(myImg.templateData.rsp[0].sizes[0].size[i].width); } }}img = myImg.templateData.rsp[0].sizes[0].size[sizeIndex].source;myImg.loadImage(img);]]></SCR> </RES> </INT> </RES> <RES name="onLoadImage" type="event" eventName="onLoad" icon="myImg" erase="0" exit="0"> <DIS textColour="#333333" name="ccInfo" x="270" y="454" w="450" h="10" type="text"><![CDATA[{ccInfo}]]></DIS> <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[sizeIndex].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[projPI]}]]></DIS> <SCR name="initialise"><![CDATA[imageInteraction.broadcast('getImage');]]></SCR> </PG>
<PG title="flickr" name="flickr"> <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.flickr[rootIcon.projectPageIndex].name == undefined){ projPI = 0;} else { projPI = rootIcon.projectPageIndex; } // set up display textif (pageIcon.templateData.flickr[projPI].nextTipTxt != undefined){ nextTipTxt = pageIcon.templateData.flickr[projPI].nextTipTxt;} else { nextTipTxt = "Next Image";}if (pageIcon.templateData.flickr[projPI].priorTipTxt != undefined){ priorTipTxt = pageIcon.templateData.flickr[projPI].priorTipTxt;} else { priorTipTxt = "Previous Image";}if (pageIcon.templateData.flickr[projPI].loadingTxt != undefined){ loadingTxt = pageIcon.templateData.flickr[projPI].loadingTxt;} else { loadingTxt = "Loading...";}if (pageIcon.templateData.flickr[projPI].imageTxt != undefined){ imageTxt = pageIcon.templateData.flickr[projPI].imageTxt;} else { imageTxt = "Image {i} of {n} images";}imageIndex = 0;imageCount = 0;ccLicenses = new Array();ccLicenses.push('');ccLicenses.push({desc: 'Creative Commons Attribution-NonCommercial-ShareAlike License', url:'http://creativecommons.org/licenses/by-nc-sa/2.0/'});ccLicenses.push({desc: 'Creative Commons Attribution-NonCommercial License', url:'http://creativecommons.org/licenses/by-nc/2.0/'});ccLicenses.push({desc: 'Creative Commons Attribution-NonCommercial-NoDerivs License', url:'http://creativecommons.org/licenses/by-nc-nd/2.0/'});ccLicenses.push({desc: 'Creative Commons Attribution License', url:'http://creativecommons.org/licenses/by/2.0/'});ccLicenses.push({desc: 'Creative Commons Attribution-ShareAlike License', url:'http://creativecommons.org/licenses/by-sa/2.0/'});ccLicenses.push({desc: 'Creative Commons Attribution-NoDerivs License', url:'http://creativecommons.org/licenses/by-nd/2.0/'});ccLicenses.push({desc: 'No known copyright restrictions', url:'http://flickr.com/commons/usage/'});if (pageIcon.templateData.flickr[projPI].narration != undefined){ narration = pageIcon.templateData.flickr[projPI].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 + 30" type="ext" url="--loadedByCode--"><![CDATA[Tooltip]]></DIS> <DIS textColour="#333333" id="orientation" name="orientation" x="panel._x + 10" y="panel._y + 10" w="450" h="10" type="text"><![CDATA[{loadingTxt}]]></DIS> <INT id="imageInteraction" name="getNewImage" perpetual="1"> <RES toolTip="{priorTipTxt}" rs="btnPrev" swf="templatePath + 'common/leftButton.swf'" name="previousImage" type="button" x="725" y="464" label="{priorTipTxt}" erase="1" exit="0"> <SCR name="prev"><![CDATA[if (imageIndex > 0){ imageIndex--; imageInteraction.broadcast('getImage');}]]></SCR> </RES> <RES toolTip="{nextTipTxt}" rs="btnNext" swf="templatePath + 'common/rightButton.swf'" name="nextImage" type="button" x="750" y="464" label="{nextTipTxt}" 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(loadingTxt);//to searchurl = "https://api.flickr.com/services/rest/"url += "?api_key=8f6f38d31f048a90c436583a6ac92e47";url += "&method=flickr.photos.search";url += "&text=" + pageIcon.templateData.flickr[projPI].keywords;url += "&per_page=500";url += "&safe_search=1";url += "&license=";//creative commonsif (pageIcon.templateData.flickr[projPI].content == 'all use'){ if (pageIcon.templateData.flickr[projPI].deriv == 'unrestricted'){ url += '1,2,3,4,5,6'; } if (pageIcon.templateData.flickr[projPI].deriv == 'non-derivative'){ url += '3,6'; } if (pageIcon.templateData.flickr[projPI].deriv == 'share alike'){ url += '1,5'; }} else if (pageIcon.templateData.flickr[projPI].content == 'non-commercial use'){ if (pageIcon.templateData.flickr[projPI].deriv == 'unrestricted'){ url += '2'; } if (pageIcon.templateData.flickr[projPI].deriv == 'non-derivative'){ url += '3'; } if (pageIcon.templateData.flickr[projPI].deriv == 'share alike'){ url += '5'; }} else { url += '1,2,3,4,5,6';}//debug(url);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="getLicense"><![CDATA[id = myImg.templateData.rsp[0].photos[0].photo[imageIndex].id;imageCount = myImg.templateData.rsp[0].photos[0].photo.length;displayTxt = imageTxt;if (imageCount == undefined || imageCount == 0){ imageCount = 0; displayTxt = replace(displayTxt, "{i}", imageCount);} else { displayTxt = replace(displayTxt, "{i}", imageIndex + 1);}displayTxt = replace(displayTxt, "{n}", imageCount);orientation.setText(displayTxt);url = "https://api.flickr.com/services/rest/"url += "?api_key=8f6f38d31f048a90c436583a6ac92e47";url += "&method=flickr.photos.getInfo";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="getID"><![CDATA[//build attribution infoccInfo = myImg.templateData.rsp[0].photo[0].title;ccInfo += ' © ' + myImg.templateData.rsp[0].photo[0].owner[0].realname + ', ' + myImg.templateData.rsp[0].photo[0].dates[0].taken.split('-')[0] +'\r';ccInfo += '<a href="' + ccLicenses[myImg.templateData.rsp[0].photo[0].license].url + '" target="_blank">' + ccLicenses[myImg.templateData.rsp[0].photo[0].license].desc + '</a>';url = "https://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="thirdHandler" perpetual="0"> <RES name="onS&L" type="event" eventName="onSendAndLoad" icon="myImg" erase="1" exit="1"> <SCR name="getSource"><![CDATA[// loop through the size array to find either the first picture that is large enough,// or the largest availablemaxWidth = 0;for (i = 0; i < myImg.templateData.rsp[0].sizes[0].size.length; i++){ if (myImg.templateData.rsp[0].sizes[0].size[i].width >= 500 || myImg.templateData.rsp[0].sizes[0].size[i].height >= 400){ sizeIndex = i; break; // we have a picture big enough } else { if (myImg.templateData.rsp[0].sizes[0].size[i].width >= maxWidth){ // we have a new largest picture sizeIndex = i; maxWidth = parseInt(myImg.templateData.rsp[0].sizes[0].size[i].width); } }}img = myImg.templateData.rsp[0].sizes[0].size[sizeIndex].source;myImg.loadImage(img);]]></SCR> </RES> </INT> </RES> <RES name="onLoadImage" type="event" eventName="onLoad" icon="myImg" erase="0" exit="0"> <DIS textColour="#333333" name="ccInfo" x="270" y="454" w="450" h="10" type="text"><![CDATA[{ccInfo}]]></DIS> <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[sizeIndex].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[projPI]}]]></DIS> <SCR name="initialise"><![CDATA[imageInteraction.broadcast('getImage');]]></SCR> </PG>
Expand Down
Expand Up @@ -137,7 +137,7 @@
license = '1,2,3,4,5,6';
}

var feedURL = "http://api.flickr.com/services/rest/";
var feedURL = "https://api.flickr.com/services/rest/";
feedURL += "?method=flickr.photos.search";
feedURL += "&text=" + keywords;
feedURL += "&api_key=8f6f38d31f048a90c436583a6ac92e47";
Expand Down Expand Up @@ -185,7 +185,7 @@
);
}
else {
var url = "http://api.flickr.com/services/rest/";
var url = "https://api.flickr.com/services/rest/";
url += "?api_key=8f6f38d31f048a90c436583a6ac92e47";
url += "&method=flickr.photos.getInfo";
url += "&format=json";
Expand Down Expand Up @@ -217,7 +217,7 @@
ccInfo += '" target="_blank">' + ccLicenses[data.photo.license-1].desc + '</a>';
x_pageInfo[x_currentPage].savedData.pictureInfo = ccInfo;

var url = "http://api.flickr.com/services/rest/";
var url = "https://api.flickr.com/services/rest/";
url += "?api_key=8f6f38d31f048a90c436583a6ac92e47";
url += "&method=flickr.photos.getSizes";
url += "&format=json";
Expand Down

0 comments on commit 81d982c

Please sign in to comment.