Core

OpenForum Javascript {{version}}

Latest build {{buildDate}}

Edit OpenForum Javascript Core <!--Extension InsertFile pageName="/OpenForum/Javascript" fileName="open-forum.js" -->//==============================================================================================================// <!-- Version 1.16.24--> <!-- Built on Fri Nov 29 2024 11:54:57 GMT-0000 (GMT) --> <!-- Built by OpenForum Javascript Builder.--> <!-- Do not edit as changes may be overwritten --> //==============================================================================================================// //==============================================================================================================// <!-- Source: /OpenForum/Javascript/Core/open-forum-header.js--> //==============================================================================================================// <!--<ul><li> Author: Nik Cross</li> <li> Description: A set of browser side js functions to make life better.</li> </ul>--> <!-- End of: /OpenForum/Javascript/Core/open-forum-header.js--> //==============================================================================================================// //==============================================================================================================// <!-- Source: /OpenForum/Javascript/Core/open-forum-dependency.js--> //==============================================================================================================// //<hr/> DependencyService <hr/> if(typeof OpenForum == "undefined") OpenForum = {}; var DependencyService = new function() { //All sets of dependencies var dependencies = <a href="/OpenForum/Javascript/Core/" target="newTab"><img src='/OpenForum/Images/icons/png/link_go.png' /></a>; //All scripts that have been loaded var loadedScripts = <a href="/OpenForum/Javascript/Core/" target="newTab"><img src='/OpenForum/Images/icons/png/link_go.png' /></a>; //All scripts that have been requested var requestedScripts = <a href="/OpenForum/Javascript/Core/" target="newTab"><img src='/OpenForum/Images/icons/png/link_go.png' /></a>; var dp = this; dp.createNewDependency = function() { var dependency = new function() { //Id of the dependency set var id = dependencies.length; var self = this; //Scripts that need to be loaded var scriptsToLoad = <a href="/OpenForum/Javascript/Core/" target="newTab"><img src='/OpenForum/Images/icons/png/link_go.png' /></a>; //Scripts that are required var requiredScripts = <a href="/OpenForum/Javascript/Core/" target="newTab"><img src='/OpenForum/Images/icons/png/link_go.png' /></a>; //Function to call when all required scripts are loaded var onLoadTrigger = function() {}; var loaded = false; self.addDependency = function(script) { if( requiredScripts.includes(script) ) return this; requiredScripts.push(script); if( requestedScripts.includes(script) == false ) { requestedScripts.push(script); } return self; }; self.setOnLoadTrigger = function(triggerFunction) { onLoadTrigger = triggerFunction; return self; }; self.loadDependencies = function() { if(requiredScripts.length===0) { DependencyService.dependencyLoaded(id); return; } var openForumDependencies = OpenForum.getDependencies(); var jsServices = {request:""}; //Collate scripts that are required scriptsToLoad = <a href="/OpenForum/Javascript/Core/" target="newTab"><img src='/OpenForum/Images/icons/png/link_go.png' /></a>; for( var i in requiredScripts) { if( loadedScripts.includes(requiredScripts<a href="/OpenForum/Editor?pageName=/OpenForum/Javascript/Core/i"target="editor" style="color: red" title="The page /OpenForum/Editor?pageName=/OpenForum/Javascript/Core/i does not exist. Click to create it.">i</a>) ){ continue; } if(openForumDependencies<img src="/OpenForum/Editor?pageName=/OpenForum/Javascript/Core/requiredScripts<a href="/OpenForum/Javascript/Core/" target="newTab"><img src='/OpenForum/Images/icons/png/link_go.png' /></a>i" alt="requiredScripts<a href="/OpenForum/Javascript/Core/" target="newTab"><img src='/OpenForum/Images/icons/png/link_go.png' /></a>i" title="requiredScripts<a href="/OpenForum/Javascript/Core/" target="newTab"><img src='/OpenForum/Images/icons/png/link_go.png' /></a>i"/>]!=null) { console.log( "Excluded " + requiredScripts<a href="/OpenForum/Editor?pageName=/OpenForum/Javascript/Core/i"target="editor" style="color: red" title="The page /OpenForum/Editor?pageName=/OpenForum/Javascript/Core/i does not exist. Click to create it.">i</a> ); //TODO //continue; } else { openForumDependencies<img src="/OpenForum/Editor?pageName=/OpenForum/Javascript/Core/requiredScripts<a href="/OpenForum/Javascript/Core/" target="newTab"><img src='/OpenForum/Images/icons/png/link_go.png' /></a>i" alt="requiredScripts<a href="/OpenForum/Javascript/Core/" target="newTab"><img src='/OpenForum/Images/icons/png/link_go.png' /></a>i" title="requiredScripts<a href="/OpenForum/Javascript/Core/" target="newTab"><img src='/OpenForum/Images/icons/png/link_go.png' /></a>i"/>] = jsServices; console.log( "Added " + requiredScripts<a href="/OpenForum/Editor?pageName=/OpenForum/Javascript/Core/i"target="editor" style="color: red" title="The page /OpenForum/Editor?pageName=/OpenForum/Javascript/Core/i does not exist. Click to create it.">i</a> ); } scriptsToLoad.push(requiredScripts<a href="/OpenForum/Editor?pageName=/OpenForum/Javascript/Core/i"target="editor" style="color: red" title="The page /OpenForum/Editor?pageName=/OpenForum/Javascript/Core/i does not exist. Click to create it.">i</a>); } //requiredScripts = <a href="/OpenForum/Javascript/Core/" target="newTab"><img src='/OpenForum/Images/icons/png/link_go.png' /></a>; if(scriptsToLoad.length==0) { DependencyService.dependencyLoaded(id); return; } var fileName = ""; for(var i=0;i<scriptsToLoad.length;i++) { if(i>0) fileName+=","; fileName+=scriptsToLoad<a href="/OpenForum/Editor?pageName=/OpenForum/Javascript/Core/i"target="editor" style="color: red" title="The page /OpenForum/Editor?pageName=/OpenForum/Javascript/Core/i does not exist. Click to create it.">i</a>; } var url = "/OpenForum/Javascript/Services?script="+fileName+"&callback=DependencyService.dependencyLoaded&callbackId="+id+"&v="+OpenForum.pageVersion; if(OpenForum.pageVersion) url += "&v="+OpenForum.pageVersion; jsServices.request = url; OpenForum.loadScript(url); }; self.checkLoaded = function() { return loaded; }; self.setLoaded = function() { for(var i in requiredScripts) { if(!loadedScripts<img src="/OpenForum/Editor?pageName=/OpenForum/Javascript/Core/requiredScripts<a href="/OpenForum/Javascript/Core/" target="newTab"><img src='/OpenForum/Images/icons/png/link_go.png' /></a>i" alt="requiredScripts<a href="/OpenForum/Javascript/Core/" target="newTab"><img src='/OpenForum/Images/icons/png/link_go.png' /></a>i" title="requiredScripts<a href="/OpenForum/Javascript/Core/" target="newTab"><img src='/OpenForum/Images/icons/png/link_go.png' /></a>i"/>]) { setTimeout(self.setLoaded,100); return; } } loaded = true; onLoadTrigger(); }; self.getScriptsToLoad = function() { return scriptsToLoad; }; }; dependencies.push(dependency); return dependency; }; this.dependencyLoaded = function(id) { var newScripts = dependencies<a href="/OpenForum/Editor?pageName=/OpenForum/Javascript/Core/id"target="editor" style="color: red" title="The page /OpenForum/Editor?pageName=/OpenForum/Javascript/Core/id does not exist. Click to create it.">id</a>.getScriptsToLoad(); for(var i in newScripts) { loadedScripts<img src="/OpenForum/Editor?pageName=/OpenForum/Javascript/Core/newScripts<a href="/OpenForum/Javascript/Core/" target="newTab"><img src='/OpenForum/Images/icons/png/link_go.png' /></a>i" alt="newScripts<a href="/OpenForum/Javascript/Core/" target="newTab"><img src='/OpenForum/Images/icons/png/link_go.png' /></a>i" title="newScripts<a href="/OpenForum/Javascript/Core/" target="newTab"><img src='/OpenForum/Images/icons/png/link_go.png' /></a>i"/>]=true; } dependencies<a href="/OpenForum/Editor?pageName=/OpenForum/Javascript/Core/id"target="editor" style="color: red" title="The page /OpenForum/Editor?pageName=/OpenForum/Javascript/Core/id does not exist. Click to create it.">id</a>.setLoaded(); }; }; <!-- End of: /OpenForum/Javascript/Core/open-forum-dependency.js--> //==============================================================================================================// //==============================================================================================================// <!-- Source: /OpenForum/Javascript/Core/open-forum-scanner.js--> //==============================================================================================================// //<hr/> OpenForum <hr/> var OpenForum = new function(){ this.FIELD_DELIMETER_START = "{"+"{"; this.FIELD_DELIMETER_END = "}"+"}"; this.pageVersion = "build-" + new Date(document.lastModified).getTime(); var self = this; var objects= <a href="/OpenForum/Javascript/Core/" target="newTab"><img src='/OpenForum/Images/icons/png/link_go.png' /></a>; var tables = <a href="/OpenForum/Javascript/Core/" target="newTab"><img src='/OpenForum/Images/icons/png/link_go.png' /></a>; var tabs = <a href="/OpenForum/Javascript/Core/" target="newTab"><img src='/OpenForum/Images/icons/png/link_go.png' /></a>; var persistentObjectIds = <a href="/OpenForum/Javascript/Core/" target="newTab"><img src='/OpenForum/Images/icons/png/link_go.png' /></a>; var nextId = 0; var hash; var hashCalls = <a href="/OpenForum/Javascript/Core/" target="newTab"><img src='/OpenForum/Images/icons/png/link_go.png' /></a>; var nodeProcessors = <a href="/OpenForum/Javascript/Core/" target="newTab"><img src='/OpenForum/Images/icons/png/link_go.png' /></a>; var scanners = <a href="/OpenForum/Javascript/Core/" target="newTab"><img src='/OpenForum/Images/icons/png/link_go.png' /></a>; var initialisers = <a href="/OpenForum/Javascript/Core/" target="newTab"><img src='/OpenForum/Images/icons/png/link_go.png' /></a>; var dependencies = <a href="/OpenForum/Javascript/Core/" target="newTab"><img src='/OpenForum/Images/icons/png/link_go.png' /></a>; var waitingScripts = null; var watchers = <a href="/OpenForum/Javascript/Core/" target="newTab"><img src='/OpenForum/Images/icons/png/link_go.png' /></a>; var defaultScanPeriod = 500; self.interval = null; self.getVersion = function() { return "1.16.24"; }; self.getBuildDate = function() { return "Fri Nov 29 2024 11:54:57 GMT-0000 (GMT)"; }; self.initDependencies = DependencyService.createNewDependency(); self.includeScript = function( scriptName ) { if(dependencies<a href="/OpenForum/Editor?pageName=/OpenForum/Javascript/Core/scriptName"target="editor" style="color: red" title="The page /OpenForum/Editor?pageName=/OpenForum/Javascript/Core/scriptName does not exist. Click to create it.">scriptName</a>) return; dependencies<a href="/OpenForum/Editor?pageName=/OpenForum/Javascript/Core/scriptName"target="editor" style="color: red" title="The page /OpenForum/Editor?pageName=/OpenForum/Javascript/Core/scriptName does not exist. Click to create it.">scriptName</a> = self.initDependencies.addDependency( scriptName ); }; self.getDependencies = function() { return dependencies; }; //Fluent dependency interface //Example: OpenForum.addScript("my script 1).addScript("my script 2").then( function() { console.log("Loaded"); } ); //Example: OpenForum.addScript("my script 1).addScript("my script 2").go(); self.addScript = function( scriptUrl ) { if(waitingScripts == null) { waitingScripts = new function() { var self = this; var dependencyService = DependencyService.createNewDependency(); self.addScript = function( scriptUrl ) { dependencyService.addDependency( scriptUrl ); return self; }; self.then = function( thenFn ) { dependencyService.setOnLoadTrigger( thenFn); dependencyService.loadDependencies(); waitingScripts = null; }; self.go = function() { dependencyService.loadDependencies(); waitingScripts = null; }; }; } return waitingScripts.addScript( scriptUrl ); }; self.getRoot = function() { var root = document.location.toString(); root = root.substring( root.indexOf("://")+3 ); root = root.substring( root.indexOf("/")+1 ); root = "/"+root.substring( 0,root.indexOf("/") ); return root; }; self.addNodeProcessor = function(processor) { nodeProcessors.push(processor); }; self.addScanner = function(scanner) { scanners.push(scanner); }; self.addInitialiser = function( fn ) { initialisers.push(fn); }; self.addHashCall = function(hash,callFn) { hashCalls<a href="/OpenForum/Editor?pageName=/OpenForum/Javascript/Core/hash"target="editor" style="color: red" title="The page /OpenForum/Editor?pageName=/OpenForum/Javascript/Core/hash does not exist. Click to create it.">hash</a> = callFn; }; self.addTable = function(table) { tables<a href="/OpenForum/Editor?pageName=/OpenForum/Javascript/Core/table.getId()"target="editor" style="color: red" title="The page /OpenForum/Editor?pageName=/OpenForum/Javascript/Core/table.getId() does not exist. Click to create it.">table.getId()</a>=table; }; self.getTable = function(ofId) { return tables<input type='radio' />; }; self.getNextId = function() { nextId++; return nextId; }; self.getObject= function(id) { //id = id.replace(/<br/>./g,"_dot_"); if(objects<a href="/OpenForum/Editor?pageName=/OpenForum/Javascript/Core/id"target="editor" style="color: red" title="The page /OpenForum/Editor?pageName=/OpenForum/Javascript/Core/id does not exist. Click to create it.">id</a>===undefined) { objects<a href="/OpenForum/Editor?pageName=/OpenForum/Javascript/Core/id"target="editor" style="color: red" title="The page /OpenForum/Editor?pageName=/OpenForum/Javascript/Core/id does not exist. Click to create it.">id</a> = new OpenForumObject(id); } return objects<a href="/OpenForum/Editor?pageName=/OpenForum/Javascript/Core/id"target="editor" style="color: red" title="The page /OpenForum/Editor?pageName=/OpenForum/Javascript/Core/id does not exist. Click to create it.">id</a>; }; self.removeObject = function(id) { if(objects<a href="/OpenForum/Editor?pageName=/OpenForum/Javascript/Core/id"target="editor" style="color: red" title="The page /OpenForum/Editor?pageName=/OpenForum/Javascript/Core/id does not exist. Click to create it.">id</a>!=undefined) { delete objects<a href="/OpenForum/Editor?pageName=/OpenForum/Javascript/Core/id"target="editor" style="color: red" title="The page /OpenForum/Editor?pageName=/OpenForum/Javascript/Core/id does not exist. Click to create it.">id</a>; } }; self.persistObject = function(id) { persistentObjectIds.push(id); }; self.storePersistentState = function( key ) { if( typeof key == "undefined" ) { key = window.location.pathname; } if( persistentObjectIds.length==0 ) return; var json = {}; for( var i in persistentObjectIds) { var object = OpenForum.getObject( persistentObjectIds<a href="/OpenForum/Editor?pageName=/OpenForum/Javascript/Core/i"target="editor" style="color: red" title="The page /OpenForum/Editor?pageName=/OpenForum/Javascript/Core/i does not exist. Click to create it.">i</a> ); if( isUndefined(object) ) continue; try{ //Test can be stringified JSON.stringify( object.getValue() ); json<input type='radio' /> = object.getValue(); } catch(e) {} } OpenForum.Storage.set( key + ".persist", JSON.stringify(json) ); }; self.restorePersistentState = function( key ) { if( typeof key == "undefined" ) { key = window.location.pathname; } var data = OpenForum.Storage.get( key + ".persist" ); if(data!=null) { try{ var json = JSON.parse( data ); for(var j in json) { //OpenForum.getObject(j).setValue( json<a href="/OpenForum/Editor?pageName=/OpenForum/Javascript/Core/j"target="editor" style="color: red" title="The page /OpenForum/Editor?pageName=/OpenForum/Javascript/Core/j does not exist. Click to create it.">j</a> ); try{ OpenForum.evaluate( j + "=" + JSON.stringify( json<a href="/OpenForum/Editor?pageName=/OpenForum/Javascript/Core/j"target="editor" style="color: red" title="The page /OpenForum/Editor?pageName=/OpenForum/Javascript/Core/j does not exist. Click to create it.">j</a> ) ); } catch(e) { console.log(e); } } } catch(e) { console.log(e); } } }; self.addListener = function(id,listener) { self.getObject(id).addListener(listener); }; self.removeListener = function(id,listener) { self.getObject(id).removeListener(listener); }; self.scan = function(firstTime) { <!--if(self.hash != window.location.hash) { self.hash = window.location.hash; self._onHash(self.hash); }--> for(var tableIndex in tables) { tables<a href="/OpenForum/Editor?pageName=/OpenForum/Javascript/Core/tableIndex"target="editor" style="color: red" title="The page /OpenForum/Editor?pageName=/OpenForum/Javascript/Core/tableIndex does not exist. Click to create it.">tableIndex</a>.refresh(); } self.hash = window.location.hash; self._onHash(self.hash); for(var objectIndex in objects) { object = objects<input type='radio' />; if(typeof(object)=="undefined") { } else { object.scan(); } } for(var scanner in scanners) { try{ scanners<a href="/OpenForum/Editor?pageName=/OpenForum/Javascript/Core/scanner"target="editor" style="color: red" title="The page /OpenForum/Editor?pageName=/OpenForum/Javascript/Core/scanner does not exist. Click to create it.">scanner</a>(); } catch(e) { console.log(e); } } if(document.body && document.body!=null && firstTime==true) { self.preparePage(document.body); } }; self.addNodeProcessor( function(node) { if(node.attributes==undefined) return; for(var a=0; a<node.attributes.length; a++) { //has attribute to map if(node.attributes<a href="/OpenForum/Editor?pageName=/OpenForum/Javascript/Core/a"target="editor" style="color: red" title="The page /OpenForum/Editor?pageName=/OpenForum/Javascript/Core/a does not exist. Click to create it.">a</a>.value.indexOf(self.FIELD_DELIMETER_START)!==0) continue; var key = node.attributes<a href="/OpenForum/Editor?pageName=/OpenForum/Javascript/Core/a"target="editor" style="color: red" title="The page /OpenForum/Editor?pageName=/OpenForum/Javascript/Core/a does not exist. Click to create it.">a</a>.name; var watch = node.attributes<a href="/OpenForum/Editor?pageName=/OpenForum/Javascript/Core/a"target="editor" style="color: red" title="The page /OpenForum/Editor?pageName=/OpenForum/Javascript/Core/a does not exist. Click to create it.">a</a>.value.substring(2,node.attributes<a href="/OpenForum/Editor?pageName=/OpenForum/Javascript/Core/a"target="editor" style="color: red" title="The page /OpenForum/Editor?pageName=/OpenForum/Javascript/Core/a does not exist. Click to create it.">a</a>.value.length-2); var value = OpenForum.evaluate( watch ); node.attributes<a href="/OpenForum/Editor?pageName=/OpenForum/Javascript/Core/a"target="editor" style="color: red" title="The page /OpenForum/Editor?pageName=/OpenForum/Javascript/Core/a does not exist. Click to create it.">a</a>.value = value; self.addScanner( function() { var newValue = OpenForum.evaluate( watch ); if(value==newValue) return; value = newValue; node.attributes<a href="/OpenForum/Editor?pageName=/OpenForum/Javascript/Core/key"target="editor" style="color: red" title="The page /OpenForum/Editor?pageName=/OpenForum/Javascript/Core/key does not exist. Click to create it.">key</a>.value = value; } ); } }); self.crawl = function (node) { self.crawlTables(node); self.crawlParts(node); }; self.preparePage = function(node) { //Copy all attributes starting ofa-??? to attribute ??? if(node.attributes) { for(var i=0;i<node.attributes.length;i++) { var key = node.attributes<a href="/OpenForum/Editor?pageName=/OpenForum/Javascript/Core/i"target="editor" style="color: red" title="The page /OpenForum/Editor?pageName=/OpenForum/Javascript/Core/i does not exist. Click to create it.">i</a>.name; if(key.indexOf("ofa-")==0) { key = key.substring(4); if(node.attributes<a href="/OpenForum/Editor?pageName=/OpenForum/Javascript/Core/i"target="editor" style="color: red" title="The page /OpenForum/Editor?pageName=/OpenForum/Javascript/Core/i does not exist. Click to create it.">i</a>.value.indexOf(self.FIELD_DELIMETER_START)==-1) { var term = node.attributes<a href="/OpenForum/Editor?pageName=/OpenForum/Javascript/Core/i"target="editor" style="color: red" title="The page /OpenForum/Editor?pageName=/OpenForum/Javascript/Core/i does not exist. Click to create it.">i</a>.value;//.substring(2,node.attributes<a href="/OpenForum/Editor?pageName=/OpenForum/Javascript/Core/i"target="editor" style="color: red" title="The page /OpenForum/Editor?pageName=/OpenForum/Javascript/Core/i does not exist. Click to create it.">i</a>.value.length-2); var value = term; if(term.indexOf("js:")==0) { try{ value = OpenForum.evaluate( term.substring(3) ); } catch(e) { } } if(node.getAttribute(key)!=value) { node.setAttribute(key, value); } } else { var term = node.attributes<a href="/OpenForum/Editor?pageName=/OpenForum/Javascript/Core/i"target="editor" style="color: red" title="The page /OpenForum/Editor?pageName=/OpenForum/Javascript/Core/i does not exist. Click to create it.">i</a>.value.substring(2,node.attributes<a href="/OpenForum/Editor?pageName=/OpenForum/Javascript/Core/i"target="editor" style="color: red" title="The page /OpenForum/Editor?pageName=/OpenForum/Javascript/Core/i does not exist. Click to create it.">i</a>.value.length-2); var value = OpenForum.evaluate( term ); if(node.getAttribute(key)!=value) { node.setAttribute(key, value); } //node.setAttribute(key, node.attributes<a href="/OpenForum/Editor?pageName=/OpenForum/Javascript/Core/i"target="editor" style="color: red" title="The page /OpenForum/Editor?pageName=/OpenForum/Javascript/Core/i does not exist. Click to create it.">i</a>.value); //node.removeAttribute( node.attributes<a href="/OpenForum/Editor?pageName=/OpenForum/Javascript/Core/i"target="editor" style="color: red" title="The page /OpenForum/Editor?pageName=/OpenForum/Javascript/Core/i does not exist. Click to create it.">i</a>.name ); } } } } for(var nodeIndex=0; nodeIndex<node.childNodes.length; nodeIndex++) { self.preparePage( node.childNodes<a href="/OpenForum/Editor?pageName=/OpenForum/Javascript/Core/nodeIndex"target="editor" style="color: red" title="The page /OpenForum/Editor?pageName=/OpenForum/Javascript/Core/nodeIndex does not exist. Click to create it.">nodeIndex</a> ); } }; self.crawlParts = function (node,prefix) { if(node.attributes && node.attributes<a href="/OpenForum/Editor?pageName=/OpenForum/Javascript/Core/'of-exclude'"target="editor" style="color: red" title="The page /OpenForum/Editor?pageName=/OpenForum/Javascript/Core/'of-exclude' does not exist. Click to create it.">'of-exclude'</a>) { return; } if(typeof(prefix)=="undefined") { prefix=""; } for(var ni = 0; ni<nodeProcessors.length; ni++) { try{ nodeProcessors<a href="/OpenForum/Editor?pageName=/OpenForum/Javascript/Core/ni"target="editor" style="color: red" title="The page /OpenForum/Editor?pageName=/OpenForum/Javascript/Core/ni does not exist. Click to create it.">ni</a>(node); } catch(e) { console.log(e); } } if(!(node.childNodes && node.childNodes.length>0) || node.type=="select-one" || node.type=="select-multiple" || node.type=="textarea") { if(node.attributes && node.attributes<a href="/OpenForum/Editor?pageName=/OpenForum/Javascript/Core/'of-id'"target="editor" style="color: red" title="The page /OpenForum/Editor?pageName=/OpenForum/Javascript/Core/'of-id' does not exist. Click to create it.">'of-id'</a>) { var nodeName = node.attributes<a href="/OpenForum/Editor?pageName=/OpenForum/Javascript/Core/'of-id'"target="editor" style="color: red" title="The page /OpenForum/Editor?pageName=/OpenForum/Javascript/Core/'of-id' does not exist. Click to create it.">'of-id'</a>.value; if(prefix.length>0) { nodeName = prefix+"."+nodeName; } var object = OpenForum.getObject(nodeName).add( node ); objects<input type='radio' />=object; } if( typeof(node.innerHTML)!="undefined" && node.innerHTML.indexOf(OpenForum.FIELD_DELIMETER_START)!=-1) { self.parseParts(node,objects,prefix); } if( node.nodeName=="#text" && node.nodeValue.indexOf(OpenForum.FIELD_DELIMETER_START)!=-1) { self.parseText(node,objects,prefix); } } for(var nodeIndex=0; nodeIndex<node.childNodes.length; nodeIndex++) { var childNode = node.childNodes<a href="/OpenForum/Editor?pageName=/OpenForum/Javascript/Core/nodeIndex"target="editor" style="color: red" title="The page /OpenForum/Editor?pageName=/OpenForum/Javascript/Core/nodeIndex does not exist. Click to create it.">nodeIndex</a>; self.crawlParts(childNode,prefix); if(childNode.id && childNode.id.indexOf("OFTable")===0) { self.getTable(childNode.id).setTableNode(childNode); } if(childNode.id && childNode.id.indexOf("OFTabs")===0) { self.getTab(childNode.id).setTabNode(childNode); } } return objects; }; self.crawlTables = function (node) { for(var nodeIndex=0; nodeIndex<node.childNodes.length; nodeIndex++) { var childNode = node.childNodes<a href="/OpenForum/Editor?pageName=/OpenForum/Javascript/Core/nodeIndex"target="editor" style="color: red" title="The page /OpenForum/Editor?pageName=/OpenForum/Javascript/Core/nodeIndex does not exist. Click to create it.">nodeIndex</a>; self.crawlTables(childNode); if(childNode.attributes && childNode.attributes<a href="/OpenForum/Editor?pageName=/OpenForum/Javascript/Core/'of-repeatFor'"target="editor" style="color: red" title="The page /OpenForum/Editor?pageName=/OpenForum/Javascript/Core/'of-repeatFor' does not exist. Click to create it.">'of-repeatFor'</a>) { self.addTable( new OpenForumTable(childNode) ); } } }; self.parseText= function(node,objects,prefix) { var data = node.nodeValue; var spans = <a href="/OpenForum/Javascript/Core/" target="newTab"><img src='/OpenForum/Images/icons/png/link_go.png' /></a>; while(data.indexOf(OpenForum.FIELD_DELIMETER_START)!=-1) { name = data.substring(data.indexOf(OpenForum.FIELD_DELIMETER_START)+2,data.indexOf(OpenForum.FIELD_DELIMETER_END)); data = data.substring(0,data.indexOf(OpenForum.FIELD_DELIMETER_START))+ "<span id='OpenForumId"+nextId+"'>&nbsp;</span>"+ data.substring(data.indexOf(OpenForum.FIELD_DELIMETER_END)+2); spans<a href="/OpenForum/Editor?pageName=/OpenForum/Javascript/Core/spans.length"target="editor" style="color: red" title="The page /OpenForum/Editor?pageName=/OpenForum/Javascript/Core/spans.length does not exist. Click to create it.">spans.length</a> = {id: 'OpenForumId'+nextId,name: name}; nextId++; } //node.nodeValue = data; newNode = document.createElement("span"); node.parentNode.replaceChild(newNode,node); newNode.innerHTML = data; for(var spanIndex in spans) { var span = spans<a href="/OpenForum/Editor?pageName=/OpenForum/Javascript/Core/spanIndex"target="editor" style="color: red" title="The page /OpenForum/Editor?pageName=/OpenForum/Javascript/Core/spanIndex does not exist. Click to create it.">spanIndex</a>; var object = self.getObject( span.name ); object.add( document.getElementById(span.id) ); objects<input type='radio' />=object; } }; self.parseParts= function(node,objects,prefix) { var data = node.innerHTML; var spans = <a href="/OpenForum/Javascript/Core/" target="newTab"><img src='/OpenForum/Images/icons/png/link_go.png' /></a>; while(data.indexOf(OpenForum.FIELD_DELIMETER_START)!=-1) { name = data.substring(data.indexOf(OpenForum.FIELD_DELIMETER_START)+2,data.indexOf(OpenForum.FIELD_DELIMETER_END)); data = data.substring(0,data.indexOf(OpenForum.FIELD_DELIMETER_START))+ "<span id='OpenForumId"+nextId+"'>&nbsp;</span>"+ data.substring(data.indexOf(OpenForum.FIELD_DELIMETER_END)+2); spans.push( {id: 'OpenForumId'+nextId,name: name} ); nextId++; } node.innerHTML = data; for(var spanIndex = 0; spanIndex<spans.length; spanIndex++) { var span = spans<a href="/OpenForum/Editor?pageName=/OpenForum/Javascript/Core/spanIndex"target="editor" style="color: red" title="The page /OpenForum/Editor?pageName=/OpenForum/Javascript/Core/spanIndex does not exist. Click to create it.">spanIndex</a>; var object = self.getObject( span.name ); object.add( document.getElementById(span.id) ); objects<input type='radio' />=object; } }; self.loadScript = function(scriptURL) { if(dependencies<a href="/OpenForum/Editor?pageName=/OpenForum/Javascript/Core/scriptURL"target="editor" style="color: red" title="The page /OpenForum/Editor?pageName=/OpenForum/Javascript/Core/scriptURL does not exist. Click to create it.">scriptURL</a>) return; var fileref = document.createElement("script"); fileref.setAttribute("src",scriptURL); if( scriptURL.indexOf("module")!=-1 ) { fileref.setAttribute("type","module"); } else { fileref.setAttribute("type","text/javascript"); } document.getElementsByTagName("head")<a href="/OpenForum/Editor?pageName=/OpenForum/Javascript/Core/0"target="editor" style="color: red" title="The page /OpenForum/Editor?pageName=/OpenForum/Javascript/Core/0 does not exist. Click to create it.">0</a>.appendChild(fileref); dependencies<a href="/OpenForum/Editor?pageName=/OpenForum/Javascript/Core/scriptURL"target="editor" style="color: red" title="The page /OpenForum/Editor?pageName=/OpenForum/Javascript/Core/scriptURL does not exist. Click to create it.">scriptURL</a> = fileref; }; self.loadCSS = function(cssURL) { if(dependencies<a href="/OpenForum/Editor?pageName=/OpenForum/Javascript/Core/cssURL"target="editor" style="color: red" title="The page /OpenForum/Editor?pageName=/OpenForum/Javascript/Core/cssURL does not exist. Click to create it.">cssURL</a>) return; var fileref = document.createElement("link"); fileref.setAttribute("rel", "stylesheet"); fileref.setAttribute("type", "text/css"); fileref.setAttribute("href", cssURL); document.getElementsByTagName("head")<a href="/OpenForum/Editor?pageName=/OpenForum/Javascript/Core/0"target="editor" style="color: red" title="The page /OpenForum/Editor?pageName=/OpenForum/Javascript/Core/0 does not exist. Click to create it.">0</a>.appendChild(fileref); dependencies<a href="/OpenForum/Editor?pageName=/OpenForum/Javascript/Core/cssURL"target="editor" style="color: red" title="The page /OpenForum/Editor?pageName=/OpenForum/Javascript/Core/cssURL does not exist. Click to create it.">cssURL</a> = fileref; }; self._onHash= function(hash) { hash = hash.substring(1); if(hash==="") { hash="home"; } if(hashCalls<a href="/OpenForum/Editor?pageName=/OpenForum/Javascript/Core/hash"target="editor" style="color: red" title="The page /OpenForum/Editor?pageName=/OpenForum/Javascript/Core/hash does not exist. Click to create it.">hash</a>) { hashCalls<a href="/OpenForum/Editor?pageName=/OpenForum/Javascript/Core/hash"target="editor" style="color: red" title="The page /OpenForum/Editor?pageName=/OpenForum/Javascript/Core/hash does not exist. Click to create it.">hash</a>(); } self.onHash(hash); }; self.onHash= function(hash) {}; self.init= function() {}; self.close= function() {}; self.onload= function(next) { self.initDependencies.loadDependencies(); self.waitForReady(); }; var waitForReadyCount = 0; self.waitForReady = function() { if(waitForReadyCount<75) { if(self.initDependencies.checkLoaded()===false) { setTimeout(OpenForum.waitForReady,200); waitForReadyCount++; return; } for(var fni in initialisers) { var initialiser = initialisers<a href="/OpenForum/Editor?pageName=/OpenForum/Javascript/Core/fni"target="editor" style="color: red" title="The page /OpenForum/Editor?pageName=/OpenForum/Javascript/Core/fni does not exist. Click to create it.">fni</a>; if(!initialiser.ready) { initialiser.ready = initialiser()!==false; setTimeout(OpenForum.waitForReady,200); waitForReadyCount++; return; } } } else { console.log("Error: OpenForum.waitForReady timed out."); } console.log("Running OpenForum Version "+OpenForum.getVersion()); self.crawl(document.body); self.createData(); self.hash = ""; self.restorePersistentState(); self.scan(true); //First Time self.init(); self.startAutoScan(); }; self.stopAutoScan = function() { if(self.interval !== null ) { clearInterval( self.interval ); self.interval = null; } }; self.startAutoScan = function(scanTime) { self.stopAutoScan(); if(scanTime) { self.interval = setInterval(self.scan,scanTime,scanTime); } else { self.interval = setInterval(self.scan,defaultScanPeriod,defaultScanPeriod); } }; self.onunload= function() { self.storePersistentState(); this.close(); }; self.getObjects = function() { return objects; }; self.getTables = function() { return tables; }; self.listData = function() { var list = <a href="/OpenForum/Javascript/Core/" target="newTab"><img src='/OpenForum/Images/icons/png/link_go.png' /></a>; for(var objectIndex in objects) { var object = objects<input type='radio' />; if(typeof(object)=="undefined") { continue; } if(object.getId()) { list<a href="/OpenForum/Editor?pageName=/OpenForum/Javascript/Core/list.length"target="editor" style="color: red" title="The page /OpenForum/Editor?pageName=/OpenForum/Javascript/Core/list.length does not exist. Click to create it.">list.length</a>=object.getId(); } } return list; }; self.createData = function() { for(var objectIndex in objects) { var object = objects<input type='radio' />; if(typeof(object)=="undefined") { continue; } this.createParents(object.getId()); if( OpenForum.evaluate("typeof("+object.getId()+")")==="undefined" ) { OpenForum.evaluate(object.getId()+"=<br/>"<br/>";"); object.setValue(""); } else { object.setValue( OpenForum.evaluate(object.getId()) ); } } }; self.createParents = function(id) { if(id.indexOf(".")==-1) { return; } var parts = id.split("."); id = ""; for(var index=0;index<parts.length-1;index++) { if(id.length>0) { id+="."; } id+=parts<a href="/OpenForum/Editor?pageName=/OpenForum/Javascript/Core/index"target="editor" style="color: red" title="The page /OpenForum/Editor?pageName=/OpenForum/Javascript/Core/index does not exist. Click to create it.">index</a>; if( OpenForum.evaluate("typeof("+id+")")=="undefined" ) { OpenForum.evaluate(id+"={};"); } } }; self.createObjectSignature = function(object) { var cache = <a href="/OpenForum/Javascript/Core/" target="newTab"><img src='/OpenForum/Images/icons/png/link_go.png' /></a>; var signature = JSON.stringify(object, function(key, value) { if (typeof value === 'object' && value !== null) { if (cache.indexOf(value) !== -1) { // Circular reference found, discard key return; } // Store value in our collection cache.push(value); } return value; }); cache = null; return signature; }; self.childCount = function(object) { var count=0; for(var index in object) { count++; } return count; }; self.addTab = function(id) { tabs<a href="/OpenForum/Editor?pageName=/OpenForum/Javascript/Core/id"target="editor" style="color: red" title="The page /OpenForum/Editor?pageName=/OpenForum/Javascript/Core/id does not exist. Click to create it.">id</a> = document.getElementById(id); }; self.showTab = function(id){ for(var index in tabs) { tabs<a href="/OpenForum/Editor?pageName=/OpenForum/Javascript/Core/index"target="editor" style="color: red" title="The page /OpenForum/Editor?pageName=/OpenForum/Javascript/Core/index does not exist. Click to create it.">index</a>.style.display="none"; } tabs<a href="/OpenForum/Editor?pageName=/OpenForum/Javascript/Core/id"target="editor" style="color: red" title="The page /OpenForum/Editor?pageName=/OpenForum/Javascript/Core/id does not exist. Click to create it.">id</a>.style.display="block"; }; self.getTabs = function(){ return tabs; }; self.getTab = function(id){ return tabs<a href="/OpenForum/Editor?pageName=/OpenForum/Javascript/Core/id"target="editor" style="color: red" title="The page /OpenForum/Editor?pageName=/OpenForum/Javascript/Core/id does not exist. Click to create it.">id</a>; }; //Keep all the evil in one place self.evaluate = function(script) { try{ return eval(script); } catch (e) { OpenForum.debug( "ERROR", "Exception evaluating '" + script + "'",e ); throw e; } }; self.globalExists = function( name ) { name = name.replace(/<br/><a href="/OpenForum/Editor?pageName=/g,".").replace(/<br/>"target="editor" style="color: red" title="The page /OpenForum/Editor?pageName=/g,".").replace(/<br/> does not exist. Click to create it.">/g,".").replace(/<br/></a>/g,"").replace(/'/g,"").replace(/<br/>(.*<br/>)/g,""); var parts = name.split("."); var obj = window; for(var part in parts) { if( typeof obj<img src="/OpenForum/Editor?pageName=/OpenForum/Javascript/Core/parts<a href="/OpenForum/Javascript/Core/" target="newTab"><img src='/OpenForum/Images/icons/png/link_go.png' /></a>part" alt="parts<a href="/OpenForum/Javascript/Core/" target="newTab"><img src='/OpenForum/Images/icons/png/link_go.png' /></a>part" title="parts<a href="/OpenForum/Javascript/Core/" target="newTab"><img src='/OpenForum/Images/icons/png/link_go.png' /></a>part"/>] === "undefined" ) return false; obj = obj<img src="/OpenForum/Editor?pageName=/OpenForum/Javascript/Core/parts<a href="/OpenForum/Javascript/Core/" target="newTab"><img src='/OpenForum/Images/icons/png/link_go.png' /></a>part" alt="parts<a href="/OpenForum/Javascript/Core/" target="newTab"><img src='/OpenForum/Images/icons/png/link_go.png' /></a>part" title="parts<a href="/OpenForum/Javascript/Core/" target="newTab"><img src='/OpenForum/Images/icons/png/link_go.png' /></a>part"/>]; } return true; }; self.getGlobal = function( name ) { name = name.replace(/<br/><a href="/OpenForum/Editor?pageName=/g,".").replace(/<br/>"target="editor" style="color: red" title="The page /OpenForum/Editor?pageName=/g,".").replace(/<br/> does not exist. Click to create it.">/g,".").replace(/<br/></a>/g,"").replace(/'/g,"").replace(/<br/>(.*<br/>)/g,""); var parts = name.split("."); var obj = window; for(var part in parts) obj = obj<img src="/OpenForum/Editor?pageName=/OpenForum/Javascript/Core/parts<a href="/OpenForum/Javascript/Core/" target="newTab"><img src='/OpenForum/Images/icons/png/link_go.png' /></a>part" alt="parts<a href="/OpenForum/Javascript/Core/" target="newTab"><img src='/OpenForum/Images/icons/png/link_go.png' /></a>part" title="parts<a href="/OpenForum/Javascript/Core/" target="newTab"><img src='/OpenForum/Images/icons/png/link_go.png' /></a>part"/>]; if(typeof obj === "function") return obj(); else return obj; }; self.setGlobal = function( name,value,create ) { name = name.replace(/<br/><a href="/OpenForum/Editor?pageName=/g,".").replace(/<br/>"target="editor" style="color: red" title="The page /OpenForum/Editor?pageName=/g,".").replace(/<br/> does not exist. Click to create it.">/g,".").replace(/<br/></a>/g,"").replace(/'/g,""); var parts = name.split("."); var obj = window; var i=0; for(i=0; i<parts.length-1; i++) { if( typeof obj<img src="/OpenForum/Editor?pageName=/OpenForum/Javascript/Core/parts<a href="/OpenForum/Javascript/Core/" target="newTab"><img src='/OpenForum/Images/icons/png/link_go.png' /></a>i" alt="parts<a href="/OpenForum/Javascript/Core/" target="newTab"><img src='/OpenForum/Images/icons/png/link_go.png' /></a>i" title="parts<a href="/OpenForum/Javascript/Core/" target="newTab"><img src='/OpenForum/Images/icons/png/link_go.png' /></a>i"/>] === "undefined" && create===true ) obj<img src="/OpenForum/Editor?pageName=/OpenForum/Javascript/Core/parts<a href="/OpenForum/Javascript/Core/" target="newTab"><img src='/OpenForum/Images/icons/png/link_go.png' /></a>i" alt="parts<a href="/OpenForum/Javascript/Core/" target="newTab"><img src='/OpenForum/Images/icons/png/link_go.png' /></a>i" title="parts<a href="/OpenForum/Javascript/Core/" target="newTab"><img src='/OpenForum/Images/icons/png/link_go.png' /></a>i"/>] = {}; obj = obj<img src="/OpenForum/Editor?pageName=/OpenForum/Javascript/Core/parts<a href="/OpenForum/Javascript/Core/" target="newTab"><img src='/OpenForum/Images/icons/png/link_go.png' /></a>i" alt="parts<a href="/OpenForum/Javascript/Core/" target="newTab"><img src='/OpenForum/Images/icons/png/link_go.png' /></a>i" title="parts<a href="/OpenForum/Javascript/Core/" target="newTab"><img src='/OpenForum/Images/icons/png/link_go.png' /></a>i"/>]; } obj<img src="/OpenForum/Editor?pageName=/OpenForum/Javascript/Core/parts<a href="/OpenForum/Javascript/Core/" target="newTab"><img src='/OpenForum/Images/icons/png/link_go.png' /></a>i" alt="parts<a href="/OpenForum/Javascript/Core/" target="newTab"><img src='/OpenForum/Images/icons/png/link_go.png' /></a>i" title="parts<a href="/OpenForum/Javascript/Core/" target="newTab"><img src='/OpenForum/Images/icons/png/link_go.png' /></a>i"/>] = value; }; self.globalLink = function( part1,part2 ) { OpenForum.setGlobal(part1,OpenForum.evaluate(part1),true); OpenForum.setGlobal(part2,OpenForum.evaluate(part2),true); //console.log( "linked" ); var oldValue1 = OpenForum.getGlobal(part1); var oldValue2 = OpenForum.getGlobal(part2); setInterval( function() { if( OpenForum.getGlobal(part1) != oldValue1 ) { oldValue1 = OpenForum.getGlobal(part1); OpenForum.setGlobal(part2, OpenForum.getGlobal(part1) ); oldValue2 = OpenForum.getGlobal(part2); //console.log( "part1 changed to " + OpenForum.getGlobal(part1) ); } else if( OpenForum.getGlobal(part2) != oldValue2 ) { oldValue2 = OpenForum.getGlobal(part2); OpenForum.setGlobal(part1,OpenForum.getGlobal(part2)); oldValue1 = OpenForum.getGlobal(part1); //console.log( "part2 changed to " + OpenForum.getGlobal(part2) ); } }, 500 ); }; }; OpenForum.getSystemTime = function(callback) { var callTime = new Date().getTime(); if(!callback) { var data = OpenForum.loadFile("/OpenForum/Actions/SystemTime?action=getTime"); var jsonData = JSON.parse(data); var responseTime = new Date().getTime(); return new Date( jsonData.time - (responseTime-callTime) ); } else { OpenForum.loadFile( "/OpenForum/Actions/SystemTime?action=getTime", function(data) { var jsonData = JSON.parse(data); var responseTime = new Date().getTime(); callback( new Date( jsonData.time ) ); } ); } }; OpenForum.stateToJson = function( objectIds ) { var objects = <a href="/OpenForum/Javascript/Core/" target="newTab"><img src='/OpenForum/Images/icons/png/link_go.png' /></a>; if( !isUndefined( objectIds ) ) { for(var o in objectNames) { objects.push( OpenForum.getObject( objectIds<input type='radio' /> ) ); } } else { objects = OpenForum.getObjects(); } var json = {}; for( var o in objects) { var object = objects<input type='radio' />; if( isUndefined(object) ) continue; try{ //Test can be stringified JSON.stringify( object.getValue() ); json<input type='radio' /> = object.getValue(); } catch(e) {} } return json; }; OpenForum.jsonToState = function(json) { for(var j in json) { OpenForum.getObject(o).setValue( json<a href="/OpenForum/Editor?pageName=/OpenForum/Javascript/Core/j"target="editor" style="color: red" title="The page /OpenForum/Editor?pageName=/OpenForum/Javascript/Core/j does not exist. Click to create it.">j</a> ); } }; onload = function() { OpenForum.onload(); }; onunload = function() { OpenForum.onunload(); }; <!-- End of: /OpenForum/Javascript/Core/open-forum-scanner.js--> //==============================================================================================================// //==============================================================================================================// <!-- Source: /OpenForum/Javascript/Core/open-forum-files.js--> //==============================================================================================================// <!--<ul><li> Author: </li> <li> Description: </li> </ul>--> OpenForum.loadScripts = function(scriptURLs,callback) { var scripts="&callback="+callback; var index=1; for(var scriptIndex in scriptURLs) { scripts+="&script"+index+"="+scriptURLs<a href="/OpenForum/Editor?pageName=/OpenForum/Javascript/Core/scriptIndex"target="editor" style="color: red" title="The page /OpenForum/Editor?pageName=/OpenForum/Javascript/Core/scriptIndex does not exist. Click to create it.">scriptIndex</a>; index++; } var fileref = document.createElement("script"); fileref.setAttribute("src",OpenForum.getRoot()+"/OpenForum/Javascripts?action=getScripts"+scripts); fileref.setAttribute("type","text/javascript"); document.getElementsByTagName("head")<a href="/OpenForum/Editor?pageName=/OpenForum/Javascript/Core/0"target="editor" style="color: red" title="The page /OpenForum/Editor?pageName=/OpenForum/Javascript/Core/0 does not exist. Click to create it.">0</a>.appendChild(fileref); }; OpenForum.getAttachments = function(pageName,callBack,matching,withMetaData) { var params = "pageName="+pageName; if(matching) params += "&matching="+matching; if(withMetaData) params += "&metaData=true"; if(callBack) { var action = function(response) { callBack( JSON.parse(response) ); }; Ajax.sendRequest( new AjaxRequest("GET","/OpenForum/Actions/Attachments",params,null,action,null,true)); } else { return JSON.parse( Ajax.sendRequest( new AjaxRequest("GET","/OpenForum/Actions/Attachments",params,null,null,null,false)) ); } }; OpenForum.getSubPages = function(pageName, callBack) { var params = "action=getSubPages&pageName="+pageName; if(callBack) { var action = function(response) { callBack( JSON.parse(response) ); }; Ajax.sendRequest( new AjaxRequest("GET","/OpenForum/Javascript/Tree",params,null,action,null,true)); } else { return Ajax.sendRequest( new AjaxRequest("GET","/OpenForum/Javascript/Tree",params,null,null,null,false)); } }; OpenForum.NO_CACHE = "no-cache"; OpenForum.loadFile = function(fileName,callBack,noCache) { if(noCache) { if(fileName.indexOf("?")!==-1) { fileName += "&ts="+new Date().getTime(); } else { fileName += "?ts="+new Date().getTime(); } } if(callBack) { Ajax.sendRequest( new AjaxRequest("GET",fileName,"",null,callBack,null,true) ); } else { return Ajax.sendRequest( new AjaxRequest("GET",fileName,"",null,null,null,false) ); } }; OpenForum.loadJSON = function(fileName,callBack,noCache) { if(callBack) { var action = function(response) { callBack( JSON.parse(response) ); }; OpenForum.loadFile(fileName,action,noCache); } else { return JSON.parse( OpenForum.loadFile(fileName,null,noCache) ); } }; OpenForum.loadVersion = function(pageName) { if(!pageName) { pageName = window.location.pathname; } OpenForum.loadJSON(pageName+"/release-info.json",function(data) { VERSION = data.version; }, true); }; OpenForum.loadXML = function(fileName,callBack,noCache) { if(callBack) { var action = function(response) { var parser = new DOMParser(); response = parser.parseFromString(response,"text/xml"); callBack( JSON.parse(response) ); }; OpenForum.loadFile(fileName,action,noCache); } else { var text = OpenForum.loadFile(fileName,null,noCache); var parser = new DOMParser(); text = parser.parseFromString(text,"text/xml"); return JSON.parse( text ); } }; OpenForum.loadDataList = function( fileName ) { OpenForum.loadJSON(fileName, function(data) { for(var d in data) { var name = d; var variable = OpenForum.evaluate( name + " = " + JSON.stringify(data<a href="/OpenForum/Editor?pageName=/OpenForum/Javascript/Core/d"target="editor" style="color: red" title="The page /OpenForum/Editor?pageName=/OpenForum/Javascript/Core/d does not exist. Click to create it.">d</a>) + ";" ); var list = document.createElement("datalist"); list.setAttribute("id",name); for(var i in data<a href="/OpenForum/Editor?pageName=/OpenForum/Javascript/Core/d"target="editor" style="color: red" title="The page /OpenForum/Editor?pageName=/OpenForum/Javascript/Core/d does not exist. Click to create it.">d</a>) { var option = document.createElement("option"); option.setAttribute( "value", i ); list.appendChild( option ); } document.body.appendChild( list ); } }); }; OpenForum.saveFile = function(fileName,data,callBack) { var pageName = fileName.substring(0,fileName.lastIndexOf("/")); fileName = fileName.substring(fileName.lastIndexOf("/")+1); data = "pageName="+encodeURIComponent(pageName)+"&fileName="+encodeURIComponent(fileName)+"&data="+encodeURIComponent(data); if(callBack) { Ajax.sendRequest( new AjaxRequest( "POST", "/OpenForum/Actions/Save", "returnType=json", data, function(data) { callBack(JSON.parse(data)); }, null, true)); } else { return JSON.parse( Ajax.sendRequest( new AjaxRequest("POST","/OpenForum/Actions/Save","returnType=json",data,null,null,false)) ); } }; OpenForum.saveJSON = function(fileName,data,callBack) { data = JSON.stringify(data,null,4); return OpenForum.saveFile(fileName,data,callBack); }; OpenForum.saveXML = function(fileName,data,callBack) { data = XMLSerializer.serializeToString(data); return OpenForum.saveFile(fileName,data,callBack); }; OpenForum.appendFile = function(fileName,data,callBack) { var pageName = fileName.substring(0,fileName.lastIndexOf("/")); fileName = fileName.substring(fileName.lastIndexOf("/")+1); var parameters = "action=appendStringToFileNoBackup"+ "&arg0="+encodeURIComponent(pageName)+"&arg1="+encodeURIComponent(fileName)+"&arg2="+encodeURIComponent(data); if(callBack) { return Ajax.sendRequest( new AjaxRequest("GET","/OpenForum/Javascript/OpenForumServer/File",parameters,null,callBack,null,true)); } else { return JSON.parse( Ajax.sendRequest( new AjaxRequest("GET","/OpenForum/Javascript/OpenForumServer/File",parameters,null,null,null,false)) ); } }; OpenForum.deleteFile = function(pageName,fileName,callBack) { var parameters = "pageName="+pageName+ "&fileName="+fileName+ "&returnType=json"; if(callBack) { return Ajax.sendRequest( new AjaxRequest("GET","/OpenForum/Actions/Delete",parameters,null, function(response) { callBack(response.deleted); }, null,true)); } else { var response = Ajax.sendRequest( new AjaxRequest("GET","/OpenForum/Actions/Delete",parameters,null,null,null,false)); return JSON.parse( response ).deleted; } }; OpenForum.copyFile = function(fileName,toFileName,callBack) { var pageName = fileName.substring(0,fileName.lastIndexOf("/")); fileName = fileName.substring(fileName.lastIndexOf("/")+1); var toPageName = toFileName.substring(0,toFileName.lastIndexOf("/")); toFileName = toFileName.substring(toFileName.lastIndexOf("/")+1); var parameters = "pageName="+pageName+ "&fileName="+fileName+ "&newPageName="+toPageName+ "&newFileName="+toFileName+ "&returnType=json"; if(callBack) { return Ajax.sendRequest( new AjaxRequest("GET","/OpenForum/Actions/Copy",parameters,null,callBack,null,true)); } else { return JSON.parse( Ajax.sendRequest( new AjaxRequest("GET","/OpenForum/Actions/Copy",parameters,null,null,null,false))); } }; OpenForum.moveFile = function(fileName,toFileName,callBack) { var pageName = fileName.substring(0,fileName.lastIndexOf("/")); fileName = fileName.substring(fileName.lastIndexOf("/")+1); var toPageName = toFileName.substring(0,toFileName.lastIndexOf("/")); toFileName = toFileName.substring(toFileName.lastIndexOf("/")+1); var parameters = "pageName="+pageName+ "&fileName="+fileName+ "&newPageName="+toPageName+ "&newFileName="+toFileName+ "&returnType=json"; if(callBack) { return Ajax.sendRequest( new AjaxRequest("GET","/OpenForum/Actions/Move",parameters,null,callBack,null,true)); } else { return JSON.parse( Ajax.sendRequest( new AjaxRequest("GET","/OpenForum/Actions/Move",parameters,null,null,null,false)) ); } }; OpenForum.fileExists = function(fileName) { var pageName = fileName.substring(0,fileName.lastIndexOf("/")); fileName = fileName.substring(fileName.lastIndexOf("/")+1); return JSON.parse( Ajax.sendRequest( new AjaxRequest("GET","/OpenForum/Actions/AttachmentExists","pageName="+pageName+"&fileName="+fileName,null,null,null,false)) ); }; OpenForum.uploadFromURL = function(url,uploadPageName,uploadFileName,callback,callbackError) { JSON.get("/OpenForum/Actions/Attach","upload","pageName="+uploadPageName+"&fileName="+uploadFileName+"&url="+url) .onSuccess( function() { if(callback) callback(); }) .onError( function() { if(callbackError) callbackError(); } ).go(); }; OpenForum.uploadFile = function(id,pageName,callBack,errorCallBack,progressCallback) { var fileName = document.getElementById(id).file.value; fileName = fileName.replace(/<br/><br/>/g,"/"); fileName = fileName.substring(fileName.lastIndexOf("/")+1); var result = OpenForum.loadFile("/OpenForum/Actions/AttachmentExists?pageName="+pageName+"&fileName="+fileName); if(result==="true" && confirm("Attachment "+fileName+" exists","Replace this attachment ?")===false ) { return; } var formData = new FormData(document.getElementById( id )); var xhr = new XMLHttpRequest(); if(callBack) { xhr.onload = function() { callBack(); }; } if(errorCallBack) { xhr.onerror = function() { errorCallBack(); }; } if(progressCallback) { xhr.onprogress = function(event) { progressCallback( event.loaded, event.total ); }; } xhr.open('POST', "/OpenForum/Actions/Attach?page="+pageName, true); xhr.send(formData); }; <!-- End of: /OpenForum/Javascript/Core/open-forum-files.js--> //==============================================================================================================// //==============================================================================================================// <!-- Source: /OpenForum/Javascript/Core/open-forum-json.js--> //==============================================================================================================// //<hr/> JSON <hr/> if( typeof(JSON)=="undefined" ) { JSON = {}; } JSON.get = function( page,action,parameters ) { var request = {method: 'GET',page: page,action: action,parameters: parameters, onSuccess: JSON.onSuccess, onError: JSON.onError, go: JSON.go}; return request; }; JSON.post = function( page,action,parameters ) { var request = {method: 'POST',page: page,action: action,parameters: parameters, onSuccess: JSON.onSuccess, onError: JSON.onError, go: JSON.go}; return request; }; JSON.onSuccess = function(onSuccess) { this.onSuccess = function(data) { //var object = JSON.parse(data); var object = OpenForum.evaluate("("+data+")"); onSuccess(object); }; return this; }; JSON.onError = function(onError) { this.onError = function(error) { onError(error); }; return this; }; JSON.go = function() { var request = null; if(this.action && this.action !== null && this.action !== "") request = "action="+this.action; if(this.method=="GET") { if(this.parameters && this.parameters.length>0) { request+="&"+this.parameters; } OpenForum.debug("INFO","JSON.get page:" + this.page + " request:" + request); Ajax.sendRequest( new AjaxRequest(this.method,this.page,request,"",this.onSuccess,this.onError,true) ); } else { if(this.parameters.length<200) { OpenForum.debug("INFO","JSON.post page:" + this.page + " request:" + request + " parameters:" + this.parameters); } else { OpenForum.debug("INFO","JSON.post page:" + this.page + " request:" + request + " parameters:"+this.parameters.substring(0,200)+"... p;arameters size:" + this.parameters.length); } Ajax.sendRequest( new AjaxRequest(this.method,this.page,request,this.parameters,this.onSuccess,this.onError,true) ); } }; JSON.findPath = function( json, path ) { var currentNode = json; path = path.split("."); for( var p in path ) { var found = false; var name = path<a href="/OpenForum/Editor?pageName=/OpenForum/Javascript/Core/p"target="editor" style="color: red" title="The page /OpenForum/Editor?pageName=/OpenForum/Javascript/Core/p does not exist. Click to create it.">p</a>; for(var n in currentNode) { if( n == name ) { found = true; currentNode = currentNode<a href="/OpenForum/Editor?pageName=/OpenForum/Javascript/Core/name"target="editor" style="color: red" title="The page /OpenForum/Editor?pageName=/OpenForum/Javascript/Core/name does not exist. Click to create it.">name</a>; break; } } if( found == false ) return;OpenForum.includeScript("/OpenForum/Editor/Editors/StandaloneEditor.js"); } return currentNode; }; JSON.createPath = function( json, path ) { var currentNode = json; path = path.split("."); for( var p in path ) { var found = false; var name = path<a href="/OpenForum/Editor?pageName=/OpenForum/Javascript/Core/p"target="editor" style="color: red" title="The page /OpenForum/Editor?pageName=/OpenForum/Javascript/Core/p does not exist. Click to create it.">p</a>; for(var n in currentNode) { if( n == name ) { found = true; currentNode = currentNode<a href="/OpenForum/Editor?pageName=/OpenForum/Javascript/Core/name"target="editor" style="color: red" title="The page /OpenForum/Editor?pageName=/OpenForum/Javascript/Core/name does not exist. Click to create it.">name</a>; break; } } if( found == false ) { currentNode<a href="/OpenForum/Editor?pageName=/OpenForum/Javascript/Core/name"target="editor" style="color: red" title="The page /OpenForum/Editor?pageName=/OpenForum/Javascript/Core/name does not exist. Click to create it.">name</a> = {}; currentNode = currentNode<a href="/OpenForum/Editor?pageName=/OpenForum/Javascript/Core/name"target="editor" style="color: red" title="The page /OpenForum/Editor?pageName=/OpenForum/Javascript/Core/name does not exist. Click to create it.">name</a>; } } return currentNode; }; JSON.webStringify = function( json ) { return JSON.stringify( json , null , " " ).replaceAll("<br/>n","<br/>").replaceAll(" ","&nbsp;"); }; <!-- End of: /OpenForum/Javascript/Core/open-forum-json.js--> //==============================================================================================================// //==============================================================================================================// <!-- Source: /OpenForum/Javascript/Core/open-forum-ajax-request.js--> //==============================================================================================================// //<hr/> AjaxRequest <hr/> requestCount = 0; function AjaxRequest(method,url,request,data,onSuccess,onError,asynchronous) { var self=this; self.id = "request_"+requestCount; requestCount++; eval( self.id+"=this;" ); self.method = method; self.url = url; self.request = request; self.data = data; self.onSuccess = onSuccess; self.onError = onError; self.asynchronous = asynchronous; self.transaction = null; this.processTransactionStateChange = function processTransactionStateChange(ev) { if (self.transaction.readyState == 4) { if (self.transaction.status == 200) { onSuccess(self.transaction.responseText); } else if (self.transaction.status === 0) { } else { onError( self.transaction.status,self.transaction.statusText ); } eval( self.id+"=null;" ); } }; } <!-- End of: /OpenForum/Javascript/Core/open-forum-ajax-request.js--> //==============================================================================================================// //==============================================================================================================// <!-- Source: /OpenForum/Javascript/Core/open-forum-ajax.js--> //==============================================================================================================// //<hr/> Ajax <hr/> Ajax = new function() { this.sendRequest = function sendRequest(request) { request.transaction = false; if(window.XMLHttpRequest) { try { request.transaction = new XMLHttpRequest(); } catch(e) { alert(e); request.transaction = false; } } else if(window.ActiveXObject) { try { request.transaction = new ActiveXObject("Msxml2.XMLHTTP"); } catch(e) { alert(e); try { request.transaction = new ActiveXObject("Microsoft.XMLHTTP"); } catch(e) { alert(e); request.transaction = false; } } } if(request.transaction) { if(request.asynchronous === true) { var fn = eval(request.id+".processTransactionStateChange"); request.transaction.onreadystatechange= function(ev){ fn(ev); }; if(request.request!==null && request.request.length>0) { request.transaction.open(request.method, request.url+"?"+request.request,true); request.transaction.setRequestHeader("Content-Type","application/x-www-form-urlencoded"); //request.transaction.setRequestHeader("If-Modified-Since", new Date(0)); request.transaction.send(request.data); } else { request.transaction.open(request.method, request.url,true); request.transaction.setRequestHeader("Content-Type","application/x-www-form-urlencoded"); //request.transaction.setRequestHeader("If-Modified-Since", new Date(0)); request.transaction.send(request.data); } } else { if(request.request!==null && request.request.length>0) { request.transaction.open(request.method, request.url+"?"+request.request,false); request.transaction.setRequestHeader("Content-Type","application/x-www-form-urlencoded"); } else { request.transaction.open(request.method, request.url,false); request.transaction.setRequestHeader("Content-Type","application/x-www-form-urlencoded"); } //request.transaction.setRequestHeader("If-Modified-Since", new Date(0)); request.transaction.send(request.data); this.currentRequest=null; return request.transaction.responseText; } } else { alert("failed"); } }; }; <!-- End of: /OpenForum/Javascript/Core/open-forum-ajax.js--> //==============================================================================================================// //==============================================================================================================// <!-- Source: /OpenForum/Javascript/Core/open-forum-ajax-post.js--> //==============================================================================================================// //<hr/> Post <hr/> function Post() { this.data = <a href="/OpenForum/Javascript/Core/" target="newTab"><img src='/OpenForum/Images/icons/png/link_go.png' /></a>; this.addItem = function(name,value) { this.item = <a href="/OpenForum/Javascript/Core/" target="newTab"><img src='/OpenForum/Images/icons/png/link_go.png' /></a>; this.data<a href="/OpenForum/Editor?pageName=/OpenForum/Javascript/Core/this.data.length"target="editor" style="color: red" title="The page /OpenForum/Editor?pageName=/OpenForum/Javascript/Core/this.data.length does not exist. Click to create it.">this.data.length</a> = this.item; this.item<a href="/OpenForum/Editor?pageName=/OpenForum/Javascript/Core/0"target="editor" style="color: red" title="The page /OpenForum/Editor?pageName=/OpenForum/Javascript/Core/0 does not exist. Click to create it.">0</a> = name; this.item<a href="/OpenForum/Editor?pageName=/OpenForum/Javascript/Core/1"target="editor" style="color: red" title="The page /OpenForum/Editor?pageName=/OpenForum/Javascript/Core/1 does not exist. Click to create it.">1</a> = value; return this; }; this.addForm = function(formId) { form = document.getElementById(formId); for(var loop=0;loop<form.elements.length;loop++) { name=form.elements<a href="/OpenForum/Editor?pageName=/OpenForum/Javascript/Core/loop"target="editor" style="color: red" title="The page /OpenForum/Editor?pageName=/OpenForum/Javascript/Core/loop does not exist. Click to create it.">loop</a>.name; if(name.length>0) { this.addItem(name,form.elements<a href="/OpenForum/Editor?pageName=/OpenForum/Javascript/Core/loop"target="editor" style="color: red" title="The page /OpenForum/Editor?pageName=/OpenForum/Javascript/Core/loop does not exist. Click to create it.">loop</a>.value); } } return this; }; this.getData = function() { var dataString = ""; for(var entry in this.data) { if(dataString.length>0) { dataString +="&"; } dataString += this.data<a href="/OpenForum/Editor?pageName=/OpenForum/Javascript/Core/entry"target="editor" style="color: red" title="The page /OpenForum/Editor?pageName=/OpenForum/Javascript/Core/entry does not exist. Click to create it.">entry</a><a href="/OpenForum/Editor?pageName=/OpenForum/Javascript/Core/0"target="editor" style="color: red" title="The page /OpenForum/Editor?pageName=/OpenForum/Javascript/Core/0 does not exist. Click to create it.">0</a>+"="+encodeURIComponent(this.data<a href="/OpenForum/Editor?pageName=/OpenForum/Javascript/Core/entry"target="editor" style="color: red" title="The page /OpenForum/Editor?pageName=/OpenForum/Javascript/Core/entry does not exist. Click to create it.">entry</a><a href="/OpenForum/Editor?pageName=/OpenForum/Javascript/Core/1"target="editor" style="color: red" title="The page /OpenForum/Editor?pageName=/OpenForum/Javascript/Core/1 does not exist. Click to create it.">1</a>); } return dataString; }; //TODO add get parameters method like <!-- this.data=""; for(this.loop=0;this.loop<dataArray.length;this.loop++) { if(this.loop!=0) { this.data += "&"; } this.data += dataArray<a href="/OpenForum/Editor?pageName=/OpenForum/Javascript/Core/this.loop"target="editor" style="color: red" title="The page /OpenForum/Editor?pageName=/OpenForum/Javascript/Core/this.loop does not exist. Click to create it.">this.loop</a><a href="/OpenForum/Editor?pageName=/OpenForum/Javascript/Core/0"target="editor" style="color: red" title="The page /OpenForum/Editor?pageName=/OpenForum/Javascript/Core/0 does not exist. Click to create it.">0</a>+"="+encodeURIComponent(dataArray<a href="/OpenForum/Editor?pageName=/OpenForum/Javascript/Core/this.loop"target="editor" style="color: red" title="The page /OpenForum/Editor?pageName=/OpenForum/Javascript/Core/this.loop does not exist. Click to create it.">this.loop</a><a href="/OpenForum/Editor?pageName=/OpenForum/Javascript/Core/1"target="editor" style="color: red" title="The page /OpenForum/Editor?pageName=/OpenForum/Javascript/Core/1 does not exist. Click to create it.">1</a>); } --> } <!-- End of: /OpenForum/Javascript/Core/open-forum-ajax-post.js--> //==============================================================================================================// //==============================================================================================================// <!-- Source: /OpenForum/Javascript/Core/open-forum-tree.js--> //==============================================================================================================// //<hr/> Tree <hr/> var NextTreeNodeIndex = 0; var TreeNodes = <a href="/OpenForum/Javascript/Core/" target="newTab"><img src='/OpenForum/Images/icons/png/link_go.png' /></a>; function Tree(elementId,name,attributes,modifier) { var self = this; var jsonModifier = function(json) { if(modifier) modifier(json); }; var root = new TreeNode(name,attributes,null,jsonModifier); self.setJSONModifier = function(newModifier) { modifier = newModifier; }; self.render = function() { var element = document.getElementById(elementId); element.innerHTML = root.render(0); return this; }; self.addChild = function(name,attributes) { return root.addChild(name,attributes); }; self.addJSON = function(node) { return root.addJSON(node); }; self.setJSON = function(node) { root = root.addJSON(node); root.setParent(null); return root; }; self.toJSON = function() { return root.toJSON(); }; self.render(); self.expandAll = function() { root.applyToChildren( function(child){ child.expand(); } ); root.expand(); return this; }; self.collapseAll = function() { root.applyToChildren( function(child){ child.collapse(); } ); root.collapse(); return this; }; self.deleteChild = function(node) { node.parent.deleteChild(node); return this; }; self.getRoot = function() { return root; }; self.expandPath = function(path) { var nodePath = findPath(path); if(nodePath!==null) { nodePath.forEach( function(node) {node.expand(); } ); return true; } else { return false; } }; self.findNode = function(path) { return findPath(path); }; self.init = function() {}; var findPath = function(path) { if(path.charAt(0)==="/") { path = path.substring(1); } var parts = path.split("/"); var node = root; var nodePath = <a href="/OpenForum/Editor?pageName=/OpenForum/Javascript/Core/root"target="editor" style="color: red" title="The page /OpenForum/Editor?pageName=/OpenForum/Javascript/Core/root does not exist. Click to create it.">root</a>; for(var i=0;i<parts.length;i++) { var children = node.getChildren(); for(var c=0;c<children.length;c++) { if(children<a href="/OpenForum/Editor?pageName=/OpenForum/Javascript/Core/c"target="editor" style="color: red" title="The page /OpenForum/Editor?pageName=/OpenForum/Javascript/Core/c does not exist. Click to create it.">c</a>.getName()===parts<a href="/OpenForum/Editor?pageName=/OpenForum/Javascript/Core/i"target="editor" style="color: red" title="The page /OpenForum/Editor?pageName=/OpenForum/Javascript/Core/i does not exist. Click to create it.">i</a>) { node = children<a href="/OpenForum/Editor?pageName=/OpenForum/Javascript/Core/c"target="editor" style="color: red" title="The page /OpenForum/Editor?pageName=/OpenForum/Javascript/Core/c does not exist. Click to create it.">c</a>; nodePath.push(node); break; } } if(c===children.length) { return null; //No path match } } return nodePath; }; } var NextActionId=0; var Actions = <a href="/OpenForum/Javascript/Core/" target="newTab"><img src='/OpenForum/Images/icons/png/link_go.png' /></a>; function Action(config) { var self = this; var fn = OpenForum.evaluate("("+config.fn+")"); var icon = config.icon; var toolTip = config.toolTip; var id = "ActionId"+NextActionId; NextActionId++; Actions<a href="/OpenForum/Editor?pageName=/OpenForum/Javascript/Core/id"target="editor" style="color: red" title="The page /OpenForum/Editor?pageName=/OpenForum/Javascript/Core/id does not exist. Click to create it.">id</a>=this; icon = "/OpenForum/Images/icons/png/" + icon + ".png"; self.call = function(node) { fn(node); }; self.render = function(target) { data="&nbsp;<a href='#' onClick='Actions<a href="/OpenForum/Editor?pageName=/OpenForum/Javascript/Core/<br/>""+id+"<br/>""target="editor" style="color: red" title="The page /OpenForum/Editor?pageName=/OpenForum/Javascript/Core/<br/>""+id+"<br/>" does not exist. Click to create it."><br/>""+id+"<br/>"</a>.call("+target+");return false;'>"+ "<i style='background: url(<br/>""+icon+"<br/>") no-repeat scroll; min-width: 16px; min-height: 16px; display: inline-block;' title='"+toolTip+"'></i></a>"; return data; }; } function TreeNode(name,attributes,newParent,jsonModifier) { var self = this; var id = "TreeNode"+NextTreeNodeIndex; NextTreeNodeIndex++; TreeNodes<a href="/OpenForum/Editor?pageName=/OpenForum/Javascript/Core/id"target="editor" style="color: red" title="The page /OpenForum/Editor?pageName=/OpenForum/Javascript/Core/id does not exist. Click to create it.">id</a> = self; var children = <a href="/OpenForum/Javascript/Core/" target="newTab"><img src='/OpenForum/Images/icons/png/link_go.png' /></a>; var expanded = false; var SPACE = "&nbsp;&nbsp;&nbsp;&nbsp;"; var localDepth = 0; var lazyLoad = null; var parent = newParent; var paint = function() { document.getElementById(id).innerHTML = self.render(localDepth); }; self.paint = paint; self.getId = function() { return id; }; self.setLazyLoad = function(lazyLoadFn) { lazyLoad = lazyLoadFn; return this; }; self.getParent = function() { return parent; }; self.setParent = function(newParent) { parent = newParent; }; self.addChild = function(name,attributes) { var newChild = new TreeNode(name,attributes,self,jsonModifier); children<a href="/OpenForum/Editor?pageName=/OpenForum/Javascript/Core/children.length"target="editor" style="color: red" title="The page /OpenForum/Editor?pageName=/OpenForum/Javascript/Core/children.length does not exist. Click to create it.">children.length</a> = newChild; newChild.parent = self; return newChild; }; self.addJSON = function(node) { if(jsonModifier!==null) jsonModifier(node); var child = self.addChild( node.name,node.attributes ); if(node.leaves) { for(var i in node.leaves) { child.addJSON( node.leaves<a href="/OpenForum/Editor?pageName=/OpenForum/Javascript/Core/i"target="editor" style="color: red" title="The page /OpenForum/Editor?pageName=/OpenForum/Javascript/Core/i does not exist. Click to create it.">i</a> ); } } return child; }; self.importJSON = function(url,action,parameters) { JSON.get(url,action,parameters).onSuccess( function(response) { for(var i in response.leaves) { self.addJSON( response.leaves<a href="/OpenForum/Editor?pageName=/OpenForum/Javascript/Core/i"target="editor" style="color: red" title="The page /OpenForum/Editor?pageName=/OpenForum/Javascript/Core/i does not exist. Click to create it.">i</a> ); } paint(); } ).go(); }; self.toJSON = function() { var json = { name: name, attributes: {}, leaves: <a href="/OpenForum/Javascript/Core/" target="newTab"><img src='/OpenForum/Images/icons/png/link_go.png' /></a> }; for(var a in attributes) { if( typeof a == "string") { json.attributes<a href="/OpenForum/Editor?pageName=/OpenForum/Javascript/Core/a"target="editor" style="color: red" title="The page /OpenForum/Editor?pageName=/OpenForum/Javascript/Core/a does not exist. Click to create it.">a</a> = attributes<a href="/OpenForum/Editor?pageName=/OpenForum/Javascript/Core/a"target="editor" style="color: red" title="The page /OpenForum/Editor?pageName=/OpenForum/Javascript/Core/a does not exist. Click to create it.">a</a>; } } for(var c in children) { json.leaves.push( children<a href="/OpenForum/Editor?pageName=/OpenForum/Javascript/Core/c"target="editor" style="color: red" title="The page /OpenForum/Editor?pageName=/OpenForum/Javascript/Core/c does not exist. Click to create it.">c</a>.toJSON() ); } return json; }; self.deleteChild = function(node) { for(var index in children) { if(children<a href="/OpenForum/Editor?pageName=/OpenForum/Javascript/Core/index"target="editor" style="color: red" title="The page /OpenForum/Editor?pageName=/OpenForum/Javascript/Core/index does not exist. Click to create it.">index</a>.getId()===node.getId()) { children.splice(index,1); return this; } } return this; }; self.isExpanded = function() { return expanded; }; self.expand = function() { if(lazyLoad!==null) { lazyLoad(self); lazyLoad = null; return this; } if(parent && parent.isExpanded()===false) { parent.expand(); } expanded=true; paint(); return this; }; self.collapse = function() { expanded=false; paint(); return this; }; self.toggle = function() { expanded=!expand; paint(); return this; }; self.render = function(depth) { if(!depth) { depth=0; } localDepth = depth; var data = ""; data+="<span id='"+id+"' style='white-space: nowrap;'>"; for(var count=0;count<depth;count++) { data+=SPACE; } if(children.length>0) { if(expanded===false) { data+="<a href='#' onClick='TreeNodes<a href="/OpenForum/Editor?pageName=/OpenForum/Javascript/Core/<br/>""+id+"<br/>""target="editor" style="color: red" title="The page /OpenForum/Editor?pageName=/OpenForum/Javascript/Core/<br/>""+id+"<br/>" does not exist. Click to create it."><br/>""+id+"<br/>"</a>.expand();return false;'>"+ "<i style='background: url(<br/>"/OpenForum/Images/icons/png/add.png<br/>") no-repeat scroll; min-width: 16px; min-height: 16px; display: inline-block;'></i></a>"; } else { data+="<a href='#' onClick='TreeNodes<a href="/OpenForum/Editor?pageName=/OpenForum/Javascript/Core/<br/>""+id+"<br/>""target="editor" style="color: red" title="The page /OpenForum/Editor?pageName=/OpenForum/Javascript/Core/<br/>""+id+"<br/>" does not exist. Click to create it."><br/>""+id+"<br/>"</a>.collapse();return false;'>"+ "<i style='background: url(<br/>"/OpenForum/Images/icons/png/accept.png<br/>") no-repeat scroll; min-width: 16px; min-height: 16px; display: inline-block;'></i></a>"; } } else { data+="&nbsp;"; } if(attributes && attributes.link) { if(attributes.toolTip) { data += "<a href=<br/>"" + attributes.link + "<br/>" title=<br/>""+ attributes.toolTip +"<br/>" target=<br/>"_pageView<br/>">"; } else { data += "<a href=<br/>"" + attributes.link + "<br/>" target=<br/>"_pageView<br/>">"; } if(attributes.icon) { data += "<i style='background: url(<br/>"/OpenForum/Images/icons/png/"+attributes.icon+".png<br/>") no-repeat scroll; min-width: 16px; min-height: 16px; display: inline-block;'></i>"; } data += name; data += "</a>"; } else { if(attributes && attributes.icon) { data += "<i style='background: url(<br/>"/OpenForum/Images/icons/png/"+attributes.icon+".png<br/>") no-repeat scroll; min-width: 16px; min-height: 16px; display: inline-block;'></i>"; } data += name; } if(attributes && attributes.actions) { for(var actionIndex in attributes.actions) { var actionConfig = attributes.actions<a href="/OpenForum/Editor?pageName=/OpenForum/Javascript/Core/actionIndex"target="editor" style="color: red" title="The page /OpenForum/Editor?pageName=/OpenForum/Javascript/Core/actionIndex does not exist. Click to create it.">actionIndex</a>; var action = new Action(actionConfig); data+=action.render("TreeNodes<a href="/OpenForum/Editor?pageName=/OpenForum/Javascript/Core/<br/>""+id+"<br/>""target="editor" style="color: red" title="The page /OpenForum/Editor?pageName=/OpenForum/Javascript/Core/<br/>""+id+"<br/>" does not exist. Click to create it."><br/>""+id+"<br/>"</a>"); } } data+="<br/>"; if(expanded===true) { for(var childIndex in children) { data+=children<a href="/OpenForum/Editor?pageName=/OpenForum/Javascript/Core/childIndex"target="editor" style="color: red" title="The page /OpenForum/Editor?pageName=/OpenForum/Javascript/Core/childIndex does not exist. Click to create it.">childIndex</a>.render(depth+1); } } data+="</span>"; return data; }; self.getName = function() { return name; }; self.setName = function(newName) { name = newName; }; self.getAttribute = function(name) { return attributes<a href="/OpenForum/Editor?pageName=/OpenForum/Javascript/Core/name"target="editor" style="color: red" title="The page /OpenForum/Editor?pageName=/OpenForum/Javascript/Core/name does not exist. Click to create it.">name</a>; }; self.setAttribute = function(name,value) { attributes<a href="/OpenForum/Editor?pageName=/OpenForum/Javascript/Core/name"target="editor" style="color: red" title="The page /OpenForum/Editor?pageName=/OpenForum/Javascript/Core/name does not exist. Click to create it.">name</a> = value; }; self.applyToChildren = function( fn ) { children.forEach( function(child) { fn(child); } ); }; self.getChildren = function() { return children; }; } OpenForum.createFileTree = function(id,root,fileExtension,modifier) { var tree = new Tree(id,"Loading...","",modifier); if( isUndefined(fileExtension) ) { JSON.get("/OpenForum/Javascript/Tree","getPageTree","pageName="+root).onSuccess( function(result) { tree.setJSON(result); tree.render(); tree.getRoot().expand(); tree.init(); } ).go(); } else { JSON.get("/OpenForum/Javascript/Tree","getPageTree","pageName="+root+"&match=.*<br/>."+fileExtension).onSuccess( function(result) { tree.setJSON(result); tree.render(); tree.getRoot().expand(); tree.init(); } ).go(); } return tree; }; <!-- End of: /OpenForum/Javascript/Core/open-forum-tree.js--> //==============================================================================================================// //==============================================================================================================// <!-- Source: /OpenForum/Javascript/Core/open-forum-js-extensions.js--> //==============================================================================================================// //Global extra methods function typeOf( thing ) { return Object.prototype.toString.call( thing ).slice(8, -1).toLowerCase(); } function isArray( thing ) { return typeOf( thing ) == "array"; } function isObject( thing ) { return typeOf( thing ) == "object"; } function isFunction( thing ) { return typeOf( thing ) == "function"; } function isUndefined( thing ) { return typeOf( thing ) == "undefined"; } function isString( thing ) { return typeOf( thing ) == "string"; } function isNumber( thing ) { return typeOf( thing ) == "number"; } function isFloat( thing ) { return thing === +thing && thing !== (thing|0); } function isInteger( thing ) { return thing === +thing && thing === (thing|0); } function isNullOrBlank( thing ) { return ( isUndefined(thing) || thing == null || ( isString( thing ) && thing.trim().length == 0) ); } //<hr/> Math extra methods <hr/> Math.degToRad = function( deg ) { return (deg * Math.PI)/180; }; Math.radToDeg = function( rad ) { return (rad * 180)/Math.PI; }; //<hr/> String extra methods <hr/> String.prototype.contains = function(start) { return (this.indexOf(start)!==-1); }; String.prototype.startsWith = function(start) { return (this.indexOf(start)===0); }; String.prototype.endsWith = function(end) { if(!this.contains(end)) return false; return (this.lastIndexOf(end)===this.length-end.length); }; String.prototype.between = function(start,end) { if(!this.contains(start) || !this.contains(end)) return; return this.substring(this.indexOf(start)+start.length,this.indexOf(end)); }; String.prototype.before = function (end) { if(!this.contains(end)) return; return this.substring(0,this.indexOf(end)); }; String.prototype.beforeLast = function (end) { if(!this.contains(end)) return; return this.substring(0,this.lastIndexOf(end)); }; String.prototype.after = function (start) { if(!this.contains(start)) return; return this.substring(this.indexOf(start)+start.length); }; String.prototype.afterLast = function (start) { if(!this.contains(start)) return; return this.substring(this.lastIndexOf(start)+start.length); }; String.prototype.replaceAll = function(find,replace) { return this.replace( new RegExp(find,"g"), replace); }; String.prototype.padBefore = function(padding,targetLength) { var result = this; while(result.length<targetLength) { result = padding+result; } return result; }; String.prototype.padAfter = function(padding) { var result = this; while(result.length<targetLength) { result = result+padding; } return result; }; //<hr/> Date extra methods Date.prototype.getDisplayString = function() { return (""+this).substring(0,24); }; Date.prototype.SECOND_IN_MILLIS = 1000; Date.prototype.MINUTE_IN_MILLIS = Date.prototype.SECOND_IN_MILLIS*60; Date.prototype.HOUR_IN_MILLIS = Date.prototype.MINUTE_IN_MILLIS*60; Date.prototype.DAY_IN_MILLIS = Date.prototype.HOUR_IN_MILLIS*24; Date.prototype.clone = function() { return new Date( this.getTime() ); }; Date.prototype.toISODateString = function() { return this.toISOString().substring(0,10); }; Date.prototype.plusSeconds = function(seconds) { this.setTime( this.getTime()+(this.SECOND_IN_MILLIS*seconds) ); return this; }; Date.prototype.plusMinutes = function(minutes) { this.setTime( this.getTime()+(this.HOUR_IN_MILLIS*minutes) ); return this; }; Date.prototype.plusHours = function(hours) { this.setTime( this.getTime()+(this.HOUR_IN_MILLIS*hours) ); return this; }; Date.prototype.plusDays = function(days) { this.setTime( this.getTime()+(this.DAY_IN_MILLIS*days) ); return this; }; Date.prototype.plusMonths = function(months) { this.setMonth( this.getMonth()+months ); return this; }; Date.prototype.plusYears = function(years) { this.setYear( this.getYears()+years ); return this; }; Date.prototype.isOnOrAfter = function(date) { return (Math.floor(this.getTime()/this.DAY_IN_MILLIS)>=Math.floor(date.getTime()/this.DAY_IN_MILLIS)); }; Date.prototype.isAfter = function(date) { return (this.getTime()>date.getTime()); }; Date.prototype.isBefore = function(date) { return (this.getTime()<date.getTime()); }; Date.prototype.isOnOrBefore = function(date) { return (Math.floor(this.getTime()/this.DAY_IN_MILLIS)<=Math.floor(date.getTime()/this.DAY_IN_MILLIS)); }; //<hr/> New type, time var Time = function(hours,minutes,seconds) { var self = this; if(!hours) hours = 0; var parts = hours.split(":"); if(parts.length>1) { hours = parts<a href="/OpenForum/Editor?pageName=/OpenForum/Javascript/Core/0"target="editor" style="color: red" title="The page /OpenForum/Editor?pageName=/OpenForum/Javascript/Core/0 does not exist. Click to create it.">0</a>; } if(parts<a href="/OpenForum/Editor?pageName=/OpenForum/Javascript/Core/1"target="editor" style="color: red" title="The page /OpenForum/Editor?pageName=/OpenForum/Javascript/Core/1 does not exist. Click to create it.">1</a>) { minutes = parts<a href="/OpenForum/Editor?pageName=/OpenForum/Javascript/Core/1"target="editor" style="color: red" title="The page /OpenForum/Editor?pageName=/OpenForum/Javascript/Core/1 does not exist. Click to create it.">1</a>; } if(parts<a href="/OpenForum/Editor?pageName=/OpenForum/Javascript/Core/2"target="editor" style="color: red" title="The page /OpenForum/Editor?pageName=/OpenForum/Javascript/Core/2 does not exist. Click to create it.">2</a>) { seconds = parts<a href="/OpenForum/Editor?pageName=/OpenForum/Javascript/Core/1"target="editor" style="color: red" title="The page /OpenForum/Editor?pageName=/OpenForum/Javascript/Core/1 does not exist. Click to create it.">1</a>; } if(!minutes) minutes = 0; if(!seconds) seconds = 0; hours = parseInt(hours); minutes = parseInt(minutes); seconds = parseInt(seconds); self.getTime = function() { return <p>hours * 3600) + (minutes * 60) + seconds)*1000; }; self.plusSeconds = function( newSeconds ) { seconds += parseInt(newSeconds); minutes += Math.floor(seconds/60); seconds = seconds % 60; hours += Math.floor(minutes/60); minutes = minutes % 60; }; self.getHours = function() { return hours; }; self.getMinutes = function() { return minutes; }; self.getSeconds = function() { return seconds; }; self.setHours = function(newHours) { hours=newHours; }; self.setMinutes = function(newMinutes) { minutes=newMinutes; }; self.setSeconds = function(newSeconds) { seconds=newSeconds; }; self.plusMinutes = function( newMinutes ) { minutes += parseInt(newMinutes); hours += Math.floor(minutes/60); minutes = minutes % 60; }; self.plusHours = function( newHours ) { hours += parseInt(newHours); }; self.isAtOrAfter = function(time) { if( self.getTime() >= time.getTime() ) return true; else return false; }; self.isAfter = function(time) { if( self.getTime() > time.getTime() ) return true; else return false; }; self.isAtOrBefore = function(time) { if( self.getTime() <= time.getTime() ) return true; else return false; }; self.isBefore = function(time) { if( self.getTime() < time.getTime() ) return true; else return false; }; self.toString = function() { return ("" + hours).padBefore("0",2) + ":" + ("" + minutes).padBefore("0",2) + ":" + ("" + seconds).padBefore("0",2); }; self.toShortString = function() { return ("" + hours).padBefore("0",2) + ":" + ("" + minutes).padBefore("0",2); }; }; //<hr/> Async processing helper function Process() { var callFn; var waitTest; var thenFn; var self = this; self.call = function(newCallFn) { callFn = newCallFn; return self; }; self.waitFor = function(newWaitTest) { waitTest = newWaitTest; return self; }; self.then = function(newThenFn) { thenFn = newThenFn; return self; }; var wait = function() { if(waitTest()===false) { setTimeout(wait,100); } else { if(thenFn) thenFn(); } }; self.run = function(data) { if(callFn) callFn(data); wait(); }; } <!-- End of: /OpenForum/Javascript/Core/open-forum-js-extensions.js--> //==============================================================================================================// //==============================================================================================================// <!-- Source: /OpenForum/Javascript/Core/open-forum-object.js--> //==============================================================================================================// //<hr/> OpenForumObject <hr/> function OpenForumObject(objectId) { var self = this; var id = objectId; var value = null; var targets=<a href="/OpenForum/Javascript/Core/" target="newTab"><img src='/OpenForum/Images/icons/png/link_go.png' /></a>; var listeners=<a href="/OpenForum/Javascript/Core/" target="newTab"><img src='/OpenForum/Images/icons/png/link_go.png' /></a>; var quiet = false; OpenForum.debug("INFO","Object " + id + " created"); var notifyListeners = function() { if(quiet) { OpenForum.debug("INFO","Object " + id + " has changed but is quiet"); return; } for(var listenerIndex in listeners) { var listener = listeners<a href="/OpenForum/Editor?pageName=/OpenForum/Javascript/Core/listenerIndex"target="editor" style="color: red" title="The page /OpenForum/Editor?pageName=/OpenForum/Javascript/Core/listenerIndex does not exist. Click to create it.">listenerIndex</a>; listener( self ); if(listener.getId) { OpenForum.debug("INFO","Object " + id + " has notified " + listener.getId() + "of change"); } } }; self.getId = function() { return id; }; self.add = function(target) { targets.push(target); if(value != null) { // If you want to join, you have to take on the value var hold = value; value = null; // Force the value to be set in all targets as will be seen as a change self.setValueQuietly(hold); // Not a real change of value, so quietly does it } if(target.getId) { OpenForum.debug("INFO","Object " + id + " has added new target " + target.getId(</p>; } else { OpenForum.debug("INFO","Object " + id + " has added new target " + target); } }; self.reset = function() { value = null; }; self.setValueQuietly = function (newValue,exclude,clone) { quiet = true; self.setValue(newValue,exclude,clone); quiet = false; }; self.setValue = function(newValue,exclude,clone) { if(OpenForum.isEqual(newValue,value)) { return; } OpenForum.debug("INFO","Object " + id + " value set to " + newValue); if(clone && typeof newValue == "object") { value = OpenForum.clone(newValue); } else { value = newValue; } for(var targetIndex in targets) { var target = targets<a href="/OpenForum/Editor?pageName=/OpenForum/Javascript/Core/targetIndex"target="editor" style="color: red" title="The page /OpenForum/Editor?pageName=/OpenForum/Javascript/Core/targetIndex does not exist. Click to create it.">targetIndex</a>; if(target===null) { continue; } if(exclude && exclude===target) { continue; } if(typeof(target.type)!="undefined" && target.type=="checkbox") { target.checked = value; } else if(typeof(target.type)!="undefined" && target.type=="select-multiple") { for(var i in target.options) { target.options<a href="/OpenForum/Editor?pageName=/OpenForum/Javascript/Core/i"target="editor" style="color: red" title="The page /OpenForum/Editor?pageName=/OpenForum/Javascript/Core/i does not exist. Click to create it.">i</a>.selected=false; for(var j in value) { if(target.options<a href="/OpenForum/Editor?pageName=/OpenForum/Javascript/Core/i"target="editor" style="color: red" title="The page /OpenForum/Editor?pageName=/OpenForum/Javascript/Core/i does not exist. Click to create it.">i</a>.value==value<a href="/OpenForum/Editor?pageName=/OpenForum/Javascript/Core/j"target="editor" style="color: red" title="The page /OpenForum/Editor?pageName=/OpenForum/Javascript/Core/j does not exist. Click to create it.">j</a>) { target.options<a href="/OpenForum/Editor?pageName=/OpenForum/Javascript/Core/i"target="editor" style="color: red" title="The page /OpenForum/Editor?pageName=/OpenForum/Javascript/Core/i does not exist. Click to create it.">i</a>.selected=true; } } } OpenForum.setGlobal(id,value); } else if(typeof(target.value)!="undefined") { target.value = value; } else if(target.innerHTML) { if(value==="") { target.innerHTML = " "; } else { target.innerHTML = ""+value; } } } }; self.getValue = function() { return value; }; self.scan = function() { for(var targetIndex=0; targetIndex<targets.length; targetIndex++) { try { var target = targets<a href="/OpenForum/Editor?pageName=/OpenForum/Javascript/Core/targetIndex"target="editor" style="color: red" title="The page /OpenForum/Editor?pageName=/OpenForum/Javascript/Core/targetIndex does not exist. Click to create it.">targetIndex</a>; if(target===null) { continue; } if(typeof(target.type)!="undefined" && target.type=="checkbox") { if(target.checked!==value) { //If UI has been checked self.setValue(target.checked,target,true); OpenForum.setGlobal(id,target.checked); OpenForum.debug("INFO","Object (checkbox) " + id + " value set to " + value); notifyListeners(); return; } } else if(target.type=="select-multiple") { var selected = <a href="/OpenForum/Javascript/Core/" target="newTab"><img src='/OpenForum/Images/icons/png/link_go.png' /></a>; for(var i in target.options) { if(target.options<a href="/OpenForum/Editor?pageName=/OpenForum/Javascript/Core/i"target="editor" style="color: red" title="The page /OpenForum/Editor?pageName=/OpenForum/Javascript/Core/i does not exist. Click to create it.">i</a>.selected) selected.push(target.options<a href="/OpenForum/Editor?pageName=/OpenForum/Javascript/Core/i"target="editor" style="color: red" title="The page /OpenForum/Editor?pageName=/OpenForum/Javascript/Core/i does not exist. Click to create it.">i</a>.value); } //If UI selection changes if(OpenForum.isEqual(value,selected)==false) { self.setValue(selected,target,true); OpenForum.setGlobal(id,selected); OpenForum.debug("INFO","Object (select-multiple) " + id + " value set to " + selected); notifyListeners(); return; } } else if(typeof(target.value)!="undefined") { //If UI value changes if(target.value!=value) { self.setValue(target.value,target,true); OpenForum.setGlobal(id,value); OpenForum.debug("INFO","Object " + id + " value set to " + value); notifyListeners(); return; } } } catch(e) { OpenForum.debug("ERROR","Object " + id + " error in setting value (case 1).", e); } } try{ var testId = id; if( OpenForum.globalExists(testId) ) { //If bound js variable changes if( OpenForum.isEqual(value,OpenForum.getGlobal(testId))===false) { self.setValue(OpenForum.getGlobal(testId),null,true); notifyListeners(); } } else { OpenForum.setGlobal(testId,value,true); OpenForum.debug("INFO","Global object created " + testId + " and value set to " + value); } } catch(e) { OpenForum.debug("ERROR","Object " + id + " error in setting value (case 2).", e); } }; self.addListener = function(listener) { listeners.push(listener); if(listener.getId) { OpenForum.debug("INFO","Object " + id + " has added new listener " + listener.getId()); } else { OpenForum.debug("INFO","Object " + id + " has added new listener " + listener); } }; self.removeListener = function(listener) { for(var listenerIndex in listeners) { if(listeners<a href="/OpenForum/Editor?pageName=/OpenForum/Javascript/Core/listenerIndex"target="editor" style="color: red" title="The page /OpenForum/Editor?pageName=/OpenForum/Javascript/Core/listenerIndex does not exist. Click to create it.">listenerIndex</a>.getId && listener.getId && listeners<a href="/OpenForum/Editor?pageName=/OpenForum/Javascript/Core/listenerIndex"target="editor" style="color: red" title="The page /OpenForum/Editor?pageName=/OpenForum/Javascript/Core/listenerIndex does not exist. Click to create it.">listenerIndex</a>.getId() == listener.getId() ) { listeners.splice(listenerIndex,1); break; } else if (listeners<a href="/OpenForum/Editor?pageName=/OpenForum/Javascript/Core/listenerIndex"target="editor" style="color: red" title="The page /OpenForum/Editor?pageName=/OpenForum/Javascript/Core/listenerIndex does not exist. Click to create it.">listenerIndex</a> == listener) { listeners.splice(listenerIndex,1); break; } } if(listener.getId) { OpenForum.debug("INFO","Object " + id + " has added removed a listener " + listener.getId()); } else { OpenForum.debug("INFO","Object " + id + " has added removed a listener " + listener); } }; self.getId = function() { return id; }; self.getTargets = function() { return targets; }; } <!-- End of: /OpenForum/Javascript/Core/open-forum-object.js--> //==============================================================================================================// //==============================================================================================================// <!-- Source: /OpenForum/Javascript/Core/open-forum-table.js--> //==============================================================================================================// //<hr/> OpenForumTable <hr/> function OpenForumTable(node) { var self = this; var rowNode = node; var tableNode = node.parentNode; var value; var id; if(tableNode.attributes && tableNode.attributes<a href="/OpenForum/Editor?pageName=/OpenForum/Javascript/Core/'of-id'"target="editor" style="color: red" title="The page /OpenForum/Editor?pageName=/OpenForum/Javascript/Core/'of-id' does not exist. Click to create it.">'of-id'</a>) { id=tableNode.attributes<a href="/OpenForum/Editor?pageName=/OpenForum/Javascript/Core/'of-id'"target="editor" style="color: red" title="The page /OpenForum/Editor?pageName=/OpenForum/Javascript/Core/'of-id' does not exist. Click to create it.">'of-id'</a>.value; <!--if( this.tableNode.value ) { this.tableNode.value = eval(this.tableNode.id); eval(this.tableNode.id+"=<br/>""+this.value+"<br/>";") }--> } else if(tableNode.id) { id=tableNode.id; } else { id="OFTable"+OpenForum.getNextId(); } node.parentNode.removeChild(node); var temp = document.createElement("table"); temp.appendChild(node); var rowHTML = temp.innerHTML; var repeatFor = node.attributes<a href="/OpenForum/Editor?pageName=/OpenForum/Javascript/Core/'of-repeatFor'"target="editor" style="color: red" title="The page /OpenForum/Editor?pageName=/OpenForum/Javascript/Core/'of-repeatFor' does not exist. Click to create it.">'of-repeatFor'</a>.value; var target = repeatFor.substring(repeatFor.indexOf(" in ")+4); var element = repeatFor.substring(0,repeatFor.indexOf(" in ")); var targetObject = OpenForum.getObject(target); var targetObjectSignature = OpenForum.createObjectSignature( targetObject.getValue() ); if(id.indexOf("OFTable")===0) id += "_" + repeatFor.replaceAll(" ","_"); OpenForum.debug("INFO","Added OpenForum table " + repeatFor + " as " + id); var tableTop = tableNode.innerHTML; tableNode.id = id; self.setTableNode = function(newTableNode) { tableNode = newTableNode; }; self.reset = function() { targetObjectSignature = null; value = null; }; self.updateQuietly = function() { targetObjectSignature = OpenForum.createObjectSignature( targetObject.getValue() ); }; self.refresh = function() { try { if(tableNode.attributes && tableNode.attributes<a href="/OpenForum/Editor?pageName=/OpenForum/Javascript/Core/'of-id'"target="editor" style="color: red" title="The page /OpenForum/Editor?pageName=/OpenForum/Javascript/Core/'of-id' does not exist. Click to create it.">'of-id'</a> && typeof tableNode.value != "undefined" ) { //Not sure what the empty string was there for, but it stops select working //if( this.tableNode.value!=this.value && this.value!="") { if( tableNode.value!=value) { value = tableNode.value; OpenForum.setGlobal(tableNode.id,value); OpenForum.debug("INFO","Table " + id + " value changed to " + value); } else { var newValue = OpenForum.getGlobal(tableNode.id); if( typeof tableNode.value !== "undefined" && tableNode.value!=newValue && typeof newValue !== "undefined" && newValue !== null ) { tableNode.value=newValue; value = newValue; if(tableNode.value === newValue) { OpenForum.debug("INFO","Table " + id + " value changed to " + value); } } } } } catch(e) { OpenForum.debug("ERROR","Table " + id + " set value failed.", e); } //check if changed var objectSignature = OpenForum.createObjectSignature( targetObject.getValue() ); if(objectSignature==targetObjectSignature) { return; } var errors = false; var tableData = tableTop; var collection = targetObject.getValue(); for( var elementIndex in collection ) { try { var item = {}; item<a href="/OpenForum/Editor?pageName=/OpenForum/Javascript/Core/element"target="editor" style="color: red" title="The page /OpenForum/Editor?pageName=/OpenForum/Javascript/Core/element does not exist. Click to create it.">element</a>= collection<a href="/OpenForum/Editor?pageName=/OpenForum/Javascript/Core/elementIndex"target="editor" style="color: red" title="The page /OpenForum/Editor?pageName=/OpenForum/Javascript/Core/elementIndex does not exist. Click to create it.">elementIndex</a>; item<a href="/OpenForum/Editor?pageName=/OpenForum/Javascript/Core/element"target="editor" style="color: red" title="The page /OpenForum/Editor?pageName=/OpenForum/Javascript/Core/element does not exist. Click to create it.">element</a>.index = elementIndex; var data = ""+rowHTML; while(data.indexOf(OpenForum.FIELD_DELIMETER_START)!=-1) { var name = data.substring(data.indexOf(OpenForum.FIELD_DELIMETER_START)+2,data.indexOf(OpenForum.FIELD_DELIMETER_END)); var rowValue; if(name.indexOf(".")===-1) { if(name==element) { rowValue = item<a href="/OpenForum/Editor?pageName=/OpenForum/Javascript/Core/element"target="editor" style="color: red" title="The page /OpenForum/Editor?pageName=/OpenForum/Javascript/Core/element does not exist. Click to create it.">element</a>; } else { rowValue = OpenForum.getGlobal(name); } } else { var parts = name.split("."); rowValue = item; for(var part in parts) { if(parts<a href="/OpenForum/Editor?pageName=/OpenForum/Javascript/Core/part"target="editor" style="color: red" title="The page /OpenForum/Editor?pageName=/OpenForum/Javascript/Core/part does not exist. Click to create it.">part</a>.indexOf("(")!==-1) { var fn = parts<a href="/OpenForum/Editor?pageName=/OpenForum/Javascript/Core/part"target="editor" style="color: red" title="The page /OpenForum/Editor?pageName=/OpenForum/Javascript/Core/part does not exist. Click to create it.">part</a>.substring(0,parts<a href="/OpenForum/Editor?pageName=/OpenForum/Javascript/Core/part"target="editor" style="color: red" title="The page /OpenForum/Editor?pageName=/OpenForum/Javascript/Core/part does not exist. Click to create it.">part</a>.indexOf("(")); var call = parts<a href="/OpenForum/Editor?pageName=/OpenForum/Javascript/Core/part"target="editor" style="color: red" title="The page /OpenForum/Editor?pageName=/OpenForum/Javascript/Core/part does not exist. Click to create it.">part</a>.substring(parts<a href="/OpenForum/Editor?pageName=/OpenForum/Javascript/Core/part"target="editor" style="color: red" title="The page /OpenForum/Editor?pageName=/OpenForum/Javascript/Core/part does not exist. Click to create it.">part</a>.indexOf("("),parts<a href="/OpenForum/Editor?pageName=/OpenForum/Javascript/Core/part"target="editor" style="color: red" title="The page /OpenForum/Editor?pageName=/OpenForum/Javascript/Core/part does not exist. Click to create it.">part</a>.indexOf(")")).split(","); rowValue = rowValue<a href="/OpenForum/Editor?pageName=/OpenForum/Javascript/Core/fn"target="editor" style="color: red" title="The page /OpenForum/Editor?pageName=/OpenForum/Javascript/Core/fn does not exist. Click to create it.">fn</a>.apply( this,call ); } else if(parts<a href="/OpenForum/Editor?pageName=/OpenForum/Javascript/Core/part"target="editor" style="color: red" title="The page /OpenForum/Editor?pageName=/OpenForum/Javascript/Core/part does not exist. Click to create it.">part</a>.indexOf("=")!==-1) { var pName = parts<a href="/OpenForum/Editor?pageName=/OpenForum/Javascript/Core/part"target="editor" style="color: red" title="The page /OpenForum/Editor?pageName=/OpenForum/Javascript/Core/part does not exist. Click to create it.">part</a>.substring(0,parts<a href="/OpenForum/Editor?pageName=/OpenForum/Javascript/Core/part"target="editor" style="color: red" title="The page /OpenForum/Editor?pageName=/OpenForum/Javascript/Core/part does not exist. Click to create it.">part</a>.indexOf("=")); var value = parts<a href="/OpenForum/Editor?pageName=/OpenForum/Javascript/Core/part"target="editor" style="color: red" title="The page /OpenForum/Editor?pageName=/OpenForum/Javascript/Core/part does not exist. Click to create it.">part</a>.substring(parts<a href="/OpenForum/Editor?pageName=/OpenForum/Javascript/Core/part"target="editor" style="color: red" title="The page /OpenForum/Editor?pageName=/OpenForum/Javascript/Core/part does not exist. Click to create it.">part</a>.indexOf("=")+1).split("?"); if( rowValue<a href="/OpenForum/Editor?pageName=/OpenForum/Javascript/Core/pName"target="editor" style="color: red" title="The page /OpenForum/Editor?pageName=/OpenForum/Javascript/Core/pName does not exist. Click to create it.">pName</a> == value<a href="/OpenForum/Editor?pageName=/OpenForum/Javascript/Core/0"target="editor" style="color: red" title="The page /OpenForum/Editor?pageName=/OpenForum/Javascript/Core/0 does not exist. Click to create it.">0</a> ) { rowValue = value<a href="/OpenForum/Editor?pageName=/OpenForum/Javascript/Core/1"target="editor" style="color: red" title="The page /OpenForum/Editor?pageName=/OpenForum/Javascript/Core/1 does not exist. Click to create it.">1</a>; } else { rowValue = ""; } }else { rowValue = rowValue<img src="/OpenForum/Editor?pageName=/OpenForum/Javascript/Core/parts<a href="/OpenForum/Javascript/Core/" target="newTab"><img src='/OpenForum/Images/icons/png/link_go.png' /></a>part" alt="parts<a href="/OpenForum/Javascript/Core/" target="newTab"><img src='/OpenForum/Images/icons/png/link_go.png' /></a>part" title="parts<a href="/OpenForum/Javascript/Core/" target="newTab"><img src='/OpenForum/Images/icons/png/link_go.png' /></a>part"/>]; } } } var dataStart = data.substring(0,data.indexOf(OpenForum.FIELD_DELIMETER_START)); var dataEnd = data.substring(data.indexOf(OpenForum.FIELD_DELIMETER_END)+2); if(dataStart.indexOf("of-if=<br/>"")==dataStart.length-7) { data = dataStart.substring(0,dataStart.indexOf("of-if=<br/>""))+ rowValue+ dataEnd.substring(1); } else { data = dataStart + rowValue + dataEnd; } if( tableNode.type=="select-one") { if(OpenForum.getGlobal(id) === rowValue ) { data = data.replace("selected=<br/>"<br/>"","selected"); OpenForum.debug("INFO","Table " + id + " selected = " + rowValue); } else { data = data.replace("selected=<br/>"<br/>"",""); } } } tableData += data; } catch(e) { OpenForum.debug("ERROR","Table " + id + " refresh failed.", e); //Fail quietly errors = true; } } OpenForum.debug("INFO","Table " + id + " updated."); tableNode.innerHTML=tableData; OpenForum.preparePage(tableNode); //Only update the signature once the data is in the view without errors if(errors==false) { targetObjectSignature=objectSignature; } }; self.getId = function() { return id; }; } <!-- End of: /OpenForum/Javascript/Core/open-forum-table.js--> //==============================================================================================================// //==============================================================================================================// <!-- Source: /OpenForum/Javascript/Core/open-forum-browser.js--> //==============================================================================================================// if(!OpenForum) { OpenForum = {}; } OpenForum.Browser={}; OpenForum.Browser.download = function(fileName,data){ var hiddenElement = document.createElement('a'); hiddenElement.href = 'data:attachment/text,' + encodeURIComponent(data); hiddenElement.target = '_blank'; hiddenElement.style.display = "none"; hiddenElement.download = fileName; document.body.appendChild(hiddenElement); hiddenElement.click(); }; OpenForum.Browser.upload = function(callback,onError) { var hiddenElement = document.createElement('input'); hiddenElement.type = "file"; hiddenElement.style.display = "none"; hiddenElement.onchange = function(event) { var reader = new FileReader(); reader.onload = function(event) { if(event.target.readyState != 2) return; if(event.target.error) { if(onError) { onError('Error while reading file'); } else { alert('Error while reading file'); } return; } callback( event.target.result ); }; reader.readAsText(event.target.files<a href="/OpenForum/Editor?pageName=/OpenForum/Javascript/Core/0"target="editor" style="color: red" title="The page /OpenForum/Editor?pageName=/OpenForum/Javascript/Core/0 does not exist. Click to create it.">0</a>); }; document.body.appendChild(hiddenElement); hiddenElement.click(); }; OpenForum.Browser.uploadDataUrl = function(callback,onError) { var hiddenElement = document.createElement('input'); hiddenElement.type = "file"; hiddenElement.style.display = "none"; hiddenElement.onchange = function(event) { var reader = new FileReader(); reader.onload = function(event) { if(event.target.readyState != 2) return; if(event.target.error) { if(onError) { onError('Error while reading file'); } else { alert('Error while reading file'); } return; } callback( event.target.result ); }; reader.readAsDataURL(event.target.files<a href="/OpenForum/Editor?pageName=/OpenForum/Javascript/Core/0"target="editor" style="color: red" title="The page /OpenForum/Editor?pageName=/OpenForum/Javascript/Core/0 does not exist. Click to create it.">0</a>); }; document.body.appendChild(hiddenElement); hiddenElement.click(); }; OpenForum.Browser.overrideSave = function(fn) { $(document).bind('keydown', function(e) { if(e.ctrlKey && (e.which == 83)) { e.preventDefault(); fn(); return false; } }); }; OpenForum.Browser.isBrowserStorageEnabled = function() { return ( typeof OpenForum.findBrowserFileTreeNode != "undefined" ); }; OpenForum.Browser.enableBrowserStorage = function() { if( OpenForum.Browser.isBrowserStorageEnabled() ) { console.log("Browser Storage already enabled"); return; } OpenForum.findBrowserFileTreeNode = function( pageName ) { pageName = pageName.replace("browser:/",""); var list = OpenForum.Storage.find("browserFS "+pageName+"*."); var data = <a href="/OpenForum/Javascript/Core/" target="newTab"><img src='/OpenForum/Images/icons/png/link_go.png' /></a>; var found = {}; for(var a in list) { var fileName = list<a href="/OpenForum/Editor?pageName=/OpenForum/Javascript/Core/a"target="editor" style="color: red" title="The page /OpenForum/Editor?pageName=/OpenForum/Javascript/Core/a does not exist. Click to create it.">a</a>.key.substring( pageName.length + 10); if(fileName.startsWith("/")) fileName = fileName.substring(1); if(fileName.indexOf("/")!=-1) { var page = fileName.substring(0,fileName.indexOf("/")); if( page.length==0 ) continue; if( typeof found<a href="/OpenForum/Editor?pageName=/OpenForum/Javascript/Core/page"target="editor" style="color: red" title="The page /OpenForum/Editor?pageName=/OpenForum/Javascript/Core/page does not exist. Click to create it.">page</a> == "undefined" ) { data.push( {fileName: page, type: "page"} ); found<a href="/OpenForum/Editor?pageName=/OpenForum/Javascript/Core/page"target="editor" style="color: red" title="The page /OpenForum/Editor?pageName=/OpenForum/Javascript/Core/page does not exist. Click to create it.">page</a> = true; } } else { if( fileName.length==0 ) continue; if( typeof found<a href="/OpenForum/Editor?pageName=/OpenForum/Javascript/Core/fileName"target="editor" style="color: red" title="The page /OpenForum/Editor?pageName=/OpenForum/Javascript/Core/fileName does not exist. Click to create it.">fileName</a> == "undefined" ) { var extension = fileName.substring( fileName.indexOf(".")+1 ); data.push( {fileName: fileName, type: "file", extension: ""} ); found<a href="/OpenForum/Editor?pageName=/OpenForum/Javascript/Core/fileName"target="editor" style="color: red" title="The page /OpenForum/Editor?pageName=/OpenForum/Javascript/Core/fileName does not exist. Click to create it.">fileName</a> = true; } } } return data; }; OpenForum.remoteSave = OpenForum.saveFile; OpenForum.saveFile = function(fileName,data,callBack) { if(fileName.startsWith("browser://")) { fileName = fileName.replace("browser:/","browserFS "); OpenForum.Storage.set(fileName,data); if( isUndefined(OpenForum.inq) == false ) OpenForum.inq.send( { type: "browserFS", event: "fileChanged", fileName: fileName } ); var simpleFileName = fileName.substring( fileName.lastIndexOf("/")+1 ); var extension = simpleFileName.substring( simpleFileName.lastIndexOf(".")+1 ); OpenForum.findBrowserFileTreeNode( fileName, { type: "file", size: data.length, created: new Date().getTime(), updated: new Date().getTime(), fileName: simpleFileName, extension: extension } ); var response = {"result":"ok","message":"Saved " + fileName,"saved":true}; if(callBack) { callBack( response ); } else { return response; } } else { return OpenForum.remoteSave(fileName,data,callBack); } }; OpenForum.remoteDelete = OpenForum.deleteFile; OpenForum.deleteFile = function(pageName,fileName,callBack) { if(fileName.startsWith("browser://")) { fileName = fileName.replace("browser:/","browserFS "); OpenForum.findBrowserFileTreeNode( fileName, { deleted: true } ); if( isUndefined(OpenForum.inq) == false ) OpenForum.inq.send( { type: "browserFS", event: "fileDeleted", fileName: fileName } ); var response = {"result":"ok","message":"Deleted " + fileName,"deleted":true}; if(callBack) { callBack( response ); } else { return response; } } else { return OpenForum.remoteDelete(pageName,fileName,callBack); } }; OpenForum.remoteLoad = OpenForum.loadFile; OpenForum.loadFile = function(fileName,callBack,noCache) { if(fileName.startsWith("browser://")) { fileName = fileName.replace("browser:/","browserFS "); var data = OpenForum.Storage.get(fileName); if(callBack) { callBack( data ); } return data; } else { return OpenForum.remoteLoad(fileName,callBack,noCache); } }; OpenForum.remoteAppend = OpenForum.appendFile; OpenForum.appendFile = function(fileName,data,callBack) { if(fileName.startsWith("browser://")) { fileName = fileName.replace("browser:/","browserFS "); var currentData = OpenForum.Storage.get(fileName); if( currentData == null ) { return OpenForum.saveFile(fileName,data,callBack); } data = currentData + data; OpenForum.Storage.set(fileName,data); if( isUndefined(OpenForum.inq) == false ) OpenForum.inq.send( { type: "browserFS", event: "fileChanged", fileName: fileName } ); OpenForum.findBrowserFileTreeNode( fileName, { modified: new Date().getTime(), size: data.length } ); var response = {"result":"ok","message":"Appended " + fileName,"appended":true}; if(callBack) { callBack( response ); } else { return response; } } else { return OpenForum.remoteAppend(fileName,data,callBack); } }; OpenForum.remoteCopy = OpenForum.copyFile; OpenForum.copyFile = function(fileName,toFileName,callBack) { if(fileName.startsWith("browser://")) { fileName = fileName.replace("browser:/","browserFS "); var data = OpenForum.Storage.get(fileName); OpenForum.saveFile(toFileName,data); var response = {"result":"ok","message":"Copied " + fileName,"copied":true}; if(callBack) { callBack( response ); } else { return response; } } else { return OpenForum.remoteCopy(fileName,toFileName,callBack); } }; OpenForum.remoteMove = OpenForum.moveFile; OpenForum.moveFile = function(fileName,toFileName,callBack) { if(fileName.startsWith("browser://")) { fileName = fileName.replace("browser:/","browserFS "); var data = OpenForum.Storage.get(fileName); OpenForum.saveFile(toFileName,data); OpenForum.deleteFile(fileName); var response = {"result":"ok","message":"Moved " + fileName,"moved":true}; if(callBack) { callBack( response ); } else { return response; } } else { return OpenForum.remoteMove(fileName,toFileName,callBack); } }; OpenForum.remoteFileExists = OpenForum.fileExists; OpenForum.fileExists = function(fileName) { if(fileName.startsWith("browser://")) { fileName = fileName.replace("browser:/","browserFS "); return OpenForum.Storage.get(fileName) != null; } else { return OpenForum.remoteFileExists(fileName); } }; OpenForum.remoteGetAttachments = OpenForum.getAttachments; OpenForum.getAttachments = function(pageName,callBack,matching,withMetaData) { if(pageName.startsWith("browser://")) { pageName = pageName.replace("browser:/","browserFS "); var list = OpenForum.Storage.find(pageName+"*."); var json = { attachments: <a href="/OpenForum/Javascript/Core/" target="newTab"><img src='/OpenForum/Images/icons/png/link_go.png' /></a>, length: 0, pageName: pageName }; if(withMetaData) { json.size = 0; } for(var a in list) { var fileName = list<a href="/OpenForum/Editor?pageName=/OpenForum/Javascript/Core/a"target="editor" style="color: red" title="The page /OpenForum/Editor?pageName=/OpenForum/Javascript/Core/a does not exist. Click to create it.">a</a>.key.substring( pageName.length+1 ); if(fileName.indexOf("/")!=-1) continue; var attachment = { pageName: pageName, fileName: fileName }; if(withMetaData) { attachment.size = list<a href="/OpenForum/Editor?pageName=/OpenForum/Javascript/Core/a"target="editor" style="color: red" title="The page /OpenForum/Editor?pageName=/OpenForum/Javascript/Core/a does not exist. Click to create it.">a</a>.value.length; attachment.lastModified = 0; json.size += attachment.size; } json.length ++; json.attachments.push( attachment ); } if(callBack) { callBack( json.attachments); } else { return json.attachments; } } else { return OpenForum.remoteGetAttachments(pageName,callBack,matching,withMetaData); } }; OpenForum.remoteGetSubPages = OpenForum.getSubPages; OpenForum.getSubPages = function(pageName, callBack) { if(pageName.startsWith("browser://")) { pageName = pageName.replace("browser:/","browserFS "); var list = OpenForum.Storage.find(pageName+"*."); var json = <a href="/OpenForum/Javascript/Core/" target="newTab"><img src='/OpenForum/Images/icons/png/link_go.png' /></a>; var found = {}; for(var a in list) { var fileName = list<a href="/OpenForum/Editor?pageName=/OpenForum/Javascript/Core/a"target="editor" style="color: red" title="The page /OpenForum/Editor?pageName=/OpenForum/Javascript/Core/a does not exist. Click to create it.">a</a>.key.substring( pageName.length ); if(fileName.indexOf("/")!=-1) { dataPageName = fileName.substring( 0, fileName.indexOf("/") ); if(typeof found<a href="/OpenForum/Editor?pageName=/OpenForum/Javascript/Core/dataPageName"target="editor" style="color: red" title="The page /OpenForum/Editor?pageName=/OpenForum/Javascript/Core/dataPageName does not exist. Click to create it.">dataPageName</a> == "undefined") { json.push(dataPageName); found<a href="/OpenForum/Editor?pageName=/OpenForum/Javascript/Core/dataPageName"target="editor" style="color: red" title="The page /OpenForum/Editor?pageName=/OpenForum/Javascript/Core/dataPageName does not exist. Click to create it.">dataPageName</a> = true; } } } if(callBack) { callBack( json ); } else { return json; } } else { return OpenForum.remoteGetSubPages(pageName,callBack); } }; OpenForum.remoteCreateFileTree = OpenForum.createFileTree; OpenForum.createFileTree = function(id,root,fileExtension,modifier) { if(root.startsWith("browser://")) { var tree = new Tree(id,"Loading...","",modifier); var fsJson = OpenForum.findBrowserFileTreeNode( root.replace("browser:/","") ); //Copy //https://open-forum.onestonesoup.org/OpenForum/Javascript/Tree?action=getPageTree&pageName=/TheLab/Experiments/BrowserFileStorage var toFileTree = function( depth, name, json, path ) { if( isUndefined( path ) ) { path = ""; } var newNode = {}; newNode.name = name; newNode.attributes = { type: "page", pageName: path, link: path, icon: "book", toolTip: "Open page" }; newNode.leaves = <a href="/OpenForum/Javascript/Core/" target="newTab"><img src='/OpenForum/Images/icons/png/link_go.png' /></a>; for(var i in json) { var node = json<a href="/OpenForum/Editor?pageName=/OpenForum/Javascript/Core/i"target="editor" style="color: red" title="The page /OpenForum/Editor?pageName=/OpenForum/Javascript/Core/i does not exist. Click to create it.">i</a>; if(node.type && node.type == "file") { if( ( typeof fileExtension != "undefined" ) && node.extension.match( ".*<br/>." + fileExtension ) ) { continue; } var jsonNode = {}; jsonNode.name = node.fileName; jsonNode.leaves = <a href="/OpenForum/Javascript/Core/" target="newTab"><img src='/OpenForum/Images/icons/png/link_go.png' /></a>; jsonNode.attributes = { type: "file", pageName: path, fileName: node.fileName, link: path + "/" +node.fileName, icon: "attach", actions: <a href=" { fn: "function(node){ window.open('/OpenForum/Editor?pageName=' + node.getAttribute('pageName') + '&fileName=' + node.getAttribute('fileName')); }", icon: "pencil", toolTip: "Edit file" } " target="external_page"> { fn: "function(node){ window.open('/OpenForum/Editor?pageName=' + node.getAttribute('pageName') + '&fileName=' + node.getAttribute('fileName')); }", icon: "pencil", toolTip: "Edit file" } </a> }; newNode.leaves.push( jsonNode ); } else if(node.type && node.type == "page") { var fullPage = path; if( fullPage.endsWith("/") == false ) fullPage += "/"; fullPage += node.fileName; var jsonNode = {}; jsonNode.name = node.fileName; jsonNode.leaves = <a href="/OpenForum/Javascript/Core/" target="newTab"><img src='/OpenForum/Images/icons/png/link_go.png' /></a>; jsonNode.attributes = { type: "page", pageName: node.fileName, link: fullPage, icon: "page", toolTip: "Open page", depth: depth }; var fsJson = OpenForum.findBrowserFileTreeNode( fullPage ); newNode.leaves.push( toFileTree( depth+1, node.fileName, fsJson, fullPage ) ); } } return newNode; }; var jsonTree = toFileTree( 0,root.substring( root.lastIndexOf("/")+1 ) ,fsJson, root ); tree.setJSON(jsonTree); tree.render(); tree.getRoot().expand(); tree.init(); return tree; } else { return OpenForum.remoteCreateFileTree(id,root,fileExtension,modifier); } }; }; OpenForum.addInitialiser( function() { //browserFS enabled by default. Add ?browserFS=false to stop if( OpenForum.getParameter("browserFS")=="false" == false ) { OpenForum.Browser.enableBrowserStorage(); } }); <!-- End of: /OpenForum/Javascript/Core/open-forum-browser.js--> //==============================================================================================================// //==============================================================================================================// <!-- Source: /OpenForum/Javascript/Core/open-forum-action.js--> //==============================================================================================================// OpenForum.action = {}; OpenForum.action.copyPage = function(pageName,newPageName) { window.open("/OpenForum/Actions/Copy?newPageName="+newPageName+"&pageName="+pageName); }; OpenForum.action.movePage = function(pageName,newPageName) { window.location = "/OpenForum/Actions/Move?newPageName="+newPageName+"&pageName="+pageName; }; OpenForum.action.zipPage = function(pageName) { window.location = "/OpenForum/Actions/Zip?action=zip&pageName="+pageName; }; OpenForum.action.deletePage = function(pageName) { window.location = "/OpenForum/Actions/Delete?pageName="+pageName; }; <!-- End of: /OpenForum/Javascript/Core/open-forum-action.js--> //==============================================================================================================// //==============================================================================================================// <!-- Source: /OpenForum/Javascript/Core/open-forum-utils.js--> //==============================================================================================================// if(!OpenForum) { OpenForum = {}; } <!--<ul><li> Author: Nik Cross</li> <li> Description: A set of functions to help with manipulating doms and js objects</li> </ul>--> OpenForum.BLANK = ""; //Used in Extensions where "" cannot be used OpenForum.createObjectSignature = function(object) { var cache = <a href="/OpenForum/Javascript/Core/" target="newTab"><img src='/OpenForum/Images/icons/png/link_go.png' /></a>; var signature = JSON.stringify(object, function(key, value) { if (typeof value === 'object' && value !== null) { if (cache.indexOf(value) !== -1) { // Circular reference found, discard key return; } // Store value in our collection cache.push(value); } return value; }); cache = null; return signature; }; OpenForum.copyElement = function(id) { document.getElementById(id).select(); document.execCommand('copy'); }; OpenForum.copyData = function(data) { var hiddenElement = document.createElement('textarea'); hiddenElement.value = data; document.body.appendChild( hiddenElement ); hiddenElement.select(); document.execCommand('copy'); document.body.removeChild( hiddenElement ); }; OpenForum.setElement = function(id,content) { document.getElementById(id).innerHTML = content; OpenForum.crawl( document.getElementById(id) ); }; OpenForum.appendToElement = function(id,content) { document.getElementById(id).innerHTML += content; OpenForum.crawl( document.getElementById(id) ); }; OpenForum.showElement = function(id, show) { if( typeof show != "undefined" && show == false ) { OpenForum.hideElement( id ); } else { document.getElementById(id).style.display = "block"; } }; OpenForum.hideElement = function(id) { document.getElementById(id).style.display = "none"; }; OpenForum.toggleElement = function(id) { if(document.getElementById(id).style.display==="block") { document.getElementById(id).style.display = "none"; } else { document.getElementById(id).style.display = "block"; } }; OpenForum.setTitle = function(title) { document.title = title; }; OpenForum.setCursor = function(pointer) { if(pointer == "wait") { document.body.style.cursor = 'wait'; return; } else if(pointer == "zoom-in") { document.body.style.cursor = 'zoom-in'; return; } else if(pointer == "pointer") { document.body.style.cursor = 'pointer'; return; } else if(pointer == "crosshair") { document.body.style.cursor = 'crosshair'; return; } else if(pointer == "default") { document.body.style.cursor = 'default'; return; } if(pointer.indexOf(".")==-1) { pointer = "/OpenForum/Images/icons/png/" +pointer+ ".png"; } document.getElementsByTagName("body")<a href="/OpenForum/Editor?pageName=/OpenForum/Javascript/Core/0"target="editor" style="color: red" title="The page /OpenForum/Editor?pageName=/OpenForum/Javascript/Core/0 does not exist. Click to create it.">0</a>.style.cursor = "url('"+pointer+"'), auto"; }; OpenForum.setTabIcon = function(icon) { if(icon.indexOf(".")==-1) { icon = "/OpenForum/Images/icons/png/" +icon+ ".png"; } var link = document.querySelector("link<a href="/OpenForum/Editor?pageName=/OpenForum/Javascript/Core/rel~='icon'"target="editor" style="color: red" title="The page /OpenForum/Editor?pageName=/OpenForum/Javascript/Core/rel~='icon' does not exist. Click to create it.">rel~='icon'</a>"); if (!link) { link = document.createElement('link'); link.rel = 'icon'; document.head.appendChild(link); } link.href = icon; }; OpenForum.getParameter = function( name ) { name = name.replace(/<img src="/OpenForum/Editor?pageName=/OpenForum/Javascript/Core/<br/><a href="/OpenForum/Javascript/Core/" target="newTab"><img src='/OpenForum/Images/icons/png/link_go.png' /></a>" alt="<br/><a href="/OpenForum/Javascript/Core/" target="newTab"><img src='/OpenForum/Images/icons/png/link_go.png' /></a>" title="<br/><a href="/OpenForum/Javascript/Core/" target="newTab"><img src='/OpenForum/Images/icons/png/link_go.png' /></a>"/>/g,"<br/><br/><br/><img src="/OpenForum/Editor?pageName=/OpenForum/Javascript/Core/").replace(/<a href="/OpenForum/Javascript/Core/" target="newTab"><img src='/OpenForum/Images/icons/png/link_go.png' /></a><br/>" alt="").replace(/<a href="/OpenForum/Javascript/Core/" target="newTab"><img src='/OpenForum/Images/icons/png/link_go.png' /></a><br/>" title="").replace(/<a href="/OpenForum/Javascript/Core/" target="newTab"><img src='/OpenForum/Images/icons/png/link_go.png' /></a><br/>"/>]/g,"<br/><br/><br/>]"); var regexS = "<a href="/OpenForum/Editor?pageName=/OpenForum/Javascript/Core/<br/><br/>?&"target="editor" style="color: red" title="The page /OpenForum/Editor?pageName=/OpenForum/Javascript/Core/<br/><br/>?& does not exist. Click to create it."><br/><br/>?&</a>"+name+"=(<a href="/OpenForum/Editor?pageName=/OpenForum/Javascript/Core/^&#"target="editor" style="color: red" title="The page /OpenForum/Editor?pageName=/OpenForum/Javascript/Core/^&# does not exist. Click to create it.">^&#</a>*)"; var regex = new RegExp( regexS ); var results = regex.exec( window.location.href ); if( results === null ) return ""; else return results<a href="/OpenForum/Editor?pageName=/OpenForum/Javascript/Core/1"target="editor" style="color: red" title="The page /OpenForum/Editor?pageName=/OpenForum/Javascript/Core/1 does not exist. Click to create it.">1</a>; }; OpenForum.getCookie = function(name) { var nameEQ = name + "="; var ca = document.cookie.split(';'); for(var i=0;i < ca.length;i++) { var c = ca<a href="/OpenForum/Editor?pageName=/OpenForum/Javascript/Core/i"target="editor" style="color: red" title="The page /OpenForum/Editor?pageName=/OpenForum/Javascript/Core/i does not exist. Click to create it.">i</a>; while (c.charAt(0)==' ') { c = c.substring(1,c.length); } if (c.indexOf(nameEQ) === 0) { return c.substring(nameEQ.length,c.length); } } return null; }; //Keep all the evil in one place OpenForum.evaluate = function(script) { try{ return eval(script); } catch (e) { OpenForum.debug( "ERROR", "Exception evaluating '" + script + "'",e ); throw e; } }; OpenForum.globalExists = function( name ) { name = name.replace(/<br/><a href="/OpenForum/Editor?pageName=/g,".").replace(/<br/>"target="editor" style="color: red" title="The page /OpenForum/Editor?pageName=/g,".").replace(/<br/> does not exist. Click to create it.">/g,".").replace(/<br/></a>/g,"").replace(/'/g,"").replace(/<br/>(.*<br/>)/g,""); var parts = name.split("."); var obj = window; for(var part in parts) { if( typeof obj<img src="/OpenForum/Editor?pageName=/OpenForum/Javascript/Core/parts<a href="/OpenForum/Javascript/Core/" target="newTab"><img src='/OpenForum/Images/icons/png/link_go.png' /></a>part" alt="parts<a href="/OpenForum/Javascript/Core/" target="newTab"><img src='/OpenForum/Images/icons/png/link_go.png' /></a>part" title="parts<a href="/OpenForum/Javascript/Core/" target="newTab"><img src='/OpenForum/Images/icons/png/link_go.png' /></a>part"/>] === "undefined" ) return false; obj = obj<img src="/OpenForum/Editor?pageName=/OpenForum/Javascript/Core/parts<a href="/OpenForum/Javascript/Core/" target="newTab"><img src='/OpenForum/Images/icons/png/link_go.png' /></a>part" alt="parts<a href="/OpenForum/Javascript/Core/" target="newTab"><img src='/OpenForum/Images/icons/png/link_go.png' /></a>part" title="parts<a href="/OpenForum/Javascript/Core/" target="newTab"><img src='/OpenForum/Images/icons/png/link_go.png' /></a>part"/>]; } return true; }; OpenForum.getGlobal = function( name ) { name = name.replace(/<br/><a href="/OpenForum/Editor?pageName=/g,".").replace(/<br/>"target="editor" style="color: red" title="The page /OpenForum/Editor?pageName=/g,".").replace(/<br/> does not exist. Click to create it.">/g,".").replace(/<br/></a>/g,"").replace(/'/g,"").replace(/<br/>(.*<br/>)/g,""); var parts = name.split("."); var obj = window; for(var part in parts) obj = obj<img src="/OpenForum/Editor?pageName=/OpenForum/Javascript/Core/parts<a href="/OpenForum/Javascript/Core/" target="newTab"><img src='/OpenForum/Images/icons/png/link_go.png' /></a>part" alt="parts<a href="/OpenForum/Javascript/Core/" target="newTab"><img src='/OpenForum/Images/icons/png/link_go.png' /></a>part" title="parts<a href="/OpenForum/Javascript/Core/" target="newTab"><img src='/OpenForum/Images/icons/png/link_go.png' /></a>part"/>]; if(typeof obj === "function") return obj(); else return obj; }; OpenForum.setGlobal = function( name,value,create ) { name = name.replace(/<br/><a href="/OpenForum/Editor?pageName=/g,".").replace(/<br/>"target="editor" style="color: red" title="The page /OpenForum/Editor?pageName=/g,".").replace(/<br/> does not exist. Click to create it.">/g,".").replace(/<br/></a>/g,"").replace(/'/g,""); var parts = name.split("."); var obj = window; var i=0; for(i=0; i<parts.length-1; i++) { if( typeof obj<img src="/OpenForum/Editor?pageName=/OpenForum/Javascript/Core/parts<a href="/OpenForum/Javascript/Core/" target="newTab"><img src='/OpenForum/Images/icons/png/link_go.png' /></a>i" alt="parts<a href="/OpenForum/Javascript/Core/" target="newTab"><img src='/OpenForum/Images/icons/png/link_go.png' /></a>i" title="parts<a href="/OpenForum/Javascript/Core/" target="newTab"><img src='/OpenForum/Images/icons/png/link_go.png' /></a>i"/>] === "undefined" && create===true ) obj<img src="/OpenForum/Editor?pageName=/OpenForum/Javascript/Core/parts<a href="/OpenForum/Javascript/Core/" target="newTab"><img src='/OpenForum/Images/icons/png/link_go.png' /></a>i" alt="parts<a href="/OpenForum/Javascript/Core/" target="newTab"><img src='/OpenForum/Images/icons/png/link_go.png' /></a>i" title="parts<a href="/OpenForum/Javascript/Core/" target="newTab"><img src='/OpenForum/Images/icons/png/link_go.png' /></a>i"/>] = {}; obj = obj<img src="/OpenForum/Editor?pageName=/OpenForum/Javascript/Core/parts<a href="/OpenForum/Javascript/Core/" target="newTab"><img src='/OpenForum/Images/icons/png/link_go.png' /></a>i" alt="parts<a href="/OpenForum/Javascript/Core/" target="newTab"><img src='/OpenForum/Images/icons/png/link_go.png' /></a>i" title="parts<a href="/OpenForum/Javascript/Core/" target="newTab"><img src='/OpenForum/Images/icons/png/link_go.png' /></a>i"/>]; } obj<img src="/OpenForum/Editor?pageName=/OpenForum/Javascript/Core/parts<a href="/OpenForum/Javascript/Core/" target="newTab"><img src='/OpenForum/Images/icons/png/link_go.png' /></a>i" alt="parts<a href="/OpenForum/Javascript/Core/" target="newTab"><img src='/OpenForum/Images/icons/png/link_go.png' /></a>i" title="parts<a href="/OpenForum/Javascript/Core/" target="newTab"><img src='/OpenForum/Images/icons/png/link_go.png' /></a>i"/>] = value; }; OpenForum.isEqual = function(a,b,depth,maxDepth) { if(typeof b === undefined || typeof a === undefined) return false; if(b === null && a === null) return true; if(b === null || a === null) return false; if(typeof a !== typeof b) return false; if(!depth) { depth=0; } if(depth>maxDepth) { OpenForum.debug( "Maximum depth exceeded in isEqual." ); return true; } if(!maxDepth) { maxDepth = 10; } if( typeof a === "object" ) { if(Array.isArray(a)) { if(!Array.isArray(b) || a.length!==b.length) return false; } if(Array.isArray(b)) { if(!Array.isArray(a) || a.length!==b.length) return false; } for(var i in a) { if(typeof b<a href="/OpenForum/Editor?pageName=/OpenForum/Javascript/Core/i"target="editor" style="color: red" title="The page /OpenForum/Editor?pageName=/OpenForum/Javascript/Core/i does not exist. Click to create it.">i</a> === "undefined") return false; if( OpenForum.isEqual(a<a href="/OpenForum/Editor?pageName=/OpenForum/Javascript/Core/i"target="editor" style="color: red" title="The page /OpenForum/Editor?pageName=/OpenForum/Javascript/Core/i does not exist. Click to create it.">i</a>,b<a href="/OpenForum/Editor?pageName=/OpenForum/Javascript/Core/i"target="editor" style="color: red" title="The page /OpenForum/Editor?pageName=/OpenForum/Javascript/Core/i does not exist. Click to create it.">i</a>,depth+1,maxDepth)===false) return false; } return true; } else { return (a===b); } }; OpenForum.copyDifferencesFromTo = function(a,b,depth,minDepth,maxDepth,doDelete) { if(!minDepth) { minDepth=1; } if(!maxDepth) { maxDepth = 10; } if(!depth) { depth=1; } if(depth>maxDepth) { OpenForum.debug( "Maximum depth exceeded in isEqual." ); return null; } if(doDelete == false && Array.isArray(a) && Array.isArray(b)) { for(var i in a) { b.push( a<a href="/OpenForum/Editor?pageName=/OpenForum/Javascript/Core/i"target="editor" style="color: red" title="The page /OpenForum/Editor?pageName=/OpenForum/Javascript/Core/i does not exist. Click to create it.">i</a> ); } return b; } if( typeof a === "object" ) { for(var i in a) { if( typeof a<a href="/OpenForum/Editor?pageName=/OpenForum/Javascript/Core/i"target="editor" style="color: red" title="The page /OpenForum/Editor?pageName=/OpenForum/Javascript/Core/i does not exist. Click to create it.">i</a> == "function" ) { // Do not clone objects with functions return null; } } for(var i in a) { if(!b<a href="/OpenForum/Editor?pageName=/OpenForum/Javascript/Core/i"target="editor" style="color: red" title="The page /OpenForum/Editor?pageName=/OpenForum/Javascript/Core/i does not exist. Click to create it.">i</a>) { //If it doesn't exist, create it if(typeof a<a href="/OpenForum/Editor?pageName=/OpenForum/Javascript/Core/i"target="editor" style="color: red" title="The page /OpenForum/Editor?pageName=/OpenForum/Javascript/Core/i does not exist. Click to create it.">i</a> === "object") { var value; if(a<a href="/OpenForum/Editor?pageName=/OpenForum/Javascript/Core/i"target="editor" style="color: red" title="The page /OpenForum/Editor?pageName=/OpenForum/Javascript/Core/i does not exist. Click to create it.">i</a>==null) value = null; else if(Array.isArray(a<a href="/OpenForum/Editor?pageName=/OpenForum/Javascript/Core/i"target="editor" style="color: red" title="The page /OpenForum/Editor?pageName=/OpenForum/Javascript/Core/i does not exist. Click to create it.">i</a>)) value = OpenForum.copyDifferencesFromTo(a<a href="/OpenForum/Editor?pageName=/OpenForum/Javascript/Core/i"target="editor" style="color: red" title="The page /OpenForum/Editor?pageName=/OpenForum/Javascript/Core/i does not exist. Click to create it.">i</a>,<a href="/OpenForum/Javascript/Core/" target="newTab"><img src='/OpenForum/Images/icons/png/link_go.png' /></a>,depth+1,minDepth,maxDepth,doDelete); else value = OpenForum.copyDifferencesFromTo(a<a href="/OpenForum/Editor?pageName=/OpenForum/Javascript/Core/i"target="editor" style="color: red" title="The page /OpenForum/Editor?pageName=/OpenForum/Javascript/Core/i does not exist. Click to create it.">i</a>,{},depth+1,minDepth,maxDepth,doDelete); if(value==null) { if(depth<=maxDepth) { b<a href="/OpenForum/Editor?pageName=/OpenForum/Javascript/Core/i"target="editor" style="color: red" title="The page /OpenForum/Editor?pageName=/OpenForum/Javascript/Core/i does not exist. Click to create it.">i</a> = a<a href="/OpenForum/Editor?pageName=/OpenForum/Javascript/Core/i"target="editor" style="color: red" title="The page /OpenForum/Editor?pageName=/OpenForum/Javascript/Core/i does not exist. Click to create it.">i</a>; } else { return null; } } else { b<a href="/OpenForum/Editor?pageName=/OpenForum/Javascript/Core/i"target="editor" style="color: red" title="The page /OpenForum/Editor?pageName=/OpenForum/Javascript/Core/i does not exist. Click to create it.">i</a> = value; } } else { b<a href="/OpenForum/Editor?pageName=/OpenForum/Javascript/Core/i"target="editor" style="color: red" title="The page /OpenForum/Editor?pageName=/OpenForum/Javascript/Core/i does not exist. Click to create it.">i</a> = a<a href="/OpenForum/Editor?pageName=/OpenForum/Javascript/Core/i"target="editor" style="color: red" title="The page /OpenForum/Editor?pageName=/OpenForum/Javascript/Core/i does not exist. Click to create it.">i</a>; } } else if( OpenForum.isEqual(a<a href="/OpenForum/Editor?pageName=/OpenForum/Javascript/Core/i"target="editor" style="color: red" title="The page /OpenForum/Editor?pageName=/OpenForum/Javascript/Core/i does not exist. Click to create it.">i</a>,b<a href="/OpenForum/Editor?pageName=/OpenForum/Javascript/Core/i"target="editor" style="color: red" title="The page /OpenForum/Editor?pageName=/OpenForum/Javascript/Core/i does not exist. Click to create it.">i</a>)===false) { //If it exists but is not equal, copy differences var value = OpenForum.copyDifferencesFromTo(a<a href="/OpenForum/Editor?pageName=/OpenForum/Javascript/Core/i"target="editor" style="color: red" title="The page /OpenForum/Editor?pageName=/OpenForum/Javascript/Core/i does not exist. Click to create it.">i</a>,b<a href="/OpenForum/Editor?pageName=/OpenForum/Javascript/Core/i"target="editor" style="color: red" title="The page /OpenForum/Editor?pageName=/OpenForum/Javascript/Core/i does not exist. Click to create it.">i</a>,depth+1,minDepth,maxDepth,doDelete); if(value!=null) { if(depth<=maxDepth) { b<a href="/OpenForum/Editor?pageName=/OpenForum/Javascript/Core/i"target="editor" style="color: red" title="The page /OpenForum/Editor?pageName=/OpenForum/Javascript/Core/i does not exist. Click to create it.">i</a> = value; } else { return null; } } } } for(var i in b) { if(typeof a<a href="/OpenForum/Editor?pageName=/OpenForum/Javascript/Core/i"target="editor" style="color: red" title="The page /OpenForum/Editor?pageName=/OpenForum/Javascript/Core/i does not exist. Click to create it.">i</a> == "undefined" && typeof b<a href="/OpenForum/Editor?pageName=/OpenForum/Javascript/Core/i"target="editor" style="color: red" title="The page /OpenForum/Editor?pageName=/OpenForum/Javascript/Core/i does not exist. Click to create it.">i</a> != "undefined" ) { if(doDelete) { delete b<a href="/OpenForum/Editor?pageName=/OpenForum/Javascript/Core/i"target="editor" style="color: red" title="The page /OpenForum/Editor?pageName=/OpenForum/Javascript/Core/i does not exist. Click to create it.">i</a>; } else { a<a href="/OpenForum/Editor?pageName=/OpenForum/Javascript/Core/i"target="editor" style="color: red" title="The page /OpenForum/Editor?pageName=/OpenForum/Javascript/Core/i does not exist. Click to create it.">i</a> = b<a href="/OpenForum/Editor?pageName=/OpenForum/Javascript/Core/i"target="editor" style="color: red" title="The page /OpenForum/Editor?pageName=/OpenForum/Javascript/Core/i does not exist. Click to create it.">i</a>; } } } } else { return a; } return b; }; OpenForum.clone = function(a) { var b = {}; if(a.length) b = <a href="/OpenForum/Javascript/Core/" target="newTab"><img src='/OpenForum/Images/icons/png/link_go.png' /></a>; OpenForum.copyDifferencesFromTo(a,b); return b; }; OpenForum.clean = function(a) { if( typeof a === "object" ) { for(var i in a) { if(typeof a<a href="/OpenForum/Editor?pageName=/OpenForum/Javascript/Core/i"target="editor" style="color: red" title="The page /OpenForum/Editor?pageName=/OpenForum/Javascript/Core/i does not exist. Click to create it.">i</a> === "object") { a<a href="/OpenForum/Editor?pageName=/OpenForum/Javascript/Core/i"target="editor" style="color: red" title="The page /OpenForum/Editor?pageName=/OpenForum/Javascript/Core/i does not exist. Click to create it.">i</a> = OpenForum.clean(a<a href="/OpenForum/Editor?pageName=/OpenForum/Javascript/Core/i"target="editor" style="color: red" title="The page /OpenForum/Editor?pageName=/OpenForum/Javascript/Core/i does not exist. Click to create it.">i</a>); } else if(typeof a<a href="/OpenForum/Editor?pageName=/OpenForum/Javascript/Core/i"target="editor" style="color: red" title="The page /OpenForum/Editor?pageName=/OpenForum/Javascript/Core/i does not exist. Click to create it.">i</a> === "number") { a<a href="/OpenForum/Editor?pageName=/OpenForum/Javascript/Core/i"target="editor" style="color: red" title="The page /OpenForum/Editor?pageName=/OpenForum/Javascript/Core/i does not exist. Click to create it.">i</a> = 0; } else if(typeof a<a href="/OpenForum/Editor?pageName=/OpenForum/Javascript/Core/i"target="editor" style="color: red" title="The page /OpenForum/Editor?pageName=/OpenForum/Javascript/Core/i does not exist. Click to create it.">i</a> === "boolean") { a<a href="/OpenForum/Editor?pageName=/OpenForum/Javascript/Core/i"target="editor" style="color: red" title="The page /OpenForum/Editor?pageName=/OpenForum/Javascript/Core/i does not exist. Click to create it.">i</a> = true; } else { a<a href="/OpenForum/Editor?pageName=/OpenForum/Javascript/Core/i"target="editor" style="color: red" title="The page /OpenForum/Editor?pageName=/OpenForum/Javascript/Core/i does not exist. Click to create it.">i</a> = ""; } } } return a; }; OpenForum.addFunctionPrefix = function( fn1, fn2 ) { var secondFn = ""+fn1; var firstFunction = "" + fn2; firstFunction = firstFunction.substring(firstFunction.indexOf("{")+1, firstFunction.lastIndexOf("}")-1 ); secondFn = "f = " + secondFn.substring(0,secondFn.indexOf("{")+1) + " " + firstFunction + " " + secondFn.substring( secondFn.indexOf("{")+1 ); return OpenForum.evaluate( secondFn ); }; OpenForum.addFunctionSuffix = function( fn1, fn2 ) { var secondFn = ""+fn2; var firstFunction = "" + fn1; firstFunction = firstFunction.substring(firstFunction.indexOf("{")+1, firstFunction.lastIndexOf("}")-1 ); secondFn = "f = " + secondFn.substring(0,secondFn.indexOf("{")+1) + " " + firstFunction + " " + secondFn.substring( secondFn.indexOf("{")+1 ); return OpenForum.evaluate( secondFn ); }; OpenForum.setInterval = function(fn,timePeriod,immediate,blocking,doesCallback) { if(blocking) { var blocked = false; if(immediate) { blocked = true; try{ if(doesCallback) { fn( function() {blocked = false;} ); } else { fn(); blocked = false; } } catch (e) { blocked = false; } } return setInterval( function() { if(blocked) return; blocked = true; try{ if(doesCallback) { fn( function() {blocked = false;} ); } else { fn(); blocked = false; } } catch (e) { blocked = false; } }, timePeriod ); } else { if(immediate) { fn(); return setInterval(fn,timePeriod); } } }; OpenForum.waitFor = function(test,callback,pause,timeout) { if(!pause) pause=200; if(!timeout) timeout = new Date().getTime()+30000; else if( new Date().getTime()>timeout ) throw "Timeout waiting for " + test; if(test()===true) { callback(); } else { setTimeout( function(test,callback,pause,timeout){ return function() { OpenForum.waitFor(test,callback,pause,timeout); }; }( test, callback, pause ), pause ); } }; OpenForum.runAsync = function(fn) { setTimeout( function() { fn(); },1 ); }; OpenForum.queue = function(process,supplyState) { var test = OpenForum.queue.ready; if(!test) test = function() { return true; }; OpenForum.queue.ready = function() { return (!OpenForum.processing); }; var state = {complete: false}; if(supplyState===true) { OpenForum.queue.ready = function() { if(state.complete===true) delete OpenForum.processing; return (state.complete); }; } OpenForum.waitFor( test, function() { OpenForum.processing = process; process(state); if(!supplyState) { delete OpenForum.processing; } } ); }; OpenForum.Table = {}; OpenForum.Table.setCell = function(table,row,column,value) { if(typeof value != "undefined") { table<a href="/OpenForum/Editor?pageName=/OpenForum/Javascript/Core/row"target="editor" style="color: red" title="The page /OpenForum/Editor?pageName=/OpenForum/Javascript/Core/row does not exist. Click to create it.">row</a><a href="/OpenForum/Editor?pageName=/OpenForum/Javascript/Core/column"target="editor" style="color: red" title="The page /OpenForum/Editor?pageName=/OpenForum/Javascript/Core/column does not exist. Click to create it.">column</a> = value; } else { //Is simple array so value is column table<a href="/OpenForum/Editor?pageName=/OpenForum/Javascript/Core/row"target="editor" style="color: red" title="The page /OpenForum/Editor?pageName=/OpenForum/Javascript/Core/row does not exist. Click to create it.">row</a> = column; } }; OpenForum.Table.editRow = function(table,index) { for(var i in table) { table<a href="/OpenForum/Editor?pageName=/OpenForum/Javascript/Core/i"target="editor" style="color: red" title="The page /OpenForum/Editor?pageName=/OpenForum/Javascript/Core/i does not exist. Click to create it.">i</a>.view = "display: block;"; table<a href="/OpenForum/Editor?pageName=/OpenForum/Javascript/Core/i"target="editor" style="color: red" title="The page /OpenForum/Editor?pageName=/OpenForum/Javascript/Core/i does not exist. Click to create it.">i</a>.edit = "display: none;"; } table<a href="/OpenForum/Editor?pageName=/OpenForum/Javascript/Core/index"target="editor" style="color: red" title="The page /OpenForum/Editor?pageName=/OpenForum/Javascript/Core/index does not exist. Click to create it.">index</a>.edit = "display: block;"; table<a href="/OpenForum/Editor?pageName=/OpenForum/Javascript/Core/index"target="editor" style="color: red" title="The page /OpenForum/Editor?pageName=/OpenForum/Javascript/Core/index does not exist. Click to create it.">index</a>.view = "display: none;"; }; OpenForum.jsonToCsv = function(json,delimiter) { if(!delimiter) delimiter = "<br/>t"; var csv = ""; if(Array.isArray(json)) { for(var i in json) { var row = json<a href="/OpenForum/Editor?pageName=/OpenForum/Javascript/Core/i"target="editor" style="color: red" title="The page /OpenForum/Editor?pageName=/OpenForum/Javascript/Core/i does not exist. Click to create it.">i</a>; //add column name row if(csv.length===0) { for (var c in row) { if(csv.length>0) { csv+=delimiter; } csv += c; } csv += "<br/>n"; } //add row var csvRow = ""; for (var r in row) { if(csvRow.length>0) { csvRow+=delimiter; } csvRow += row<a href="/OpenForum/Editor?pageName=/OpenForum/Javascript/Core/r"target="editor" style="color: red" title="The page /OpenForum/Editor?pageName=/OpenForum/Javascript/Core/r does not exist. Click to create it.">r</a>; } csv += csvRow +"<br/>n"; } } else if(typeof json === "object") { for(var name in json) { csv += name + delimiter + json<a href="/OpenForum/Editor?pageName=/OpenForum/Javascript/Core/name"target="editor" style="color: red" title="The page /OpenForum/Editor?pageName=/OpenForum/Javascript/Core/name does not exist. Click to create it.">name</a> + "<br/>n"; } } return csv; }; OpenForum.Table.closeTable = function(table) { for(var i in table) { table<a href="/OpenForum/Editor?pageName=/OpenForum/Javascript/Core/i"target="editor" style="color: red" title="The page /OpenForum/Editor?pageName=/OpenForum/Javascript/Core/i does not exist. Click to create it.">i</a>.view = "display: block;"; table<a href="/OpenForum/Editor?pageName=/OpenForum/Javascript/Core/i"target="editor" style="color: red" title="The page /OpenForum/Editor?pageName=/OpenForum/Javascript/Core/i does not exist. Click to create it.">i</a>.edit = "display: none;"; } }; OpenForum.Table.addRow = function(table,templateRow,clean) { if(!templateRow) { templateRow = table<a href="/OpenForum/Editor?pageName=/OpenForum/Javascript/Core/table.length-1"target="editor" style="color: red" title="The page /OpenForum/Editor?pageName=/OpenForum/Javascript/Core/table.length-1 does not exist. Click to create it.">table.length-1</a>; } if(!templateRow.view) { templateRow.view = "display: block;"; templateRow.edit = "display: none;"; } var newRow = OpenForum.clone( templateRow ); if(clean) { OpenForum.clean( newRow ); } table.push( newRow ); OpenForum.Table.editRow(table,table.length-1); }; OpenForum.Table.removeRow = function(table,index) { return table.splice(index,1)<a href="/OpenForum/Editor?pageName=/OpenForum/Javascript/Core/0"target="editor" style="color: red" title="The page /OpenForum/Editor?pageName=/OpenForum/Javascript/Core/0 does not exist. Click to create it.">0</a>; }; OpenForum.Table.moveRowUp = function(table,index) { if(index<=0) return; var row = table.splice(index,1)<a href="/OpenForum/Editor?pageName=/OpenForum/Javascript/Core/0"target="editor" style="color: red" title="The page /OpenForum/Editor?pageName=/OpenForum/Javascript/Core/0 does not exist. Click to create it.">0</a>; table.splice(index-1,0,row); }; OpenForum.Table.moveRowDown = function(table,index) { if(index>=table.length-1) return; var row = table.splice(index,1)<a href="/OpenForum/Editor?pageName=/OpenForum/Javascript/Core/0"target="editor" style="color: red" title="The page /OpenForum/Editor?pageName=/OpenForum/Javascript/Core/0 does not exist. Click to create it.">0</a>; table.splice(index+1,0,row); }; OpenForum.Table.applyRowFilter = function(tableName,tableData,fieldName,fieldFilter) { var table = document.getElementById(tableName); var filters = <a href="/OpenForum/Javascript/Core/" target="newTab"><img src='/OpenForum/Images/icons/png/link_go.png' /></a>; var allBlank = true; if(typeof fieldFilter == "undefined" && fieldName.length) { //Assume array of filters filters = fieldName; for(var i in filters) { if(filters<a href="/OpenForum/Editor?pageName=/OpenForum/Javascript/Core/i"target="editor" style="color: red" title="The page /OpenForum/Editor?pageName=/OpenForum/Javascript/Core/i does not exist. Click to create it.">i</a>.fieldFilter!="") allBlank = false; filters<a href="/OpenForum/Editor?pageName=/OpenForum/Javascript/Core/i"target="editor" style="color: red" title="The page /OpenForum/Editor?pageName=/OpenForum/Javascript/Core/i does not exist. Click to create it.">i</a>.query = ".*"+filters<a href="/OpenForum/Editor?pageName=/OpenForum/Javascript/Core/i"target="editor" style="color: red" title="The page /OpenForum/Editor?pageName=/OpenForum/Javascript/Core/i does not exist. Click to create it.">i</a>.fieldFilter+".*"; } } else { if(fieldFilter!="") allBlank = false; filters.push( {fieldName: fieldName, fieldFilter: fieldFilter, query: ".*"+fieldFilter+".*"} ); } var index = 1; for(var i in tableData) { var rowData = tableData<a href="/OpenForum/Editor?pageName=/OpenForum/Javascript/Core/i"target="editor" style="color: red" title="The page /OpenForum/Editor?pageName=/OpenForum/Javascript/Core/i does not exist. Click to create it.">i</a>; if(allBlank) { OpenForum.Table.showRow(table,index); } else { OpenForum.Table.showRow(table,index); for(var j in filters) { if( (filters<a href="/OpenForum/Editor?pageName=/OpenForum/Javascript/Core/j"target="editor" style="color: red" title="The page /OpenForum/Editor?pageName=/OpenForum/Javascript/Core/j does not exist. Click to create it.">j</a>.query != ".*.*") && (""+rowData<img src="/OpenForum/Editor?pageName=/OpenForum/Javascript/Core/filters<a href="/OpenForum/Javascript/Core/" target="newTab"><img src='/OpenForum/Images/icons/png/link_go.png' /></a>j" alt="filters<a href="/OpenForum/Javascript/Core/" target="newTab"><img src='/OpenForum/Images/icons/png/link_go.png' /></a>j" title="filters<a href="/OpenForum/Javascript/Core/" target="newTab"><img src='/OpenForum/Images/icons/png/link_go.png' /></a>j"/>.fieldName]).match(filters<a href="/OpenForum/Editor?pageName=/OpenForum/Javascript/Core/j"target="editor" style="color: red" title="The page /OpenForum/Editor?pageName=/OpenForum/Javascript/Core/j does not exist. Click to create it.">j</a>.query) == null) { OpenForum.Table.hideRow(table,index); } } } index++; } }; OpenForum.Table.sort = function(tableData,fieldName,ascending) { tableData.sort( function(a,b) { if(ascending) { if(a<a href="/OpenForum/Editor?pageName=/OpenForum/Javascript/Core/fieldName"target="editor" style="color: red" title="The page /OpenForum/Editor?pageName=/OpenForum/Javascript/Core/fieldName does not exist. Click to create it.">fieldName</a><b<a href="/OpenForum/Editor?pageName=/OpenForum/Javascript/Core/fieldName"target="editor" style="color: red" title="The page /OpenForum/Editor?pageName=/OpenForum/Javascript/Core/fieldName does not exist. Click to create it.">fieldName</a>) return 1; else return -1; } else { if(a<a href="/OpenForum/Editor?pageName=/OpenForum/Javascript/Core/fieldName"target="editor" style="color: red" title="The page /OpenForum/Editor?pageName=/OpenForum/Javascript/Core/fieldName does not exist. Click to create it.">fieldName</a>>b<a href="/OpenForum/Editor?pageName=/OpenForum/Javascript/Core/fieldName"target="editor" style="color: red" title="The page /OpenForum/Editor?pageName=/OpenForum/Javascript/Core/fieldName does not exist. Click to create it.">fieldName</a>) return 1; else return -1; } } ); }; OpenForum.Table.hideRow = function(table,row) { var nodes = table.querySelectorAll('tbody tr:nth-child(' + row + ')'); nodes.item(0).style.display = "none"; }; OpenForum.Table.showRow = function(table,row) { var nodes = table.querySelectorAll('tbody tr:nth-child(' + row + ')'); nodes.item(0).style.display = ""; }; OpenForum.Table.renderTable = function(tableName,tableData) { var html = "<table id='"+tableName+"'>"; html += "<thead><tr>"; for(var n in tableData<a href="/OpenForum/Editor?pageName=/OpenForum/Javascript/Core/0"target="editor" style="color: red" title="The page /OpenForum/Editor?pageName=/OpenForum/Javascript/Core/0 does not exist. Click to create it.">0</a>) { html += "<td>" + n.replaceAll("_"," ") + "</td>"; } html += "</tr></thead>"; html += "<tbody>"; for(var r in tableData) { var row = tableData<a href="/OpenForum/Editor?pageName=/OpenForum/Javascript/Core/r"target="editor" style="color: red" title="The page /OpenForum/Editor?pageName=/OpenForum/Javascript/Core/r does not exist. Click to create it.">r</a>; html += "<tr>"; for(var n in row) { var cell = row<a href="/OpenForum/Editor?pageName=/OpenForum/Javascript/Core/n"target="editor" style="color: red" title="The page /OpenForum/Editor?pageName=/OpenForum/Javascript/Core/n does not exist. Click to create it.">n</a>; if<p>typeof n == "string" && n.indexOf("url")!=-1) || (typeof cell == "string" && cell.indexOf("http")!=-1</p> { cell = "<a href='"+cell+"' target='url'>"+cell+"</a>"; } html += "<td>" + cell + "</td>"; } html += "</tr>"; } html+= "</tr></tbody>"; html+="</table>"; return html; }; <!-- End of: /OpenForum/Javascript/Core/open-forum-utils.js--> //==============================================================================================================// //==============================================================================================================// <!-- Source: /OpenForum/Javascript/Core/open-forum-storage.js--> //==============================================================================================================// if(!OpenForum) { OpenForum = {}; } OpenForum.Storage = {}; OpenForum.Storage.requestAccess = function() { document.requestStorageAccess(); }; OpenForum.Storage.get = function(key) { try{ return localStorage.getItem(key); } catch(e) { console.log(e); } }; OpenForum.Storage.set = function(key,value) { try{ localStorage.setItem(key,value); } catch(e) { console.log(e); } }; OpenForum.Storage.find = function(regex) { try{ var found = <a href="/OpenForum/Javascript/Core/" target="newTab"><img src='/OpenForum/Images/icons/png/link_go.png' /></a>; for(var i in localStorage) { if( i.match(regex)) { found.push( {key: i, value: localStorage<a href="/OpenForum/Editor?pageName=/OpenForum/Javascript/Core/i"target="editor" style="color: red" title="The page /OpenForum/Editor?pageName=/OpenForum/Javascript/Core/i does not exist. Click to create it.">i</a>} ); } } return found; } catch(e) { console.log(e); } }; <!-- End of: /OpenForum/Javascript/Core/open-forum-storage.js--> //==============================================================================================================// //==============================================================================================================// <!-- Source: /OpenForum/Javascript/Core/open-forum-ofx.js--> //==============================================================================================================// <!--<ul><li> Author: Nik Cross</li> <li> Description: A replacement for OpenForum JSON.get and JSON.post</li> </ul>--> var OFX = { fromJson: function( json ) { if(json.method == "get" ) { return OFX.get( json.url ).withAction( json.action ).withData( json.data ); } else if(json.method == "post" ) { return OFX.post( json.url ).withAction( json.action ).withData( json.data ); } }, clearOfflineCache: function() { OpenForum.Storage.set("OFX.cache","<a href="/OpenForum/Javascript/Core/" target="newTab"><img src='/OpenForum/Images/icons/png/link_go.png' /></a>"); console.log("OFX cache cleared."); }, sendOfflineCache: function( callback, callbackError ) { if(navigator.onLine===false) { return; } var cache = OFX.getOfflineCache(); if(cache.length==0) { return; } var request = cache.shift(); OpenForum.Storage.set("OFX.cache",JSON.stringify(cache)); OFX.fromJson( request ).onSuccess( callback ).onError( callbackError ).go(true); if(cache.length!=0) { setTimeout( function() { OFX.sendOfflineCache(callback,callbackError); }, 1000 ); } }, getOfflineCache: function() { var cache = OpenForum.Storage.get("OFX.cache"); if(cache==null) { cache = <a href="/OpenForum/Javascript/Core/" target="newTab"><img src='/OpenForum/Images/icons/png/link_go.png' /></a>; } else { try{ cache = JSON.parse(cache); } catch(e) { console.log("OFX cache error "+e+". Replacing cache."); cache = <a href="/OpenForum/Javascript/Core/" target="newTab"><img src='/OpenForum/Images/icons/png/link_go.png' /></a>; } } return cache; }, appendToOfflineCache: function(request) { var cache = OFX.getOfflineCache(); cache.push( request.toJson() ); OpenForum.Storage.set("OFX.cache",JSON.stringify(cache)); }, get: function(url) { var GET = function(url) { var self = this; var action; var data; var callBack; var callOnError; self.withAction = function(newAction) { action = newAction; return self; }; self.withData = function(newData) { data = newData; return self; }; self.onSuccess = function(newCallBack) { callBack = newCallBack; return self; }; self.onError = function(newCallOnError) { callOnError = newCallOnError; return self; }; self.toJson = function() { return { url: url, method: "get", action: action, data: data, requestedTime: new Date().getTime() }; }; self.go = function( withOfflineCache ) { if(navigator.onLine===false && withOfflineCache) { OFX.appendToOfflineCache( self ); return true; } if(action) { if(data) { if(typeof data == "object") { var dataString = ""; for(var name in data) { if(dataString.length>0) dataString += "&"; if(typeof data<a href="/OpenForum/Editor?pageName=/OpenForum/Javascript/Core/name"target="editor" style="color: red" title="The page /OpenForum/Editor?pageName=/OpenForum/Javascript/Core/name does not exist. Click to create it.">name</a> == "object") { dataString += name + "="+ JSON.stringify( data<a href="/OpenForum/Editor?pageName=/OpenForum/Javascript/Core/name"target="editor" style="color: red" title="The page /OpenForum/Editor?pageName=/OpenForum/Javascript/Core/name does not exist. Click to create it.">name</a> ); } else { dataString += name + "="+ data<a href="/OpenForum/Editor?pageName=/OpenForum/Javascript/Core/name"target="editor" style="color: red" title="The page /OpenForum/Editor?pageName=/OpenForum/Javascript/Core/name does not exist. Click to create it.">name</a>; } } data = dataString; } } var get = JSON.get(url,action,data); if(callBack) { get = get.onSuccess( callBack ); } if(callOnError) { get = get.onError(callOnError); } get.go(); } else { OpenForum.loadFile(url,callBack); } }; }; return new GET(url); }, post: function(url) { var POST = function(url) { var self = this; var action; var data; var callBack; var callOnError; self.withAction = function(newAction) { action = newAction; return self; }; self.withData = function(newData) { data = newData; return self; }; self.onSuccess = function(newCallBack) { callBack = newCallBack; return self; }; self.onError = function(newCallOnError) { callOnError = newCallOnError; return self; }; self.toJson = function() { return { url: url, method: "post", action: action, data: data, requestedTime: new Date().getTime() }; }; self.go = function( withOfflineCache ) { if(navigator.onLine===false && withOfflineCache) { OFX.appendToOfflineCache( self ); return true; } if(action) { if(data) { if(typeof data == "object") { var dataString = ""; for(var name in data) { if(dataString.length>0) dataString += "&"; if(typeof data<a href="/OpenForum/Editor?pageName=/OpenForum/Javascript/Core/name"target="editor" style="color: red" title="The page /OpenForum/Editor?pageName=/OpenForum/Javascript/Core/name does not exist. Click to create it.">name</a> == "object") { dataString += name + "="+ JSON.stringify( data<a href="/OpenForum/Editor?pageName=/OpenForum/Javascript/Core/name"target="editor" style="color: red" title="The page /OpenForum/Editor?pageName=/OpenForum/Javascript/Core/name does not exist. Click to create it.">name</a> ); } else { dataString += name + "="+ data<a href="/OpenForum/Editor?pageName=/OpenForum/Javascript/Core/name"target="editor" style="color: red" title="The page /OpenForum/Editor?pageName=/OpenForum/Javascript/Core/name does not exist. Click to create it.">name</a>; } } data = dataString; } } var post = JSON.post(url,action,data); if(callBack) { post = post.onSuccess( callBack ); } if(callOnError) { post = post.onError(callOnError); } post.go(); } else { OpenForum.saveFile(url,data); } }; }; return new POST(url); } }; <!-- End of: /OpenForum/Javascript/Core/open-forum-ofx.js--> //==============================================================================================================// //==============================================================================================================// <!-- Source: /OpenForum/Javascript/Core/open-forum-intraq.js--> //==============================================================================================================// <!--<ul><li> Author: </li> <li> Description: </li> </ul>--> if(typeof OpenForum == "undefined") { OpenForum = {}; } OpenForum.IntraQ = function( queueName, types ) { var self = this; var tabId = "Tab:" + new Date().getTime() + ":" + Math.random(); var lastChecked = 0; var listeners = <a href="/OpenForum/Javascript/Core/" target="newTab"><img src='/OpenForum/Images/icons/png/link_go.png' /></a>; if( typeof types == "undefined" ) { types = <a href="/OpenForum/Javascript/Core/" target="newTab"><img src='/OpenForum/Images/icons/png/link_go.png' /></a>; } self.registerAsType = function( type ) { types.push( type ); }; self.addListener = function(listener) { listeners.push( listener ); }; var checkForMessages = function() { var queue = JSON.parse( OpenForum.Storage.get("IntraQ."+queueName) ); var now = new Date().getTime(); var newQ = <a href="/OpenForum/Javascript/Core/" target="newTab"><img src='/OpenForum/Images/icons/png/link_go.png' /></a>; for(var i in queue) { var packet = queue<a href="/OpenForum/Editor?pageName=/OpenForum/Javascript/Core/i"target="editor" style="color: red" title="The page /OpenForum/Editor?pageName=/OpenForum/Javascript/Core/i does not exist. Click to create it.">i</a>; if(packet.ts>lastChecked && packet.id != tabId) { var typeMatch = false; if(packet.data.types) { for(var t in types) { packet.data.types.includes( types<a href="/OpenForum/Editor?pageName=/OpenForum/Javascript/Core/t"target="editor" style="color: red" title="The page /OpenForum/Editor?pageName=/OpenForum/Javascript/Core/t does not exist. Click to create it.">t</a> ); typeMatch = true; break; } } else { typeMatch = true; } if( typeMatch == true ) { for(var l in listeners) { listeners<a href="/OpenForum/Editor?pageName=/OpenForum/Javascript/Core/l"target="editor" style="color: red" title="The page /OpenForum/Editor?pageName=/OpenForum/Javascript/Core/l does not exist. Click to create it.">l</a>(packet.data); } } } if(now-packet.ts<5000) { //Messages that are older than 5 seconds are not included newQ.push(packet); } } lastChecked = now; var owner = JSON.parse( OpenForum.Storage.get("IntraQ."+queueName+".owner") ); if(owner==null) { owner = {id: tabId, ts: now}; } if(owner.id == tabId) { owner.ts = now; OpenForum.Storage.set("IntraQ."+queueName+".owner", JSON.stringify(owner) ); OpenForum.Storage.set("IntraQ."+queueName, JSON.stringify(newQ) ); //Retire messages that are not new } else if(now-owner.ts>5000) { owner.id = tabId; // Take ownership if queue owner has gone owner.ts = now; OpenForum.Storage.set("IntraQ."+queueName+".owner", JSON.stringify(owner) ); } setTimeout( checkForMessages, 500 ); }; self.getTabId = function() { return tabId; }; self.send = function( data ) { var queue = JSON.parse( OpenForum.Storage.get("IntraQ."+queueName) ); if(queue==null) queue = <a href="/OpenForum/Javascript/Core/" target="newTab"><img src='/OpenForum/Images/icons/png/link_go.png' /></a>; queue.push( {data: data, ts: new Date().getTime(), id: tabId} ); OpenForum.Storage.set("IntraQ."+queueName, JSON.stringify(queue)); }; self.send( { action: "joined", tabId: tabId, types: types } ); checkForMessages(); }; OpenForum.InQ = function() { var self = this; var inq = new OpenForum.IntraQ( "inq" ); //TODO Needs to handle lots of different objects and values //Only ignore those that have just been set to stop a loop back condition var ignore = null; var listeners = <a href="/OpenForum/Javascript/Core/" target="newTab"><img src='/OpenForum/Images/icons/png/link_go.png' /></a>; inq.addListener( function( data) { if(data.action && data.action=="run") { OpenForum.evaluate( data.script ); } else if(data.action && data.action=="set") { ignore = data.name; OpenForum.evaluate( data.name + " = " + JSON.stringify( data.value ) ); } else if(data.action && data.action=="message") { inq.notifyListeners( data.message ); } }); inq.notifyListeners = function(message) { for( var l in listeners ) { var listener = listeners<a href="/OpenForum/Editor?pageName=/OpenForum/Javascript/Core/l"target="editor" style="color: red" title="The page /OpenForum/Editor?pageName=/OpenForum/Javascript/Core/l does not exist. Click to create it.">l</a>; if( listener.type == "*" || listener.type == message.type ) { listener.fn( message ); } } }; self.addMessageListener = function( listener, type ) { listeners.push( {fn: listener, type: type} ); }; self.send = function(message) { inq.send( { action: "message",tabId: inq.getTabId(),"message": message } ); }; self.run = function( script ) { inq.send( { action: "run",tabId: inq.getTabId(),"script": script } ); }; self.share = function( name) { OpenForum.getObject( name ).addListener( function( obj ) { if( ignore != obj.getId() ) { inq.send( { action: "set",tabId: inq.getTabId(),"name": obj.getId(), "value": obj.getValue() } ); } else { ignore = null; } } ); }; }; OpenForum.addInitialiser( function() { //inq default. Add ?inq=false to stop if( OpenForum.getParameter("inq")=="false" == false ) { OpenForum.inq = new OpenForum.InQ(); } }); <!-- End of: /OpenForum/Javascript/Core/open-forum-intraq.js--> //==============================================================================================================// //==============================================================================================================// <!-- Source: /OpenForum/Javascript/Core/open-forum-google-font.js--> //==============================================================================================================// <!--<ul><li> Author: </li> <li> Description: </li> </ul>--> OpenForum.loadGoogleFont = function(fontFamily,weight) { if(!weight) weight = 400; OpenForum.loadCSS( "https://fonts.googleapis.com/css2?family="+fontFamily+":wght@"+weight ); }; <!-- End of: /OpenForum/Javascript/Core/open-forum-google-font.js--> //==============================================================================================================// //==============================================================================================================// <!-- Source: /OpenForum/Javascript/Core/open-forum-debug.js--> //==============================================================================================================// <!--<ul><li> Author: </li> <li> Description: </li> </ul>--> OpenForum.debugON = false; OpenForum.setDebugToConsole = function(state) { if( state === true ) { OpenForum.debug = function(type,message,exception) { if(!message) { message = type; type = "INFO"; } console.log( new Date().toLocaleTimeString() + " " + type + " " + message ); if(exception) { if(exception.stack) { console.log("Stack trace: " + exception.stack); } else { console.log("Exception: " + exception); } } }; OpenForum.stop = function() { debugger; }; OpenForum.debug("INFO","OpenForum Console Debugging now on."); } else { OpenForum.debug("INFO","OpenForum Console Debugging now off."); OpenForum.debug = function(type,message,exception) {}; OpenForum.stop = function(){}; } OpenForum.debugON = state; }; OpenForum.stop = function(){}; OpenForum.debug = function(type,message,exception) {}; if( OpenForum.getParameter("debug")=="true" ) { OpenForum.setDebugToConsole(true); } <!-- End of: /OpenForum/Javascript/Core/open-forum-debug.js--> //==============================================================================================================// //==============================================================================================================// <!-- Source: /OpenForum/Javascript/Core/open-forum-user-reference.js--> //==============================================================================================================// OpenForum.getUserReference = function() { var userReference = OpenForum.Storage.get("user.reference"); if(userReference==null) { userReference = "User:"+(""+Math.random()).replace(".","")+":"+new Date().getTime(); OpenForum.Storage.set("user.reference",userReference); } return userReference; }; <!-- End of: /OpenForum/Javascript/Core/open-forum-user-reference.js--> //==============================================================================================================// //==============================================================================================================// <!-- Source: /OpenForum/Javascript/Core/open-forum-bind.js--> //==============================================================================================================// OpenForum.bind = function( a, b) { if(typeof b == "function") { b( OpenForum.getObject( a ).getValue() ); OpenForum.getObject( a ).addListener( function(value) { b( value.getValue() ); } ); } else { OpenForum.getObject( b ).setValue( OpenForum.getObject( a ).getValue() ); OpenForum.getObject( a ).addListener( function(value) { OpenForum.getObject( b ).setValue( value.getValue() ); } ); } }; <!-- End of: /OpenForum/Javascript/Core/open-forum-bind.js--> //==============================================================================================================// //==============================================================================================================// <!-- Source: /OpenForum/Javascript/Core/open-forum-testing.js--> //==============================================================================================================// <!--<ul><li> Author: </li> <li> Description: </li> </ul>--> if(typeof OpenForum == "undefined") { OpenForum = { testing: {} }; } else if(typeof OpenForum.testing == "undefined") { OpenForum.testing = {}; } OpenForum.testing.showComments = function() { var filterNone = function() { return NodeFilter.FILTER_ACCEPT; }; var iterator = document.createNodeIterator(document.body, NodeFilter.SHOW_COMMENT, filterNone); var currentNode; while ( currentNode = iterator.nextNode() ) { try{ var e = document.createElement("div"); //if(currentNode.nextElementSibling.offsetParent!=null) { var x = currentNode.nextElementSibling.offsetTop; var y = currentNode.nextElementSibling.offsetLeft; e.style.position = "absolute"; e.style.top = x; e.style.left = y; e.style.color = "black"; e.style.backgroundColor = "white"; e.style.border = "solid 1px black"; e.style.borderRadius = "8px"; e.style.padding = "2px"; e.style.zIndex = "9999"; //} e.innerHTML = "comment"; e.title = currentNode.nodeValue; currentNode.nextElementSibling.insertAdjacentElement('beforeBegin',e); console.log("Displaying comment " + currentNode.nodeValue); } catch (ex) { console.log("Error displaying comment " + ex); } } }; OpenForum.testing.showIds = function() { var filterNone = function() { return NodeFilter.FILTER_ACCEPT; }; var iterator = document.createNodeIterator(document.body, NodeFilter.SHOW_ALL, filterNone); var currentNode; while ( currentNode = iterator.nextNode() ) { try{ if(typeof currentNode.id == "undefined" || currentNode.id == "") continue; var e = document.createElement("div"); //if(currentNode.nextElementSibling.offsetParent!=null) { var x = currentNode.offsetTop; var y = currentNode.offsetLeft; e.style.position = "absolute"; e.style.top = x; e.style.left = y; e.style.color = "black"; e.style.backgroundColor = "cyan"; e.style.border = "solid 1px black"; e.style.borderRadius = "2px"; e.style.padding = "2px"; e.style.zIndex = "9999"; //} e.innerHTML = "id"; e.title = currentNode.id; currentNode.insertAdjacentElement('beforeBegin',e); console.log("Displaying id " + currentNode.id); } catch (ex) { console.log("Error displaying id " + ex + " for " +currentNode.id); } } }; OpenForum.testing.showNames = function() { var filterNone = function() { return NodeFilter.FILTER_ACCEPT; }; var iterator = document.createNodeIterator(document.body, NodeFilter.SHOW_ALL, filterNone); var currentNode; while ( currentNode = iterator.nextNode() ) { try{ if(typeof currentNode.name == "undefined" || currentNode.name == "") continue; var e = document.createElement("div"); //if(currentNode.nextElementSibling.offsetParent!=null) { var x = currentNode.offsetTop; var y = currentNode.offsetLeft; e.style.position = "absolute"; e.style.top = x; e.style.left = y; e.style.color = "white"; e.style.backgroundColor = "black"; e.style.border = "solid 1px white"; e.style.borderRadius = "2px"; e.style.padding = "2px"; e.style.zIndex = "9999"; //} e.innerHTML = "name"; e.title = currentNode.name; currentNode.insertAdjacentElement('beforeBegin',e); console.log("Displaying id " + currentNode.id); } catch (ex) { console.log("Error displaying id " + ex + " for " +currentNode.id); } } }; OpenForum.testing.readForm = function() { var data = {}; var is = document.getElementsByTagName("input"); for( var i in is ) { if( is<a href="/OpenForum/Editor?pageName=/OpenForum/Javascript/Core/i"target="editor" style="color: red" title="The page /OpenForum/Editor?pageName=/OpenForum/Javascript/Core/i does not exist. Click to create it.">i</a>.id ) { if(is<a href="/OpenForum/Editor?pageName=/OpenForum/Javascript/Core/i"target="editor" style="color: red" title="The page /OpenForum/Editor?pageName=/OpenForum/Javascript/Core/i does not exist. Click to create it.">i</a>.type == "radio") { data<img src="/OpenForum/Editor?pageName=/OpenForum/Javascript/Core/ is<a href="/OpenForum/Javascript/Core/" target="newTab"><img src='/OpenForum/Images/icons/png/link_go.png' /></a>i" alt=" is<a href="/OpenForum/Javascript/Core/" target="newTab"><img src='/OpenForum/Images/icons/png/link_go.png' /></a>i" title=" is<a href="/OpenForum/Javascript/Core/" target="newTab"><img src='/OpenForum/Images/icons/png/link_go.png' /></a>i"/>.id ] = is<a href="/OpenForum/Editor?pageName=/OpenForum/Javascript/Core/i"target="editor" style="color: red" title="The page /OpenForum/Editor?pageName=/OpenForum/Javascript/Core/i does not exist. Click to create it.">i</a>.checked; } else { data<img src="/OpenForum/Editor?pageName=/OpenForum/Javascript/Core/ is<a href="/OpenForum/Javascript/Core/" target="newTab"><img src='/OpenForum/Images/icons/png/link_go.png' /></a>i" alt=" is<a href="/OpenForum/Javascript/Core/" target="newTab"><img src='/OpenForum/Images/icons/png/link_go.png' /></a>i" title=" is<a href="/OpenForum/Javascript/Core/" target="newTab"><img src='/OpenForum/Images/icons/png/link_go.png' /></a>i"/>.id ] = is<a href="/OpenForum/Editor?pageName=/OpenForum/Javascript/Core/i"target="editor" style="color: red" title="The page /OpenForum/Editor?pageName=/OpenForum/Javascript/Core/i does not exist. Click to create it.">i</a>.value; } } else if( is<a href="/OpenForum/Editor?pageName=/OpenForum/Javascript/Core/i"target="editor" style="color: red" title="The page /OpenForum/Editor?pageName=/OpenForum/Javascript/Core/i does not exist. Click to create it.">i</a>.name ) { if(is<a href="/OpenForum/Editor?pageName=/OpenForum/Javascript/Core/i"target="editor" style="color: red" title="The page /OpenForum/Editor?pageName=/OpenForum/Javascript/Core/i does not exist. Click to create it.">i</a>.type == "radio") { data<img src="/OpenForum/Editor?pageName=/OpenForum/Javascript/Core/ is<a href="/OpenForum/Javascript/Core/" target="newTab"><img src='/OpenForum/Images/icons/png/link_go.png' /></a>i" alt=" is<a href="/OpenForum/Javascript/Core/" target="newTab"><img src='/OpenForum/Images/icons/png/link_go.png' /></a>i" title=" is<a href="/OpenForum/Javascript/Core/" target="newTab"><img src='/OpenForum/Images/icons/png/link_go.png' /></a>i"/>.name ] = is<a href="/OpenForum/Editor?pageName=/OpenForum/Javascript/Core/i"target="editor" style="color: red" title="The page /OpenForum/Editor?pageName=/OpenForum/Javascript/Core/i does not exist. Click to create it.">i</a>.checked; } else { data<img src="/OpenForum/Editor?pageName=/OpenForum/Javascript/Core/ is<a href="/OpenForum/Javascript/Core/" target="newTab"><img src='/OpenForum/Images/icons/png/link_go.png' /></a>i" alt=" is<a href="/OpenForum/Javascript/Core/" target="newTab"><img src='/OpenForum/Images/icons/png/link_go.png' /></a>i" title=" is<a href="/OpenForum/Javascript/Core/" target="newTab"><img src='/OpenForum/Images/icons/png/link_go.png' /></a>i"/>.name ] = is<a href="/OpenForum/Editor?pageName=/OpenForum/Javascript/Core/i"target="editor" style="color: red" title="The page /OpenForum/Editor?pageName=/OpenForum/Javascript/Core/i does not exist. Click to create it.">i</a>.value; } } } is = document.getElementsByTagName("select"); for( var i in is ) { if( is<a href="/OpenForum/Editor?pageName=/OpenForum/Javascript/Core/i"target="editor" style="color: red" title="The page /OpenForum/Editor?pageName=/OpenForum/Javascript/Core/i does not exist. Click to create it.">i</a>.id ) { data<img src="/OpenForum/Editor?pageName=/OpenForum/Javascript/Core/ is<a href="/OpenForum/Javascript/Core/" target="newTab"><img src='/OpenForum/Images/icons/png/link_go.png' /></a>i" alt=" is<a href="/OpenForum/Javascript/Core/" target="newTab"><img src='/OpenForum/Images/icons/png/link_go.png' /></a>i" title=" is<a href="/OpenForum/Javascript/Core/" target="newTab"><img src='/OpenForum/Images/icons/png/link_go.png' /></a>i"/>.id ] = is<a href="/OpenForum/Editor?pageName=/OpenForum/Javascript/Core/i"target="editor" style="color: red" title="The page /OpenForum/Editor?pageName=/OpenForum/Javascript/Core/i does not exist. Click to create it.">i</a>.value; } else if( is<a href="/OpenForum/Editor?pageName=/OpenForum/Javascript/Core/i"target="editor" style="color: red" title="The page /OpenForum/Editor?pageName=/OpenForum/Javascript/Core/i does not exist. Click to create it.">i</a>.name ) { data<img src="/OpenForum/Editor?pageName=/OpenForum/Javascript/Core/ is<a href="/OpenForum/Javascript/Core/" target="newTab"><img src='/OpenForum/Images/icons/png/link_go.png' /></a>i" alt=" is<a href="/OpenForum/Javascript/Core/" target="newTab"><img src='/OpenForum/Images/icons/png/link_go.png' /></a>i" title=" is<a href="/OpenForum/Javascript/Core/" target="newTab"><img src='/OpenForum/Images/icons/png/link_go.png' /></a>i"/>.name ] = is<a href="/OpenForum/Editor?pageName=/OpenForum/Javascript/Core/i"target="editor" style="color: red" title="The page /OpenForum/Editor?pageName=/OpenForum/Javascript/Core/i does not exist. Click to create it.">i</a>.value; } } return data; }; OpenForum.testing.writeToForm = function(data) { for(var i in data) { try{ var el = document.getElementById(i); if(typeof el == "undefined") { el = document.getElementsByName(i)<a href="/OpenForum/Editor?pageName=/OpenForum/Javascript/Core/0"target="editor" style="color: red" title="The page /OpenForum/Editor?pageName=/OpenForum/Javascript/Core/0 does not exist. Click to create it.">0</a>; } if(el.type=="radio") { if(data<a href="/OpenForum/Editor?pageName=/OpenForum/Javascript/Core/i"target="editor" style="color: red" title="The page /OpenForum/Editor?pageName=/OpenForum/Javascript/Core/i does not exist. Click to create it.">i</a>==true) { el.checked=true; console.log( i + ".checked = true" ); } else { el.checked=false; console.log( i + ".checked = false" ); } } else { el.value = data<a href="/OpenForum/Editor?pageName=/OpenForum/Javascript/Core/i"target="editor" style="color: red" title="The page /OpenForum/Editor?pageName=/OpenForum/Javascript/Core/i does not exist. Click to create it.">i</a>; console.log( i + ".value set to " + el.value ); } } catch(e) { console.log("In "+i); console.log("Ex:" + e); } } }; <!-- End of: /OpenForum/Javascript/Core/open-forum-testing.js--> //==============================================================================================================// //==============================================================================================================// <!-- Source: /OpenForum/Javascript/Core/open-forum-input-field.js--> //==============================================================================================================// if(!OpenForum) { OpenForum = {}; } OpenForum.Input={}; OpenForum.Input.getText = function(elementId) { var input = document.getElementById( elementId ); return input.value; }; OpenForum.Input.getSelectedText = function(elementId) { var input = document.getElementById( elementId ); return input.value.substring(input.selectionStart,input.selectionEnd); }; OpenForum.Input.hasSelection = function(elementId) { var input = document.getElementById( elementId ); return input.selectionStart != input.selectionEnd; }; OpenForum.Input.wrapSelectedText = function ( elementId, startText, endText ) { var input = document.getElementById( elementId ); var text = input.value.substring(input.selectionStart,input.selectionEnd); var start = input.value.substring(0,input.selectionStart); var end = input.value.substring(input.selectionEnd); input.value = start + startText + text + endText + end; }; OpenForum.Input.wrapAllText = function ( elementId, startText, endText ) { var input = document.getElementById( elementId ); var text = input.value; input.value = startText + text + endText; }; OpenForum.Input.replaceSelectedText = function ( elementId, replaceWith ) { var input = document.getElementById( elementId ); var start = input.value.substring(0,input.selectionStart); var end = input.value.substring(input.selectionEnd); input.value = start + replaceWith + end; }; OpenForum.Input.appendAtCursor = function ( elementId, text ) { var input = document.getElementById( elementId ); var start = input.value.substring(0,input.selectionEnd); var end = input.value.substring(input.selectionEnd); input.value = start + text + end; }; OpenForum.Input.toDateField = function ( date ) { var value = date.getFullYear()+"-"+(""+(date.getMonth()+1)).padBefore("0",2)+"-"+(""+date.getDate()).padBefore("0",2); return value; }; OpenForum.Input.toDateTimeField = function ( date ) { var value = date.getFullYear()+"-"+(""+(date.getMonth()+1)).padBefore("0",2)+"-"+(""+date.getDate()).padBefore("0",2); value += "T" + (""+date.getHours() ).padBefore("0",2) + ":" + (""+date.getMinutes() ).padBefore("0",2); return value; }; OpenForum.Input.fromDateField = function ( value ) { var parts = value.split("-"); var newDate = new Date(parts<a href="/OpenForum/Editor?pageName=/OpenForum/Javascript/Core/0"target="editor" style="color: red" title="The page /OpenForum/Editor?pageName=/OpenForum/Javascript/Core/0 does not exist. Click to create it.">0</a>, parseInt(parts<a href="/OpenForum/Editor?pageName=/OpenForum/Javascript/Core/1"target="editor" style="color: red" title="The page /OpenForum/Editor?pageName=/OpenForum/Javascript/Core/1 does not exist. Click to create it.">1</a>,10)-1, parts<a href="/OpenForum/Editor?pageName=/OpenForum/Javascript/Core/2"target="editor" style="color: red" title="The page /OpenForum/Editor?pageName=/OpenForum/Javascript/Core/2 does not exist. Click to create it.">2</a>, 0, 0, 0, 0); return newDate; }; OpenForum.Input.fromDateTimeField = function ( value ) { var parts = value.before("T").split("-"); var newDate = new Date(parts<a href="/OpenForum/Editor?pageName=/OpenForum/Javascript/Core/0"target="editor" style="color: red" title="The page /OpenForum/Editor?pageName=/OpenForum/Javascript/Core/0 does not exist. Click to create it.">0</a>, parseInt(parts<a href="/OpenForum/Editor?pageName=/OpenForum/Javascript/Core/1"target="editor" style="color: red" title="The page /OpenForum/Editor?pageName=/OpenForum/Javascript/Core/1 does not exist. Click to create it.">1</a>,10)-1, parts<a href="/OpenForum/Editor?pageName=/OpenForum/Javascript/Core/2"target="editor" style="color: red" title="The page /OpenForum/Editor?pageName=/OpenForum/Javascript/Core/2 does not exist. Click to create it.">2</a>, 0, 0, 0, 0); parts = value.after("T").split(":"); newDate.setHours( parseInt( parts<a href="/OpenForum/Editor?pageName=/OpenForum/Javascript/Core/0"target="editor" style="color: red" title="The page /OpenForum/Editor?pageName=/OpenForum/Javascript/Core/0 does not exist. Click to create it.">0</a> ) ); newDate.setMinutes( parseInt( parts<a href="/OpenForum/Editor?pageName=/OpenForum/Javascript/Core/1"target="editor" style="color: red" title="The page /OpenForum/Editor?pageName=/OpenForum/Javascript/Core/1 does not exist. Click to create it.">1</a> ) ); return newDate; }; <!-- End of: /OpenForum/Javascript/Core/open-forum-input-field.js--> //==============================================================================================================// <!--End Extension InsertFile pageName="/OpenForum/Javascript" fileName="open-forum.js" -->

Child Pages


Build Script

<!--Extension InsertFile pageName="/OpenForum/Javascript/Core" fileName="script.build.json" -->{ "version": "1.16.24", "targetFile": "/OpenForum/Javascript/open-forum.js", "versionFile": "/OpenForum/Javascript/Versions/open-forum.js", "steps": <a href=" { "action": "append", "file": "/OpenForum/Javascript/Core/open-forum-header.js", "ofIndex": "1", "index": "0" }, { "action": "append", "file": "/OpenForum/Javascript/Core/open-forum-dependency.js", "ofIndex": "0", "index": "1" }, { "action": "append", "file": "/OpenForum/Javascript/Core/open-forum-scanner.js", "ofIndex": "1", "index": "2", "searchFor": "", "replaceWith": "", "data": "" }, { "action": "append", "file": "/OpenForum/Javascript/Core/open-forum-files.js", "ofIndex": "1", "index": "3" }, { "action": "replace", "searchFor": "&version;", "replaceWith": "$version", "ofIndex": "2", "index": "4" }, { "action": "replace", "searchFor": "&date;", "replaceWith": "$date", "ofIndex": "3", "index": "5", "data": "", "file": "/OpenForum/Javascript/Core/open-forum-action.js" }, { "action": "append", "file": "/OpenForum/Javascript/Core/open-forum-json.js", "ofIndex": "4", "index": "6" }, { "action": "append", "file": "/OpenForum/Javascript/Core/open-forum-ajax-request.js", "ofIndex": "5", "index": "7" }, { "action": "append", "file": "/OpenForum/Javascript/Core/open-forum-ajax.js", "ofIndex": "6", "index": "8" }, { "action": "append", "file": "/OpenForum/Javascript/Core/open-forum-ajax-post.js", "ofIndex": "7", "index": "9" }, { "action": "append", "file": "/OpenForum/Javascript/Core/open-forum-tree.js", "ofIndex": "8", "index": "10" }, { "action": "append", "file": "/OpenForum/Javascript/Core/open-forum-js-extensions.js", "ofIndex": "9", "index": "11" }, { "action": "append", "file": "/OpenForum/Javascript/Core/open-forum-object.js", "ofIndex": "10", "index": "12" }, { "action": "append", "file": "/OpenForum/Javascript/Core/open-forum-table.js", "ofIndex": "11", "index": "13" }, { "action": "append", "file": "/OpenForum/Javascript/Core/open-forum-browser.js", "ofIndex": "12", "index": "14" }, { "action": "append", "file": "/OpenForum/Javascript/Core/open-forum-action.js", "ofIndex": "13", "index": "15", "searchFor": "", "replaceWith": "", "data": "" }, { "action": "append", "file": "/OpenForum/Javascript/Core/open-forum-utils.js", "ofIndex": "14", "index": "16" }, { "action": "append", "file": "/OpenForum/Javascript/Core/open-forum-storage.js", "ofIndex": "14", "index": "17" }, { "action": "append", "file": "/OpenForum/Javascript/Core/open-forum-ofx.js", "ofIndex": "15", "index": "18" }, { "action": "append", "file": "/OpenForum/Javascript/Core/open-forum-intraq.js", "ofIndex": "16", "index": "19" }, { "action": "append", "file": "/OpenForum/Javascript/Core/open-forum-google-font.js", "ofIndex": "17", "index": "20", "searchFor": "", "replaceWith": "", "data": "" }, { "action": "append", "file": "/OpenForum/Javascript/Core/open-forum-debug.js", "ofIndex": "21", "index": "21" }, { "action": "append", "file": "/OpenForum/Javascript/Core/open-forum-user-reference.js", "index": "22", "searchFor": "", "replaceWith": "", "data": "" }, { "action": "append", "file": "/OpenForum/Javascript/Core/open-forum-bind.js", "index": "23", "searchFor": "", "replaceWith": "", "data": "" }, { "action": "append", "file": "/OpenForum/Javascript/Core/open-forum-testing.js", "index": "24", "searchFor": "", "replaceWith": "", "data": "" }, { "action": "append", "file": "/OpenForum/Javascript/Core/open-forum-input-field.js", "index": "25", "searchFor": "", "replaceWith": "", "data": "" } " target="external_page"> { "action": "append", "file": "/OpenForum/Javascript/Core/open-forum-header.js", "ofIndex": "1", "index": "0" }, { "action": "append", "file": "/OpenForum/Javascript/Core/open-forum-dependency.js", "ofIndex": "0", "index": "1" }, { "action": "append", "file": "/OpenForum/Javascript/Core/open-forum-scanner.js", "ofIndex": "1", "index": "2", "searchFor": "", "replaceWith": "", "data": "" }, { "action": "append", "file": "/OpenForum/Javascript/Core/open-forum-files.js", "ofIndex": "1", "index": "3" }, { "action": "replace", "searchFor": "&version;", "replaceWith": "$version", "ofIndex": "2", "index": "4" }, { "action": "replace", "searchFor": "&date;", "replaceWith": "$date", "ofIndex": "3", "index": "5", "data": "", "file": "/OpenForum/Javascript/Core/open-forum-action.js" }, { "action": "append", "file": "/OpenForum/Javascript/Core/open-forum-json.js", "ofIndex": "4", "index": "6" }, { "action": "append", "file": "/OpenForum/Javascript/Core/open-forum-ajax-request.js", "ofIndex": "5", "index": "7" }, { "action": "append", "file": "/OpenForum/Javascript/Core/open-forum-ajax.js", "ofIndex": "6", "index": "8" }, { "action": "append", "file": "/OpenForum/Javascript/Core/open-forum-ajax-post.js", "ofIndex": "7", "index": "9" }, { "action": "append", "file": "/OpenForum/Javascript/Core/open-forum-tree.js", "ofIndex": "8", "index": "10" }, { "action": "append", "file": "/OpenForum/Javascript/Core/open-forum-js-extensions.js", "ofIndex": "9", "index": "11" }, { "action": "append", "file": "/OpenForum/Javascript/Core/open-forum-object.js", "ofIndex": "10", "index": "12" }, { "action": "append", "file": "/OpenForum/Javascript/Core/open-forum-table.js", "ofIndex": "11", "index": "13" }, { "action": "append", "file": "/OpenForum/Javascript/Core/open-forum-browser.js", "ofIndex": "12", "index": "14" }, { "action": "append", "file": "/OpenForum/Javascript/Core/open-forum-action.js", "ofIndex": "13", "index": "15", "searchFor": "", "replaceWith": "", "data": "" }, { "action": "append", "file": "/OpenForum/Javascript/Core/open-forum-utils.js", "ofIndex": "14", "index": "16" }, { "action": "append", "file": "/OpenForum/Javascript/Core/open-forum-storage.js", "ofIndex": "14", "index": "17" }, { "action": "append", "file": "/OpenForum/Javascript/Core/open-forum-ofx.js", "ofIndex": "15", "index": "18" }, { "action": "append", "file": "/OpenForum/Javascript/Core/open-forum-intraq.js", "ofIndex": "16", "index": "19" }, { "action": "append", "file": "/OpenForum/Javascript/Core/open-forum-google-font.js", "ofIndex": "17", "index": "20", "searchFor": "", "replaceWith": "", "data": "" }, { "action": "append", "file": "/OpenForum/Javascript/Core/open-forum-debug.js", "ofIndex": "21", "index": "21" }, { "action": "append", "file": "/OpenForum/Javascript/Core/open-forum-user-reference.js", "index": "22", "searchFor": "", "replaceWith": "", "data": "" }, { "action": "append", "file": "/OpenForum/Javascript/Core/open-forum-bind.js", "index": "23", "searchFor": "", "replaceWith": "", "data": "" }, { "action": "append", "file": "/OpenForum/Javascript/Core/open-forum-testing.js", "index": "24", "searchFor": "", "replaceWith": "", "data": "" }, { "action": "append", "file": "/OpenForum/Javascript/Core/open-forum-input-field.js", "index": "25", "searchFor": "", "replaceWith": "", "data": "" } </a> }<!--End Extension InsertFile pageName="/OpenForum/Javascript/Core" fileName="script.build.json" -->

Script elements