1)},show:function(){return rn(this,true)},hide:function(){return rn(this)},toggle:function(e){if(typeof e==="boolean"){return e?this.show():this.hide()}return this.each(function(){if(nn(this)){w(this).show()}else{w(this).hide()}})}});w.extend({cssHooks:{opacity:{get:function(e,t){if(t){var n=Rt(e,"opacity");return n===""?"1":n}}}},cssNumber:{columnCount:true,fillOpacity:true,fontWeight:true,lineHeight:true,opacity:true,order:true,orphans:true,widows:true,zIndex:true,zoom:true},cssProps:{"float":w.support.cssFloat?"cssFloat":"styleFloat"},style:function(e,n,r,i){if(!e||e.nodeType===3||e.nodeType===8||!e.style){return}var s,o,u,a=w.camelCase(n),f=e.style;n=w.cssProps[a]||(w.cssProps[a]=tn(f,a));u=w.cssHooks[n]||w.cssHooks[a];if(r!==t){o=typeof r;if(o==="string"&&(s=Kt.exec(r))){r=(s[1]+1)*s[2]+parseFloat(w.css(e,n));o="number"}if(r==null||o==="number"&&isNaN(r)){return}if(o==="number"&&!w.cssNumber[a]){r+="px"}if(!w.support.clearCloneStyle&&r===""&&n.indexOf("background")===0){f[n]="inherit"}if(!u||!("set"in u)||(r=u.set(e,r,i))!==t){try{f[n]=r}catch(l){}}}else{if(u&&"get"in u&&(s=u.get(e,false,i))!==t){return s}return f[n]}},css:function(e,n,r,i){var s,o,u,a=w.camelCase(n);n=w.cssProps[a]||(w.cssProps[a]=tn(e.style,a));u=w.cssHooks[n]||w.cssHooks[a];if(u&&"get"in u){o=u.get(e,true,r)}if(o===t){o=Rt(e,n,i)}if(o==="normal"&&n in Yt){o=Yt[n]}if(r===""||r){s=parseFloat(o);return r===true||w.isNumeric(s)?s||0:o}return o}});if(e.getComputedStyle){qt=function(t){return e.getComputedStyle(t,null)};Rt=function(e,n,r){var i,s,o,u=r||qt(e),a=u?u.getPropertyValue(n)||u[n]:t,f=e.style;if(u){if(a===""&&!w.contains(e.ownerDocument,e)){a=w.style(e,n)}if(Jt.test(a)&&Vt.test(n)){i=f.width;s=f.minWidth;o=f.maxWidth;f.minWidth=f.maxWidth=f.width=a;a=u.width;f.width=i;f.minWidth=s;f.maxWidth=o}}return a}}else if(o.documentElement.currentStyle){qt=function(e){return e.currentStyle};Rt=function(e,n,r){var i,s,o,u=r||qt(e),a=u?u[n]:t,f=e.style;if(a==null&&f&&f[n]){a=f[n]}if(Jt.test(a)&&!Wt.test(n)){i=f.left;s=e.runtimeStyle;o=s&&s.left;if(o){s.left=e.currentStyle.left}f.left=n==="fontSize"?"1em":a;a=f.pixelLeft+"px";f.left=i;if(o){s.left=o}}return a===""?"auto":a}}w.each(["height","width"],function(e,t){w.cssHooks[t]={get:function(e,n,r){if(n){return e.offsetWidth===0&&Xt.test(w.css(e,"display"))?w.swap(e,Gt,function(){return un(e,t,r)}):un(e,t,r)}},set:function(e,n,r){var i=r&&qt(e);return sn(e,n,r?on(e,t,r,w.support.boxSizing&&w.css(e,"boxSizing",false,i)==="border-box",i):0)}}});if(!w.support.opacity){w.cssHooks.opacity={get:function(e,t){return zt.test((t&&e.currentStyle?e.currentStyle.filter:e.style.filter)||"")?.01*parseFloat(RegExp.$1)+"":t?"1":""},set:function(e,t){var n=e.style,r=e.currentStyle,i=w.isNumeric(t)?"alpha(opacity="+t*100+")":"",s=r&&r.filter||n.filter||"";n.zoom=1;if((t>=1||t==="")&&w.trim(s.replace(Ut,""))===""&&n.removeAttribute){n.removeAttribute("filter");if(t===""||r&&!r.filter){return}}n.filter=Ut.test(s)?s.replace(Ut,i):s+" "+i}}}w(function(){if(!w.support.reliableMarginRight){w.cssHooks.marginRight={get:function(e,t){if(t){return w.swap(e,{display:"inline-block"},Rt,[e,"marginRight"])}}}}if(!w.support.pixelPosition&&w.fn.position){w.each(["top","left"],function(e,t){w.cssHooks[t]={get:function(e,n){if(n){n=Rt(e,t);return Jt.test(n)?w(e).position()[t]+"px":n}}}})}});if(w.expr&&w.expr.filters){w.expr.filters.hidden=function(e){return e.offsetWidth<=0&&e.offsetHeight<=0||!w.support.reliableHiddenOffsets&&(e.style&&e.style.display||w.css(e,"display"))==="none"};w.expr.filters.visible=function(e){return!w.expr.filters.hidden(e)}}w.each({margin:"",padding:"",border:"Width"},function(e,t){w.cssHooks[e+t]={expand:function(n){var r=0,i={},s=typeof n==="string"?n.split(" "):[n];for(;r<4;r++){i[e+Zt[r]+t]=s[r]||s[r-2]||s[0]}return i}};if(!Vt.test(e)){w.cssHooks[e+t].set=sn}});var ln=/%20/g,cn=/\[\]$/,hn=/\r?\n/g,pn=/^(?:submit|button|image|reset|file)$/i,dn=/^(?:input|select|textarea|keygen)/i;w.fn.extend({serialize:function(){return w.param(this.serializeArray())},serializeArray:function(){return this.map(function(){var e=w.prop(this,"elements");return e?w.makeArray(e):this}).filter(function(){var e=this.type;return this.name&&!w(this).is(":disabled")&&dn.test(this.nodeName)&&!pn.test(e)&&(this.checked||!xt.test(e))}).map(function(e,t){var n=w(this).val();return n==null?null:w.isArray(n)?w.map(n,function(e){return{name:t.name,value:e.replace(hn,"\r\n")}}):{name:t.name,value:n.replace(hn,"\r\n")}}).get()}});w.param=function(e,n){var r,i=[],s=function(e,t){t=w.isFunction(t)?t():t==null?"":t;i[i.length]=encodeURIComponent(e)+"="+encodeURIComponent(t)};if(n===t){n=w.ajaxSettings&&w.ajaxSettings.traditional}if(w.isArray(e)||e.jquery&&!w.isPlainObject(e)){w.each(e,function(){s(this.name,this.value)})}else{for(r in e){vn(r,e[r],n,s)}}return i.join("&").replace(ln,"+")};w.each(("blur focus focusin focusout load resize scroll unload click dblclick "+"mousedown mouseup mousemove mouseover mouseout mouseenter mouseleave "+"change select submit keydown keypress keyup error contextmenu").split(" "),function(e,t){w.fn[t]=function(e,n){return arguments.length>0?this.on(t,null,e,n):this.trigger(t)}});w.fn.extend({hover:function(e,t){return this.mouseenter(e).mouseleave(t||e)},bind:function(e,t,n){return this.on(e,null,t,n)},unbind:function(e,t){return this.off(e,null,t)},delegate:function(e,t,n,r){return this.on(t,e,n,r)},undelegate:function(e,t,n){return arguments.length===1?this.off(e,"**"):this.off(t,e||"**",n)}});var mn,gn,yn=w.now(),bn=/\?/,wn=/#.*$/,En=/([?&])_=[^&]*/,Sn=/^(.*?):[ \t]*([^\r\n]*)\r?$/mg,xn=/^(?:about|app|app-storage|.+-extension|file|res|widget):$/,Tn=/^(?:GET|HEAD)$/,Nn=/^\/\//,Cn=/^([\w.+-]+:)(?:\/\/([^\/?#:]*)(?::(\d+)|)|)/,kn=w.fn.load,Ln={},An={},On="*/".concat("*");try{gn=s.href}catch(Mn){gn=o.createElement("a");gn.href="";gn=gn.href}mn=Cn.exec(gn.toLowerCase())||[];w.fn.load=function(e,n,r){if(typeof e!=="string"&&kn){return kn.apply(this,arguments)}var i,s,o,u=this,a=e.indexOf(" ");if(a>=0){i=e.slice(a,e.length);e=e.slice(0,a)}if(w.isFunction(n)){r=n;n=t}else if(n&&typeof n==="object"){o="POST"}if(u.length>0){w.ajax({url:e,type:o,dataType:"html",data:n}).done(function(e){s=arguments;u.html(i?w("").append(w.parseHTML(e)).find(i):e)}).complete(r&&function(e,t){u.each(r,s||[e.responseText,t,e])})}return this};w.each(["ajaxStart","ajaxStop","ajaxComplete","ajaxError","ajaxSuccess","ajaxSend"],function(e,t){w.fn[t]=function(e){return this.on(t,e)}});w.extend({active:0,lastModified:{},etag:{},ajaxSettings:{url:gn,type:"GET",isLocal:xn.test(mn[1]),global:true,processData:true,async:true,contentType:"application/x-www-form-urlencoded; charset=UTF-8",accepts:{"*":On,text:"text/plain",html:"text/html",xml:"application/xml, text/xml",json:"application/json, text/javascript"},contents:{xml:/xml/,html:/html/,json:/json/},responseFields:{xml:"responseXML",text:"responseText",json:"responseJSON"},converters:{"* text":String,"text html":true,"text json":w.parseJSON,"text xml":w.parseXML},flatOptions:{url:true,context:true}},ajaxSetup:function(e,t){return t?Pn(Pn(e,w.ajaxSettings),t):Pn(w.ajaxSettings,e)},ajaxPrefilter:_n(Ln),ajaxTransport:_n(An),ajax:function(e,n){function N(e,n,r,i){var l,g,y,E,S,T=n;if(b===2){return}b=2;if(u){clearTimeout(u)}f=t;o=i||"";x.readyState=e>0?4:0;l=e>=200&&e<300||e===304;if(r){E=Hn(c,x,r)}E=Bn(c,E,x,l);if(l){if(c.ifModified){S=x.getResponseHeader("Last-Modified");if(S){w.lastModified[s]=S}S=x.getResponseHeader("etag");if(S){w.etag[s]=S}}if(e===204||c.type==="HEAD"){T="nocontent"}else if(e===304){T="notmodified"}else{T=E.state;g=E.data;y=E.error;l=!y}}else{y=T;if(e||!T){T="error";if(e<0){e=0}}}x.status=e;x.statusText=(n||T)+"";if(l){d.resolveWith(h,[g,T,x])}else{d.rejectWith(h,[x,T,y])}x.statusCode(m);m=t;if(a){p.trigger(l?"ajaxSuccess":"ajaxError",[x,c,l?g:y])}v.fireWith(h,[x,T]);if(a){p.trigger("ajaxComplete",[x,c]);if(!--w.active){w.event.trigger("ajaxStop")}}}if(typeof e==="object"){n=e;e=t}n=n||{};var r,i,s,o,u,a,f,l,c=w.ajaxSetup({},n),h=c.context||c,p=c.context&&(h.nodeType||h.jquery)?w(h):w.event,d=w.Deferred(),v=w.Callbacks("once memory"),m=c.statusCode||{},g={},y={},b=0,E="canceled",x={readyState:0,getResponseHeader:function(e){var t;if(b===2){if(!l){l={};while(t=Sn.exec(o)){l[t[1].toLowerCase()]=t[2]}}t=l[e.toLowerCase()]}return t==null?null:t},getAllResponseHeaders:function(){return b===2?o:null},setRequestHeader:function(e,t){var n=e.toLowerCase();if(!b){e=y[n]=y[n]||e;g[e]=t}return this},overrideMimeType:function(e){if(!b){c.mimeType=e}return this},statusCode:function(e){var t;if(e){if(b<2){for(t in e){m[t]=[m[t],e[t]]}}else{x.always(e[x.status])}}return this},abort:function(e){var t=e||E;if(f){f.abort(t)}N(0,t);return this}};d.promise(x).complete=v.add;x.success=x.done;x.error=x.fail;c.url=((e||c.url||gn)+"").replace(wn,"").replace(Nn,mn[1]+"//");c.type=n.method||n.type||c.method||c.type;c.dataTypes=w.trim(c.dataType||"*").toLowerCase().match(S)||[""];if(c.crossDomain==null){r=Cn.exec(c.url.toLowerCase());c.crossDomain=!!(r&&(r[1]!==mn[1]||r[2]!==mn[2]||(r[3]||(r[1]==="http:"?"80":"443"))!==(mn[3]||(mn[1]==="http:"?"80":"443"))))}if(c.data&&c.processData&&typeof c.data!=="string"){c.data=w.param(c.data,c.traditional)}Dn(Ln,c,n,x);if(b===2){return x}a=c.global;if(a&&w.active++===0){w.event.trigger("ajaxStart")}c.type=c.type.toUpperCase();c.hasContent=!Tn.test(c.type);s=c.url;if(!c.hasContent){if(c.data){s=c.url+=(bn.test(s)?"&":"?")+c.data;delete c.data}if(c.cache===false){c.url=En.test(s)?s.replace(En,"$1_="+yn++):s+(bn.test(s)?"&":"?")+"_="+yn++}}if(c.ifModified){if(w.lastModified[s]){x.setRequestHeader("If-Modified-Since",w.lastModified[s])}if(w.etag[s]){x.setRequestHeader("If-None-Match",w.etag[s])}}if(c.data&&c.hasContent&&c.contentType!==false||n.contentType){x.setRequestHeader("Content-Type",c.contentType)}x.setRequestHeader("Accept",c.dataTypes[0]&&c.accepts[c.dataTypes[0]]?c.accepts[c.dataTypes[0]]+(c.dataTypes[0]!=="*"?", "+On+"; q=0.01":""):c.accepts["*"]);for(i in c.headers){x.setRequestHeader(i,c.headers[i])}if(c.beforeSend&&(c.beforeSend.call(h,x,c)===false||b===2)){return x.abort()}E="abort";for(i in{success:1,error:1,complete:1}){x[i](c[i])}f=Dn(An,c,n,x);if(!f){N(-1,"No Transport")}else{x.readyState=1;if(a){p.trigger("ajaxSend",[x,c])}if(c.async&&c.timeout>0){u=setTimeout(function(){x.abort("timeout")},c.timeout)}try{b=1;f.send(g,N)}catch(T){if(b<2){N(-1,T)}else{throw T}}}return x},getJSON:function(e,t,n){return w.get(e,t,n,"json")},getScript:function(e,n){return w.get(e,t,n,"script")}});w.each(["get","post"],function(e,n){w[n]=function(e,r,i,s){if(w.isFunction(r)){s=s||i;i=r;r=t}return w.ajax({url:e,type:n,dataType:s,data:r,success:i})}});w.ajaxSetup({accepts:{script:"text/javascript, application/javascript, application/ecmascript, application/x-ecmascript"},contents:{script:/(?:java|ecma)script/},converters:{"text script":function(e){w.globalEval(e);return e}}});w.ajaxPrefilter("script",function(e){if(e.cache===t){e.cache=false}if(e.crossDomain){e.type="GET";e.global=false}});w.ajaxTransport("script",function(e){if(e.crossDomain){var n,r=o.head||w("head")[0]||o.documentElement;return{send:function(t,i){n=o.createElement("script");n.async=true;if(e.scriptCharset){n.charset=e.scriptCharset}n.src=e.url;n.onload=n.onreadystatechange=function(e,t){if(t||!n.readyState||/loaded|complete/.test(n.readyState)){n.onload=n.onreadystatechange=null;if(n.parentNode){n.parentNode.removeChild(n)}n=null;if(!t){i(200,"success")}}};r.insertBefore(n,r.firstChild)},abort:function(){if(n){n.onload(t,true)}}}}});var jn=[],Fn=/(=)\?(?=&|$)|\?\?/;w.ajaxSetup({jsonp:"callback",jsonpCallback:function(){var e=jn.pop()||w.expando+"_"+yn++;this[e]=true;return e}});w.ajaxPrefilter("json jsonp",function(n,r,i){var s,o,u,a=n.jsonp!==false&&(Fn.test(n.url)?"url":typeof n.data==="string"&&!(n.contentType||"").indexOf("application/x-www-form-urlencoded")&&Fn.test(n.data)&&"data");if(a||n.dataTypes[0]==="jsonp"){s=n.jsonpCallback=w.isFunction(n.jsonpCallback)?n.jsonpCallback():n.jsonpCallback;if(a){n[a]=n[a].replace(Fn,"$1"+s)}else if(n.jsonp!==false){n.url+=(bn.test(n.url)?"&":"?")+n.jsonp+"="+s}n.converters["script json"]=function(){if(!u){w.error(s+" was not called")}return u[0]};n.dataTypes[0]="json";o=e[s];e[s]=function(){u=arguments};i.always(function(){e[s]=o;if(n[s]){n.jsonpCallback=r.jsonpCallback;jn.push(s)}if(u&&w.isFunction(o)){o(u[0])}u=o=t});return"script"}});var In,qn,Rn=0,Un=e.ActiveXObject&&function(){var e;for(e in In){In[e](t,true)}};w.ajaxSettings.xhr=e.ActiveXObject?function(){return!this.isLocal&&zn()||Wn()}:zn;qn=w.ajaxSettings.xhr();w.support.cors=!!qn&&"withCredentials"in qn;qn=w.support.ajax=!!qn;if(qn){w.ajaxTransport(function(n){if(!n.crossDomain||w.support.cors){var r;return{send:function(i,s){var o,u,a=n.xhr();if(n.username){a.open(n.type,n.url,n.async,n.username,n.password)}else{a.open(n.type,n.url,n.async)}if(n.xhrFields){for(u in n.xhrFields){a[u]=n.xhrFields[u]}}if(n.mimeType&&a.overrideMimeType){a.overrideMimeType(n.mimeType)}if(!n.crossDomain&&!i["X-Requested-With"]){i["X-Requested-With"]="XMLHttpRequest"}try{for(u in i){a.setRequestHeader(u,i[u])}}catch(f){}a.send(n.hasContent&&n.data||null);r=function(e,i){var u,f,l,c;try{if(r&&(i||a.readyState===4)){r=t;if(o){a.onreadystatechange=w.noop;if(Un){delete In[o]}}if(i){if(a.readyState!==4){a.abort()}}else{c={};u=a.status;f=a.getAllResponseHeaders();if(typeof a.responseText==="string"){c.text=a.responseText}try{l=a.statusText}catch(h){l=""}if(!u&&n.isLocal&&!n.crossDomain){u=c.text?200:404}else if(u===1223){u=204}}}}catch(p){if(!i){s(-1,p)}}if(c){s(u,l,c,f)}};if(!n.async){r()}else if(a.readyState===4){setTimeout(r)}else{o=++Rn;if(Un){if(!In){In={};w(e).unload(Un)}In[o]=r}a.onreadystatechange=r}},abort:function(){if(r){r(t,true)}}}}})}var Xn,Vn,$n=/^(?:toggle|show|hide)$/,Jn=new RegExp("^(?:([+-])=|)("+E+")([a-z%]*)$","i"),Kn=/queueHooks$/,Qn=[nr],Gn={"*":[function(e,t){var n=this.createTween(e,t),r=n.cur(),i=Jn.exec(t),s=i&&i[3]||(w.cssNumber[e]?"":"px"),o=(w.cssNumber[e]||s!=="px"&&+r)&&Jn.exec(w.css(n.elem,e)),u=1,a=20;if(o&&o[3]!==s){s=s||o[3];i=i||[];o=+r||1;do{u=u||".5";o=o/u;w.style(n.elem,e,o+s)}while(u!==(u=n.cur()/r)&&u!==1&&--a)}if(i){o=n.start=+o||+r||0;n.unit=s;n.end=i[1]?o+(i[1]+1)*i[2]:+i[2]}return n}]};w.Animation=w.extend(er,{tweener:function(e,t){if(w.isFunction(e)){t=e;e=["*"]}else{e=e.split(" ")}var n,r=0,i=e.length;for(;r
-1,f={},l={},c,h;if(a){l=i.position();c=l.top;h=l.left}else{c=parseFloat(o)||0;h=parseFloat(u)||0}if(w.isFunction(t)){t=t.call(e,n,s)}if(t.top!=null){f.top=t.top-s.top+c}if(t.left!=null){f.left=t.left-s.left+h}if("using"in t){t.using.call(e,f)}else{i.css(f)}}};w.fn.extend({position:function(){if(!this[0]){return}var e,t,n={top:0,left:0},r=this[0];if(w.css(r,"position")==="fixed"){t=r.getBoundingClientRect()}else{e=this.offsetParent();t=this.offset();if(!w.nodeName(e[0],"html")){n=e.offset()}n.top+=w.css(e[0],"borderTopWidth",true);n.left+=w.css(e[0],"borderLeftWidth",true)}return{top:t.top-n.top-w.css(r,"marginTop",true),left:t.left-n.left-w.css(r,"marginLeft",true)}},offsetParent:function(){return this.map(function(){var e=this.offsetParent||u;while(e&&!w.nodeName(e,"html")&&w.css(e,"position")==="static"){e=e.offsetParent}return e||u})}});w.each({scrollLeft:"pageXOffset",scrollTop:"pageYOffset"},function(e,n){var r=/Y/.test(n);w.fn[e]=function(i){return w.access(this,function(e,i,s){var o=sr(e);if(s===t){return o?n in o?o[n]:o.document.documentElement[i]:e[i]}if(o){o.scrollTo(!r?s:w(o).scrollLeft(),r?s:w(o).scrollTop())}else{e[i]=s}},e,i,arguments.length,null)}});w.each({Height:"height",Width:"width"},function(e,n){w.each({padding:"inner"+e,content:n,"":"outer"+e},function(r,i){w.fn[i]=function(i,s){var o=arguments.length&&(r||typeof i!=="boolean"),u=r||(i===true||s===true?"margin":"border");return w.access(this,function(n,r,i){var s;if(w.isWindow(n)){return n.document.documentElement["client"+e]}if(n.nodeType===9){s=n.documentElement;return Math.max(n.body["scroll"+e],s["scroll"+e],n.body["offset"+e],s["offset"+e],s["client"+e])}return i===t?w.css(n,r,u):w.style(n,r,i,u)},n,o?i:t,o,null)}})});w.fn.size=function(){return this.length};w.fn.andSelf=w.fn.addBack;if(typeof module==="object"&&module&&typeof module.exports==="object"){module.exports=w}else{e.jQuery=e.$=w;if(typeof define==="function"&&define.amd){define("jquery",[],function(){return w})}}})(window);(function(){"use strict";function encodeHTMLSource(){var e={"&":"&","<":"<",">":">",'"':""","'":"'","/":"/"},t=/&(?!#?\w+;)|<|>|"|'|\//g;return function(){return this?this.replace(t,function(t){return e[t]||t}):this}}function resolveDefs(e,t,n){return(typeof t==="string"?t:t.toString()).replace(e.define||skip,function(t,r,i,s){if(r.indexOf("def.")===0){r=r.substring(4)}if(!(r in n)){if(i===":"){if(e.defineParams)s.replace(e.defineParams,function(e,t,i){n[r]={arg:t,text:i}});if(!(r in n))n[r]=s}else{(new Function("def","def['"+r+"']="+s))(n)}}return""}).replace(e.use||skip,function(t,r){if(e.useParams)r=r.replace(e.useParams,function(e,t,r,i){if(n[r]&&n[r].arg&&i){var s=(r+":"+i).replace(/'|\\/g,"_");n.__exp=n.__exp||{};n.__exp[s]=n[r].text.replace(new RegExp("(^|[^\\w$])"+n[r].arg+"([^\\w$])","g"),"$1"+i+"$2");return t+"def.__exp['"+s+"']"}});var i=(new Function("def","return "+r))(n);return i?resolveDefs(e,i,n):i})}function unescape(e){return e.replace(/\\('|\\)/g,"$1").replace(/[\r\t\n]/g," ")}var doT={version:"1.0.1-nanoui",templateSettings:{evaluate:/\{\{([\s\S]+?)\}\}/g,interpolate:/\{\{:([\s\S]+?)\}\}/g,encode:/\{\{>([\s\S]+?)\}\}/g,use:/\{\{#([\s\S]+?)\}\}/g,define:/\{\{##\s*([\w\.$]+)\s*(\:|=)([\s\S]+?)#\}\}/g,conditional:/\{\{\/?if\s*([\s\S]*?)\s*\}\}/g,conditionalElse:/\{\{else\s*([\s\S]*?)\s*\}\}/g,iterate:/\{\{\/?for\s*(?:\}\}|([\s\S]+?)\s*(?:\:\s*([\w$]+))?\s*(?:\:\s*([\w$]+))?\s*\}\})/g,props:/\{\{\/?props\s*(?:\}\}|([\s\S]+?)\s*(?:\:\s*([\w$]+))?\s*(?:\:\s*([\w$]+))?\s*\}\})/g,empty:/\{\{empty\}\}/g,varname:"data, config, helper",strip:true,append:true,selfcontained:false},template:undefined,compile:undefined},global;if(typeof module!=="undefined"&&module.exports){module.exports=doT}else if(typeof define==="function"&&define.amd){define(function(){return doT})}else{global=function(){return this||(0,eval)("this")}();global.doT=doT}String.prototype.encodeHTML=encodeHTMLSource();var startend={append:{start:"'+(",end:")+'",endencode:"||'').toString().encodeHTML()+'"},split:{start:"';out+=(",end:");out+='",endencode:"||'').toString().encodeHTML();out+='"}},skip=/$^/;doT.template=function(e,t,n){t=t||doT.templateSettings;var r=t.append?startend.append:startend.split,i,s=0,o=t.use||t.define?resolveDefs(t,e,n||{}):e;o=("var out='"+(t.strip?o.replace(/(^|\r|\n)\t* +| +\t*(\r|\n|$)/g," ").replace(/\r|\n|\t|\/\*[\s\S]*?\*\//g,""):o).replace(/'|\\/g,"\\$&").replace(t.interpolate||skip,function(e,t){return r.start+unescape(t)+r.end}).replace(t.encode||skip,function(e,t){i=true;return r.start+unescape(t)+r.endencode}).replace(t.conditional||skip,function(e,t){return t?"';if("+unescape(t)+"){out+='":"';}out+='"}).replace(t.conditionalElse||skip,function(e,t){return t?"';}else if("+unescape(t)+"){out+='":"';}else{out+='"}).replace(t.iterate||skip,function(e,t,n,r){if(!t)return"';} } out+='";s+=1;n=n||"value";r=r||"index";t=unescape(t);var i="arr"+s;return"';var "+i+"="+t+";if("+i+" && "+i+".length > 0){var "+n+","+r+"=-1,l"+s+"="+i+".length-1;while("+r+" 0){var "+n+";for( var "+r+" in "+i+"){ if (!"+i+".hasOwnProperty("+r+")) continue; "+n+"="+i+"["+r+"];out+='"}).replace(t.empty||skip,function(e){return"';}}else{if(true){out+='"}).replace(t.evaluate||skip,function(e,t){return"';"+unescape(t)+"out+='"})+"';return out;").replace(/\n/g,"\\n").replace(/\t/g,"\\t").replace(/\r/g,"\\r").replace(/(\s|;|\}|^|\{)out\+='';/g,"$1").replace(/\+''/g,"").replace(/(\s|;|\}|^|\{)out\+=''\+/g,"$1out+=");if(i&&t.selfcontained){o="String.prototype.encodeHTML=("+encodeHTMLSource.toString()+"());"+o}try{return new Function(t.varname,o)}catch(u){if(typeof console!=="undefined")console.log("Could not create a template function: "+o);throw u}};doT.compile=function(e,t){return doT.template(e,null,t)}})();jQuery.fn.extend({everyTime:function(e,t,n,r){return this.each(function(){jQuery.timer.add(this,e,t,n,r)})},oneTime:function(e,t,n){return this.each(function(){jQuery.timer.add(this,e,t,n,1)})},stopTime:function(e,t){return this.each(function(){jQuery.timer.remove(this,e,t)})}});jQuery.extend({timer:{global:[],guid:1,dataKey:"jQuery.timer",regex:/^([0-9]+(?:\.[0-9]*)?)\s*(.*s)?$/,powers:{ms:1,cs:10,ds:100,s:1e3,das:1e4,hs:1e5,ks:1e6},timeParse:function(e){if(e==undefined||e==null)return null;var t=this.regex.exec(jQuery.trim(e.toString()));return t[2]?parseFloat(t[1])*(this.powers[t[2]]||1):e},add:function(e,t,n,r,i){var s=0;if(jQuery.isFunction(n)){i||(i=r);r=n;n=t}t=jQuery.timer.timeParse(t);if(!(typeof t!="number"||isNaN(t)||t<0)){if(typeof i!="number"||isNaN(i)||i<0)i=0;i=i||0;var o=jQuery.data(e,this.dataKey)||jQuery.data(e,this.dataKey,{});o[n]||(o[n]={});r.timerID=r.timerID||this.guid++;var u=function(){if(++s>i&&i!==0||r.call(e,s)===false)jQuery.timer.remove(e,n,r)};u.timerID=r.timerID;o[n][r.timerID]||(o[n][r.timerID]=window.setInterval(u,t));this.global.push(e)}},remove:function(e,t,n){var r=jQuery.data(e,this.dataKey),i;if(r){if(t){if(r[t]){if(n){if(n.timerID){window.clearInterval(r[t][n.timerID]);delete r[t][n.timerID]}}else for(n in r[t]){window.clearInterval(r[t][n]);delete r[t][n]}for(i in r[t])break;if(!i){i=null;delete r[t]}}}else for(t in r)this.remove(e,t,n);for(i in r)break;i||jQuery.removeData(e,this.dataKey)}}}});jQuery(window).bind("unload",function(){jQuery.each(jQuery.timer.global,function(e,t){jQuery.timer.remove(t)})})
\ No newline at end of file
diff --git a/nano/js/libraries/2-doT.js b/nano/js/libraries/2-doT.js
index 50c5e451fc..a0ec5520c0 100644
--- a/nano/js/libraries/2-doT.js
+++ b/nano/js/libraries/2-doT.js
@@ -13,7 +13,8 @@
conditionalElse: /\{\{else\s*([\s\S]*?)\s*\}\}/g,
iterate: /\{\{\/?for\s*(?:\}\}|([\s\S]+?)\s*(?:\:\s*([\w$]+))?\s*(?:\:\s*([\w$]+))?\s*\}\})/g,
props: /\{\{\/?props\s*(?:\}\}|([\s\S]+?)\s*(?:\:\s*([\w$]+))?\s*(?:\:\s*([\w$]+))?\s*\}\})/g,
- varname: 'data, helper',
+ empty: /\{\{empty\}\}/g,
+ varname: 'data, config, helper',
strip: true,
append: true,
selfcontained: false
@@ -116,7 +117,7 @@
iname = iname || "index";
iterate = unescape(iterate);
var arrayName = "arr" + sid;
- return "';var " + arrayName + "=" + iterate + ";if(" + arrayName + "){var " + vname + "," + iname + "=-1,l" + sid + "=" + arrayName + ".length-1;while(" + iname + " 0){var " + vname + "," + iname + "=-1,l" + sid + "=" + arrayName + ".length-1;while(" + iname + " 0){var " + vname + ";for( var " + iname + " in " + objectName + "){ if (!" + objectName + ".hasOwnProperty(" + iname + ")) continue; " + vname + "=" + objectName + "[" + iname + "];out+='";
+ })
+ .replace(c.empty || skip, function (m) {
+ return "';}}else{if(true){out+='"; // The "if(true)" condition is required to account for the for tag closing with two brackets
})
.replace(c.evaluate || skip, function (m, code) {
return "';" + unescape(code) + "out+='";
diff --git a/nano/js/nano_base_callbacks.js b/nano/js/nano_base_callbacks.js
new file mode 100644
index 0000000000..3770dae7ec
--- /dev/null
+++ b/nano/js/nano_base_callbacks.js
@@ -0,0 +1,85 @@
+// NanoBaseCallbacks is where the base callbacks (common to all templates) are stored
+NanoBaseCallbacks = function ()
+{
+ // _canClick is used to disable clicks for a short period after each click (to avoid mis-clicks)
+ var _canClick = true;
+
+ var _baseBeforeUpdateCallbacks = {}
+
+ var _baseAfterUpdateCallbacks = {
+ // this callback is triggered after new data is processed
+ // it updates the status/visibility icon and adds click event handling to buttons/links
+ status: function (updateData) {
+ var uiStatusClass;
+ if (updateData['config']['status'] == 2)
+ {
+ uiStatusClass = 'icon24 uiStatusGood';
+ $('.linkActive').removeClass('inactive');
+ }
+ else if (updateData['config']['status'] == 1)
+ {
+ uiStatusClass = 'icon24 uiStatusAverage';
+ $('.linkActive').addClass('inactive');
+ }
+ else
+ {
+ uiStatusClass = 'icon24 uiStatusBad'
+ $('.linkActive').addClass('inactive');
+ }
+ $('#uiStatusIcon').attr('class', uiStatusClass);
+
+ $('.linkActive').stopTime('linkPending');
+ $('.linkActive').removeClass('linkPending');
+
+ $('.linkActive').off('click');
+ $('.linkActive').on('click', function (event) {
+ event.preventDefault();
+ var href = $(this).data('href');
+ if (href != null && _canClick)
+ {
+ _canClick = false;
+ $('body').oneTime(300, 'enableClick', function () {
+ _canClick = true;
+ });
+ if (updateData['config']['status'] == 2)
+ {
+ $(this).oneTime(300, 'linkPending', function () {
+ $(this).addClass('linkPending');
+ });
+ }
+ window.location.href = href;
+ }
+ });
+ }
+ };
+
+ return {
+ addCallbacks: function () {
+ NanoStateManager.addBeforeUpdateCallbacks(_baseBeforeUpdateCallbacks);
+ NanoStateManager.addAfterUpdateCallbacks(_baseAfterUpdateCallbacks);
+ },
+ removeCallbacks: function () {
+ for (var callbackKey in _baseBeforeUpdateCallbacks)
+ {
+ if (_baseBeforeUpdateCallbacks.hasOwnProperty(callbackKey))
+ {
+ NanoStateManager.removeBeforeUpdateCallback(callbackKey);
+ }
+ }
+ for (var callbackKey in _baseAfterUpdateCallbacks)
+ {
+ if (_baseAfterUpdateCallbacks.hasOwnProperty(callbackKey))
+ {
+ NanoStateManager.removeAfterUpdateCallback(callbackKey);
+ }
+ }
+ }
+ };
+} ();
+
+
+
+
+
+
+
diff --git a/nano/js/nano_base_helpers.js b/nano/js/nano_base_helpers.js
index 90b29da1e0..98275b247d 100644
--- a/nano/js/nano_base_helpers.js
+++ b/nano/js/nano_base_helpers.js
@@ -1,17 +1,8 @@
// NanoBaseHelpers is where the base template helpers (common to all templates) are stored
NanoBaseHelpers = function ()
{
- var init = function ()
- {
-
-
- initHelpers();
- };
-
- var initHelpers = function ()
- {
- NanoTemplate.addHelpers({
-
+ var _baseHelpers = {
+ // change ui styling to "syndicate mode"
syndicateMode: function() {
$('body').css("background-color","#8f1414");
$('body').css("background-image","url('uiBackground-Syndicate.png')");
@@ -24,7 +15,6 @@ NanoBaseHelpers = function ()
return '';
},
-
// Generate a Byond link
link: function( text, icon, parameters, status, elementClass, elementId) {
@@ -187,13 +177,22 @@ NanoBaseHelpers = function ()
return html;
}
- });
- };
-
+ };
+
return {
- init: function ()
+ addHelpers: function ()
{
- init();
+ NanoTemplate.addHelpers(_baseHelpers);
+ },
+ removeHelpers: function ()
+ {
+ for (var helperKey in _baseHelpers)
+ {
+ if (_baseHelpers.hasOwnProperty(helperKey))
+ {
+ NanoTemplate.removeHelper(helperKey);
+ }
+ }
}
};
} ();
diff --git a/nano/js/nano_state.js b/nano/js/nano_state.js
new file mode 100644
index 0000000000..7a3dcfdf03
--- /dev/null
+++ b/nano/js/nano_state.js
@@ -0,0 +1,69 @@
+// This is the base state class, it is not to be used directly
+
+function NanoStateClass() {
+ /*if (typeof this.key != 'string' || !this.key.length)
+ {
+ alert('ERROR: Tried to create a state with an invalid state key: ' + this.key);
+ return;
+ }
+
+ this.key = this.key.toLowerCase();
+
+ NanoStateManager.addState(this);*/
+}
+
+NanoStateClass.prototype.key = null;
+
+NanoStateClass.prototype.isCurrent = function () {
+ return NanoStateManager.getCurrentState() == this;
+};
+
+NanoStateClass.prototype.onAdd = function (previousState) {
+ // Do not add code here, add it to the 'default' state (nano_state_defaut.js) or create a new state and override this function
+
+ NanoBaseCallbacks.addCallbacks();
+ NanoBaseHelpers.addHelpers();
+};
+
+NanoStateClass.prototype.onRemove = function (nextState) {
+ // Do not add code here, add it to the 'default' state (nano_state_defaut.js) or create a new state and override this function
+
+ NanoBaseCallbacks.removeCallbacks();
+ NanoBaseHelpers.removeHelpers();
+};
+
+NanoStateClass.prototype.onBeforeUpdate = function (data) {
+ // Do not add code here, add it to the 'default' state (nano_state_defaut.js) or create a new state and override this function
+
+ data = NanoStateManager.executeBeforeUpdateCallbacks(data);
+
+ return data; // Return data to continue, return false to prevent onUpdate and onAfterUpdate
+};
+
+NanoStateClass.prototype.onUpdate = function (data) {
+ // Do not add code here, add it to the 'default' state (nano_state_defaut.js) or create a new state and override this function
+
+ try
+ {
+ $("#mainTemplate").html(NanoTemplate.parse('main', data)); // render the 'mail' template to the #mainTemplate div
+ }
+ catch(error)
+ {
+ alert('ERROR: An error occurred while rendering the UI: ' + error.message);
+ return;
+ }
+};
+
+NanoStateClass.prototype.onAfterUpdate = function (data) {
+ // Do not add code here, add it to the 'default' state (nano_state_defaut.js) or create a new state and override this function
+
+ NanoStateManager.executeAfterUpdateCallbacks(data);
+};
+
+NanoStateClass.prototype.alertText = function (text) {
+ // Do not add code here, add it to the 'default' state (nano_state_defaut.js) or create a new state and override this function
+
+ alert(text);
+};
+
+
diff --git a/nano/js/nano_state_default.js b/nano/js/nano_state_default.js
new file mode 100644
index 0000000000..65493b8c87
--- /dev/null
+++ b/nano/js/nano_state_default.js
@@ -0,0 +1,14 @@
+
+NanoStateDefaultClass.inheritsFrom(NanoStateClass);
+var NanoStateDefault = new NanoStateDefaultClass();
+
+function NanoStateDefaultClass() {
+
+ this.key = 'default';
+
+ //this.parent.constructor.call(this);
+
+ this.key = this.key.toLowerCase();
+
+ NanoStateManager.addState(this);
+}
\ No newline at end of file
diff --git a/nano/js/nano_state_manager.js b/nano/js/nano_state_manager.js
new file mode 100644
index 0000000000..0cbdb2e48a
--- /dev/null
+++ b/nano/js/nano_state_manager.js
@@ -0,0 +1,227 @@
+// NanoStateManager handles data from the server and uses it to render templates
+NanoStateManager = function ()
+{
+ // _isInitialised is set to true when all of this ui's templates have been processed/rendered
+ var _isInitialised = false;
+
+ // the array of template names to use for this ui
+ var _templates = null;
+ // the data for this ui
+ var _data = null;
+ // new data which arrives before _isInitialised is true is stored here for processing later
+ var _earlyUpdateData = null;
+
+ // this is an array of callbacks which are called when new data arrives, before it is processed
+ var _beforeUpdateCallbacks = {};
+ // this is an array of callbacks which are called when new data arrives, before it is processed
+ var _afterUpdateCallbacks = {};
+
+ // this is an array of state objects, these can be used to provide custom javascript logic
+ var _states = {};
+
+ var _currentState = null;
+
+ // the init function is called when the ui has loaded
+ // this function sets up the templates and base functionality
+ var init = function ()
+ {
+ $('#uiLoadingNotice').html('Loading...');
+
+ // We store initialData and templateData in the body tag, it's as good a place as any
+ _data = $('body').data('initialData');
+
+ if (_data == null || !_data.hasOwnProperty('config') || !_data.hasOwnProperty('data'))
+ {
+ alert('Error: Initial data did not load correctly.');
+ }
+
+ var stateKey = 'default';
+ if (_data['config'].hasOwnProperty('stateKey') && _data['config']['stateKey'])
+ {
+ stateKey = _data['config']['stateKey'].toLowerCase();
+ }
+
+ NanoStateManager.setCurrentState(stateKey);
+
+ $(document).on('templatesLoaded', function () {
+ doUpdate(_data);
+
+ _isInitialised = true;
+ $('#uiLoadingNotice').hide();
+ });
+ };
+
+ // Receive update data from the server
+ var receiveUpdateData = function (jsonString)
+ {
+ var updateData;
+ try
+ {
+ // parse the JSON string from the server into a JSON object
+ updateData = jQuery.parseJSON(jsonString);
+ }
+ catch (error)
+ {
+ alert(error.Message);
+ return;
+ }
+
+ if (!updateData.hasOwnProperty('data'))
+ {
+ if (_data && _data.hasOwnProperty('data'))
+ {
+ updateData['data'] = _data['data'];
+ }
+ else
+ {
+ updateData['data'] = {};
+ }
+ }
+
+ if (_isInitialised) // all templates have been registered, so render them
+ {
+ doUpdate(updateData);
+ }
+ else
+ {
+ _data = updateData; // all templates have not been registered. We set _data directly here which will be applied after the template is loaded with the initial data
+ }
+ };
+
+ // This function does the update by calling the methods on the current state
+ var doUpdate = function (data)
+ {
+ if (_currentState == null)
+ {
+ return;
+ }
+
+ data = _currentState.onBeforeUpdate(data);
+
+ if (data === false)
+ {
+ alert('data is false, return');
+ return; // A beforeUpdateCallback returned a false value, this prevents the render from occuring
+ }
+
+ _data = data;
+
+ _currentState.onUpdate(_data);
+
+ _currentState.onAfterUpdate(_data);
+ };
+
+ // Execute all callbacks in the callbacks array/object provided, updateData is passed to them for processing and potential modification
+ var executeCallbacks = function (callbacks, data)
+ {
+ for (var key in callbacks)
+ {
+ if (callbacks.hasOwnProperty(key) && jQuery.isFunction(callbacks[key]))
+ {
+ data = callbacks[key].call(this, data);
+ }
+ }
+
+ return data;
+ };
+
+ return {
+ init: function ()
+ {
+ init();
+ },
+ receiveUpdateData: function (jsonString)
+ {
+ receiveUpdateData(jsonString);
+ },
+ addBeforeUpdateCallback: function (key, callbackFunction)
+ {
+ _beforeUpdateCallbacks[key] = callbackFunction;
+ },
+ addBeforeUpdateCallbacks: function (callbacks) {
+ for (var callbackKey in callbacks) {
+ if (!callbacks.hasOwnProperty(callbackKey))
+ {
+ continue;
+ }
+ NanoStateManager.addBeforeUpdateCallback(callbackKey, callbacks[callbackKey]);
+ }
+ },
+ removeBeforeUpdateCallback: function (key)
+ {
+ if (_beforeUpdateCallbacks.hasOwnProperty(key))
+ {
+ delete _beforeUpdateCallbacks[key];
+ }
+ },
+ executeBeforeUpdateCallbacks: function (data) {
+ return executeCallbacks(_beforeUpdateCallbacks, data);
+ },
+ addAfterUpdateCallback: function (key, callbackFunction)
+ {
+ _afterUpdateCallbacks[key] = callbackFunction;
+ },
+ addAfterUpdateCallbacks: function (callbacks) {
+ for (var callbackKey in callbacks) {
+ if (!callbacks.hasOwnProperty(callbackKey))
+ {
+ continue;
+ }
+ NanoStateManager.addAfterUpdateCallback(callbackKey, callbacks[callbackKey]);
+ }
+ },
+ removeAfterUpdateCallback: function (key)
+ {
+ if (_afterUpdateCallbacks.hasOwnProperty(key))
+ {
+ delete _afterUpdateCallbacks[key];
+ }
+ },
+ executeAfterUpdateCallbacks: function (data) {
+ return executeCallbacks(_afterUpdateCallbacks, data);
+ },
+ addState: function (state)
+ {
+ if (!(state instanceof NanoStateClass))
+ {
+ alert('ERROR: Attempted to add a state which is not instanceof NanoStateClass');
+ return;
+ }
+ if (!state.key)
+ {
+ alert('ERROR: Attempted to add a state with an invalid stateKey');
+ return;
+ }
+ _states[state.key] = state;
+ },
+ setCurrentState: function (stateKey)
+ {
+ if (typeof stateKey == 'undefined' || !stateKey) {
+ alert('ERROR: No state key was passed!');
+ return false;
+ }
+ if (!_states.hasOwnProperty(stateKey))
+ {
+ alert('ERROR: Attempted to set a current state which does not exist: ' + stateKey);
+ return false;
+ }
+
+ var previousState = _currentState;
+
+ _currentState = _states[stateKey];
+
+ if (previousState != null) {
+ previousState.onRemove(_currentState);
+ }
+
+ _currentState.onAdd(previousState);
+
+ return true;
+ },
+ getCurrentState: function ()
+ {
+ return _currentState;
+ }
+ };
+} ();
+
\ No newline at end of file
diff --git a/nano/js/nano_template.js b/nano/js/nano_template.js
index 13588f9f72..23e2ac0837 100644
--- a/nano/js/nano_template.js
+++ b/nano/js/nano_template.js
@@ -7,7 +7,69 @@ var NanoTemplate = function () {
var _helpers = {};
var init = function () {
-
+ // We store initialData and templateData in the body tag, it's as good a place as any
+ var templateData = $('body').data('templateData');
+
+ if (templateData == null)
+ {
+ alert('Error: Template data did not load correctly.');
+ }
+
+ // we count the number of templates for this ui so that we know when they've all been rendered
+ var templateCount = 0;
+ for (var key in templateData)
+ {
+ if (templateData.hasOwnProperty(key))
+ {
+ templateCount++;
+ }
+ }
+
+ if (!templateCount)
+ {
+ alert('ERROR: No templates listed!');
+ }
+
+ // load markup for each template and register it
+ for (var key in templateData)
+ {
+ if (!templateData.hasOwnProperty(key))
+ {
+ continue;
+ }
+
+ $.when($.ajax({
+ url: templateData[key],
+ cache: false,
+ dataType: 'text'
+ }))
+ .done(function(templateMarkup) {
+
+ //templateMarkup = templateMarkup.replace(/ +\) *\}\}/g, ')}}');
+
+ templateMarkup += '';
+
+ try
+ {
+ NanoTemplate.addTemplate(key, templateMarkup)
+
+ templateCount--;
+
+ if (templateCount <= 0)
+ {
+ $(document).trigger('templatesLoaded');
+ }
+ }
+ catch(error)
+ {
+ alert('ERROR: An error occurred while loading the UI: ' + error.message);
+ return;
+ }
+ })
+ .fail(function () {
+ alert('ERROR: Loading template ' + key + '(' + templateData[key] + ') failed!');
+ });;
+ }
};
var compileTemplates = function () {
@@ -37,7 +99,7 @@ var NanoTemplate = function () {
}
compileTemplates();
}
- return _compiledTemplates[templateKey].call(this, data, _helpers);
+ return _compiledTemplates[templateKey].call(this, data['data'], data['config'], _helpers);
},
addHelper: function (helperName, helperFunction) {
if (!jQuery.isFunction(helperFunction)) {
@@ -55,6 +117,12 @@ var NanoTemplate = function () {
}
NanoTemplate.addHelper(helperName, helpers[helperName]);
}
+ },
+ removeHelper: function (helperName) {
+ if (helpers.hasOwnProperty(helperName))
+ {
+ delete _helpers[helperName];
+ }
}
}
}();
diff --git a/nano/js/nano_update.js b/nano/js/nano_update.js
deleted file mode 100644
index 9b9e7a4cf6..0000000000
--- a/nano/js/nano_update.js
+++ /dev/null
@@ -1,237 +0,0 @@
-// NanoUpdate handles data from the server and uses it to render templates
-NanoUpdate = function ()
-{
- // _isInitialised is set to true when all of this ui's templates have been processed/rendered
- var _isInitialised = false;
-
- // the array of template names to use for this ui
- var _templates = null;
- // the data for this ui
- var _data = null;
- // new data which arrives before _isInitialised is true is stored here for processing later
- var _earlyUpdateData = null;
-
- // this is an array of callbacks which are called when new data arrives, before it is processed
- var _beforeUpdateCallbacks = [];
- // this is an array of callbacks which are called when new data arrives, before it is processed
- var _afterUpdateCallbacks = [];
-
- // _canClick is used to disable clicks for a short period after each click (to avoid mis-clicks)
- var _canClick = true;
-
- // the init function is called when the ui has loaded
- // this function sets up the templates and base functionality
- var init = function ()
- {
- $('#uiNoJavaScript').html('Loading...');
-
- // this callback is triggered after new data is processed
- // it updates the status/visibility icon and adds click event handling to buttons/links
- NanoUpdate.addAfterUpdateCallback(function (updateData) {
- var uiStatusClass;
- if (updateData['ui']['status'] == 2)
- {
- uiStatusClass = 'icon24 uiStatusGood';
- $('.linkActive').removeClass('inactive');
- }
- else if (updateData['ui']['status'] == 1)
- {
- uiStatusClass = 'icon24 uiStatusAverage';
- $('.linkActive').addClass('inactive');
- }
- else
- {
- uiStatusClass = 'icon24 uiStatusBad'
- $('.linkActive').addClass('inactive');
- }
- $('#uiStatusIcon').attr('class', uiStatusClass);
-
- $('.linkActive').stopTime('linkPending');
- $('.linkActive').removeClass('linkPending');
-
- $('.linkActive').off('click');
- $('.linkActive').on('click', function (event) {
- event.preventDefault();
- var href = $(this).data('href');
- if (href != null && _canClick)
- {
- _canClick = false;
- $('body').oneTime(300, 'enableClick', function () {
- _canClick = true;
- });
- if (updateData['ui']['status'] == 2)
- {
- $(this).oneTime(300, 'linkPending', function () {
- $(this).addClass('linkPending');
- });
- }
- window.location.href = href;
- }
- });
- });
-
- // We store initialData and templateData in the body tag, it's as good a place as any
- var body = $('body');
- var templateData = body.data('templateData');
- var initialData = body.data('initialData');
-
- if (templateData == null || !initialData == null)
- {
- alert('Error: Initial data did not load correctly.');
- }
-
- // we count the number of templates for this ui so that we know when they've all been rendered
- var templateCount = 0;
- for (var key in templateData)
- {
- if (templateData.hasOwnProperty(key))
- {
- templateCount++;
- }
- }
-
- if (!templateCount)
- {
- alert('ERROR: No templates listed!');
- }
-
- // load markup for each template and register it
- for (var key in templateData)
- {
- if (templateData.hasOwnProperty(key))
- {
- $.when($.ajax({
- url: templateData[key],
- cache: false,
- dataType: 'text'
- }))
- //$.when($.get(templateData[key]))
- .done(function(templateMarkup) {
-
- //templateMarkup = templateMarkup.replace(/ +\) *\}\}/g, ')}}');
-
- templateMarkup += '';
-
- try
- {
- NanoTemplate.addTemplate(key, templateMarkup)
-
- templateCount--;
-
- if (templateCount <= 0)
- {
- if (_earlyUpdateData !== null) // Newer data has already arrived, so update
- {
- renderTemplates(_earlyUpdateData);
- }
- else
- {
- renderTemplates(initialData);
- }
- _isInitialised = true;
- $('#uiNoJavaScript').hide();
- }
- }
- catch(error)
- {
- alert('ERROR: An error occurred while loading the UI: ' + error.message);
- return;
- }
- })
- .fail(function () {
- alert('Loading template ' + key + '(' + templateData[key] + ') failed!');
- });;
- }
- }
- };
-
- // Receive update data from the server
- var receiveUpdateData = function (jsonString)
- {
- var updateData;
- try
- {
- // parse the JSON string from the server into a JSON object
- updateData = jQuery.parseJSON(jsonString);
- }
- catch (error)
- {
- alert(error.Message);
- return;
- }
-
-
- if (_isInitialised) // all templates have been registered, so render them
- {
- renderTemplates(updateData);
- }
- else
- {
- _earlyUpdateData = updateData; // all templates have not been registered. We set _earlyUpdateData which will be applied after the template is loaded with the initial data
- }
- };
-
- // This function renders the template with the latest data
- // It has to be done recursively as each piece of data is observed individually and needs to be updated individually
- var renderTemplates = function (data)
- {
- data = executeCallbacks(_beforeUpdateCallbacks, data);
-
- if (data === false)
- {
- return; // A beforeUpdateCallback returned a false value, this prevents the render from occuring
- }
-
- _data = data;
-
- try
- {
- $("#mainTemplate").html(NanoTemplate.parse('main', _data));
- }
- catch(error)
- {
- alert('ERROR: An error occurred while rendering the UI: ' + error.message);
- return;
- }
-
- executeCallbacks(_afterUpdateCallbacks, _data);
- };
-
- // Execute all callbacks in the callbacks array/object provided, updateData is passed to them for processing and potential modification
- var executeCallbacks = function (callbacks, updateData)
- {
- for (var key in callbacks)
- {
- if (callbacks.hasOwnProperty(key) && jQuery.isFunction(callbacks[key]))
- {
- updateData = callbacks[key].call(this, updateData);
- }
- }
-
- return updateData;
- };
-
- return {
- init: function ()
- {
- init();
- },
- isInitialised: function ()
- {
- return _isInitialised;
- },
- receiveUpdateData: function (jsonString)
- {
- receiveUpdateData(jsonString);
- },
- addBeforeUpdateCallback: function (callbackFunction)
- {
- _beforeUpdateCallbacks.push(callbackFunction);
- },
- addAfterUpdateCallback: function (callbackFunction)
- {
- _afterUpdateCallbacks.push(callbackFunction);
- }
- };
-} ();
-
\ No newline at end of file
diff --git a/nano/js/nano_utility.js b/nano/js/nano_utility.js
index d54857a347..40cd827d13 100644
--- a/nano/js/nano_utility.js
+++ b/nano/js/nano_utility.js
@@ -53,9 +53,8 @@ if (typeof doT == 'undefined') {
// All scripts are initialised here, this allows control of init order
$(document).ready(function () {
NanoUtility.init();
+ NanoStateManager.init();
NanoTemplate.init();
- NanoBaseHelpers.init();
- NanoUpdate.init();
});
if (!Array.prototype.indexOf)
@@ -139,4 +138,11 @@ String.prototype.toTitleCase = function () {
$.ajaxSetup({
cache: false
-});
\ No newline at end of file
+});
+
+Function.prototype.inheritsFrom = function (parentClassOrObject) {
+ this.prototype = new parentClassOrObject;
+ this.prototype.constructor = this;
+ this.prototype.parent = parentClassOrObject.prototype;
+ return this;
+};
\ No newline at end of file
diff --git a/nano/templates/apc.tmpl b/nano/templates/apc.tmpl
index 0fbba9fe86..1db3cb3dda 100644
--- a/nano/templates/apc.tmpl
+++ b/nano/templates/apc.tmpl
@@ -9,9 +9,9 @@
{{else}}
{{if data.locked}}
- Swipe an ID card to unlock this interface.
+ Swipe an ID card to unlock this interface
{{else}}
- Swipe an ID card to lock this interface.
+ Swipe an ID card to lock this interface
{{/if}}
{{/if}}
@@ -114,11 +114,13 @@
{{else value.status >= 2}}
On
{{/if}}
- {{if value.status == 1 || value.status == 3}}
- [Auto]
- {{else}}
- [Manual]
- {{/if}}
+ {{if data.locked}}
+ {{if value.status == 1 || value.status == 3}}
+ Auto
+ {{else}}
+ Manual
+ {{/if}}
+ {{/if}}
{{if !data.locked || data.siliconUser}}
diff --git a/nano/templates/canister.tmpl b/nano/templates/canister.tmpl
index dd1f9a2e01..dd72102232 100644
--- a/nano/templates/canister.tmpl
+++ b/nano/templates/canister.tmpl
@@ -4,7 +4,7 @@
Tank Label:
-
{{:data.name}}
{{:helper.link('Relabel', 'pencil', {'relabel' : 1}, (canLabel) ? null : 'disabled')}}
+
{{:data.name}}
{{:helper.link('Relabel', 'pencil', {'relabel' : 1}, (data.canLabel) ? null : 'disabled')}}
@@ -57,17 +57,17 @@
Release Pressure:
- {{:helper.displayBar(releasePressure, minReleasePressure, maxReleasePressure)}}
+ {{:helper.displayBar(data.releasePressure, data.minReleasePressure, data.maxReleasePressure)}}
- {{:helper.link('-', null, {'pressure_adj' : -1000}, (releasePressure > minReleasePressure) ? null : 'disabled')}}
- {{:helper.link('-', null, {'pressure_adj' : -100}, (releasePressure > minReleasePressure) ? null : 'disabled')}}
- {{:helper.link('-', null, {'pressure_adj' : -10}, (releasePressure > minReleasePressure) ? null : 'disabled')}}
- {{:helper.link('-', null, {'pressure_adj' : -1}, (releasePressure > minReleasePressure) ? null : 'disabled')}}
+ {{:helper.link('-', null, {'pressure_adj' : -1000}, (data.releasePressure > data.minReleasePressure) ? null : 'disabled')}}
+ {{:helper.link('-', null, {'pressure_adj' : -100}, (data.releasePressure > data.minReleasePressure) ? null : 'disabled')}}
+ {{:helper.link('-', null, {'pressure_adj' : -10}, (data.releasePressure > data.minReleasePressure) ? null : 'disabled')}}
+ {{:helper.link('-', null, {'pressure_adj' : -1}, (data.releasePressure > data.minReleasePressure) ? null : 'disabled')}}
{{:data.releasePressure}} kPa
- {{:helper.link('+', null, {'pressure_adj' : 1}, (releasePressure < maxReleasePressure) ? null : 'disabled')}}
- {{:helper.link('+', null, {'pressure_adj' : 10}, (releasePressure < maxReleasePressure) ? null : 'disabled')}}
- {{:helper.link('+', null, {'pressure_adj' : 100}, (releasePressure < maxReleasePressure) ? null : 'disabled')}}
- {{:helper.link('+', null, {'pressure_adj' : 1000}, (releasePressure < maxReleasePressure) ? null : 'disabled')}}
+ {{:helper.link('+', null, {'pressure_adj' : 1}, (data.releasePressure < data.maxReleasePressure) ? null : 'disabled')}}
+ {{:helper.link('+', null, {'pressure_adj' : 10}, (data.releasePressure < data.maxReleasePressure) ? null : 'disabled')}}
+ {{:helper.link('+', null, {'pressure_adj' : 100}, (data.releasePressure < data.maxReleasePressure) ? null : 'disabled')}}
+ {{:helper.link('+', null, {'pressure_adj' : 1000}, (data.releasePressure < data.maxReleasePressure) ? null : 'disabled')}}
@@ -77,7 +77,7 @@
Release Valve:
- {{:helper.link('Open', 'unlocked', {'toggle' : 1}, valveOpen ? 'selected' : null)}}{{:helper.link('Close', 'locked', {'toggle' : 1}, valveOpen ? null : 'selected')}}
+ {{:helper.link('Open', 'unlocked', {'toggle' : 1}, data.valveOpen ? 'selected' : null)}}{{:helper.link('Close', 'locked', {'toggle' : 1}, data.valveOpen ? null : 'selected')}}
diff --git a/nano/templates/chem_dispenser.tmpl b/nano/templates/chem_dispenser.tmpl
index 4be8b89578..1dd960f9c8 100644
--- a/nano/templates/chem_dispenser.tmpl
+++ b/nano/templates/chem_dispenser.tmpl
@@ -7,7 +7,7 @@ Used In File(s): \code\modules\reagents\Chemistry-Machinery.dm
Energy:
- {{:helper.displayBar(energy, 0, maxEnergy, 'good', energy + ' Units')}}
+ {{:helper.displayBar(data.energy, 0, data.maxEnergy, 'good', data.energy + ' Units')}}
@@ -16,11 +16,11 @@ Used In File(s): \code\modules\reagents\Chemistry-Machinery.dm
Dispense:
- {{:helper.link('5', 'gear', {'amount' : 5}, (amount == 5) ? 'selected' : null)}}
- {{:helper.link('10', 'gear', {'amount' : 10}, (amount == 10) ? 'selected' : null)}}
- {{:helper.link('20', 'gear', {'amount' : 20}, (amount == 20) ? 'selected' : null)}}
- {{:helper.link('30', 'gear', {'amount' : 30}, (amount == 30) ? 'selected' : null)}}
- {{:helper.link('50', 'gear', {'amount' : 50}, (amount == 50) ? 'selected' : null)}}
+ {{:helper.link('5', 'gear', {'amount' : 5}, (data.amount == 5) ? 'selected' : null)}}
+ {{:helper.link('10', 'gear', {'amount' : 10}, (data.amount == 10) ? 'selected' : null)}}
+ {{:helper.link('20', 'gear', {'amount' : 20}, (data.amount == 20) ? 'selected' : null)}}
+ {{:helper.link('30', 'gear', {'amount' : 30}, (data.amount == 30) ? 'selected' : null)}}
+ {{:helper.link('50', 'gear', {'amount' : 50}, (data.amount == 50) ? 'selected' : null)}}
@@ -36,7 +36,7 @@ Used In File(s): \code\modules\reagents\Chemistry-Machinery.dm
{{for data.chemicals}}
- {{:helper.link(title, 'circle-arrow-s', commands, null, ~root.glass ? 'fixedLeftWide' : 'fixedLeft')}}
+ {{:helper.link(value.title, 'circle-arrow-s', value.commands, null, data.glass ? 'fixedLeftWide' : 'fixedLeft')}}
{{/for}}
@@ -51,32 +51,36 @@ Used In File(s): \code\modules\reagents\Chemistry-Machinery.dm
{{/if}} Contents
- {{:helper.link(glass ? 'Eject Glass' : 'Eject Beaker', 'eject', {'ejectBeaker' : 1}, isBeakerLoaded ? null : 'disabled', 'floatRight')}}
+ {{:helper.link(data.glass ? 'Eject Glass' : 'Eject Beaker', 'eject', {'ejectBeaker' : 1}, data.isBeakerLoaded ? null : 'disabled', 'floatRight')}}
-
+
{{if data.isBeakerLoaded}}
Volume: {{:data.beakerCurrentVolume}} / {{:data.beakerMaxVolume}}
{{for data.beakerContents}}
- {{:data.volume}} units of {{:data.name}}
- {{else}}
+ {{:value.volume}} units of {{:value.name}}
+ {{empty}}
- {{if data.glass}}
- Glass
- {{else}}
- Beaker
- {{/if}}
- is empty
+ {{if data.glass}}
+ Glass
+ {{else}}
+ Beaker
+ {{/if}}
+ is empty
+
{{/for}}
{{else}}
- No
- {{if data.glass}}
- Glass
- {{else}}
- Beaker
- {{/if}} loaded
+
+ No
+ {{if data.glass}}
+ Glass
+ {{else}}
+ Beaker
+ {{/if}}
+ loaded
+
{{/if}}
diff --git a/nano/templates/crew_monitor.tmpl b/nano/templates/crew_monitor.tmpl
index bdaa9f973d..f789f6052c 100644
--- a/nano/templates/crew_monitor.tmpl
+++ b/nano/templates/crew_monitor.tmpl
@@ -3,12 +3,12 @@ Crew Monitoring Computer interface
-->
{{for data.crewmembers}}
- {{if data.sensor_type == 1}}
- | {{:data.name}} | {{:data.dead ? "Deceased" : "Living"}} | Not Available |
- {{else data.sensor_type == 2}}
- | {{:data.name}} | {{:data.dead ? "Deceased" : "Living"}} ({{:data.oxy}}/{{:data.tox}}/{{:data.fire}}/{{:data.brute}}) | Not Available |
- {{else data.sensor_type == 3}}
- | {{:data.name}} | {{:data.dead ? "Deceased" : "Living"}} ({{:data.oxy}}/{{:data.tox}}/{{:data.fire}}/{{:data.brute}}) | {{:data.area}}({{:data.x}}, {{:data.y}}) |
+ {{if value.sensor_type == 1}}
+ | {{:value.name}} | {{:value.dead ? "Deceased" : "Living"}} | Not Available |
+ {{else value.sensor_type == 2}}
+ | {{:value.name}} | {{:value.dead ? "Deceased" : "Living"}} ({{:value.oxy}}/{{:value.tox}}/{{:value.fire}}/{{:value.brute}}) | Not Available |
+ {{else value.sensor_type == 3}}
+ | {{:value.name}} | {{:value.dead ? "Deceased" : "Living"}} ({{:value.oxy}}/{{:value.tox}}/{{:value.fire}}/{{:value.brute}}) | {{:value.area}}({{:value.x}}, {{:value.y}}) |
{{/if}}
{{/for}}
\ No newline at end of file
diff --git a/nano/templates/cryo.tmpl b/nano/templates/cryo.tmpl
index 08102950f6..e8302b07df 100644
--- a/nano/templates/cryo.tmpl
+++ b/nano/templates/cryo.tmpl
@@ -23,42 +23,44 @@ Used In File(s): \code\game\machinery\cryo.dm
Health:
{{if data.occupant.health >= 0}}
- {{:helper.displayBar(occupant.health, 0, occupant.maxHealth, 'good')}}
+ {{:helper.displayBar(data.occupant.health, 0, data.occupant.maxHealth, 'good')}}
{{else}}
- {{:helper.displayBar(occupant.health, 0, occupant.minHealth, 'average alignRight')}}
+ {{:helper.displayBar(data.occupant.health, 0, data.occupant.minHealth, 'average alignRight')}}
{{/if}}
-
{{:helper.round(occupant.health)}}
+
{{:helper.round(data.occupant.health)}}
=> Brute Damage:
- {{:helper.displayBar(occupant.bruteLoss, 0, occupant.maxHealth, 'bad')}}
-
{{:helper.round(occupant.bruteLoss)}}
+ {{:helper.displayBar(data.occupant.bruteLoss, 0, data.occupant.maxHealth, 'bad')}}
+
{{:helper.round(data.occupant.bruteLoss)}}
=> Resp. Damage:
- {{:helper.displayBar(occupant.oxyLoss, 0, occupant.maxHealth, 'bad')}}
-
{{:helper.round(occupant.oxyLoss)}}
+ {{:helper.displayBar(data.occupant.oxyLoss, 0, data.occupant.maxHealth, 'bad')}}
+
{{:helper.round(data.occupant.oxyLoss)}}
=> Toxin Damage:
- {{:helper.displayBar(occupant.toxLoss, 0, occupant.maxHealth, 'bad')}}
-
{{:helper.round(occupant.toxLoss)}}
+ {{:helper.displayBar(data.occupant.toxLoss, 0, data.occupant.maxHealth, 'bad')}}
+
{{:helper.round(data.occupant.toxLoss)}}
=> Burn Severity:
- {{:helper.displayBar(occupant.fireLoss, 0, occupant.maxHealth, 'bad')}}
-
{{:helper.round(occupant.fireLoss)}}
+ {{:helper.displayBar(data.occupant.fireLoss, 0, data.occupant.maxHealth, 'bad')}}
+
{{:helper.round(data.occupant.fireLoss)}}
{{/if}}
{{/if}}
-
Cell Temperature:
- {{:helper.string('{1} K', cellTemperatureStatus, cellTemperature)}}
-
+
+
Cell Temperature:
+ {{:data.cellTemperature}} K
+
+
Cryo Cell Operation
@@ -67,10 +69,10 @@ Used In File(s): \code\game\machinery\cryo.dm
Cryo Cell Status:
- {{:helper.link('On', 'power', {'switchOn' : 1}, isOperating ? 'selected' : null)}}{{:helper.link('Off', 'close', {'switchOff' : 1}, isOperating ? null : 'selected')}}
+ {{:helper.link('On', 'power', {'switchOn' : 1}, data.isOperating ? 'selected' : null)}}{{:helper.link('Off', 'close', {'switchOff' : 1}, data.isOperating ? null : 'selected')}}
- {{:helper.link('Eject Occupant', 'arrowreturnthick-1-s', {'ejectOccupant' : 1}, hasOccupant ? null : 'disabled')}}
+ {{:helper.link('Eject Occupant', 'arrowreturnthick-1-s', {'ejectOccupant' : 1}, data.hasOccupant ? null : 'disabled')}}
@@ -80,7 +82,7 @@ Used In File(s): \code\game\machinery\cryo.dm
{{if data.isBeakerLoaded}}
- {{:data.beakerLabel ? beakerLabel : 'No label'}}
+ {{:data.beakerLabel ? data.beakerLabel : 'No label'}}
{{if data.beakerVolume}}
{{:data.beakerVolume}} units remaining
{{else}}
@@ -91,6 +93,6 @@ Used In File(s): \code\game\machinery\cryo.dm
{{/if}}
- {{:helper.link('Eject Beaker', 'eject', {'ejectBeaker' : 1}, isBeakerLoaded ? null : 'disabled')}}
+ {{:helper.link('Eject Beaker', 'eject', {'ejectBeaker' : 1}, data.isBeakerLoaded ? null : 'disabled')}}
\ No newline at end of file
diff --git a/nano/templates/disease_splicer.tmpl b/nano/templates/disease_splicer.tmpl
index a3caad12de..0277fbe342 100644
--- a/nano/templates/disease_splicer.tmpl
+++ b/nano/templates/disease_splicer.tmpl
@@ -17,7 +17,7 @@
Virus Dish
- {{:helper.link('Eject Dish', 'eject', { 'eject' : 1 }, dish_inserted ? null : 'disabled')}}
+ {{:helper.link('Eject Dish', 'eject', { 'eject' : 1 }, data.dish_inserted ? null : 'disabled')}}
@@ -25,7 +25,7 @@
Growth Density:
- {{:helper.displayBar(growth, 0, 100, growth >= 50 ? 'good' : growth >= 25 ? 'average' : 'bad', growth + '%' )}}
+ {{:helper.displayBar(data.growth, 0, 100, (data.growth >= 50) ? 'good' : data.growth >= 25 ? 'average' : 'bad', data.growth + '%' )}}
@@ -53,7 +53,7 @@
{{/if}}
- {{if data.affected_species && !info}}
+ {{if data.affected_species && !data.info}}
Affected Species:
@@ -74,7 +74,7 @@
{{for data.effects}}
- {{:helper.link(stage, 'transferthick-e-w', { 'grab' : reference })}}
+ {{:helper.link(data.stage, 'transferthick-e-w', { 'grab' : data.reference })}}
{{/for}}
@@ -93,7 +93,7 @@
{{if data.buffer}}
- {{:data.buffer.name}} ({{:data.buffer.stage}})
+ {{:data.buffer.name}} ({{:data.buffer.stage}})
{{else}}
{{if data.species_buffer}}
{{:data.species_buffer}}
@@ -103,6 +103,6 @@
{{/if}}
- {{:helper.link('Save To Disk', 'disk', { 'disk' : 1 }, (buffer || species_buffer) ? null : 'disabled')}}
- {{:helper.link('Splice Onto Dish', 'pencil', { 'splice' : 1 }, (buffer || species_buffer) && !info ? null : 'disabled')}}
+ {{:helper.link('Save To Disk', 'disk', { 'disk' : 1 }, (data.buffer || data.species_buffer) ? null : 'disabled')}}
+ {{:helper.link('Splice Onto Dish', 'pencil', { 'splice' : 1 }, ((data.buffer || data.species_buffer) && !data.info) ? null : 'disabled')}}
{{/if}}
diff --git a/nano/templates/dish_incubator.tmpl b/nano/templates/dish_incubator.tmpl
index 5b06f924e6..ae887e6986 100644
--- a/nano/templates/dish_incubator.tmpl
+++ b/nano/templates/dish_incubator.tmpl
@@ -12,12 +12,12 @@
Power:
- {{:helper.link('On', 'power', { 'power' : 1 }, !dish_inserted ? 'disabled' : on ? 'selected' : null)}}{{:helper.link('Off', 'close', { 'power' : 1 }, on ? null : 'selected')}}
+ {{:helper.link('On', 'power', { 'power' : 1 }, !data.dish_inserted ? 'disabled' : data.on ? 'selected' : null)}}{{:helper.link('Off', 'close', { 'power' : 1 }, data.on ? null : 'selected')}}
{{:helper.link('Add Radiation', 'radiation', {'rad' : 1})}}
- {{:helper.link('Flush System', 'trash', {'flush' : 1}, system_in_use ? null : 'disabled')}}
+ {{:helper.link('Flush System', 'trash', {'flush' : 1}, data.system_in_use ? null : 'disabled')}}
@@ -26,7 +26,7 @@
Virus Food:
- {{:helper.displayBar(food_supply, 0, 100, 'good', food_supply)}}
+ {{:helper.displayBar(data.food_supply, 0, 100, 'good', data.food_supply)}}
@@ -34,9 +34,9 @@
Radiation Level:
- {{:helper.displayBar(radiation, 0, 100, radiation >= 50 ? 'bad' : growth >= 25 ? 'average' : 'good')}}
+ {{:helper.displayBar(data.radiation, 0, 100, (data.radiation >= 50) ? 'bad' : (data.growth >= 25) ? 'average' : 'good')}}
- {{:helper.formatNumber(radiation * 10000)}}
µSv
+ {{:helper.formatNumber(data.radiation * 10000)}}
µSv
@@ -44,7 +44,7 @@
Toxicity:
- {{:helper.displayBar(toxins, 0, 100, toxins >= 50 ? 'bad' : toxins >= 25 ? 'average' : 'good', toxins + '%')}}
+ {{:helper.displayBar(data.toxins, 0, 100, (data.toxins >= 50) ? 'bad' : (data.toxins >= 25) ? 'average' : 'good', data.toxins + '%')}}
@@ -53,8 +53,8 @@
Chemicals
- {{:helper.link('Eject Chemicals', 'eject', { 'ejectchem' : 1 }, chemicals_inserted ? null : 'disabled')}}
- {{:helper.link('Breed Virus', 'circle-arrow-s', { 'virus' : 1 }, can_breed_virus ? null : 'disabled')}}
+ {{:helper.link('Eject Chemicals', 'eject', { 'ejectchem' : 1 }, data.chemicals_inserted ? null : 'disabled')}}
+ {{:helper.link('Breed Virus', 'circle-arrow-s', { 'virus' : 1 }, data.can_breed_virus ? null : 'disabled')}}
{{if data.chemicals_inserted}}
@@ -63,7 +63,7 @@
Volume:
- {{:helper.displayBar(chemical_volume, 0, max_chemical_volume, 'good', chemical_volume + ' / ' + max_chemical_volume)}}
+ {{:helper.displayBar(data.chemical_volume, 0, data.max_chemical_volume, 'good', data.chemical_volume + ' / ' + data.max_chemical_volume)}}
@@ -72,7 +72,7 @@
- {{:!data.dish_inserted ? 'N/A' : can_breed_virus ? 'Suitable' : 'No hemolytic samples detected'}}
+ {{:!data.dish_inserted ? 'N/A' : data.can_breed_virus ? 'Suitable' : 'No hemolytic samples detected'}}
{{if data.blood_already_infected}}
@@ -90,7 +90,7 @@
Virus Dish
- {{:helper.link('Eject Dish', 'eject', {'ejectdish' : 1}, dish_inserted ? null : 'disabled')}}
+ {{:helper.link('Eject Dish', 'eject', {'ejectdish' : 1}, data.dish_inserted ? null : 'disabled')}}
{{if data.dish_inserted}}
@@ -100,7 +100,7 @@
Growth Density:
- {{:helper.displayBar(growth, 0, 100, growth >= 50 ? 'good' : growth >= 25 ? 'average' : 'bad', growth + '%' )}}
+ {{:helper.displayBar(data.growth, 0, 100, (data.growth >= 50) ? 'good' : (data.growth >= 25) ? 'average' : 'bad', data.growth + '%' )}}
@@ -108,7 +108,7 @@
Infection Rate:
- {{:data.analysed ? infection_rate : "Unknown"}}
+ {{:data.analysed ? data.infection_rate : "Unknown"}}
{{else}}
diff --git a/nano/templates/dna_modifier.tmpl b/nano/templates/dna_modifier.tmpl
index 5efe73ce87..9a2804ba98 100644
--- a/nano/templates/dna_modifier.tmpl
+++ b/nano/templates/dna_modifier.tmpl
@@ -19,7 +19,7 @@ Used In File(s): D:\Development\SS13-BS12\code\game\dna\dna_modifier.dm
{{/if}}
- {{if !data.occupant.isViableSubject || !occupant.uniqueIdentity || !occupant.structuralEnzymes}}
+ {{if !data.occupant.isViableSubject || !data.occupant.uniqueIdentity || !data.occupant.structuralEnzymes}}
The occupant's DNA structure is ruined beyond recognition, please insert a subject with an intact DNA structure.
@@ -27,22 +27,22 @@ Used In File(s): D:\Development\SS13-BS12\code\game\dna\dna_modifier.dm
Health:
{{if data.occupant.health >= 0}}
- {{:helper.displayBar(occupant.health, 0, occupant.maxHealth, 'good')}}
+ {{:helper.displayBar(data.occupant.health, 0, data.occupant.maxHealth, 'good')}}
{{else}}
- {{:helper.displayBar(occupant.health, 0, occupant.minHealth, 'average alignRight')}}
+ {{:helper.displayBar(data.occupant.health, 0, data.occupant.minHealth, 'average alignRight')}}
{{/if}}
-
{{:helper.round(occupant.health)}}
+
{{:helper.round(data.occupant.health)}}
Radiation:
- {{:helper.displayBar(occupant.radiationLevel, 0, 100, 'average')}}
-
{{:helper.round(occupant.radiationLevel)}}
+ {{:helper.displayBar(data.occupant.radiationLevel, 0, 100, 'average')}}
+
{{:helper.round(data.occupant.radiationLevel)}}
Unique Enzymes:
-
{{:data.occupant.uniqueEnzymes ? occupant.uniqueEnzymes : 'Unknown'}}
+
{{:data.occupant.uniqueEnzymes ? data.occupant.uniqueEnzymes : 'Unknown'}}
@@ -11,7 +11,7 @@ Used In File(s): \code\game\objects\items\devices\PDA\PDA.dm
{{:helper.link('Close', 'gear', {'choice' : "Close"}, null, 'fixedLeft')}}
- {{if data.idInserted}} {{:helper.link('Update PDA Info', 'eject', {'choice' : "UpdateInfo"}, null, 'fixedLeftWide')}} {{/if}}
+ {{if data.idInserted}} {{:helper.link('Update PDA Info', 'eject', {'choice' : "UpdateInfo"}, null, 'fixedLeftWide')}} {{/if}}
{{if data.mode != 0}} {{:helper.link('Return', 'arrowreturn-1-w', {'choice' : "Return"}, null, 'fixedLeft')}} {{/if}}
@@ -40,7 +40,7 @@ Used In File(s): \code\game\objects\items\devices\PDA\PDA.dm
ID:
- {{:helper.link(idLink, 'eject', {'choice' : "Authenticate"}, idInserted ? null : 'disabled', idInserted ? 'fixedLeftWidest' : 'fixedLeft')}}
+ {{:helper.link(data.idLink, 'eject', {'choice' : "Authenticate"}, data.idInserted ? null : 'disabled', data.idInserted ? 'fixedLeftWidest' : 'fixedLeft')}}
@@ -50,9 +50,9 @@ Used In File(s): \code\game\objects\items\devices\PDA\PDA.dm
{{if data.cart_loaded==1}}
- {{:helper.link(cartridge.name, 'eject', {'choice' : "Eject"},null,null)}}
+ {{:helper.link(data.cartridge.name, 'eject', {'choice' : "Eject"},null,null)}}
{{else}}
- {{:helper.link('None', 'eject', {'choice' : "Eject"},'disabled',null)}}
+ {{:helper.link('None', 'eject', {'choice' : "Eject"},'disabled',null)}}
{{/if}}
@@ -65,7 +65,7 @@ Used In File(s): \code\game\objects\items\devices\PDA\PDA.dm
{{:helper.link('Notekeeper', 'note', {'choice' : "1"}, null, 'fixedLeftWide')}}
- {{:helper.link('Messenger', newMessage ? 'mail-closed' : 'mail-open', {'choice' : "2"}, null, 'fixedLeftWide')}}
+ {{:helper.link('Messenger', data.newMessage ? 'mail-closed' : 'mail-open', {'choice' : "2"}, null, 'fixedLeftWide')}}
{{:helper.link('Crew Manifest', 'contact', {'choice' : "41"}, null, 'fixedLeftWide')}}
@@ -100,7 +100,7 @@ Used In File(s): \code\game\objects\items\devices\PDA\PDA.dm
{{:helper.link('Medical Records', 'gear', {'choice' : "44"}, null, 'fixedLeftWide')}}
- {{:helper.link(scanmode == 1 ? 'Disable Med Scanner' : 'Enable Med Scanner', 'gear', {'choice' : "Medical Scan"}, null , 'fixedLeftWide')}}
+ {{:helper.link(data.scanmode == 1 ? 'Disable Med Scanner' : 'Enable Med Scanner', 'gear', {'choice' : "Medical Scan"}, null , 'fixedLeftWide')}}
@@ -138,30 +138,44 @@ Used In File(s): \code\game\objects\items\devices\PDA\PDA.dm
Utilities:
- {{if data.cartridge}}
- {{if data.cartridge.access.access_status_display == 1}} {{:helper.link('Status Display', 'gear', {'choice' : "42"}, null, 'fixedLeftWide')}}{{/if}}
- {{if data.cartridge.access.access_janitor==1}} {{:helper.link('Custodial Locator', 'gear', {'choice' : "49"}, null, 'fixedLeftWide')}} {{/if}}
- {{if data.cartridge.radio == 2}} {{:helper.link('Signaler System', 'gear', {'choice' : "40"}, null, 'fixedLeftWide')}} {{/if}}
- {{if data.cartridge.access.access_reagent_scanner==1}} {{:helper.link(scanmode == 3 ? 'Disable Reagent Scanner' : 'Enable Reagent Scanner', 'gear', {'choice' : "Reagent Scan"}, null, 'fixedLeftWider')}} {{/if}}
- {{if data.cartridge.access.access_engine==1}} {{:helper.link(scanmode == 4 ? 'Disable Halogen Counter' : 'Enable Halogen Counter', 'gear', {'choice' : "Halogen Counter"}, null, 'fixedLeftWider')}} {{/if}}
- {{if data.cartridge.access.access_atmos==1}} {{:helper.link(scanmode == 5 ? 'Disable Gas Scanner' : 'Enable Gas Scanner', 'gear', {'choice' : "Gas Scan"}, null, 'fixedLeftWide')}} {{/if}}
- {{if data.cartridge.access.access_remote_door==1}}{{:helper.link('Toggle Door', 'gear', {'choice' : "Toggle Door"}, null, 'fixedLeftWide')}} {{/if}}
- {{/if}}
- {{:helper.link('Atmospheric Scan', 'gear', {'choice' : "3"}, null, 'fixedLeftWide')}}
- {{:helper.link(fon==1 ? 'Disable Flashlight' : 'Enable Flashlight', 'lightbulb', {'choice' : "Light"}, null,'fixedLeftWide')}}
-
-
- {{if data.pai}}
-
-
- PAI Utilities:
-
-
- {{:helper.link('Configuration', 'gear', {'choice' : "pai", 'option' : "1"}, null, 'fixedLeft')}}
- {{:helper.link('Eject pAI', 'eject', {'choice' : "pai", 'option' : "2"}, null, 'fixedLeft')}}
+ {{if data.cartridge}}
+ {{if data.cartridge.access.access_status_display == 1}}
+ {{:helper.link('Status Display', 'gear', {'choice' : "42"}, null, 'fixedLeftWide')}}
+ {{/if}}
+ {{if data.cartridge.access.access_janitor==1}}
+ {{:helper.link('Custodial Locator', 'gear', {'choice' : "49"}, null, 'fixedLeftWide')}}
+ {{/if}}
+ {{if data.cartridge.radio == 2}}
+ {{:helper.link('Signaler System', 'gear', {'choice' : "40"}, null, 'fixedLeftWide')}}
+ {{/if}}
+ {{if data.cartridge.access.access_reagent_scanner==1}}
+ {{:helper.link(data.scanmode == 3 ? 'Disable Reagent Scanner' : 'Enable Reagent Scanner', 'gear', {'choice' : "Reagent Scan"}, null, 'fixedLeftWider')}}
+ {{/if}}
+ {{if data.cartridge.access.access_engine==1}}
+ {{:helper.link(data.scanmode == 4 ? 'Disable Halogen Counter' : 'Enable Halogen Counter', 'gear', {'choice' : "Halogen Counter"}, null, 'fixedLeftWider')}}
+ {{/if}}
+ {{if data.cartridge.access.access_atmos==1}}
+ {{:helper.link(data.scanmode == 5 ? 'Disable Gas Scanner' : 'Enable Gas Scanner', 'gear', {'choice' : "Gas Scan"}, null, 'fixedLeftWide')}}
+ {{/if}}
+ {{if data.cartridge.access.access_remote_door==1}}
+ {{:helper.link('Toggle Door', 'gear', {'choice' : "Toggle Door"}, null, 'fixedLeftWide')}}
+ {{/if}}
+ {{/if}}
+ {{:helper.link('Atmospheric Scan', 'gear', {'choice' : "3"}, null, 'fixedLeftWide')}}
+ {{:helper.link(fon==1 ? 'Disable Flashlight' : 'Enable Flashlight', 'lightbulb', {'choice' : "Light"}, null,'fixedLeftWide')}}
- {{/if}}
+ {{if data.pai}}
+
+
+ PAI Utilities:
+
+
+ {{:helper.link('Configuration', 'gear', {'choice' : "pai", 'option' : "1"}, null, 'fixedLeft')}}
+ {{:helper.link('Eject pAI', 'eject', {'choice' : "pai", 'option' : "2"}, null, 'fixedLeft')}}
+
+
+ {{/if}}
{{/if}}
{{if data.mode == 1}}
@@ -182,7 +196,7 @@ Used In File(s): \code\game\objects\items\devices\PDA\PDA.dm
-
+
{{else data.mode == 2}}
SpaceMessenger V4.0.1
@@ -191,8 +205,8 @@ Used In File(s): \code\game\objects\items\devices\PDA\PDA.dm
- {{:helper.link(silent==1 ? 'Ringer: Off' : 'Ringer: On', silent==1 ? 'volume-off' : 'volume-on', {'choice' : "Toggle Ringer"}, null, 'fixedLeftWide')}}
- {{:helper.link(toff==1 ? 'Messenger: Off' : 'Messenger: On',toff==1 ? 'close':'check', {'choice' : "Toggle Messenger"}, null, 'fixedLeftWide')}}
+ {{:helper.link(data.silent==1 ? 'Ringer: Off' : 'Ringer: On', data.silent==1 ? 'volume-off' : 'volume-on', {'choice' : "Toggle Ringer"}, null, 'fixedLeftWide')}}
+ {{:helper.link(data.toff==1 ? 'Messenger: Off' : 'Messenger: On',data.toff==1 ? 'close':'check', {'choice' : "Toggle Messenger"}, null, 'fixedLeftWide')}}
{{:helper.link('Set Ringtone', 'comment', {'choice' : "Ringtone"}, null, 'fixedLeftWide')}}
{{:helper.link('Delete all Conversations', 'trash', {'choice' : "Clear", 'option' : "All"}, null, 'fixedLeftWider')}}
@@ -200,37 +214,37 @@ Used In File(s): \code\game\objects\items\devices\PDA\PDA.dm
{{if data.toff == 0}}
{{if data.cartridge}}
- {{if data.cartridge.charges}}
+ {{if data.cartridge.charges}}
{{:data.cartridge.charges}}
{{if data.cartridge.type == "/obj/item/weapon/cartridge/syndicate"}} detonation charges left. {{/if}}
- {{if data.cartridge.type == "/obj/item/weapon/cartridge/clown" || cartridge.type == "/obj/item/weapon/cartridge/mime"}} viral files left. {{/if}}
+ {{if data.cartridge.type == "/obj/item/weapon/cartridge/clown" || data.cartridge.type == "/obj/item/weapon/cartridge/mime"}} viral files left. {{/if}}
{{/if}}
{{/if}}
-
+
{{if data.pda_count == 0}}No other PDAS located
- {{else}}
+ {{else}}
Current Conversations
{{for data.convopdas}}
- {{:helper.link(Name, 'circle-arrow-s', {'choice' : "Select Conversation", 'convo' : Reference } , null, fixedLeftWider)}}
- {{if data.~root.cartridge}}
- {{if data.~root.cartridge.type == "/obj/item/weapon/cartridge/syndicate" && Detonate == 1}} {{:helper.link('*Detonate*', 'radiation', {'choice' : "Detonate", 'target' : Reference}, null, 'fixedLeft')}} {{/if}}
- {{if data.~root.cartridge.type == "/obj/item/weapon/cartridge/clown"}} {{:helper.link('*Send Virus*', 'star', {'choice' : "Send Honk", 'target' : Reference}, null, 'fixedLeft')}} {{/if}}
- {{if data.~root.cartridge.type == "/obj/item/weapon/cartridge/mime"}} {{:helper.link('*Send Virus*', 'circle-arrow-s', {'choice' : "Send Silence", 'target' : Reference}, null, 'fixedLeft')}} {{/if}}
+ {{:helper.link(Name, 'circle-arrow-s', {'choice' : "Select Conversation", 'convo' : data.Reference } , null, fixedLeftWider)}}
+ {{if data.cartridge}}
+ {{if data.cartridge.type == "/obj/item/weapon/cartridge/syndicate" && data.Detonate == 1}} {{:helper.link('*Detonate*', 'radiation', {'choice' : "Detonate", 'target' : data.Reference}, null, 'fixedLeft')}} {{/if}}
+ {{if data.cartridge.type == "/obj/item/weapon/cartridge/clown"}} {{:helper.link('*Send Virus*', 'star', {'choice' : "Send Honk", 'target' : data.Reference}, null, 'fixedLeft')}} {{/if}}
+ {{if data.cartridge.type == "/obj/item/weapon/cartridge/mime"}} {{:helper.link('*Send Virus*', 'circle-arrow-s', {'choice' : "Send Silence", 'target' : data.Reference}, null, 'fixedLeft')}} {{/if}}
{{/if}}
{{/for}}
Other PDAs
{{for data.pdas}}
- {{:helper.link(Name, 'circle-arrow-s', {'choice' : "Message", 'target' : Reference}, null, fixedLeftWider)}}
- {{if data.~root.cartridge}}
- {{if data.~root.cartridge.type == "/obj/item/weapon/cartridge/syndicate" && Detonate == 1}} {{:helper.link('*Detonate*', 'radiation', {'choice' : "Detonate", 'target' : Reference}, null, 'fixedLeft')}} {{/if}}
- {{if data.~root.cartridge.type == "/obj/item/weapon/cartridge/clown"}} {{:helper.link('*Send Virus*', 'star', {'choice' : "Send Honk", 'target' : Reference}, null, 'fixedLeft')}} {{/if}}
- {{if data.~root.cartridge.type == "/obj/item/weapon/cartridge/mime"}} {{:helper.link('*Send Virus*', 'circle-arrow-s', {'choice' : "Send Silence", 'target' : Reference}, null, 'fixedLeft')}} {{/if}}
+ {{:helper.link(Name, 'circle-arrow-s', {'choice' : "Message", 'target' : value.Reference}, null, fixedLeftWider)}}
+ {{if value.cartridge}}
+ {{if value.cartridge.type == "/obj/item/weapon/cartridge/syndicate" && value.Detonate == 1}} {{:helper.link('*Detonate*', 'radiation', {'choice' : "Detonate", 'target' : value.Reference}, null, 'fixedLeft')}} {{/if}}
+ {{if value.cartridge.type == "/obj/item/weapon/cartridge/clown"}} {{:helper.link('*Send Virus*', 'star', {'choice' : "Send Honk", 'target' : value.Reference}, null, 'fixedLeft')}} {{/if}}
+ {{if value.cartridge.type == "/obj/item/weapon/cartridge/mime"}} {{:helper.link('*Send Virus*', 'circle-arrow-s', {'choice' : "Send Silence", 'target' : value.Reference}, null, 'fixedLeft')}} {{/if}}
{{/if}}
{{/for}}
@@ -254,19 +268,19 @@ Used In File(s): \code\game\objects\items\devices\PDA\PDA.dm
{{for data.messages}}
- {{if data.~root.active_conversation == target}}
- {{if data.sent==0}}
- Them: {{:data.message}}
- {{else}}
- You: {{:data.message}}
- {{/if}}
+ {{if data.active_conversation == value.target}}
+ {{if value.sent==0}}
+ Them: {{:value.message}}
+ {{else}}
+ You: {{:value.message}}
+ {{/if}}
{{/if}}
- {{/for}}
-
+ {{/for}}
+
- {{:helper.link('Reply', 'comment', {'choice' : "Message", 'target': active_conversation}, null, 'fixedLeft')}}
+ {{:helper.link('Reply', 'comment', {'choice' : "Message", 'target': data.active_conversation}, null, 'fixedLeft')}}
{{else data.mode== 41}}
@@ -274,30 +288,30 @@ Used In File(s): \code\game\objects\items\devices\PDA\PDA.dm
{{if data.manifest.heads.length}}
| Command |
{{for data.manifest["heads"]}}
- {{if data.rank == "Captain"}}
- | {{:data.name}} | {{:data.rank}} | {{:data.active}} |
+ {{if value.rank == "Captain"}}
+ | {{:value.name}} | {{:value.rank}} | {{:value.active}} |
{{else}}
- | {{:data.name}} | {{:data.rank}} | {{:data.active}} |
+ | {{:value.name}} | {{:value.rank}} | {{:value.active}} |
{{/if}}
{{/for}}
{{/if}}
{{if data.manifest.sec.length}}
| Security |
{{for data.manifest["sec"]}}
- {{if data.rank == "Head of Security"}}
- | {{:data.name}} | {{:data.rank}} | {{:data.active}} |
+ {{if value.rank == "Head of Security"}}
+ | {{:value.name}} | {{:value.rank}} | {{:value.active}} |
{{else}}
- | {{:data.name}} | {{:data.rank}} | {{:data.active}} |
+ | {{:value.name}} | {{:value.rank}} | {{:value.active}} |
{{/if}}
{{/for}}
{{/if}}
{{if data.manifest.eng.length}}
| Engineering |
{{for data.manifest["eng"]}}
- {{if data.rank == "Chief Engineer"}}
- | {{:data.name}} | {{:data.rank}} | {{:data.active}} |
+ {{if value.rank == "Chief Engineer"}}
+ | {{:value.name}} | {{:value.rank}} | {{:value.active}} |
{{else}}
- | {{:data.name}} | {{:data.rank}} | {{:data.active}} |
+ | {{:value.name}} | {{:value.rank}} | {{:value.active}} |
{{/if}}
{{/for}}
@@ -305,37 +319,37 @@ Used In File(s): \code\game\objects\items\devices\PDA\PDA.dm
{{if data.manifest.med.length}}
| Medical |
{{for data.manifest["med"]}}
- {{if data.rank == "Chief Medical Officer"}}
- | {{:data.name}} | {{:data.rank}} | {{:data.active}} |
+ {{if value.rank == "Chief Medical Officer"}}
+ | {{:value.name}} | {{:value.rank}} | {{:value.active}} |
{{else}}
- | {{:data.name}} | {{:data.rank}} | {{:data.active}} |
+ | {{:value.name}} | {{:value.rank}} | {{:value.active}} |
{{/if}}
{{/for}}
{{/if}}
{{if data.manifest.sci.length}}
| Science |
{{for data.manifest["sci"]}}
- {{if data.rank == "Research Director"}}
- | {{:data.name}} | {{:data.rank}} | {{:data.active}} |
+ {{if value.rank == "Research Director"}}
+ | {{:value.name}} | {{:value.rank}} | {{:value.active}} |
{{else}}
- | {{:data.name}} | {{:data.rank}} | {{:data.active}} |
+ | {{:value.name}} | {{:value.rank}} | {{:value.active}} |
{{/if}}
{{/for}}
{{/if}}
{{if data.manifest.civ.length}}
| Civilian |
{{for data.manifest["civ"]}}
- {{if data.rank == "Head of Personnel"}}
- | {{:data.name}} | {{:data.rank}} | {{:data.active}} |
+ {{if value.rank == "Head of Personnel"}}
+ | {{:value.name}} | {{:value.rank}} | {{:value.active}} |
{{else}}
- | {{:data.name}} | {{:data.rank}} | {{:data.active}} |
+ | {{:value.name}} | {{:value.rank}} | {{:value.active}} |
{{/if}}
{{/for}}
{{/if}}
{{if data.manifest.misc.length}}
| Misc |
{{for data.manifest["misc"]}}
- | {{:data.name}} | {{:data.rank}} | {{:data.active}} |
+ | {{:value.name}} | {{:value.rank}} | {{:value.active}} |
{{/for}}
{{/if}}
@@ -352,38 +366,38 @@ Used In File(s): \code\game\objects\items\devices\PDA\PDA.dm
Pressure:
- {{:helper.string('{1} kPa', aircontents.pressure < 80 || aircontents.pressure > 120 ? 'bad' : aircontents.pressure < 95 || aircontents.pressure > 110 ? 'average' : 'good' , aircontents.pressure)}}
+ {{:helper.string('{1} kPa', data.aircontents.pressure < 80 || data.aircontents.pressure > 120 ? 'bad' : data.aircontents.pressure < 95 || data.aircontents.pressure > 110 ? 'average' : 'good' , data.aircontents.pressure)}}
Temperature:
- {{:helper.string('{1} °C', aircontents.temp < 5 || aircontents.temp > 35 ? 'bad' : aircontents.temp < 15 || aircontents.temp > 25 ? 'average' : 'good' , aircontents.temp)}}
+ {{:helper.string('{1} °C', data.aircontents.temp < 5 || data.aircontents.temp > 35 ? 'bad' : data.aircontents.temp < 15 || data.aircontents.temp > 25 ? 'average' : 'good' , data.aircontents.temp)}}
Oxygen:
- {{:helper.string('{1}%', aircontents.oxygen < 17 ? 'bad' : aircontents.oxygen < 19 ? 'average' : 'good' , aircontents.oxygen)}}
+ {{:helper.string('{1}%', data.aircontents.oxygen < 17 ? 'bad' : data.aircontents.oxygen < 19 ? 'average' : 'good' , data.aircontents.oxygen)}}
Nitrogen:
- {{:helper.string('{1}%', aircontents.nitrogen > 82 ? 'bad' : aircontents.nitrogen > 80 ? 'average' : 'good' , aircontents.nitrogen)}}
+ {{:helper.string('{1}%', data.aircontents.nitrogen > 82 ? 'bad' : data.aircontents.nitrogen > 80 ? 'average' : 'good' , data.aircontents.nitrogen)}}
Carbon Dioxide:
- {{:helper.string('{1}%', aircontents.carbon_dioxide > 5 ? 'bad' : 'good' , aircontents.carbon_dioxide)}}
+ {{:helper.string('{1}%', data.aircontents.carbon_dioxide > 5 ? 'bad' : 'good' , data.aircontents.carbon_dioxide)}}
Phoron:
- {{:helper.string('{1}%', aircontents.phoron > 0 ? 'bad' : 'good' , aircontents.phoron)}}
+ {{:helper.string('{1}%', data.aircontents.phoron > 0 ? 'bad' : 'good' , data.aircontents.phoron)}}
{{if data.aircontents.other > 0}}
@@ -416,7 +430,7 @@ Used In File(s): \code\game\objects\items\devices\PDA\PDA.dm
{{:helper.link('+.2', null, {'cartmenu' : "1", 'choice' : "Signal Frequency", 'sfreq' : "2"}, null, null)}}
{{:helper.link('+1', null, {'cartmenu' : "1", 'choice' : "Signal Frequency", 'sfreq' : "10"}, null, null)}}
-
+
@@ -429,9 +443,9 @@ Used In File(s): \code\game\objects\items\devices\PDA\PDA.dm
{{:helper.link('-5', null, {'cartmenu' : "1", 'choice' : "Signal Code", 'scode' : "-5"}, null, null)}}
{{:helper.link('-1', null, {'cartmenu' : "1", 'choice' : "Signal Code", 'scode' : "-1"}, null, null)}}
- {{:helper.link('+1', null, {'cartmenu' : "1", 'choice' : "Signal Code", 'scode' : "1"}, null, null)}}
+ {{:helper.link('+1', null, {'cartmenu' : "1", 'choice' : "Signal Code", 'scode' : "1"}, null, null)}}
{{:helper.link('+5', null, {'cartmenu' : "1", 'choice' : "Signal Code", 'scode' : "5"}, null, null)}}
-
+
{{:helper.link('Send Signal', 'radiation', {'cartmenu' : "1", 'choice' : "Send Signal"}, null, null)}}
@@ -450,12 +464,12 @@ Used In File(s): \code\game\objects\items\devices\PDA\PDA.dm
-
+
Message line 1
- {{:helper.link(records.message1 + ' (set)', 'pencil', {'cartmenu' : "1", 'choice' : "Status",'statdisp' : "setmsg1"}, null, null)}}
+ {{:helper.link(data.records.message1 + ' (set)', 'pencil', {'cartmenu' : "1", 'choice' : "Status",'statdisp' : "setmsg1"}, null, null)}}
@@ -463,13 +477,13 @@ Used In File(s): \code\game\objects\items\devices\PDA\PDA.dm
Message line 2
- {{:helper.link(records.message2 + ' (set)', 'pencil', {'cartmenu' : "1", 'choice' : "Status",'statdisp' : "setmsg2"}, null, null)}}
+ {{:helper.link(data.records.message2 + ' (set)', 'pencil', {'cartmenu' : "1", 'choice' : "Status",'statdisp' : "setmsg2"}, null, null)}}
-
+
ALERT!:
@@ -481,14 +495,14 @@ Used In File(s): \code\game\objects\items\devices\PDA\PDA.dm
{{else data.mode == 43}}
-
+
Station Powermonitors
Select A power monitor:
{{for data.records.powermonitors}}
- {{:helper.link(Name, 'radiation', {'cartmenu' : "1", 'choice' : "Power Select",'target' : ref}, null, null)}}
+ {{:helper.link(value.Name, 'radiation', {'cartmenu' : "1", 'choice' : "Power Select",'target' : value.ref}, null, null)}}
{{/for}}
@@ -514,15 +528,15 @@ Used In File(s): \code\game\objects\items\devices\PDA\PDA.dm
{{for data.records.apcs}}
- {{if data.#index % 20 === 0}}
+ {{if index % 20 === 0}}
| Area | Eqp. | Lgt. | Env | Cell |
{{/if}}
-
- | {{:data.Name}} |
- {{:helper.string(' | ', Equipment==1 ? '#4f7529' : '#8f1414')}}
- {{:helper.string(' | ', Lights==1 ? '#4f7529' : '#8f1414')}}
- {{:helper.string(' | ', Environment==1 ? '#4f7529' : '#8f1414')}}
- {{:helper.string('{1} | ', CellStatus==1 ? '#4f7529' : '#8f1414', CellStatus==-1 ? 'No Cell' : CellPct + '%')}}
+
+
| {{:value.Name}} |
+ {{:helper.string(' | ', value.Equipment==1 ? '#4f7529' : '#8f1414')}}
+ {{:helper.string(' | ', value.Lights==1 ? '#4f7529' : '#8f1414')}}
+ {{:helper.string(' | ', value.Environment==1 ? '#4f7529' : '#8f1414')}}
+ {{:helper.string('{1} | ', value.CellStatus==1 ? '#4f7529' : '#8f1414', value.CellStatus==-1 ? 'No Cell' : CellPct + '%')}}
{{/for}}
@@ -536,11 +550,11 @@ Used In File(s): \code\game\objects\items\devices\PDA\PDA.dm
{{for data.records.medical_records}}
- {{:helper.link(Name, 'gear', {'cartmenu' : "1", 'choice' : "Medical Records",'target' : ref}, null, null)}}
+ {{:helper.link(value.Name, 'gear', {'cartmenu' : "1", 'choice' : "Medical Records",'target' : value.ref}, null, null)}}
{{/for}}
-
+
{{else data.mode == 441}}
Medical Record
@@ -591,7 +605,7 @@ Used In File(s): \code\game\objects\items\devices\PDA\PDA.dm
{{for data.records.security_records}}
- {{:helper.link(Name, 'gear', {'cartmenu' : "1", 'choice' : "Security Records",'target' : ref}, null, null)}}
+ {{:helper.link(value.Name, 'gear', {'cartmenu' : "1", 'choice' : "Security Records",'target' : value.ref}, null, null)}}
{{/for}}
@@ -634,7 +648,7 @@ Used In File(s): \code\game\objects\items\devices\PDA\PDA.dm
{{else data.mode == 46}}
Security Bot Control
- {{if data.records.beepsky.active == null || records.beepsky.active == 0}}
+ {{if data.records.beepsky.active == null || data.records.beepsky.active == 0}}
{{if data.records.beepsky.count == 0}}
No bots found.
{{else}}
@@ -644,7 +658,7 @@ Used In File(s): \code\game\objects\items\devices\PDA\PDA.dm
{{for data.records.beepsky.bots}}
- {{:helper.link(Name, 'gear', {'radiomenu' : "1", 'op' : "control",'bot' : ref}, null, null)}} (Location: {{:data.Location}})
+ {{:helper.link(value.Name, 'gear', {'radiomenu' : "1", 'op' : "control",'bot' : value.ref}, null, null)}} (Location: {{:value.Location}})
{{/for}}
{{/if}}
@@ -676,7 +690,7 @@ Used In File(s): \code\game\objects\items\devices\PDA\PDA.dm
{{if data.records.beepsky.botstatus.mode ==0}} Ready
{{else data.records.beepsky.botstatus.mode == 1}}
Apprehending target
- {{else data.records.beepsky.botstatus.mode ==2 || records.beepsky.botstatus.mode == 3}}
+ {{else data.records.beepsky.botstatus.mode ==2 || data.records.beepsky.botstatus.mode == 3}}
Arresting target
{{else data.records.beepsky.botstatus.mode ==4}}
Starting patrol
@@ -689,12 +703,12 @@ Used In File(s): \code\game\objects\items\devices\PDA\PDA.dm
- {{:helper.link('Stop Patrol', 'gear', {'radiomenu' : "1", 'op' : "stop"}, null, null)}}
+ {{:helper.link('Stop Patrol', 'gear', {'radiomenu' : "1", 'op' : "stop"}, null, null)}}
{{:helper.link('Start Patrol', 'gear', {'radiomenu' : "1", 'op' : "go"}, null, null)}}
{{:helper.link('Summon Bot', 'gear', {'radiomenu' : "1", 'op' : "summon"}, null, null)}}
- {{/if}}
- {{:helper.link('Return to Bot list', 'gear', {'radiomenu' : "1", 'op' : "botlist"}, null, null)}}
+ {{/if}}
+ {{:helper.link('Return to Bot list', 'gear', {'radiomenu' : "1", 'op' : "botlist"}, null, null)}}
{{/if}}
{{else data.mode == 47}}
Supply Record Interlink
@@ -720,7 +734,7 @@ Used In File(s): \code\game\objects\items\devices\PDA\PDA.dm
No current approved orders
{{else}}
{{for data.records.supply.approved}}
- #{{:data.Number}} - {{:data.Name}} approved by {{:data.OrderedBy}}
{{if data.Comment != ""}} {{:data.Comment}}
{{/if}}
+ #{{:value.Number}} - {{:value.Name}} approved by {{:value.OrderedBy}}
{{if value.Comment != ""}} {{:value.Comment}}
{{/if}}
{{/for}}
{{/if}}
@@ -729,19 +743,19 @@ Used In File(s): \code\game\objects\items\devices\PDA\PDA.dm
No current requested orders
{{else}}
{{for data.records.supply.requests}}
- #{{:data.Number}} - {{:data.Name}} requested by {{:data.OrderedBy}}
{{if data.Comment != ""}} {{:data.Comment}}
{{/if}}
+ #{{:value.Number}} - {{:value.Name}} requested by {{:value.OrderedBy}}
{{if value.Comment != ""}} {{:value.Comment}}
{{/if}}
{{/for}}
{{/if}}
-
+
{{else data.mode == 48}}
Mule Control
- {{if data.records.mulebot.active == null || records.mulebot.active == 0}}
+ {{if data.records.mulebot.active == null || data.records.mulebot.active == 0}}
{{if data.records.mulebot.count == 0}}
No bots found.
-
+
{{else}}
Mule List
@@ -750,7 +764,7 @@ Used In File(s): \code\game\objects\items\devices\PDA\PDA.dm
{{for data.records.mulebot.bots}}
- {{:helper.link(Name, 'gear', {'radiomenu' : "1", 'op' : "control",'bot' : ref}, null, null)}} (Location: {{:data.Location}})
+ {{:helper.link(value.Name, 'gear', {'radiomenu' : "1", 'op' : "control",'bot' : value.ref}, null, null)}} (Location: {{:value.Location}})
{{/for}}
{{/if}}
@@ -785,7 +799,7 @@ Used In File(s): \code\game\objects\items\devices\PDA\PDA.dm
Navigating to Home
{{else data.records.mulebot.botstatus.mode ==4}}
Waiting for Clear Path
- {{else data.records.mulebot.botstatus.mode ==5 || records.mulebot.botstatus.mode == 6}}
+ {{else data.records.mulebot.botstatus.mode ==5 || data.records.mulebot.botstatus.mode == 6}}
Calculating navigation Path
{{else data.records.mulebot.botstatus.mode ==7}}
@@ -800,7 +814,7 @@ Used In File(s): \code\game\objects\items\devices\PDA\PDA.dm
- {{:helper.link(records.mulebot.botstatus.load == null ? 'None (Unload)' : records.mulebot.botstatus.load + ' (Unload)', 'gear', {'radiomenu' : "1", 'op' : "unload"},records.mulebot.botstatus.load == null ? 'disabled' : null, null)}}
+ {{:helper.link(data.records.mulebot.botstatus.load == null ? 'None (Unload)' : data.records.mulebot.botstatus.load + ' (Unload)', 'gear', {'radiomenu' : "1", 'op' : "unload"},data.records.mulebot.botstatus.load == null ? 'disabled' : null, null)}}
@@ -820,9 +834,9 @@ Used In File(s): \code\game\objects\items\devices\PDA\PDA.dm
Destination:
- {{:helper.link(records.mulebot.botstatus.dest == null || records.mulebot.botstatus.dest == "" ? 'None (Set)': records.mulebot.botstatus.dest+ ' (Set)', 'gear', {'radiomenu' : "1", 'op' : "setdest"}, null, null)}}
+ {{:helper.link(data.records.mulebot.botstatus.dest == null || data.records.mulebot.botstatus.dest == "" ? 'None (Set)': data.records.mulebot.botstatus.dest+ ' (Set)', 'gear', {'radiomenu' : "1", 'op' : "setdest"}, null, null)}}
-
+
@@ -837,7 +851,7 @@ Used In File(s): \code\game\objects\items\devices\PDA\PDA.dm
Auto Return:
- {{:helper.link(records.mulebot.botstatus.retn == 1 ? 'ON' : 'OFF', 'gear', {'radiomenu' : "1", 'op' : records.mulebot.botstatus.retn==1 ? "retoff" : "reton"}, null, null)}}
+ {{:helper.link(data.records.mulebot.botstatus.retn == 1 ? 'ON' : 'OFF', 'gear', {'radiomenu' : "1", 'op' : data.records.mulebot.botstatus.retn==1 ? "retoff" : "reton"}, null, null)}}
@@ -845,7 +859,7 @@ Used In File(s): \code\game\objects\items\devices\PDA\PDA.dm
Auto Pickup:
- {{:helper.link(records.mulebot.botstatus.pick==1? 'ON' : 'OFF', 'gear', {'radiomenu' : "1", 'op' : records.mulebot.botstatus.pick==1 ? "pickoff" : "pickon"}, null, null)}}
+ {{:helper.link(data.records.mulebot.botstatus.pick==1? 'ON' : 'OFF', 'gear', {'radiomenu' : "1", 'op' : data.records.mulebot.botstatus.pick==1 ? "pickoff" : "pickon"}, null, null)}}
@@ -860,13 +874,13 @@ Used In File(s): \code\game\objects\items\devices\PDA\PDA.dm
{{:helper.link('Return to Bot list', 'gear', {'radiomenu' : "1", 'op' : "botlist"}, null, null)}}
-
+
{{/if}}
{{/if}}
-
-
+
+
{{else data.mode == 49}}
Janatorial Supplies Locator
@@ -879,42 +893,41 @@ Used In File(s): \code\game\objects\items\devices\PDA\PDA.dm
{{for data.records.janitor.mops}}
- {{if data.x==0}}
+ {{if value.x==0}}
Unable to locate Mop
{{else}}
Mop Location:
- ({{:data.x}} / {{:data.y}}) - {{:data.dir}} - Status: {{:data.status}}
+ ({{:value.x}} / {{:value.y}}) - {{:value.dir}} - Status: {{:value.status}}
{{/if}}
{{/for}}
-
+
{{for data.records.janitor.buckets}}
- {{if data.x==0}}
+ {{if value.x==0}}
Unable to locate Water Buckets
{{else}}
Water Buckets Location:
- ({{:data.x}} / {{:data.y}}) - {{:data.dir}} - Water Level: {{:data.status}}
+ ({{:value.x}} / {{:value.y}}) - {{:value.dir}} - Water Level: {{:value.status}}
{{/if}}
{{/for}}
{{for data.records.janitor.cleanbots}}
- {{if data.x==0}}
- Unable to locate Clean Bots
- {{else}}
- Clean Bots Location:
- ({{:data.x}} / {{:data.y}}) - {{:data.dir}} - Status: {{:data.status}}
- {{/if}}
-
+ {{if value.x==0}}
+ Unable to locate Clean Bots
+ {{else}}
+ Clean Bots Location:
+ ({{:value.x}} / {{:value.y}}) - {{:value.dir}} - Status: {{:value.status}}
+ {{/if}}
{{/for}}
{{for data.records.janitor.carts}}
- {{if data.x==0}}
+ {{if value.x==0}}
Unable to locate Janitorial Cart
{{else}}
Janitorial cart Location:
-
({{:data.x}} / {{:data.y}}) - {{:data.dir}} - Status: {{:data.status}}
+
({{:value.x}} / {{:value.y}}) - {{:value.dir}} - Status: {{:value.status}}
{{/if}}
{{/for}}
diff --git a/nano/templates/smartfridge.tmpl b/nano/templates/smartfridge.tmpl
index b9a7e85948..b371baaef3 100644
--- a/nano/templates/smartfridge.tmpl
+++ b/nano/templates/smartfridge.tmpl
@@ -14,24 +14,20 @@
{{if data.contents}}
{{for data.contents}}
-
- {{:data.display_name}} ({{:data.quantity}}):
-
-
- {{:helper.link('Vend', 'circle-arrow-s', { "vend" : vend, "amount" : 1 }, null, 'statusValue')}}
- {{if data.quantity >= 5}}
- {{:helper.link('x5', 'circle-arrow-s', { "vend" : vend, "amount" : 5 }, null, 'statusValue')}}
- {{/if}}
- {{if data.quantity >= 10}}
- {{:helper.link('x10', 'circle-arrow-s', { "vend" : vend, "amount" : 10 }, null, 'statusValue')}}
- {{/if}}
- {{if data.quantity >= 25}}
- {{:helper.link('x25', 'circle-arrow-s', { "vend" : vend, "amount" : 25 }, null, 'statusValue')}}
- {{/if}}
- {{if data.quantity > 1}}
- {{:helper.link('All', 'circle-arrow-s', { "vend" : vend, "amount" : quantity }, null, 'statusValue')}}
- {{/if}}
-
+
{{:value.display_name}} ({{:value.quantity}} available)
+
Vend:
{{:helper.link('x1', 'circle-arrow-s', { "vend" : value.vend, "amount" : 1 }, null, 'statusValue')}}
+ {{if value.quantity >= 5}}
+ {{:helper.link('x5', 'circle-arrow-s', { "vend" : value.vend, "amount" : 5 }, null, 'statusValue')}}
+ {{/if}}
+ {{if value.quantity >= 10}}
+ {{:helper.link('x10', 'circle-arrow-s', { "vend" : value.vend, "amount" : 10 }, null, 'statusValue')}}
+ {{/if}}
+ {{if value.quantity >= 25}}
+ {{:helper.link('x25', 'circle-arrow-s', { "vend" : value.vend, "amount" : 25 }, null, 'statusValue')}}
+ {{/if}}
+ {{if value.quantity > 1}}
+ {{:helper.link('All', 'circle-arrow-s', { "vend" : value.vend, "amount" : value.quantity }, null, 'statusValue')}}
+ {{/if}}
{{/for}}
{{else}}
@@ -50,15 +46,15 @@
{{for data.wires}}
-
- {{:data.wire}} wire:
+
+ {{:value.wire}} wire:
- {{if data.cut}}
- {{:helper.link('Mend', 'plus', {'cutwire' : index})}}
+ {{if value.cut}}
+ {{:helper.link('Mend', 'plus', {'cutwire' : value.index})}}
{{else}}
- {{:helper.link('Cut', 'minus', {'cutwire' : index})}}
- {{:helper.link('Pulse', 'signal-diag', {'pulsewire' : index})}}
+ {{:helper.link('Cut', 'minus', {'cutwire' : value.index})}}
+ {{:helper.link('Pulse', 'signal-diag', {'pulsewire' : value.index})}}
{{/if}}
@@ -71,8 +67,8 @@
The red light is
{{:data.shoot_inventory ? "on" : "off"}}.
{{if data.secure}}
The green light is
-
- {{:data.locked == 1 ? "off" : locked == -1 ? "blinking" : "on"}}
+
+ {{:data.locked == 1 ? "off" : data.locked == -1 ? "blinking" : "on"}}
.
{{/if}}