BLUEPRINT ( "bd763956f56bffa42119480a99ac1382", { inputs: [ 'image_in' , 'image_collection_in' ] , input_specs: [ { queue_size: 10 } , { queue_size: 10 } ] , outputs: [ 'image_loaded_indication_out' ] , properties: [ 'does_link_blank_anchors' ] , name: 'Image Board' }, function(Class) {Class.prototype._onInit=function(props) {this._auto_link=props["does_link_blank_anchors"];this.dom_node.style.MozUserSelect="none";this.dom_node.style.KhtmlUserSelect="none";this.dom_node.onselectstart=function(e){return false;};if(this.dom_node.getElementsByTagName("IMG")[0]===undefined){throw"The part is missing an IMG tag. Please include an IMG tag as a child element of this part.";}};Class.prototype._loadImage=function(uri,description,link_uri){var w=this.dom_node.offsetWidth;var h=this.dom_node.offsetHeight;var img=this.dom_node.getElementsByTagName("IMG")[0];var a=this.dom_node.getElementsByTagName("A");if(description){img.title=description;} img.src=uri;img.width=w;img.height=h;if(a.length&&link_uri&&this._auto_link){var i=0;do{a[i].href=link_uri;i++;}while(a[i]);} return img;};Class.prototype.onMsgFor["image_in"]=function(msg) {var img=this._loadImage(msg.image_content_uri,msg.description||msg.name);this.dom_node.style.visibility="visible";this._reportImgLoad(img);};Class.prototype.onMsgFor["image_collection_in"]=function(msg){var o;var uri="";var description=msg.description||msg.name;var w=this.dom_node.offsetWidth;var h=this.dom_node.offsetHeight;try{o=this._pickImageUri(msg.members,w,h);uri=o.image_content_uri img=this._loadImage(uri,msg.description||msg.name,msg.uri||o.uri);this.dom_node.style.visibility="visible";this._reportImgLoad(img);}catch(ex){if(!msg.members||!msg.members.length){this.error("The information you provided does not contain a collection of images.",ex);}else{this.error("There seems to be a problem with the information you provided. Please review the information again.",ex);}}};Class.prototype._pickImageUri=function(members,w,h) {var i,ratio,member,n=members.length;for(i=0;i/g,"");} val=val.replace(/\ /g," ");val=val.replace(/\</g,"<");val=val.replace(/\>/g,">");val=val.replace(/\—/g,"--");val=val.replace(/\—/g,"--");val=val.replace(/^\s+|\s+$/g,"");return val;} Class.prototype._mapItem=function(item,o) {var m,elems,tag_name,key,val;var i=0,self=this,delta;o.eform=item;elems=o.getElementsByTagName("*");m=elems.length;for(j=0;j is required!";} this._base_url=a.href;if(this._base_url.match(/\?/)){this._base_url+="&";}else{this._base_url+="?";} this._base_url+="jsoncallback=__star.infotrons."+escape(this.id)+"._onResponse&api_key="+escape(props["uses_api_key"])+"&format=json";this._add_random_qs=props["adds_random_number"];};Class.prototype._formatArgs=function(form) {var s="&";for(key in form){s+=escape(key)+"="+escape(form[key]);} return s;};Class.prototype.onMsgFor["arguments_in"]=function(msg) {var o,e;var type;var args=this._formatArgs(msg);var url=this._base_url+args;if(this._add_random_qs){url+="__r="+(new Date()).valueOf()+"_"+Math.random();} o=document.createElement("SCRIPT");o.type="text/javascript";o.src=url;this.debug(url);this.dom_node.appendChild(o);return 0;};Class.prototype._onResponse=function(msg) {try{this.postMessage("response_out",this._toCollection(msg));}catch(e){this.error(e);}} Class.prototype._toCollection=function(msg) {var coll=[];var n,item,m,result,results,i;result=msg;if(result!==undefined&&result.stat=="ok"){item={name:result.title,text_content:result.description,members:[]};n=result.sizes.size.length;this.debug(n);for(i=0;ithis.dom_node.offsetWidth||this.dom_node.scrollHeight>this.dom_node.offsetHeight){this.dom_node.onmousedown=__onStart;} this._offset_x=0;this._offset_y=0;this._last_x=0;this._last_y=0;this._right=this.dom_node.scrollWidth-this.dom_node.offsetWidth;this._bottom=this.dom_node.scrollHeight-this.dom_node.offsetHeight;this._orig_left=this.dom_node.offsetLeft;this._orig_top=this.dom_node.offsetTop;};Class.prototype.onDragStart=function(e) {var self=this;function __onMove(e) {e=e||window.event;self.onDrag(e);} function __onEnd(e) {e=e||window.event;self.dom_node.onmousemove=null;self.dom_node.onmouseup=null;self.dom_node.onmouseout=null;} this._last_x=e.clientX;this._last_y=e.clientY;this.dom_node.onmousemove=__onMove;this.dom_node.onmouseup=__onEnd;this.dom_node.onmouseout=__onEnd;};Class.prototype.onDrag=function(e) {var delta_x,delta_y;if(this._right){delta_x=e.clientX-this._last_x;} if(this._bottom){delta_y=e.clientY-this._last_y;} if(this._right||this._bottom){if(this.dom_node.offsetLeft+delta_x<=this._orig_left&&this._right>=-(this._offset_x+delta_x)){this._offset_x+=delta_x;this.dom_node.style.left=(this.dom_node.offsetLeft+delta_x)+"px";this.dom_node.style.width=(this.dom_node.offsetWidth-delta_x)+"px";} if(this.dom_node.offsetTop+delta_y<=this._origh_top&&this._bottom>=-(this._offset_y+delta_y)){this._offset_y+=delta_y;this.dom_node.style.top=(this.dom_node.offsetTop+delta_y)+"px";this.dom_node.style.height=(this.dom_node.offseHeight-delta_y)+"px";} this.dom_node.style.clip="rect(0px "+(this.dom_node.offsetWidth-this._offset_x)+"px "+this.dom_node.offsetHeight+"px "+(-this._offset_x)+"px)";} this._last_x=e.clientX;this._last_y=e.clientY;};}); BLUEPRINT ( "E485D6687EFD4E5F89C033303CD2617A", { inputs: [ 'arguments_in' ] , input_specs: [ { queue_size: 1 } , { queue_size: 10 } ] , outputs: [ 'response_out' ] , properties: [ 'uses_api_key' , 'adds_random_number' ] , name: 'Flickr Photo Detail Retriever' }, function(Class){Class.prototype._onInit=function(props) {var a=this.dom_node.getElementsByTagName("A")[0];if(this.dom_node.getAttribute("is_proxy")!="true"){throw"This is a proxy part: please set the is_proxy attribute to true";} if(!a||a.rel!="rpc"||!a.href){throw"This is a proxy part: an anchor tag of the format \ is required!";} this._base_url=a.href;if(this._base_url.match(/\?/)){this._base_url+="&";}else{this._base_url+="?";} this._base_url+="jsoncallback=__star.infotrons."+escape(this.id)+"._onResponse&api_key="+escape(props["uses_api_key"])+"&format=json";this._add_random_qs=props["adds_random_number"];};Class.prototype._formatArgs=function(form) {var s="&";for(key in form){s+=escape(key)+"="+escape(form[key])+"&";} return s;};Class.prototype.onMsgFor["arguments_in"]=function(msg) {var o,e;var type;var args=this._formatArgs(msg);var url=this._base_url+"&"+args;if(this._add_random_qs){url+="__r="+(new Date()).valueOf()+"_"+Math.random();} o=document.createElement("SCRIPT");o.type="text/javascript";o.src=url;this.debug(url);this.dom_node.appendChild(o);return 0;};Class.prototype._onResponse=function(msg) {try{this.postMessage("response_out",this._toCollection(msg));}catch(e){this.error(e);}} Class.prototype._toCollection=function(msg) {var coll=[];var n,item,result,results,issued,modified,m,taken,updated;result=msg;if(result!==undefined&&result.stat=="ok"){item={label:result.photo.id,name:result.photo.title._content,text_content:result.photo.description._content,uri:result.photo.urls.url.content,date:[],owner:{name:result.photo.owner["realname"],label:result.photo.owner["nsid"]}};m=new RegExp("(\\d{4})-(\\d{2})-(\\d{2}) (\\d{2})\:(\\d{2})\:(\\d{2})").exec(result.photo.dates.taken);if(m&&m.length){item.date.push(new Date(parseInt(m[1]),parseInt(m[2]),parseInt(m[3]),parseInt(m[4]),parseInt(m[5]),parseInt(m[6])));} item.date.push(new Date(parseInt(result.photo.dates.lastupdate,10)*1000));}else{item={name:'Unknown Photo',text_content:result?result.stat:""};} return item;};}); BLUEPRINT ( "959226399cc968c42d3e76f28257fc8a", { inputs: [ '__power__' ] , input_specs: [ { queue_size: 1 } ] , outputs: [ 'emission_out' ] , properties: [ 'emits' ] , name: 'Emitter' }, function(Class) {Class.prototype._onInit=function(props) {this.message=props["emits"];};Class.prototype.onMsgFor["__power__"]=function() {this.postMessage("emission_out",this.message);};});