Просмотр исходного кода

ECLPlayground: Formatting changes only.

A new editor has been auto formatting the javascript.  There are no
logic changes in this commit.

Signed-off-by: Gordon Smith <gordon.smith@lexisnexis.com>
Gordon Smith 13 лет назад
Родитель
Сommit
c311c9fbe5

+ 84 - 79
esp/files/ECLPlayground.htm

@@ -18,73 +18,73 @@
 ##############################################################################
 -->
 <html>
-
 <head>
-<meta charset="utf-8">
-<title>Demo: Graph Control</title>
-<link href="CodeMirror2/lib/codemirror.css" rel="stylesheet">
-<script src="CodeMirror2/lib/codemirror.js"></script>
-<script src="CodeMirror2/mode/ecl/ecl.js"></script>
-<link href="css/ecl.css" rel="stylesheet">
-<link href="ECLPlayground.css" media="screen" rel="stylesheet">
-<link href="dijit/themes/claro/claro.css" media="screen" rel="stylesheet">
-<link href="dojox/grid/resources/Grid.css" rel="stylesheet">
-<link href="dojox/grid/resources/claroGrid.css" rel="stylesheet">
-<!-- load dojo and provide config via dojoConfig global -->
-<script>
-	var dojoConfig = (function(){
-		var base = location.href.split("/");
-		var developerMode = base[0] == "file:";	//  If URL is local then we are in web developer mode!
-		base.pop();
-		base = base.join("/");
-		
-		return {
-			async: true,
-			isDebug: developerMode,
-			parseOnLoad: true,
-			urlBase: base,
-			serverIP:  developerMode ? "192.168.2.68" : "",	//IP of any ESP server
-			packages: [{
-				name: "main",
-				location: base + "/"  
-			}, {
-				name: "hpcc",
-				location: base + "/scripts/"
-			}]
-		};
-	})();
-	</script>
-<script src="dojo/dojo.js"></script>
-<script>
-	require(["dijit/layout/BorderContainer", "dijit/layout/ContentPane", "dijit/layout/TabContainer", "dijit/layout/AccordionContainer", "dijit/layout/AccordionPane", 
+    <meta charset="utf-8">
+    <title>Demo: Graph Control</title>
+    <link href="CodeMirror2/lib/codemirror.css" rel="stylesheet">
+    <script src="CodeMirror2/lib/codemirror.js"></script>
+    <script src="CodeMirror2/mode/ecl/ecl.js"></script>
+    <link href="css/ecl.css" rel="stylesheet">
+    <link href="ECLPlayground.css" media="screen" rel="stylesheet">
+    <link href="dijit/themes/claro/claro.css" media="screen" rel="stylesheet">
+    <link href="dojox/grid/resources/Grid.css" rel="stylesheet">
+    <link href="dojox/grid/resources/claroGrid.css" rel="stylesheet">
+    <!-- load dojo and provide config via dojoConfig global -->
+    <script>
+        var dojoConfig = (function () {
+            var base = location.href.split("/");
+            var developerMode = base[0] == "file:"; //  If URL is local then we are in web developer mode!
+            base.pop();
+            base = base.join("/");
+
+            return {
+                async: true,
+                isDebug: developerMode,
+                parseOnLoad: true,
+                urlBase: base,
+                serverIP: developerMode ? "192.168.2.68" : "", //IP of any ESP server
+                packages: [{
+                    name: "main",
+                    location: base + "/"
+                }, {
+                    name: "hpcc",
+                    location: base + "/scripts/"
+                }]
+            };
+        })();
+    </script>
+    <script src="dojo/dojo.js"></script>
+    <script>
+        require(["dijit/layout/BorderContainer", "dijit/layout/ContentPane", "dijit/layout/TabContainer", "dijit/layout/AccordionContainer", "dijit/layout/AccordionPane",
 	"dojo/domReady!"]);
-</script>
-<script>
-	require(["main/ECLPlayground", "dojo/domReady!"], function(app) {
-		app.init();
-	});
-</script>
+    </script>
+    <script>
+        require(["main/ECLPlayground", "dojo/domReady!"], function (app) {
+            app.init();
+        });
+    </script>
 </head>
-
 <body class="claro">
-
-<!-- overlay -->
-<div id="loadingOverlay" class="pageOverlay">
-	<div class="loadingMessage">
-		Loading...</div>
-</div>
-<!-- application -->
-<div id="appLayout" class="demoLayout" data-dojo-props="design: 'headline'" data-dojo-type="dijit.layout.BorderContainer">
-	<div id="topPane" class="topPanel" data-dojo-props="region: 'top'" data-dojo-type="dijit.layout.ContentPane">
-		<div id="title" style="display:inline-block; vertical-align:middle">ECL Playground</div>
-		<div style="float: right;display :inline-block; vertical-align:middle">
-			<label for="sampleSelect">Sample:</label>
-			<div id="sampleSelect"></div>
-		</div>
-	</div>
-	<div id="tabs" class="centerPanel" data-dojo-props="region: 'center'" data-dojo-type="dijit.layout.ContentPane">
-		<div id="eclContent">
-			<textarea id="eclCode">
+    <!-- overlay -->
+    <div id="loadingOverlay" class="pageOverlay">
+        <div class="loadingMessage">
+            Loading...</div>
+    </div>
+    <!-- application -->
+    <div id="appLayout" class="demoLayout" data-dojo-props="design: 'headline'" data-dojo-type="dijit.layout.BorderContainer">
+        <div id="topPane" class="topPanel" data-dojo-props="region: 'top'" data-dojo-type="dijit.layout.ContentPane">
+            <div id="title" style="display: inline-block; vertical-align: middle">
+                ECL Playground</div>
+            <div style="float: right; display: inline-block; vertical-align: middle">
+                <label for="sampleSelect">
+                    Sample:</label>
+                <div id="sampleSelect">
+                </div>
+            </div>
+        </div>
+        <div id="tabs" class="centerPanel" data-dojo-props="region: 'center'" data-dojo-type="dijit.layout.ContentPane">
+            <div id="eclContent">
+                <textarea id="eclCode">
 /*
     Example code - use without restriction.  
 */
@@ -102,21 +102,26 @@ somePeople := allPeople(LastName = 'Smith');
 
 //  Outputs  ---
 somePeople;
-			</textarea> 
-		</div>
-	</div>
-	<div id="rightPane" class="edgePanel" data-dojo-props="minSize:120, region: 'right', splitter:true" data-dojo-type="dijit.layout.TabContainer" style="width: 240px;">
-		<div id="graphs" style="width:  100%; height: 100%"></div>
-	</div>
-	<div id="bottomPane" class="edgePanel" data-dojo-props="minSize:120, region: 'bottom', splitter:true, tabPosition: 'bottom'" data-dojo-type="dijit.layout.TabContainer" style="height: 240px">
-	</div>
-	<div id="submitPane" class="edgePanel"  data-dojo-props="region: 'bottom'" data-dojo-type="dijit.layout.ContentPane">
-		<div style="display:inline-block; vertical-align:middle"><button id="submitBtn">Submit</button></div>
-		<div style="float: right;display :inline-block; vertical-align:middle">
-			<div id="status">...</div>
-		</div>
-	</div>
-</div>
+			</textarea>
+            </div>
+        </div>
+        <div id="rightPane" class="edgePanel" data-dojo-props="minSize:120, region: 'right', splitter:true"
+            data-dojo-type="dijit.layout.TabContainer" style="width: 240px;">
+            <div id="graphs" style="width: 100%; height: 100%">
+            </div>
+        </div>
+        <div id="bottomPane" class="edgePanel" data-dojo-props="minSize:120, region: 'bottom', splitter:true, tabPosition: 'bottom'"
+            data-dojo-type="dijit.layout.TabContainer" style="height: 240px">
+        </div>
+        <div id="submitPane" class="edgePanel" data-dojo-props="region: 'bottom'" data-dojo-type="dijit.layout.ContentPane">
+            <div style="display: inline-block; vertical-align: middle">
+                <button id="submitBtn">
+                    Submit</button></div>
+            <div style="float: right; display: inline-block; vertical-align: middle">
+                <div id="status">
+                    ...</div>
+            </div>
+        </div>
+    </div>
 </body>
-
 </html>

+ 60 - 60
esp/files/ECLPlayground.js

@@ -14,32 +14,32 @@
 #    You should have received a copy of the GNU Affero General Public License
 #    along with this program.  If not, see <http://www.gnu.org/licenses/>.
 ############################################################################## */
-define([ 
-	"dojo/_base/config", 
-	"dojo/_base/fx", 
-	"dojo/_base/window", 
-	"dojo/dom", 
+define([
+	"dojo/_base/config",
+	"dojo/_base/fx",
+	"dojo/_base/window",
+	"dojo/dom",
 	"dojo/dom-style",
-	"dojo/dom-geometry", 
+	"dojo/dom-geometry",
 	"dojo/on",
-	"hpcc/EclEditorControl", 
-	"hpcc/GraphControl", 
+	"hpcc/EclEditorControl",
+	"hpcc/GraphControl",
 	"hpcc/ResultsControl",
-	"hpcc/SampleSelectControl", 
+	"hpcc/SampleSelectControl",
 	"hpcc/ESPWorkunit"
-], function(baseConfig, baseFx, baseWindow, dom, domStyle, domGeometry, on, EclEditor, GraphControl, ResultsControl, Select, Workunit) {
-			var editorControl = null, 
-			graphControl = null, 
-			resultsControl = null, 
-			sampleSelectControl = null, 
+], function (baseConfig, baseFx, baseWindow, dom, domStyle, domGeometry, on, EclEditor, GraphControl, ResultsControl, Select, Workunit) {
+	var editorControl = null,
+			graphControl = null,
+			resultsControl = null,
+			sampleSelectControl = null,
 
-			initUi = function() {
+			initUi = function () {
 				on(dom.byId("submitBtn"), "click", doSubmit);
 				initSamples();
 				initEditor();
 				initResultsControl();
 				//  ActiveX will flicker if created before initial layout
-				setTimeout(function(){
+				setTimeout(function () {
 					initGraph();
 					var wuid = dojo.queryToObject(dojo.doc.location.search.substr((dojo.doc.location.search[0] === "?" ? 1 : 0)))["wuid"];
 					if (wuid) {
@@ -48,41 +48,41 @@ define([
 				}, 1);
 			},
 
-			initSamples = function() {
+			initSamples = function () {
 				sampleSelectControl = new Select({
-					id : "sampleSelect",
-					samplesURL : "ecl/ECLPlaygroundSamples.json",
-					onNewSelection : function(eclText) {
+					id: "sampleSelect",
+					samplesURL: "ecl/ECLPlaygroundSamples.json",
+					onNewSelection: function (eclText) {
 						resetPage();
 						editorControl.setText(eclText);
 					}
 				});
 			},
 
-			initEditor = function() {
+			initEditor = function () {
 				editorControl = new EclEditor({
-					domId : "eclCode"
+					domId: "eclCode"
 				});
 			},
 
-			initGraph = function() {
+			initGraph = function () {
 				graphControl = new GraphControl({
-					id : "gvc",
-					width : "100%",
-					height : "100%",
-					onInitialize : function() {
+					id: "gvc",
+					width: "100%",
+					height: "100%",
+					onInitialize: function () {
 					},
 
-					onLayoutFinished : function() {
+					onLayoutFinished: function () {
 						graphControl.obj.setMessage('');
 						graphControl.obj.centerOnItem(0, true);
 					},
 
-					onMouseDoubleClick : function(item) {
+					onMouseDoubleClick: function (item) {
 						graphControl.obj.centerOnItem(item, true);
 					},
-					
-					onSelectionChanged: function(items) {
+
+					onSelectionChanged: function (items) {
 						editorControl.clearHighlightLines();
 						for (var i = 0; i < items.length; ++i) {
 							var props = graphControl.obj.getProperties(items[i]);
@@ -97,16 +97,16 @@ define([
 				}, dom.byId("graphs"));
 			},
 
-			initResultsControl = function() {
+			initResultsControl = function () {
 				var _resultsControl = resultsControl = new ResultsControl({
-					resultsSheetID : "bottomPane",
-					onErrorClick : function(line, col) {
+					resultsSheetID: "bottomPane",
+					onErrorClick: function (line, col) {
 						editorControl.setCursor(line, col);
 					}
 				});
 			},
 
-			resetPage = function() {
+			resetPage = function () {
 				editorControl.clearErrors();
 				editorControl.clearHighlightLines();
 				graphControl.clear();
@@ -144,25 +144,25 @@ define([
 				wu.monitor();
 			},
 
-			doSubmit = function(evt) {
+			doSubmit = function (evt) {
 				resetPage();
 				wu = new Workunit({
-					wuid : "",
-					
-					onCreate : function() {
+					wuid: "",
+
+					onCreate: function () {
 						wu.update(editorControl.getText());
 					},
-					onUpdate : function() {
+					onUpdate: function () {
 						wu.submit("hthor");
 					},
-					onSubmit : function() {
+					onSubmit: function () {
 					},
-					onMonitor : function() {
-						dom.byId("status").innerHTML = wu.state;						
+					onMonitor: function () {
+						dom.byId("status").innerHTML = wu.state;
 						if (wu.isComplete())
 							wu.getInfo();
 					},
-					onGetInfo : function() {
+					onGetInfo: function () {
 						if (wu.errors.length) {
 							editorControl.setErrors(wu.errors);
 							resultsControl.addExceptionTab(wu.errors);
@@ -170,41 +170,41 @@ define([
 						wu.getResults();
 						wu.getGraphs();
 					},
-					onGetGraph : function(idx) {
+					onGetGraph: function (idx) {
 						graphControl.loadXGMML(wu.graphs[idx].xgmml, true);
 					},
-					onGetResult : function(idx) {
+					onGetResult: function (idx) {
 						resultsControl.addDatasetTab(wu.results[idx].dataset);
 					}
 				});
 			},
 
-			startLoading = function(targetNode) {
+			startLoading = function (targetNode) {
 				var overlayNode = dom.byId("loadingOverlay");
 				if ("none" == domStyle.get(overlayNode, "display")) {
 					var coords = domGeometry.getMarginBox(targetNode || baseWindow.body());
 					domGeometry.setMarginBox(overlayNode, coords);
 					domStyle.set(dom.byId("loadingOverlay"), {
-						display : "block",
-						opacity : 1
+						display: "block",
+						opacity: 1
 					});
 				}
 			},
 
-			endLoading = function() {
+			endLoading = function () {
 				baseFx.fadeOut({
-					node : dom.byId("loadingOverlay"),
-					onEnd : function(node) {
+					node: dom.byId("loadingOverlay"),
+					onEnd: function (node) {
 						domStyle.set(node, "display", "none");
 					}
 				}).play();
 			}
 
-			return {
-				init : function() {
-					startLoading();
-					initUi();
-					endLoading();
-				}
-			};
-		});
+	return {
+		init: function () {
+			startLoading();
+			initUi();
+			endLoading();
+		}
+	};
+});

+ 34 - 34
esp/files/scripts/ESPBase.js

@@ -15,54 +15,54 @@
 #    along with this program.  If not, see <http://www.gnu.org/licenses/>.
 ############################################################################## */
 define([
-	"dojo/_base/config", 
+	"dojo/_base/config",
 	"dojo/_base/declare"
-], function(baseConfig, declare) {
+], function (baseConfig, declare) {
 	return declare(null, {
 
-		constructor : function(args) {
+		constructor: function (args) {
 			declare.safeMixin(this, args);
 		},
-		
-		getParam : function(key) {
+
+		getParam: function (key) {
 			var value = dojo.queryToObject(dojo.doc.location.search.substr((dojo.doc.location.search[0] === "?" ? 1 : 0)))[key];
-			if(value)
+			if (value)
 				return value;
 			return baseConfig[key];
 		},
-		
-		getBaseURL : function() {
+
+		getBaseURL: function () {
 			var serverIP = this.getParam("serverIP");
-			if(serverIP)
+			if (serverIP)
 				return "http://" + serverIP + ":8010/WsWorkunits";
 			return "/WsWorkunits";
 		},
 
-		parseKeyValue : function(xmlDom, nodeLabel) {
+		parseKeyValue: function (xmlDom, nodeLabel) {
 			var items = xmlDom.getElementsByTagName(nodeLabel);
-			if(items.length && items[0].childNodes.length) {
+			if (items.length && items[0].childNodes.length) {
 				return items[0].childNodes[0].nodeValue;
 			}
 			return "";
 		},
-		
-		parseKeyChildren : function(xmlDom, nodeLabel) {
+
+		parseKeyChildren: function (xmlDom, nodeLabel) {
 			var items = xmlDom.getElementsByTagName(nodeLabel);
-			if(items.length && items[0].childNodes.length) {
+			if (items.length && items[0].childNodes.length) {
 				return items[0].childNodes;
 			}
 			return null;
 		},
-		
-		parseRows : function(xmlDom, nodeLabel) {
+
+		parseRows: function (xmlDom, nodeLabel) {
 			var rows = [];
 			var items = xmlDom.getElementsByTagName(nodeLabel);
-			for(var i = 0; i < items.length; ++i) {
+			for (var i = 0; i < items.length; ++i) {
 				var item = items[i];
 				var cols = {};
-				for(var c = 0; c < item.childNodes.length; ++c) {
+				for (var c = 0; c < item.childNodes.length; ++c) {
 					colNode = item.childNodes[c];
-					if(colNode.childNodes.length && colNode.childNodes[0].nodeValue) {
+					if (colNode.childNodes.length && colNode.childNodes[0].nodeValue) {
 						cols[colNode.nodeName] = colNode.childNodes[0].nodeValue;
 					} else {
 						cols[colNode.nodeName] = "";
@@ -72,43 +72,43 @@ define([
 			}
 			return rows;
 		},
-		
+
 		//  <XXX><YYY/><YYY/><YYY/><YYY/></XXX>
-		parseDataset : function(xmlDom, _name, nodeLabel) {
+		parseDataset: function (xmlDom, _name, nodeLabel) {
 			var retVal = {};
 			var retValRows = this.parseRows(xmlDom, nodeLabel);
 			var retValHeader = [];
-			if(retValRows.length) {
-				for(var key in retValRows[0]) {
+			if (retValRows.length) {
+				for (var key in retValRows[0]) {
 					retValHeader.push(key)
 				}
 			}
 			retVal = {
-				name : _name,
-				header : retValHeader,
-				rows : retValRows
+				name: _name,
+				header: retValHeader,
+				rows: retValRows
 			};
 			return retVal;
 
 		},
-		
-		parseDatasets : function(xmlDom, nodeLabel, innerNodeLabel) {
+
+		parseDatasets: function (xmlDom, nodeLabel, innerNodeLabel) {
 			var retVal = [];
 			var datasets = xmlDom.getElementsByTagName(nodeLabel);
-			for(var d = 0; d < datasets.length; ++d) {
+			for (var d = 0; d < datasets.length; ++d) {
 				var dataset = datasets[d];
 				var retValRows = this.parseRows(dataset, innerNodeLabel);
 				var retValHeader = [];
-				if(retValRows.length) {
-					for(var key in retValRows[0]) {
+				if (retValRows.length) {
+					for (var key in retValRows[0]) {
 						retValHeader.push(key)
 					}
 				}
 
 				retVal.push({
-					name : dataset.getAttribute("name"),
-					header : retValHeader,
-					rows : retValRows
+					name: dataset.getAttribute("name"),
+					header: retValHeader,
+					rows: retValRows
 				});
 			}
 			return retVal;

+ 82 - 81
esp/files/scripts/ESPWorkunit.js

@@ -15,108 +15,109 @@
 #    along with this program.  If not, see <http://www.gnu.org/licenses/>.
 ############################################################################## */
 define([
-	"dojo/_base/config", 
-	"dojo/_base/declare", 
-	"dojo/_base/xhr", 
-	"hpcc/ESPBase"], function(baseConfig, declare, baseXhr, ESPBase) {
+	"dojo/_base/config",
+	"dojo/_base/declare",
+	"dojo/_base/xhr",
+	"hpcc/ESPBase"
+], function (baseConfig, declare, baseXhr, ESPBase) {
 	return declare(ESPBase, {
-		wuid : "",
+		wuid: "",
 
-		stateID : 0,
-		state : "",
+		stateID: 0,
+		state: "",
 
 		text: "",
 
-		resultCount : 0,
-		results : [],
+		resultCount: 0,
+		results: [],
 
-		graphNameIndex : [],
-		graphs : [],
+		graphNameIndex: [],
+		graphs: [],
 
-		exceptions : [],
-		errors : [],
-		timers : [],
+		exceptions: [],
+		errors: [],
+		timers: [],
 
-		onCreate : function() {
+		onCreate: function () {
 		},
-		onUpdate : function() {
+		onUpdate: function () {
 		},
-		onSubmit : function() {
+		onSubmit: function () {
 		},
-		onMonitor : function() {
+		onMonitor: function () {
 		},
-		onComplete : function() {
+		onComplete: function () {
 		},
 		onGetText: function () {
 		},
-		onGetInfo : function() {
+		onGetInfo: function () {
 		},
-		onGetGraph : function(name) {
+		onGetGraph: function (name) {
 		},
-		constructor : function(args) {
+		constructor: function (args) {
 			declare.safeMixin(this, args);
 
-			if(!this.wuid) {
+			if (!this.wuid) {
 				this.create();
 			}
 		},
-		isComplete : function() {
+		isComplete: function () {
 			switch (this.stateID) {
 				case '3':
-				//WUStateCompleted:
+					//WUStateCompleted:
 				case '4':
-				//WUStateFailed:
+					//WUStateFailed:
 				case '5':
-				//WUStateArchived:
+					//WUStateArchived:
 				case '7':
 					//WUStateAborted:
 					return true;
 			}
 			return false;
 		},
-		monitor : function() {
+		monitor: function () {
 			var request = {};
 			request['Wuid'] = this.wuid;
 			request['rawxml_'] = "1";
 
 			var context = this;
 			baseXhr.post({
-				url : this.getBaseURL() + "/WUQuery",
-				handleAs : "xml",
-				content : request,
-				load : function(xmlDom) {
+				url: this.getBaseURL() + "/WUQuery",
+				handleAs: "xml",
+				content: request,
+				load: function (xmlDom) {
 					context.stateID = context.parseKeyValue(xmlDom, "StateID");
 					context.state = context.parseKeyValue(xmlDom, "State");
 					context.onMonitor();
-					if(!context.isComplete()) {
-						setTimeout(function() {
+					if (!context.isComplete()) {
+						setTimeout(function () {
 							context.monitor();
 						}, 200);
 					}
 				},
-				error : function() {
+				error: function () {
 					done = true;
 				}
 			});
 		},
-		create : function(ecl, _sync) {
+		create: function (ecl, _sync) {
 			var request = {};
 			request['rawxml_'] = "1";
 
 			var context = this;
 			baseXhr.post({
-				url : this.getBaseURL() + "/WUCreate",
-				handleAs : "xml",
-				content : request,
-				load : function(xmlDom) {
+				url: this.getBaseURL() + "/WUCreate",
+				handleAs: "xml",
+				content: request,
+				load: function (xmlDom) {
 					context.wuid = context.parseKeyValue(xmlDom, "Wuid");
 					context.onCreate();
 				},
-				error : function() {
+				error: function () {
 				}
 			});
 		},
-		update : function(ecl, _sync) {
+		update: function (ecl, _sync) {
 			var request = {};
 			request['Wuid'] = this.wuid;
 			request['QueryText'] = ecl;
@@ -124,18 +125,18 @@ define([
 
 			var context = this;
 			baseXhr.post({
-				url : this.getBaseURL() + "/WUUpdate",
-				handleAs : "xml",
-				content : request,
-				sync : _sync,
-				load : function(xmlDom) {
+				url: this.getBaseURL() + "/WUUpdate",
+				handleAs: "xml",
+				content: request,
+				sync: _sync,
+				load: function (xmlDom) {
 					context.onUpdate();
 				},
-				error : function() {
+				error: function () {
 				}
 			});
 		},
-		submit : function(target, _sync) {
+		submit: function (target, _sync) {
 			var request = {};
 			request['Wuid'] = this.wuid;
 			request['Cluster'] = target;
@@ -143,15 +144,15 @@ define([
 
 			var context = this;
 			baseXhr.post({
-				url : this.getBaseURL() + "/WUSubmit",
-				handleAs : "xml",
-				content : request,
-				sync : _sync,
-				load : function(xmlDom) {
+				url: this.getBaseURL() + "/WUSubmit",
+				handleAs: "xml",
+				content: request,
+				sync: _sync,
+				load: function (xmlDom) {
 					context.onSubmit();
 					context.monitor();
 				},
-				error : function() {
+				error: function () {
 				}
 			});
 		},
@@ -203,12 +204,12 @@ define([
 				context.onGetInfo();
 			}, true, true, false, true, false, false, true, false, false, false, false);
 		},
-		getGraphs : function() {
-			for(var i = 0; i < this.graphs.length; ++i) {
+		getGraphs: function () {
+			for (var i = 0; i < this.graphs.length; ++i) {
 				this.getGraph(i);
 			}
 		},
-		getGraph : function(idx, _sync) {
+		getGraph: function (idx, _sync) {
 			var request = {};
 			request['Wuid'] = this.wuid;
 			request['GraphName'] = this.graphs[idx].Name;
@@ -216,24 +217,24 @@ define([
 
 			var context = this;
 			baseXhr.post({
-				url : this.getBaseURL() + "/WUGetGraph",
-				handleAs : "xml",
-				content : request,
-				sync : _sync,
-				load : function(xmlDom) {
+				url: this.getBaseURL() + "/WUGetGraph",
+				handleAs: "xml",
+				content: request,
+				sync: _sync,
+				load: function (xmlDom) {
 					context.graphs[idx].xgmml = context.parseKeyValue(xmlDom, "Graph");
 					context.onGetGraph(idx);
 				},
-				error : function() {
+				error: function () {
 				}
 			});
 		},
-		getResults : function() {
-			for(var i = 0; i < this.results.length; ++i) {
+		getResults: function () {
+			for (var i = 0; i < this.results.length; ++i) {
 				this.getResult(i);
 			}
 		},
-		getResult : function(idx, _sync) {
+		getResult: function (idx, _sync) {
 			var request = {};
 			request['Wuid'] = this.wuid;
 			request['Sequence'] = this.results[idx].Sequence;
@@ -243,38 +244,38 @@ define([
 
 			var context = this;
 			baseXhr.post({
-				url : this.getBaseURL() + "/WUResult",
-				handleAs : "xml",
-				content : request,
-				sync : _sync,
-				load : function(xmlDom) {
+				url: this.getBaseURL() + "/WUResult",
+				handleAs: "xml",
+				content: request,
+				sync: _sync,
+				load: function (xmlDom) {
 					var name = context.parseKeyValue(xmlDom, "Name");
 					var resultDom = xmlDom.getElementsByTagName("Result");
-					if(resultDom.length) {
+					if (resultDom.length) {
 						context.results[idx].dataset = context.parseDataset(resultDom[0], name, "Row");
 					}
 					context.onGetResult(idx);
 				},
-				error : function() {
+				error: function () {
 				}
 			});
 		},
-		getInfoFast : function(_sync) {
+		getInfoFast: function (_sync) {
 			var request = {};
 			request['Wuid'] = this.wuid;
 			request['rawxml_'] = "1";
 
 			var context = this;
 			baseXhr.post({
-				url : this.getBaseURL() + "/WUQuery",
-				handleAs : "xml",
-				content : request,
-				sync : _sync,
-				load : function(xmlDom) {
+				url: this.getBaseURL() + "/WUQuery",
+				handleAs: "xml",
+				content: request,
+				sync: _sync,
+				load: function (xmlDom) {
 					context.stateID = context.parseKeyValue(xmlDom, "StateID");
 					context.state = context.parseKeyValue(xmlDom, "State");
 				},
-				error : function() {
+				error: function () {
 					done = true;
 				}
 			});

+ 18 - 18
esp/files/scripts/EclEditorControl.js

@@ -16,32 +16,32 @@
 ############################################################################## */
 define([
 	"dojo/_base/declare"
-], function(declare) {
+], function (declare) {
 	return declare(null, {
-		domId : "",
-		editor : null,
-		markers : [],
-		highlightLines : [],
+		domId: "",
+		editor: null,
+		markers: [],
+		highlightLines: [],
 
 		// The constructor    
-		constructor : function(args) {
+		constructor: function (args) {
 			declare.safeMixin(this, args);
 			this.editor = CodeMirror.fromTextArea(document.getElementById(this.domId), {
-				tabMode : "indent",
-				matchBrackets : true,
-				gutter : true,
-				lineNumbers : true
+				tabMode: "indent",
+				matchBrackets: true,
+				gutter: true,
+				lineNumbers: true
 			});
 		},
 
-		clearErrors : function(errWarnings) {
+		clearErrors: function (errWarnings) {
 			for (var i = 0; i < this.markers.length; ++i) {
 				this.editor.clearMarker(this.markers[i]);
 			}
 			this.markers = [];
 		},
 
-		setErrors : function(errWarnings) {
+		setErrors: function (errWarnings) {
 			for (var i = 0; i < errWarnings.length; ++i) {
 				this.markers.push(this.editor.setMarker(parseInt(
 						errWarnings[i].LineNo, 10) - 1, "",
@@ -49,26 +49,26 @@ define([
 			}
 		},
 
-		setCursor : function(line, col) {
+		setCursor: function (line, col) {
 			this.editor.setCursor(line - 1, col - 1);
 			this.editor.focus();
 		},
 
-		clearHighlightLines : function() {
+		clearHighlightLines: function () {
 			for (var i = 0; i < this.highlightLines.length; ++i) {
 				this.editor.setLineClass(this.highlightLines[i], null, null);
 			}
 		},
-		
-		highlightLine : function(line) {
+
+		highlightLine: function (line) {
 			this.highlightLines.push(this.editor.setLineClass(line - 1, "highlightline"));
 		},
 
-		setText : function(ecl) {
+		setText: function (ecl) {
 			this.editor.setValue(ecl);
 		},
 
-		getText : function() {
+		getText: function () {
 			return this.editor.getValue();
 		}
 	});

+ 47 - 47
esp/files/scripts/GraphControl.js

@@ -14,51 +14,51 @@
 #    You should have received a copy of the GNU Affero General Public License
 #    along with this program.  If not, see <http://www.gnu.org/licenses/>.
 ############################################################################## */
-define([    
+define([
 	"dojo/_base/declare",
 	"dojo/_base/sniff",
 	"dojo/dom"
-], function(declare, has, dom) {
+], function (declare, has, dom) {
 	return declare(null, {
 		id: "gvc",
 		width: "",
 		height: "",
-		installed:  false,
+		installed: false,
 		markup: "",
 		obj: {},
 		eventsRegistered: false,
 
-		onInitialize: function(){
+		onInitialize: function () {
 			//  Creater can override.
 		},
-		
-		onLayoutFinished: function() {
+
+		onLayoutFinished: function () {
 			//  Creater can override.
 		},
 
-		onMouseDoubleClick: function(item) {
+		onMouseDoubleClick: function (item) {
 			//  Creater can override.
 		},
 
-		onSelectionChanged: function(items) {
+		onSelectionChanged: function (items) {
 			//  Creater can override.
 		},
-	
+
 		// The constructor    
-		constructor: function(args, parentNode){
+		constructor: function (args, parentNode) {
 			declare.safeMixin(this, args);
-			
-			if(has("ie")){
-				this.installed = (function(){
-					try{
+
+			if (has("ie")) {
+				this.installed = (function () {
+					try {
 						var o = new ActiveXObject("HPCCSystems.HPCCSystemsGraphViewControl.1");
 						return true;
-					} catch(e){ }
+					} catch (e) { }
 					return false;
 				})();
-		
-				if(!this.installed){ 
-					this.markup = this.getInstallMarkup(); 
+
+				if (!this.installed) {
+					this.markup = this.getInstallMarkup();
 				} else {
 					this.markup = '<object type="application/x-hpccsystemsgraphviewcontrol" '
 						+ 'id="' + this.id + '" '
@@ -66,17 +66,17 @@ define([
 						+ 'height="' + this.height + '"></object>';
 				}
 			} else {
-				this.installed = (function(){
-					for(var i=0, p=navigator.plugins, l=p.length; i<l; i++){
-						if(p[i].name.indexOf("HPCCSystemsGraphViewControl")>-1){
+				this.installed = (function () {
+					for (var i = 0, p = navigator.plugins, l = p.length; i < l; i++) {
+						if (p[i].name.indexOf("HPCCSystemsGraphViewControl") > -1) {
 							return true;
 						}
 					}
 					return false;
 				})();
-			
-				if(!this.installed){ 
-					this.markup = this.getInstallMarkup(); 
+
+				if (!this.installed) {
+					this.markup = this.getInstallMarkup();
 				} else {
 					this.markup = '<embed type="application/x-hpccsystemsgraphviewcontrol" '
 						+ 'id="' + this.id + '" '
@@ -88,26 +88,26 @@ define([
 			parentNode.innerHTML = this.markup;
 			this.obj = dom.byId(this.id);
 			var context = this;
-			setTimeout(function(){
+			setTimeout(function () {
 				context.onInitialize();
 			}, 20);
 		},
-		
-		getInstallMarkup: function() {
+
+		getInstallMarkup: function () {
 			return "<h4>Graph View</h4>" +
-			"<p>To enable graph views, please install the Graph View Control plugin:</p>" + 
-			"<a href=\"http://graphcontrol.hpccsystems.com/stable/SetupGraphControl.msi\">Internet Explorer + Firefox (32bit)</a><br>" + 
-			"<a href=\"http://graphcontrol.hpccsystems.com/stable/SetupGraphControl64.msi\">Internet Explorer + Firefox (64bit)</a><br>" + 
+			"<p>To enable graph views, please install the Graph View Control plugin:</p>" +
+			"<a href=\"http://graphcontrol.hpccsystems.com/stable/SetupGraphControl.msi\">Internet Explorer + Firefox (32bit)</a><br>" +
+			"<a href=\"http://graphcontrol.hpccsystems.com/stable/SetupGraphControl64.msi\">Internet Explorer + Firefox (64bit)</a><br>" +
 			"<a href=\"https://github.com/hpcc-systems/GraphControl\">Linux/Other (sources)</a>";
 		},
 
-		clear: function() {
+		clear: function () {
 			if (this.obj) {
 				this.obj.clear();
 			}
 		},
-		
-		loadXGMML: function(xgmml, merge) {
+
+		loadXGMML: function (xgmml, merge) {
 			if (this.obj) {
 				this.registerEvents();
 				this.obj.setMessage("Loading Data...");
@@ -119,12 +119,12 @@ define([
 				this.obj.startLayout("dot");
 			}
 		},
-		
-		loadDOT: function(dot) {
+
+		loadDOT: function (dot) {
 			this.load(dot, "dot");
 		},
-		
-		load: function(dot, layout) {
+
+		load: function (dot, layout) {
 			if (this.obj) {
 				this.registerEvents();
 				this.obj.setMessage("Loading Data...");
@@ -133,34 +133,34 @@ define([
 				this.obj.startLayout(layout);
 			}
 		},
-		
-		setLayout: function(layout) {
+
+		setLayout: function (layout) {
 			if (this.obj) {
 				this.registerEvents();
 				this.obj.setMessage("Performing Layout...");
 				this.obj.startLayout(layout);
 			}
 		},
-		
-		centerOn : function(globalID) {
+
+		centerOn: function (globalID) {
 			var item = this.obj.getItem(globalID);
 			this.obj.centerOnItem(item, true);
 			var items = [item];
 			this.obj.setSelected(items, true);
 		},
-		
-		registerEvents: function() {
+
+		registerEvents: function () {
 			if (!this.eventsRegistered) {
 				this.eventsRegistered = true;
 				this.registerEvent("LayoutFinished", this.onLayoutFinished);
 				this.registerEvent("MouseDoubleClick", this.onMouseDoubleClick);
 				this.registerEvent("SelectionChanged", this.onSelectionChanged);
 			}
-		},		
-		
-		registerEvent: function(evt, func) {
+		},
+
+		registerEvent: function (evt, func) {
 			if (this.obj) {
-				if(has("ie")){
+				if (has("ie")) {
 					this.obj.attachEvent("on" + evt, func);
 				} else {
 					this.obj.addEventListener(evt, func, false);

+ 24 - 24
esp/files/scripts/ResultsControl.js

@@ -14,58 +14,58 @@
 #    You should have received a copy of the GNU Affero General Public License
 #    along with this program.  If not, see <http://www.gnu.org/licenses/>.
 ############################################################################## */
-define([    
+define([
 	"dojo/_base/declare",
-	"dojo/dom", 
+	"dojo/dom",
 	"dojo/store/Memory",
 	"dojo/data/ObjectStore",
 	"dojox/grid/DataGrid",
 	"dijit/registry",
 	"dijit/layout/ContentPane"
-], function(declare, dom, Memory, ObjectStore, DataGrid, registry, ContentPane) {
+], function (declare, dom, Memory, ObjectStore, DataGrid, registry, ContentPane) {
 	return declare(null, {
 		paneNum: 0,
 		resultsSheetID: "",
 
 		//  Callbacks
-		onErrorClick: function(line, col) {
+		onErrorClick: function (line, col) {
 		},
 
 		// The constructor    
-		constructor: function(args){
+		constructor: function (args) {
 			declare.safeMixin(this, args);
 		},
 
-		clear: function() {
+		clear: function () {
 			var resultSheet = registry.byId(this.resultsSheetID);
 			var tabs = resultSheet.getChildren();
-			for(var i = 0; i < tabs.length; ++i) {
+			for (var i = 0; i < tabs.length; ++i) {
 				resultSheet.removeChild(tabs[i]);
 			}
 		},
 
-		addTab: function(label) {
+		addTab: function (label) {
 			var resultSheet = registry.byId(this.resultsSheetID);
 			var paneID = "Pane_" + ++this.paneNum;
 			var pane = new ContentPane({
 				title: label,
 				id: paneID,
 				closable: "true",
-				style: {padding: "0px"},
-				content : "<div id=\"Div_" + paneID + "\"></div>"
+				style: { padding: "0px" },
+				content: "<div id=\"Div_" + paneID + "\"></div>"
 			});
 			resultSheet.addChild(pane);
 			return dom.byId(pane.id);
 		},
 
-		addDatasetTab: function(dataset) {
+		addDatasetTab: function (dataset) {
 			var resultNode = this.addTab(dataset.name);
-			
+
 			var gridLayout = [];
 			for (var h = 0; h < dataset.header.length; ++h) {
 				gridLayout.push({
 					name: dataset.header[h],
-					field: dataset.header[h], 
+					field: dataset.header[h],
 					width: "auto"
 				});
 			}
@@ -73,33 +73,33 @@ define([
 			dataStore = new ObjectStore({ objectStore: store });
 
 			grid = new DataGrid({
-				store: dataStore ,
+				store: dataStore,
 				query: {},
 				structure: gridLayout
 			}, "Div_" + resultNode.id);
 			grid.startup();
 		},
 
-		addExceptionTab: function(errors) {
+		addExceptionTab: function (errors) {
 			var resultNode = this.addTab("Error(s)");
 			store = new Memory({ data: errors });
 			dataStore = new ObjectStore({ objectStore: store });
-			
+
 			grid = new DataGrid({
-				store: dataStore ,
+				store: dataStore,
 				query: {},
 				structure: [
-					{name: "Severity", field: "Severity"}, 
-					{name: "Line", field: "LineNo"}, 
-					{name: "Column", field: "Column"}, 
-					{name: "Code", field: "Code"}, 
-					{name: "Message", field: "Message", width: "auto"}
+					{ name: "Severity", field: "Severity" },
+					{ name: "Line", field: "LineNo" },
+					{ name: "Column", field: "Column" },
+					{ name: "Code", field: "Code" },
+					{ name: "Message", field: "Message", width: "auto" }
 					]
 			}, "Div_" + resultNode.id);
 			grid.startup();
-			
+
 			var context = this;
-			grid.on("RowClick", function(evt){
+			grid.on("RowClick", function (evt) {
 				var idx = evt.rowIndex;
 				var item = this.getItem(idx);
 				var line = parseInt(this.store.getValue(item, "LineNo"), 10);

+ 13 - 13
esp/files/scripts/SampleSelectControl.js

@@ -14,49 +14,49 @@
 #    You should have received a copy of the GNU Affero General Public License
 #    along with this program.  If not, see <http://www.gnu.org/licenses/>.
 ############################################################################## */
-define([    
+define([
 	"dojo/_base/declare",
 	"dojo/_base/xhr",
 	"dojo/data/ItemFileReadStore",
 	"dijit/form/Select"
-], function(declare, baseXhr, ItemFileReadStore, Select) {
+], function (declare, baseXhr, ItemFileReadStore, Select) {
 	return declare(null, {
 		id: null,
 		samplesURL: null,
-	
-		onNewSelection: function(eclText) {
+
+		onNewSelection: function (eclText) {
 		},
-	
-		constructor: function(args){
+
+		constructor: function (args) {
 			declare.safeMixin(this, args);
 			var sampleStore = new dojo.data.ItemFileReadStore({
 				url: this.samplesURL
 			});
-			
+
 			var context = this;
 			var select = new dijit.form.Select({
 				name: this.id,
 				store: sampleStore,
 				value: "default.ecl",
 				//maxHeight: -1 // tells _HasDropDown to fit menu within viewport
-				onChange: function(){
+				onChange: function () {
 					var filename = dijit.byId(this.id).get("value");
 					baseXhr.get({
 						url: "ecl/" + filename,
-						handleAs: "text",				
-						load: function(eclText) {
+						handleAs: "text",
+						load: function (eclText) {
 							context.onNewSelection(eclText);
 						},
-						error: function() {
+						error: function () {
 						}
 					});
 				}
 			}, this.id);
 			try {
 				select.startup();
-			} catch(e) {
+			} catch (e) {
 			}
 		}
-		
+
 	});
 });