JS-EDEN must be restarted for this change to fully take effect. Would you like to restart JS-EDEN now?
",["Restart Now","Restart Later"],1,function(a){if(0==a)window.onbeforeunload=void 0,document.location.pathname=d;else if(1==a)root.lookup("debug").mutate(root.scope,function(a){a.cache.value.jsExceptions=c},Symbol.hciAgent);else{var b=document.getElementById("menu-developer");b.checked=!b.checked,edenUI.setOptionValue("developer",b.checked)}})):root.lookup("debug").mutate(root.scope,function(a){a.cache.value.jsExceptions=c},Symbol.hciAgent)}),this.element.on("keyup",".jseden-title",function(a){try{window.localStorage&&window.localStorage.setItem("title",a.currentTarget.textContent)}catch(a){}}),eden.root.lookup("jseden_project_title").addJSObserver("menubar",function(a,b){if(a.origin&&a.origin!==Symbol.hciAgent){var c=$(".jseden-title").get(0);c.contentEditable=!0,c.textContent=b,document.title=b}try{window.localStorage&&window.localStorage.setItem("title",b)}catch(d){}}),eden.root.lookup("jseden_maker").addJSObserver("menubar",function(a,b){b?o.element.find(".maker").addClass("active"):o.element.find(".maker").removeClass("active")}),eden.root.lookup("jseden_menu_showsearch").addJSObserver("menubar",function(a,b){b?o.element.find(".menusearch").show():o.element.find(".menusearch").hide()}),eden.root.lookup("jseden_menu_showshare").addJSObserver("menubar",function(a,b){b?o.element.find(".menubar-button.share").show():o.element.find(".menubar-button.share").hide()}),eden.root.lookup("jseden_menu_showcreate").addJSObserver("menubar",function(a,b){b?o.element.find(".menubar-button.create").show():o.element.find(".menubar-button.create").hide()}),eden.root.lookup("jseden_menu_showexisting").addJSObserver("menubar",function(a,b){b?o.element.find(".menubar-button.existing").show():o.element.find(".menubar-button.existing").hide()}),eden.root.lookup("jseden_menu_showsettings").addJSObserver("menubar",function(a,b){b?o.element.find(".menubar-button.settings").show():o.element.find(".menubar-button.settings").hide()}),eden.root.lookup("jseden_menu_showhelp").addJSObserver("menubar",function(a,b){b?o.element.find(".menubar-button.help").show():o.element.find(".menubar-button.help").hide()}),eden.root.lookup("jseden_project_subtitle").addJSObserver("menubar",function(a,b){}),this.notifications=new EdenUI.Notifications(this.element.find("#menubar-mainitem-notifications"),this.element.find(".menubar-notification-jewel")),this.element.on("click",".notifications",function(a){o.notifications.clearCount()}),this.element.on("click",".maker",function(a){var b=eden.root.lookup("jseden_maker");if(!b.eden_definition){var c=b.value();void 0===c&&(c=!1),b.assign(!c,eden.root.scope,Symbol.localJSAgent)}}),this.element.on("keyup",".jseden-title",function(a){var b=eden.root.lookup("jseden_project_title");b.definition||b.assign(a.currentTarget.textContent,eden.root.scope,Symbol.hciAgent)})},EdenUI.MenuBar.prototype.hide=function(){this.element.hide()},EdenUI.MenuBar.prototype.show=function(){this.element.show()},EdenUI.MenuBar.reset=function(){$(".jseden-title").html("CONSTRUIT")},EdenUI.MenuBar.saveTitle=function(a){eden.root.lookup("jseden_project_title").assign(a,eden.root.scope,Symbol.jsAgent)},EdenUI.Dialogs={},EdenUI.Dialogs.MergeError=function(a,b,c){var d=new diff_match_patch,e=d.diff_main(a,b);d.diff_cleanupSemantic(e);var f=d.diff_prettyHtml(e),g=$(''+e+"\n\n");f.on("click",function(){var a="";if(!b.statement||"definition"!=b.statement.type&&"assignment"!=b.statement.type||(a+=" Symbol: "+b.statement.lvalue.name+"\n"),b.lastsymbol&&(a+=" Related Symbol: "+b.lastsymbol+"\n"),String(b.extra).search("SyntaxError")>=0)a+=" JavaScript: "+b.javascriptSource()+"\n",f.html(e+"\n"+a);else if(a+=" Source:
'+c+"\n\n");e.on("click",function(){var a="";if(!b.statement||"definition"!=b.statement.type&&"assignment"!=b.statement.type||(a+=" Symbol: "+b.statement.lvalue.name+"\n"),b.lastsymbol&&(a+=" Related Symbol: "+b.lastsymbol+"\n"),String(b.extra).search("SyntaxError")>=0)a+=" JavaScript: "+b.javascriptSource()+"\n",e.html(c+"\n"+a);else if(a+=" Source:
",l+='
'):l='',i){var m=i.pretty();m&&m.length>0&&(l+=m)}h?(l+="
",l+="Path: "+d+"
",l+="Current Value: "+Eden.edenCodeForValue(g),l+="
",l+="Path: "+d+"",l+="
"),k.innerHTML=l})},EdenUI.SearchBox.prototype.makeStatementResult=function(a){var b,c="",d="",e="",f=!0;a.executed==-1&&(d=" historic");var g=a.getOrigin();"script"==a.type?(g&&g.remote?(e+=' data-remote="true"',a.indexed&&(e+=' data-imported="true"'),c=''):c='',b=a.doxyComment&&a.doxyComment.getProperty("title")?a.doxyComment.getProperty("title")[0]:a.name?"action "+a.name:a.getInnerSource()):"when"==a.type?(a.enabled&&(c=''),b=a.prefix.trim()):(a.lvalue&&eden.root.symbols[a.lvalue.name]&&eden.root.symbols[a.lvalue.name].origin&&eden.root.symbols[a.lvalue.name].origin.id==a.id&&(c=''),a.getSource()||console.error("NO SOURCE",a),b=a.getSource().split("\n")[0]),f&&(b.length>55&&(b=b.substr(0,55)+"..."),b=EdenUI.Highlight.html(b));var h="";if(a.doxyComment){var i=a.doxyComment.brief();i&&i.length>0&&(h=''+i+"
JS-EDEN must be restarted for this change to fully take effect. Would you like to restart JS-EDEN now?
",["Restart Now","Restart Later"],1,function(a){if(0==a)window.onbeforeunload=void 0,document.location.pathname=d;else if(1==a)root.lookup("debug").mutate(root.scope,function(a){a.cache.value.jsExceptions=c},Symbol.hciAgent);else{var b=document.getElementById("menu-developer");b.checked=!b.checked,edenUI.setOptionValue("developer",b.checked)}})):root.lookup("debug").mutate(root.scope,function(a){a.cache.value.jsExceptions=c},Symbol.hciAgent)}),this.element.on("keyup",".jseden-title",function(a){try{window.localStorage&&window.localStorage.setItem("title",a.currentTarget.textContent)}catch(a){}}),eden.root.lookup("jseden_project_title").addJSObserver("menubar",function(a,b){if(!p){if(a.origin&&a.origin!==Symbol.hciAgent){var c=$(".jseden-title").get(0);c.contentEditable=!0,c.textContent=b,document.title=b}try{window.localStorage&&window.localStorage.setItem("title",b)}catch(d){}}}),eden.root.lookup("jseden_maker").addJSObserver("menubar",function(a,b){b?o.element.find(".maker").addClass("active"):o.element.find(".maker").removeClass("active")}),eden.root.lookup("jseden_menu_showsearch").addJSObserver("menubar",function(a,b){b?(o.element.find(".menusearch").show(),p&&o.element.find("#eden-logo").hide()):(o.element.find(".menusearch").hide(),p&&o.element.find("#eden-logo").show())}),eden.root.lookup("jseden_menu_showshare").addJSObserver("menubar",function(a,b){b?o.element.find(".menubar-button.share").show():o.element.find(".menubar-button.share").hide()}),eden.root.lookup("jseden_menu_showcreate").addJSObserver("menubar",function(a,b){b?o.element.find(".menubar-button.create").show():o.element.find(".menubar-button.create").hide()}),eden.root.lookup("jseden_menu_showexisting").addJSObserver("menubar",function(a,b){b?o.element.find(".menubar-button.existing").show():o.element.find(".menubar-button.existing").hide()}),eden.root.lookup("jseden_menu_showsettings").addJSObserver("menubar",function(a,b){b?o.element.find(".menubar-button.settings").show():o.element.find(".menubar-button.settings").hide()}),eden.root.lookup("jseden_menu_showhelp").addJSObserver("menubar",function(a,b){b?o.element.find(".menubar-button.help").show():o.element.find(".menubar-button.help").hide()}),eden.root.lookup("jseden_project_subtitle").addJSObserver("menubar",function(a,b){}),this.notifications=new EdenUI.Notifications(this.element.find("#menubar-mainitem-notifications"),this.element.find(".menubar-notification-jewel")),this.element.on("click",".notifications",function(a){o.notifications.clearCount()}),this.element.on("click",".maker",function(a){var b=eden.root.lookup("jseden_maker");if(!b.eden_definition){var c=b.value();void 0===c&&(c=!1),b.assign(!c,eden.root.scope,Symbol.localJSAgent)}}),this.element.on("keyup",".jseden-title",function(a){var b=eden.root.lookup("jseden_project_title");b.definition||b.assign(a.currentTarget.textContent,eden.root.scope,Symbol.hciAgent)})},EdenUI.MenuBar.prototype.hide=function(){this.element.hide()},EdenUI.MenuBar.prototype.show=function(){this.element.show()},EdenUI.MenuBar.reset=function(){$(".jseden-title").html("CONSTRUIT")},EdenUI.MenuBar.saveTitle=function(a){eden.root.lookup("jseden_project_title").assign(a,eden.root.scope,Symbol.jsAgent)},EdenUI.Dialogs={},EdenUI.Dialogs.MergeError=function(a,b,c){var d=new diff_match_patch,e=d.diff_main(a,b);d.diff_cleanupSemantic(e);var f=d.diff_prettyHtml(e),g=$(''+e+"\n\n");f.on("click",function(){var a="";if(!b.statement||"definition"!=b.statement.type&&"assignment"!=b.statement.type||(a+=" Symbol: "+b.statement.lvalue.name+"\n"),b.lastsymbol&&(a+=" Related Symbol: "+b.lastsymbol+"\n"),String(b.extra).search("SyntaxError")>=0)a+=" JavaScript: "+b.javascriptSource()+"\n",f.html(e+"\n"+a);else if(a+=" Source:
'+c+"\n\n");e.on("click",function(){var a="";if(!b.statement||"definition"!=b.statement.type&&"assignment"!=b.statement.type||(a+=" Symbol: "+b.statement.lvalue.name+"\n"),b.lastsymbol&&(a+=" Related Symbol: "+b.lastsymbol+"\n"),String(b.extra).search("SyntaxError")>=0)a+=" JavaScript: "+b.javascriptSource()+"\n",e.html(c+"\n"+a);else if(a+=" Source:
",l+='
'):l='',i){var m=i.pretty();m&&m.length>0&&(l+=m)}h?(l+="
",l+="Path: "+d+"
",l+="Current Value: "+Eden.edenCodeForValue(g),l+="
",l+="Path: "+d+"",l+="
"),k.innerHTML=l})},EdenUI.SearchBox.prototype.makeStatementResult=function(a){var b,c="",d="",e="",f=!0;a.executed==-1&&(d=" historic");var g=a.getOrigin();"script"==a.type?(g&&g.remote?(e+=' data-remote="true"',a.indexed&&(e+=' data-imported="true"'),c=''):c='',b=a.doxyComment&&a.doxyComment.getProperty("title")?a.doxyComment.getProperty("title")[0]:a.name?"action "+a.name:a.getInnerSource()):"when"==a.type?(a.enabled&&(c=''),b=a.prefix.trim()):(a.lvalue&&eden.root.symbols[a.lvalue.name]&&eden.root.symbols[a.lvalue.name].origin&&eden.root.symbols[a.lvalue.name].origin.id==a.id&&(c=''),a.getSource()||console.error("NO SOURCE",a),b=a.getSource().split("\n")[0]),f&&(b.length>55&&(b=b.substr(0,55)+"..."),b=EdenUI.Highlight.html(b));var h="";if(a.doxyComment){var i=a.doxyComment.brief();i&&i.length>0&&(h=''+i+"
"+f+";"),e=""+e+""}this.element.html(e)},EdenUI.plugins.SymbolViewer.Symbol.prototype.updateObservable=function(){var a,b=this.symbol.value(),c=_formatVal(b);a=void 0!==this.symbol.definition?""+this.name+"":this.name;var d=""+a+" = "+c+"";if(void 0!==this.symbol.definition){var e=Eden.htmlEscape(this.symbol.getSource(),!1,!0);e=Eden.htmlEscape("
"+e+";"),d=""+d+""}this.element.html(d)},EdenUI.plugins.SymbolViewer.Symbol.prototype.updateProcedure=function(){var a,b,c=this.symbol.getSource();if(a=void 0===this.symbol.definition||/^proc\s/.test(c)?this.name:""+this.name+"",void 0!=edenfunctions.functions&&void 0!==edenfunctions.procedures[this.name]){this.details=edenfunctions.procedures[this.name];var d=Object.keys(this.details.parameters||{});b="( "+d.join(", ")+" )"}else b="";var e=""+a+""+b;if(void 0!==this.symbol.definition&&!/^proc\s/.test(c)){var f=Eden.htmlEscape(c,!1,!0);f=Eden.htmlEscape("
"+f+";"),e=""+e+""}this.element.html(e)};var edenfunctions={};EdenUI.plugins.VersionViewer=function(a,b){var c=this;this.instances=[];var d=0,e=function(a,b){var c='
Leaving this page will discard the current script. Your work will not be saved.
Are you sure you want to close JS-EDEN?
",["Close JS-EDEN","Return to Construal"],1,function(a){0==a?(doingNavigateAway=!0,window.history.back(1)):window.history.forward(1)}))}),e=!0);var j=b.slice(0,-7),k=root.lookup("createView"),l=$(''),m=root.lookup("_view_"+j+"_url"),n=l[0];g(m,m.value()),m.addJSObserver("refreshView",g);var o=$('').html(l).dialog({title:f,width:600,height:450,minHeight:120,minWidth:230,dialogClass:"external-html-content"}),p=$(''+o[1]+'
'+o[2]+'
'+o[3]+'
'+o[4]+'
'+r+'
'+u+'
'+v+'
'+w+'
'+x+"
"+i+";"),h=""+h+""}var j=this.element.find(".observable");j.html(h),j.css({"font-size":e+"px"})}},EdenUI.plugins.ObservablePalette=function(a,b){function c(a){var b=a.value();return"function"!=typeof b||!/\breturn\s+([^\/;]|(\/[^\/*]))/.test(b.toString())}function d(a,b){var d=a.term,e=i[d];if(void 0===e){var f=new RegExp("^"+d);e=[];for(var g in root.symbols)f.test(g)&&c(root.symbols[g])&&e.push(g);i[d]=e}b(e)}function e(){var a=h;return h++,a}function f(b,c,d,g,h,i){function j(a){var b=a.target.value;if("hide"==b)return void h.remove(c,g,d);var e;"boolean"==b?e=!1:"number"==b?e=0:"string"==b&&(e=""),o.assign(e,Symbol.hciAgent,!0)}function k(a){pa.fadeOut(250,"linear",function(){a?(pa.html("true"),pa.css("color","green")):(pa.html("false"),pa.css("color","red")),pa.fadeIn(400,"swing",function(){y.html(a?"true":"false")})})}var l=128;g?(g.hasClass("ui-accordion")&&g.accordion("destroy"),g.html("")):(g=$(''),i&&g.data("editor","read-only"));var m,n=a.eden.root,o=n.lookup(c),p=o.value(),q=typeof p,r="string"==q,s=!i||r,t=o.eden_definition;if(!i&&void 0!==o.eden_definition){var u=t.match(/^\S+\s+is\s+(.*?);?$/);rhs=u[1],q="definition"}var v=$('
'+c+" is currently undefined.
")),!i){var ta=z.clone();ta[0].value="undefined",ta.on("change",j);var ua=$("");ua.append(ta);var va=$("");va.append(ua),A.append(va)}m=function(a,e){void 0===e&&void 0===a.eden_definition||f(b,c,d,g,h,i)}}else m=function(a,e){void 0===e&&void 0===a.eden_definition||f(b,c,d,g,h,i)};return o.addJSObserver(b+"/"+c+"/"+d,m),s?(i&&A.find("input, textarea").attr("readonly","readonly"),g.append(A),g.accordion({active:"undefined"!=q&&void 0,collapsible:!0,heightStyle:"content"})):v.addClass("ui-accordion-header ui-helper-reset ui-state-default ui-corner-all observable-palette-static-header"),g.removeFromDialog=function(){h.remove(c,g,d)},g}function g(a,b){a.target.style.minWidth=b.size.width+"px"}var h=0,i={};root.addGlobal(function(a,b,d){if(d&&c(b)){var e=b.name.slice(1);for(var f in i)new RegExp("^"+f).test(e)&&i[f].push(e)}}),this.createDialog=function(b,c){function h(a,b){for(var c=b.data("observable"),d=b[0],e=p[c],f=0;fConnected to: "+c+"
"),e.onerror=function(a){$("#sl-status").html("Error connecting to server - please verify server is running at "+c+". For usage instructions please read the comments in the state-listener-server.js file.
"), -d.confirmClose=!1},e.onmessage=function(a){$("#sl-status").html("Received: "+Eden.htmlEscape(a.data)+"
"),eden.execute(a.data,"net","",{name:"/execute"},noop)},e.onopen=function(){d.confirmClose=!0,randomSeedSym=a.eden.root.lookup("randomSeed"),randomSeed=randomSeedSym.value(),void 0===randomSeed?randomSeedSym.assign((new Date).getTime(),eden.root.scope,void 0,!0):b("randomSeed"),b("randomGenerator")}}),d},a.views.StateListener={dialog:this.createDialog,title:"State Listener",category:a.viewCategories.extension},a.eden.include("plugins/state-listener/state-listener.js-e",b)},EdenUI.plugins.StateListener.title="State Listener",EdenUI.plugins.StateListener.description="Provides the ability to synchronize observables over the internet.",EdenUI.plugins.StateListener.author="Jonny Foss",EdenUI.plugins.NetworkRemote=function(a,b){function c(){h=!1,$("#connectBtn").attr("value","Connect"),$("#nr-ipaddr").removeAttr("disabled"),$("#nr-port").removeAttr("disabled"),$("#nr-key").removeAttr("disabled")}function d(){eden.root.lookup("network_address").assign($("#nr-ipaddr").val(),eden.root.scope),eden.root.lookup("network_port").assign($("#nr-port").val(),eden.root.scope),eden.root.lookup("network_key").assign($("#nr-key").val(),eden.root.scope),f.connect()}var e,f=this,g=!1,h=!1;Eden.Agent.importAgent("lib/dynamic","default",void 0,function(){}),f.connect=function(){function b(b){var c=a.eden.root,d=c.lookup("definitionOf").definition(c)(b);j.send(JSON.stringify({code:d}))}var c=eden.root.lookup("network_address").value(),d=eden.root.lookup("network_port").value(),g=eden.root.lookup("network_key").value();if(window.WebSocket=window.WebSocket||window.MozWebSocket,!window.WebSocket)return void console.log("WebSockets not supported");var i="ws://"+c+":"+d+"/",j=new WebSocket(i);Eden.Agent.listenTo("executeline",this,function(a,b){if(a){var c=JSON.stringify({action:"executeline",name:a.name,lineno:b});j.send(c)}}),Eden.Agent.listenTo("patch",this,function(a,b,c){if(a){var d=JSON.stringify({action:"patch",name:a.name,patch:b,lineno:c});j.send(d)}}),Eden.Agent.listenTo("owned",this,function(a,b){"net"!=b&&j.send(JSON.stringify({action:"ownership",name:a.name,owned:a.owned}))}),eden.listenTo("beforeAssign",this,function(a,b,c){"net"!=c&&(console.log("ASSIGN: "+a.name+" = "+Eden.edenCodeForValue(b)),j.send(JSON.stringify({action:"assign",symbol:a.name.slice(1),value:b})))}),$("#nr-status").html("Connected to: "+i+"
"),j.onopen=function(c){j.send(g),randomSeedSym=a.eden.root.lookup("randomSeed"),randomSeed=randomSeedSym.value(),void 0===randomSeed?randomSeedSym.assign((new Date).getTime(),eden.root.scope,void 0,!0):b("randomSeed"),b("randomGenerator"),h=!0;for(var d in Eden.Agent.agents)Eden.Agent.agents[d].owned&&j.send(JSON.stringify({action:"ownership",name:d,owned:!0}));eden.root.lookup("network_connected").assign(!0,eden.root.scope)},j.onerror=function(a){h=!1,eden.root.lookup("network_connected").assign(!1,eden.root.scope),eden.root.lookup("network_error").assign(a,eden.root.scope)},j.onclose=function(){eden.root.lookup("network_connected").assign(!1,eden.root.scope)},f.sendControl=function(a,b){console.log("Send Control: "+a+"= "+b),console.log(b),j.send(JSON.stringify({action:"control",key:a,value:b}))},f.sendAssign=function(a){"net"!=a.last_modified_by&&j.send(JSON.stringify({action:"assign",symbol:a.name.slice(1),value:a.value()}))},j.onmessage=function(a){e=JSON.parse(a.data);for(var b=0;bReplay finished
");var b=e[a].time/$("#nr-speedrange").val();b>1e3?($("#nr-status").html("Next line in "+b+" milliseconds
"),g=!0):g&&$("#nr-status").html("Replaying...
"),setTimeout(function(){eden.execute(e[a].code,"net","",{name:"/execute"},noop),f.playCode(a+1)},b)},a.views.NetworkRemote={dialog:this.createDialog,title:"Network Remote",category:a.viewCategories.extension},a.eden.include("plugins/network-remote/network-remote.js-e",b),eden.root.lookup("plugins_network_loaded").assign(!0,eden.root.scope)},EdenUI.plugins.NetworkRemote.title="Network Remote",EdenUI.plugins.NetworkRemote.description="Method of syncronizing observables via TCP, and playing back scripts",EdenUI.plugins.NetworkRemote.author="Jonny Foss",EdenUI.plugins.WindowLayoutTool=function(a,b){var c="";$.getScript("plugins/view-layout/gridster/jquery.gridster.min.js");var d=$("");$("head").append(d);var d=$("");$("head").append(d),this.name="window_name",this.createDialog=function(b,d){""==c&&(c=b);var e=[];viewlayoutstr="View Layout";var f=5*a.gridSizeY,g=3*a.gridSizeX,h=[],i=root.lookup("_views_list").value(),j=this.name;i.forEach(function(b){if(b!=j){var c=root.lookup("_view_"+b+"_x").value(),d=root.lookup("_view_"+b+"_y").value();c="undefined"!=typeof c?c:0,d="undefined"!=typeof d?d:0,h=[b,c,d,root.lookup("_view_"+b+"_width").value()+a.scrollBarSize,root.lookup("_view_"+b+"_height").value()+a.titleBarHeight,root.lookup("_view_"+b+"_title").value()],console.log(h),e.push(h)}});var k="";e.forEach(function(a,b){k+='