Commit d728c49b authored by Łukasz Nowak's avatar Łukasz Nowak

erp5_web_monitoring: Apply JSLint

parent 0eec8a72
......@@ -74,21 +74,21 @@
//"date, io rw counter, io cycles counter, disk used"
line_list = ["io rw count (Kb/s)", "io cycles count (/1000)"]; //, "disk used"];
axis_list.push({
"0": {
"title": "IO read/write counter",
"scale_type": "linear",
"value_type": "date",
"zoom_range": date_window
}
});
"0": {
"title": "IO read/write counter",
"scale_type": "linear",
"value_type": "date",
"zoom_range": date_window
}
});
axis_list.push({
"0": {
"title": "IO cycles counter",
"scale_type": "linear",
"value_type": "date",
"zoom_range": date_window
}
});
"0": {
"title": "IO cycles counter",
"scale_type": "linear",
"value_type": "date",
"zoom_range": date_window
}
});
for (i = 0; i < line_list.length; i += 1) {
line_list[i] = line_list[i].trim();
data_list.push({
......@@ -214,7 +214,7 @@
})
.push(function () {
//return gadget.element.querySelector('form button[type="submit"]').click();
return gadget.getDeclaredGadget('form_cpu_graph')
return gadget.getDeclaredGadget('form_cpu_graph')
.push(function (form_gadget) {
return form_gadget.getContent();
})
......@@ -433,14 +433,14 @@
"left",
[["my_graph_auto_update"], ["my_cpu_graph_select"]]
],
[
"right",
[]
],
[
"bottom",
[]
]]
[
"right",
[]
],
[
"bottom",
[]
]]
}
});
})
......@@ -479,7 +479,7 @@
updateGraph(gadget, true);
}
if (evt.target.getAttribute("name") === "graph_auto_update_key") {
if (evt.target.value == "on") {
if (evt.target.value === "on") {
gadget.property_dict.disable_update = false;
} else {
gadget.property_dict.disable_update = true;
......
......@@ -159,7 +159,7 @@
doc;
return gadget.notifySubmitting()
.push(function () {
return gadget.getDeclaredGadget('form_view');
return gadget.getDeclaredGadget('form_view');
})
.push(function (form_gadget) {
return form_gadget.getContent();
......
......@@ -194,17 +194,17 @@
.value.aggregate_reference === undefined) {
// Instance is not Synchronized!
promise_list.push(false);
continue;
} else {
gadget_element = document.createElement("div");
element.appendChild(gadget_element);
promise_list.push(
gadget.declareGadget("gadget_officejs_monitoring_parameter_view.html",
{element: gadget_element,
scope: 'p_' + gadget.state.instance_dict.data.rows[i].id,
sandbox: "public"}
)
);
}
gadget_element = document.createElement("div");
element.appendChild(gadget_element);
promise_list.push(
gadget.declareGadget("gadget_officejs_monitoring_parameter_view.html",
{element: gadget_element,
scope: 'p_' + gadget.state.instance_dict.data.rows[i].id,
sandbox: "public"}
)
);
}
return RSVP.all(promise_list);
})
......
/*global window, rJS, RSVP, Handlebars */
/*global window, rJS, RSVP, Rusha, Handlebars */
/*jslint nomen: true, indent: 2, maxerr: 3 */
(function (window, rJS, RSVP, Rusha) {
"use strict";
......
......@@ -228,7 +228,7 @@
start;
function addUTCTimezone(date_string) {
if (new RegExp(/[+-][\d]{2}\:?[\d]{2}$/).test(date_string)) {
if (new RegExp(/[+\-][\d]{2}\:?[\d]{2}$/).test(date_string)) {
return date_string;
}
return date_string + "+0000";
......
......@@ -178,7 +178,7 @@
})
.push(undefined, function (error) {
var message_text,
code = 0;
code = 0;
if (error instanceof jIO.util.jIOError) {
message_text = error.message;
code = error.status_code;
......
......@@ -71,7 +71,7 @@
}
return context.getUrlParameter('editable')
.push(function () {
return context.registerSync();
return context.registerSynchronisation();
})
.push(function (editable) {
return context.changeState({
......@@ -273,7 +273,7 @@
window.dispatchEvent(event);
return result;
})
.declareJob('registerSync', function () {
.declareJob('registerSynchronisation', function () {
return this.getDeclaredGadget("sync_gadget")
.push(function (sync_gadget) {
return sync_gadget.register();
......
......@@ -4,7 +4,7 @@
* http://www.gnu.org/licenses/lgpl.html
*/
/*jslint nomen: true */
/*jslint nomen: true, indent: 2, maxerr: 3*/
/*global jIO, RSVP, Rusha, console, Blob */
(function (jIO, RSVP, Rusha, Blob, console) {
......@@ -402,6 +402,15 @@
});
}
function fixDateTimezone(date_string) {
// set default timezone offset to UTC
// XXX should be removed later
if (ZONE_LIST.indexOf(date_string.slice(-5)) === -1) {
return date_string + "+0000";
}
return date_string;
}
function updateHostingSubscriptionState(hosting, element) {
var status = element.status.toUpperCase();
......@@ -410,22 +419,15 @@
}
if (hosting.status === "ERROR") {
return;
} else if (status === "ERROR") {
}
if (status === "ERROR") {
hosting.status = status;
} else if (status === "WARNING") {
hosting.status = status;
} if (status === "OK" && hosting.status !== status) {
hosting.status = status;
}
}
function fixDateTimezone(date_string) {
// set default timezone offset to UTC
// XXX should be removed later
if (ZONE_LIST.indexOf(date_string.slice(-5)) === -1) {
return date_string + "+0000";
if (status === "OK" && hosting.status !== status) {
hosting.status = status;
}
return date_string;
}
function getOpmlTree(context, opml_url, opml_spec, basic_login, opml_title) {
......@@ -702,8 +704,7 @@
name: result_list[i].url,
doc: result_list[i].current_signature
});
}
else if (context._remote_storage_unreachable_status !== undefined) {
} else if (context._remote_storage_unreachable_status !== undefined) {
if (result_list[i].type === "webhttp") {
// In case it was impossible to get software Instance
// Add an empty Software Instance with unreachable status
......
......@@ -4,7 +4,7 @@
* http://www.gnu.org/licenses/lgpl.html
*/
/*jslint nomen: true*/
/*jslint nomen: true, indent: 2, maxerr: 3*/
/*global jIO, RSVP */
(function (jIO, RSVP) {
......
/*global window, rJS, Handlebars */
/*jslint indent: 2, maxerr: 3 */
/*jslint nomen: true, indent: 2, maxerr: 3 */
(function (window, rJS, Handlebars) {
"use strict";
......@@ -7,7 +7,7 @@
templater = gadget_klass.__template_element,
status_field_template = Handlebars.compile(
templater.getElementById("template-status-field").innerHTML
);
);
gadget_klass
.declareMethod('render', function (options) {
......@@ -22,7 +22,7 @@
return this.changeState(state_dict);
})
.onStateChange(function (modification_dict) {
.onStateChange(function () {
if (this.state.hidded) {
this.element.innerHTML = "";
} else {
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment