Commit 6b2655a2 authored by Marco Mariani's avatar Marco Mariani

runner: jslint compliance

parent a3c09a4b
...@@ -37,8 +37,8 @@ function deleteCookie(name, path, domain) { ...@@ -37,8 +37,8 @@ function deleteCookie(name, path, domain) {
function setCookie(name, value, expires, path, domain, secure) { function setCookie(name, value, expires, path, domain, secure) {
"use strict"; "use strict";
if (getCookie(name) !== null){ if (getCookie(name) !== null) {
deleteCookie(name); deleteCookie(name);
} }
if (!expires) { if (!expires) {
var today = new Date(); var today = new Date();
......
...@@ -44,24 +44,24 @@ function clearAll(setStop) { ...@@ -44,24 +44,24 @@ function clearAll(setStop) {
running = setStop; running = setStop;
} }
function removeFirstLog(){ function removeFirstLog() {
"use strict"; "use strict";
currentLogSize -= parseInt($("#salpgridLog p:first-child").attr('rel'), 10); currentLogSize -= parseInt($("#salpgridLog p:first-child").attr('rel'), 10);
$("#salpgridLog p:first-child").remove(); $("#salpgridLog p:first-child").remove();
} }
function getRunningState() { function getRunningState() {
"use strict"; "use strict";
var size = 0; var size = 0,
var log_info = ""; log_info = "",
var param = { param = {
position: logReadingPosition, position: logReadingPosition,
log: (processState !== "Checking" && openedlogpage === processType.toLowerCase()) ? openedlogpage : "" log: (processState !== "Checking" && openedlogpage === processType.toLowerCase()) ? openedlogpage : ""
}, },
jqxhr = $.post(url, param, function (data) { jqxhr = $.post(url, param, function (data) {
setRunningState(data); setRunningState(data);
size = data.content.position - logReadingPosition; size = data.content.position - logReadingPosition;
if (logReadingPosition !== 0 && data.content.truncated){ if (logReadingPosition !== 0 && data.content.truncated) {
log_info = "<p class='info' rel='0'>SLAPRUNNER INFO: SLAPGRID-LOG HAS BEEN TRUNCATED HERE. To see full log reload your log page</p>"; log_info = "<p class='info' rel='0'>SLAPRUNNER INFO: SLAPGRID-LOG HAS BEEN TRUNCATED HERE. To see full log reload your log page</p>";
} }
logReadingPosition = data.content.position; logReadingPosition = data.content.position;
...@@ -78,18 +78,16 @@ function getRunningState() { ...@@ -78,18 +78,16 @@ function getRunningState() {
} }
processState = running ? "Running" : "Stopped"; processState = running ? "Running" : "Stopped";
currentLogSize += parseInt(size, 10); currentLogSize += parseInt(size, 10);
if (currentLogSize > maxLogSize){ if (currentLogSize > maxLogSize) {
//Remove the first element into log div //Remove the first element into log div
removeFirstLog(); removeFirstLog();
if (currentLogSize > maxLogSize){ if (currentLogSize > maxLogSize) {
removeFirstLog(); //in cas of previous <p/> size is 0 removeFirstLog(); //in cas of previous <p/> size is 0
} }
} }
}) }).error(function () {
.error(function () {
clearAll(false); clearAll(false);
}) }).complete(function () {
.complete(function () {
if (running) { if (running) {
setTimeout(function () { setTimeout(function () {
getRunningState(); getRunningState();
......
...@@ -19,11 +19,10 @@ $(document).ready(function () { ...@@ -19,11 +19,10 @@ $(document).ready(function () {
send = false, send = false,
edit = false, edit = false,
selection = "", selection = "",
edit_status = ""; edit_status = "",
base_path = function () {
var base_path = function() { return softwareDisplay ? projectDir : currentProject;
return softwareDisplay ? projectDir : currentProject; };
}
function setEditMode(file) { function setEditMode(file) {
var i, var i,
......
...@@ -6,5 +6,5 @@ ...@@ -6,5 +6,5 @@
$(document).ready(function () { $(document).ready(function () {
"use strict"; "use strict";
$('#fileNavigator').gsFileManager({script: $SCRIPT_ROOT + "/fileBrowser", root:'workspace/'}); $('#fileNavigator').gsFileManager({script: $SCRIPT_ROOT + "/fileBrowser", root: 'workspace/'});
}); });
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