From: Jeremy Tan Date: Sun, 13 Oct 2013 12:52:07 +0000 (+0800) Subject: Rename help/data file + fix the sidebar width X-Git-Url: https://git.ucc.asn.au/?a=commitdiff_plain;h=27b29a56eaadc0869ad4bd59268848c7b154bb7e;p=matches%2FMCTX3420.git Rename help/data file + fix the sidebar width --- diff --git a/testing/MCTXWeb/public_html/control.html b/testing/MCTXWeb/public_html/control.html index ecefd5a..d31801d 100644 --- a/testing/MCTXWeb/public_html/control.html +++ b/testing/MCTXWeb/public_html/control.html @@ -86,8 +86,9 @@ diff --git a/testing/MCTXWeb/public_html/data-Justin.html b/testing/MCTXWeb/public_html/data-Justin.html deleted file mode 100644 index 975b538..0000000 --- a/testing/MCTXWeb/public_html/data-Justin.html +++ /dev/null @@ -1,271 +0,0 @@ - - - - - - - - - MCTX3420 Web Interface - - - - - - - - - - - - -
- -
- - -
- - -
- - - -
-
-
Experiment Data
- Current Experiment - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
View Sensor DataStrain 1Strain 2Strain 3Strain 4Pressure 1Pressure 2
Save Sensor Data
DilatometerView Data
Camera DataView Data
Graphs -
- -
- -
- -

Previous Experiments

- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
Select Experiment - - - -
Experiment DateDATE LOOKUP
View Sensor DataStrain 1Strain 2Strain 3Strain 4Pressure 1Pressure 2
Save Sensor Data
DilatometerView Data
Camera DataView Data
Graphs -
- -
-
- -
-
- -
-
- - diff --git a/testing/MCTXWeb/public_html/data.html b/testing/MCTXWeb/public_html/data.html new file mode 100644 index 0000000..89a29a7 --- /dev/null +++ b/testing/MCTXWeb/public_html/data.html @@ -0,0 +1,272 @@ + + + + + + + + + MCTX3420 Web Interface + + + + + + + + + + + + +
+ +
+ + +
+ + +
+ + + +
+
+
Experiment Data
+ Current Experiment + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
View Sensor DataStrain 1Strain 2Strain 3Strain 4Pressure 1Pressure 2
Save Sensor Data
DilatometerView Data
Camera DataView Data
Graphs +
+ +
+ +
+ +

Previous Experiments

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
Select Experiment + + + +
Experiment DateDATE LOOKUP
View Sensor DataStrain 1Strain 2Strain 3Strain 4Pressure 1Pressure 2
Save Sensor Data
DilatometerView Data
Camera DataView Data
Graphs +
+ +
+
+ +
+
+ +
+
+ + diff --git a/testing/MCTXWeb/public_html/help-Justin.html b/testing/MCTXWeb/public_html/help-Justin.html deleted file mode 100644 index acf23a9..0000000 --- a/testing/MCTXWeb/public_html/help-Justin.html +++ /dev/null @@ -1,186 +0,0 @@ - - - - MCTX3420 Web Interface - - - - - - - - - - -
- -
- - -
-
- - - -
-
-
Getting Started
-

Welcome to the MCTX3420 project documentation! On this page, you will find help on how to use the project software, - as well as information about the various hardware components.

-

For a basic introduction to using the experiment, see 'Tutorials'. - System overview provides a general overview of the experiment's hardware, while - Using the web interface provides a tutorial on using the the project software. - For detailed information about the experiment hardware, see the 'Hardware' section. For detailed information about the project software, - see the 'Software' section.

-
Tutorials
- -
Hardware
- -
Software
- -
- -
-
Project Wiki
-

All of the project's help documentation is stored in its GitHub wiki. This git repository also - stores all of the software code for the project; to access the project code files, visit this link.

-

The following is a list of pages on the GitHub wiki (all of which can be accessed via the categories above):

-

-
-
- -
-
- - diff --git a/testing/MCTXWeb/public_html/help.html b/testing/MCTXWeb/public_html/help.html new file mode 100644 index 0000000..49eef7c --- /dev/null +++ b/testing/MCTXWeb/public_html/help.html @@ -0,0 +1,187 @@ + + + + MCTX3420 Web Interface + + + + + + + + + + +
+ +
+ + +
+
+ + + +
+
+
Getting Started
+

Welcome to the MCTX3420 project documentation! On this page, you will find help on how to use the project software, + as well as information about the various hardware components.

+

For a basic introduction to using the experiment, see 'Tutorials'. + System overview provides a general overview of the experiment's hardware, while + Using the web interface provides a tutorial on using the the project software. + For detailed information about the experiment hardware, see the 'Hardware' section. For detailed information about the project software, + see the 'Software' section.

+
Tutorials
+ +
Hardware
+ +
Software
+ +
+ +
+
Project Wiki
+

All of the project's help documentation is stored in its GitHub wiki. This git repository also + stores all of the software code for the project; to access the project code files, visit this link.

+

The following is a list of pages on the GitHub wiki (all of which can be accessed via the categories above):

+

+
+
+ +
+
+ + diff --git a/testing/MCTXWeb/public_html/index.html b/testing/MCTXWeb/public_html/index.html index 4ffacec..ff9b733 100644 --- a/testing/MCTXWeb/public_html/index.html +++ b/testing/MCTXWeb/public_html/index.html @@ -21,7 +21,11 @@ $("#logout").logout(); }); }); - }) + }).always(function () { + $(document).ready(function () { + //$("#sidebar-menu").populateNavMenu(); + }); + }); @@ -68,12 +72,13 @@ diff --git a/testing/MCTXWeb/public_html/static/mctx.gui.js b/testing/MCTXWeb/public_html/static/mctx.gui.js index 773fa23..c609ef5 100644 --- a/testing/MCTXWeb/public_html/static/mctx.gui.js +++ b/testing/MCTXWeb/public_html/static/mctx.gui.js @@ -1,12 +1,12 @@ /** - * MCTX3420 2013 GUI stuff. - * Coding style: - * - Always end statements with semicolons - * - Egyptian brackets are highly recommended (*cough*). - * - Don't use synchronous stuff - hook events into callbacks - * - $.fn functions should return either themselves or some useful object - * to allow for chaining of method calls - */ +* MCTX3420 2013 GUI stuff. +* Coding style: +* - Always end statements with semicolons +* - Egyptian brackets are highly recommended (*cough*). +* - Don't use synchronous stuff - hook events into callbacks +* - $.fn functions should return either themselves or some useful object +* to allow for chaining of method calls +*/ mctx = {}; //Don't use this in the final version @@ -18,33 +18,40 @@ mctx.expected_api_version = 0; mctx.has_control = false; mctx.debug = true; +mctx.menu = [ + {'text' : 'Home', href : mctx.location + 'index.html'}, + {'text' : 'Experiment control', href : mctx.location + 'control.html'}, + {'text' : 'Pin debugging', href : mctx.location + 'pintest.html'}, + {'text' : 'Help', href : mctx.location + 'help.html'} +]; + mctx.statusCodes = { - STATUS_OK : 1 + STATUS_OK : 1 }; mctx.statusCodesDescription = { - "1" : "Ok", - "-1" : "General error", - "-2" : "Unauthorized", - "-3" : "Not running", - "-4" : "Already exists" + "1" : "Ok", + "-1" : "General error", + "-2" : "Unauthorized", + "-3" : "Not running", + "-4" : "Already exists" }; mctx.sensors = { - 0 : {name : "Strain gauge 1"}, - 1 : {name : "Strain gauge 2"}, - 2 : {name : "Strain gauge 3"}, - 3 : {name : "Strain gauge 4"}, - 4 : {name : "Pressure sensor 1"}, - 5 : {name : "Pressure sensor 2"}, - 6 : {name : "Pressure sensor 3"} + 0 : {name : "Strain gauge 1"}, + 1 : {name : "Strain gauge 2"}, + 2 : {name : "Strain gauge 3"}, + 3 : {name : "Strain gauge 4"}, + 4 : {name : "Pressure sensor 1"}, + 5 : {name : "Pressure sensor 2"}, + 6 : {name : "Pressure sensor 3"} }; mctx.actuators = { - 0 : {name : "Solenoid 1"}, - 1 : {name : "Solenoid 2"}, - 2 : {name : "Solenoid 3"}, - 3 : {name : "Pressure regulator"} + 0 : {name : "Solenoid 1"}, + 1 : {name : "Solenoid 2"}, + 2 : {name : "Solenoid 3"}, + 3 : {name : "Pressure regulator"} }; mctx.strain_gauges = {}; @@ -52,257 +59,231 @@ mctx.strain_gauges.ids = [0, 1, 2, 3]; mctx.strain_gauges.time_limit = 20; /** - * Logs a message if mctx.debug is enabled. This function takes - * a variable number of arguments and passes them - * to alert or console.log (based on browser support). - * @returns {undefined} - */ +* Logs a message if mctx.debug is enabled. This function takes +* a variable number of arguments and passes them +* to alert or console.log (based on browser support). +* @returns {undefined} +*/ function debugLog () { - if (mctx.debug) { - if (typeof console === "undefined" || typeof console.log === "undefined") { - for (var i = 0; i < arguments.length; i++) { - alert(arguments[i]); - } - } else { - console.log.apply(this, arguments); + if (mctx.debug) { + if (typeof console === "undefined" || typeof console.log === "undefined") { + for (var i = 0; i < arguments.length; i++) { + alert(arguments[i]); + } + } else { + console.log.apply(this, arguments); + } } - } } /** - * Writes the current date to wherever it's called. - */ +* Writes the current date to wherever it's called. +*/ function getDate() { - document.write((new Date()).toDateString()); + document.write((new Date()).toDateString()); } /** - * Should be run before the load of any GUI page. - * To hook events to be called after this function runs, - * use the 'always' method, e.g runBeforeLoad().always(function() {my stuff}); - * @param {type} isLoginPage - * @returns The return value of calling $.ajax - */ +* Should be run before the load of any GUI page. +* To hook events to be called after this function runs, +* use the 'always' method, e.g runBeforeLoad().always(function() {my stuff}); +* @param {type} isLoginPage +* @returns The return value of calling $.ajax +*/ function runBeforeLoad(isLoginPage) { - return $.ajax({ - url : mctx.api + "identify" - }).done(function (data) { - if (data.logged_in && isLoginPage) { - if (mctx.debug) { - debugLog("Redirect disabled!"); - } else { - window.location = mctx.location; - } - } else if (!data.logged_in && !isLoginPage) { - if (mctx.debug) { - debugLog("Redirect disabled!"); - } else { - //Note: this only clears the nameless cookie - document.cookie = ""; - window.location = mctx.location + "login.html"; - } - } else { - mctx.friendlyName = data.friendly_name; - } - }).fail(function (jqHXR) { - if (mctx.debug) { - debugLog("Failed to ident server. Is API running?") - } else if (!isLoginPage) { - window.location = mctx.location + "login.html"; - } - }); + return $.ajax({ + url : mctx.api + "identify" + }).done(function (data) { + if (data.logged_in && isLoginPage) { + if (mctx.debug) { + debugLog("Redirect disabled!"); + } else { + window.location = mctx.location; + } + } else if (!data.logged_in && !isLoginPage) { + if (mctx.debug) { + debugLog("Redirect disabled!"); + } else { + //Note: this only clears the nameless cookie + document.cookie = ""; + window.location = mctx.location + "login.html"; + } + } else { + mctx.friendlyName = data.friendly_name; + } + }).fail(function (jqHXR) { + if (mctx.debug) { + debugLog("Failed to ident server. Is API running?") + } else if (!isLoginPage) { + window.location = mctx.location + "login.html"; + } + }).always(function () { + + }); } /** - * Populates a submenu of the navigation bar - * @param {string} header The header - * @param {object} items An object representing the submenu items - * @param {function} translator A function that translates an object item - * into a text and href. - * @returns {$.fn} Itself - */ -$.fn.populateSubmenu = function(header, items, translator) { - var submenuHeader = $("
  • ").append($("", {text : header, href : "#"})); - var submenu = $("