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;i0){if(self._right_limit!==undefined){end=Math.min(self._right_limit,end);} left=Math.max(left,end);}else{if(self._left_limit!==undefined){end=Math.max(self._left_limit,end);} left=Math.min(left,end);} self.dom_node.style.left=left+"px";if(left==end){self.cancelTimeOut(20,_animate);self.unblockTerminals("horizontal_slide_amount_in");}} _animate();self.registerContinuousTimeOut(20,_animate);};Class.prototype.onMsgFor["vertical_slide_amount_in"]=function(dir) {var end=(parseInt(this._getCssProp(this.dom_node,"top"))||0)+dir;var self=this;this.blockAllTerminalsExcept("horizontal_slide_amount_in");function _animate(){var top=parseInt(self._getCssProp(self.dom_node,"top"))||0;if(dir>0){if(self._bottom_limit!==undefined){end=Math.min(end,self._bottom_limit);} top=Math.max(top,end);}else{if(self._top_limit!==undefined){end=Math.max(end,self._top_limit);} top=Math.min(top,end);} self.dom_node.style.top=top+"px";if(top==end){self.cancelTimeOut(20,_animate);self.unblockTerminals("vertical_slide_amount_in");}} _animate();};Class.prototype._getCssProp=function(node,prop) {if(node.currentStyle){if(node.currentStyle.getAttribute){return node.currentStyle.getAttribute(prop.replace(/-/g,""));}else{return node.currentStyle[prop.replace(/-/g,"")];}}else{return node.ownerDocument.defaultView.getComputedStyle(node,null).getPropertyValue(prop);}};}); BLUEPRINT ( "7A2FA5EDC6F44288A7C740F75E18ED49", { inputs: [ 'content_in' ] , input_specs: [ { queue_size: 10 } ] , outputs: [ 'changed_slots_out' ] , properties: [ 'does_keep_html_tags' , 'does_link_blank_anchors' , 'does_hide_when_empty' , 'does_accumulate_content' ] , name: 'Text Slots' }, function(Class) {Class.prototype._onInit=function(props) {this._yes_tags=props["does_keep_html_tags"];this._auto_link=props["does_link_blank_anchors"];this._auto_hides=props["does_hide_when_empty"];this._accumulate=props["does_accumulate_content"];this._had_content=false;};Class.prototype._cleanString=function(val,no_tags) {if(val.sort){val=val[0];} if(val.toLocaleString){val=val.toLocaleString();} if(!val.replace){val=new String(val);} if(no_tags){val=val.replace(/<.+?>/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;i 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);};});