')
- .appendTo(document.body)
+ .appendTo(document.body);
var notification = $('
')
.text('New version! ')
- .appendTo(container)
+ .appendTo(container);
$('
')
.addClass('notification-action')
.attr("href", releases.homepage)
diff --git a/main/webapp/modules/core/scripts/index/create-project-ui.js b/main/webapp/modules/core/scripts/index/create-project-ui.js
index 4d517734c..b448f5a4f 100644
--- a/main/webapp/modules/core/scripts/index/create-project-ui.js
+++ b/main/webapp/modules/core/scripts/index/create-project-ui.js
@@ -248,7 +248,9 @@ Refine.CreateProjectUI.prototype.showImportJobError = function(message, stack) {
Refine.CreateProjectUI.composeErrorMessage = function(job) {
var messages = [];
- $.each(job.config.errors, function() { messages.push(this.message) });
+ $.each(job.config.errors, function() {
+ messages.push(this.message);
+ });
return messages.join('\n');
};
diff --git a/main/webapp/modules/core/scripts/index/default-importing-controller/controller.js b/main/webapp/modules/core/scripts/index/default-importing-controller/controller.js
index b6231fac5..3a1aa6149 100644
--- a/main/webapp/modules/core/scripts/index/default-importing-controller/controller.js
+++ b/main/webapp/modules/core/scripts/index/default-importing-controller/controller.js
@@ -256,7 +256,7 @@ Refine.DefaultImportingController.prototype.getPreviewData = function(callback,
Refine.DefaultImportingController.prototype._createProject = function() {
if ((this._formatParserUI) && this._formatParserUI.confirmReadyToCreateProject()) {
var projectName = $.trim(this._parsingPanelElmts.projectNameInput[0].value);
- if (projectName.length == 0) {
+ if (projectName.length === 0) {
window.alert("Please name the project.");
this._parsingPanelElmts.projectNameInput.focus();
return;
diff --git a/main/webapp/modules/core/scripts/index/default-importing-controller/file-selection-panel.js b/main/webapp/modules/core/scripts/index/default-importing-controller/file-selection-panel.js
index a50d50bd8..0b8fe5a37 100644
--- a/main/webapp/modules/core/scripts/index/default-importing-controller/file-selection-panel.js
+++ b/main/webapp/modules/core/scripts/index/default-importing-controller/file-selection-panel.js
@@ -121,7 +121,7 @@ Refine.DefaultImportingController.prototype._renderFileSelectionPanelFileTable =
var renderFile = function(fileRecord, index) {
var id = "import-file-selection-" + Math.round(Math.random() * 1000000);
var tr = fileTable.insertRow(fileTable.rows.length);
- $(tr).addClass(index % 2 == 0 ? 'even' : 'odd');
+ $(tr).addClass((index % 2 === 0) ? 'even' : 'odd');
var createLabeledCell = function(className) {
var td = $('').appendTo(tr);
@@ -308,7 +308,7 @@ Refine.DefaultImportingController.prototype._updateFileSelectionSummary = functi
};
Refine.DefaultImportingController.prototype._commitFileSelection = function() {
- if (this._job.config.fileSelection.length == 0) {
+ if (this._job.config.fileSelection.length === 0) {
alert("Please select at least one file.");
return;
}
diff --git a/main/webapp/modules/core/scripts/index/open-project-ui.js b/main/webapp/modules/core/scripts/index/open-project-ui.js
index 640b39acf..598e84db2 100644
--- a/main/webapp/modules/core/scripts/index/open-project-ui.js
+++ b/main/webapp/modules/core/scripts/index/open-project-ui.js
@@ -40,10 +40,10 @@ Refine.OpenProjectUI = function(elmt) {
this._elmts = DOM.bind(elmt);
$("#project-file-input").change(function() {
- if ($("#project-name-input")[0].value.length == 0) {
+ if ($("#project-name-input")[0].value.length === 0) {
var fileName = this.files[0].fileName;
if (fileName) {
- $("#project-name-input")[0].value = fileName.replace(/\.\w+/, "").replace(/[_-]/g, " ");
+ $("#project-name-input")[0].value = fileName.replace(/\.\w+/, "").replace(/[_\-]/g, " ");
}
$("#project-name-input").focus().select();
}
@@ -54,7 +54,7 @@ Refine.OpenProjectUI = function(elmt) {
});
$("#upload-file-button").click(function(evt) {
- return self._onClickUploadFileButton(evt)
+ return self._onClickUploadFileButton(evt);
});
$('#projects-workspace-open').click(function() {
@@ -83,7 +83,7 @@ Refine.OpenProjectUI.prototype.resize = function() {
this._elmts.workspaceControls
.css("bottom", "0px")
- .css("width", (width - DOM.getHPaddings(this._elmts.workspaceControls)) + "px")
+ .css("width", (width - DOM.getHPaddings(this._elmts.workspaceControls)) + "px");
};
Refine.OpenProjectUI.prototype._fetchProjects = function() {
@@ -163,12 +163,12 @@ Refine.OpenProjectUI.prototype._renderProjects = function(data) {
.css("visibility", "hidden")
.click(function() {
var name = window.prompt("New project name:", project.name);
- if (name == null) {
+ if (name === null) {
return;
}
name = $.trim(name);
- if (project.name == name || name.length == 0) {
+ if (project.name == name || name.length === 0) {
return;
}
@@ -181,7 +181,7 @@ Refine.OpenProjectUI.prototype._renderProjects = function(data) {
if (data && typeof data.code != 'undefined' && data.code == "ok") {
nameLink.text(name);
} else {
- alert("Failed to rename project: " + data.message)
+ alert("Failed to rename project: " + data.message);
}
}
});
diff --git a/main/webapp/modules/core/scripts/index/parser-interfaces/excel-parser-ui.js b/main/webapp/modules/core/scripts/index/parser-interfaces/excel-parser-ui.js
index 1097acf7e..18709a49d 100644
--- a/main/webapp/modules/core/scripts/index/parser-interfaces/excel-parser-ui.js
+++ b/main/webapp/modules/core/scripts/index/parser-interfaces/excel-parser-ui.js
@@ -47,10 +47,10 @@ Refine.ExcelParserUI = function(controller, jobID, job, format, config,
this._initialize();
this._updatePreview();
};
-Refine.DefaultImportingController.parserUIs["ExcelParserUI"] = Refine.ExcelParserUI;
+Refine.DefaultImportingController.parserUIs.ExcelParserUI = Refine.ExcelParserUI;
Refine.ExcelParserUI.prototype.dispose = function() {
- if (this._timerID != null) {
+ if (this._timerID !== null) {
window.clearTimeout(this._timerID);
this._timerID = null;
}
@@ -68,7 +68,7 @@ Refine.ExcelParserUI.prototype.getOptions = function() {
var parseIntDefault = function(s, def) {
try {
- var n = parseInt(s);
+ var n = parseInt(s,10);
if (!isNaN(n)) {
return n;
}
@@ -80,7 +80,7 @@ Refine.ExcelParserUI.prototype.getOptions = function() {
this._optionContainerElmts.sheetRecordContainer.find('input').each(function() {
if (this.checked) {
- options.sheets.push(parseInt(this.getAttribute('index')));
+ options.sheets.push(parseInt(this.getAttribute('index'),10));
}
});
@@ -178,7 +178,7 @@ Refine.ExcelParserUI.prototype._initialize = function() {
};
Refine.ExcelParserUI.prototype._scheduleUpdatePreview = function() {
- if (this._timerID != null) {
+ if (this._timerID !== null) {
window.clearTimeout(this._timerID);
this._timerID = null;
}
diff --git a/main/webapp/modules/core/scripts/index/parser-interfaces/fixed-width-parser-ui.js b/main/webapp/modules/core/scripts/index/parser-interfaces/fixed-width-parser-ui.js
index 2bbd4afce..51a61352d 100644
--- a/main/webapp/modules/core/scripts/index/parser-interfaces/fixed-width-parser-ui.js
+++ b/main/webapp/modules/core/scripts/index/parser-interfaces/fixed-width-parser-ui.js
@@ -48,10 +48,10 @@ Refine.FixedWidthParserUI = function(controller, jobID, job, format, config,
this._initialize();
this.updatePreview();
};
-Refine.DefaultImportingController.parserUIs["FixedWidthParserUI"] = Refine.FixedWidthParserUI;
+Refine.DefaultImportingController.parserUIs.FixedWidthParserUI = Refine.FixedWidthParserUI;
Refine.FixedWidthParserUI.prototype.dispose = function() {
- if (this._timerID != null) {
+ if (this._timerID !== null) {
window.clearTimeout(this._timerID);
this._timerID = null;
}
@@ -72,18 +72,15 @@ Refine.FixedWidthParserUI.prototype.getOptions = function() {
options.columnNames = columnNames;
}
- switch (this._optionContainer.find("input[name='row-separator']:checked")[0].value) {
- case 'new-line':
+ if (this._optionContainer.find("input[name='row-separator']:checked")[0].value === "new-line") {
options.lineSeparator = "\n";
- break;
- default:
- options.lineSeparator = String.decodeSeparator(
- this._optionContainerElmts.rowSeparatorInput[0].value);
+ } else {
+ options.lineSeparator = String.decodeSeparator(this._optionContainerElmts.rowSeparatorInput[0].value);
}
var parseIntDefault = function(s, def) {
try {
- var n = parseInt(s);
+ var n = parseInt(s,10);
if (!isNaN(n)) {
return n;
}
@@ -191,7 +188,7 @@ Refine.FixedWidthParserUI.prototype._getColumnWidths = function() {
var newColumnWidths = [];
var a = $.trim(this._optionContainerElmts.columnWidthsInput[0].value).replace(/,\s+/g, ',').split(',');
for (var i = 0; i < a.length; i++) {
- var n = parseInt(a[i]);
+ var n = parseInt(a[i],10);
if (!isNaN(n)) {
newColumnWidths.push(n);
}
@@ -200,7 +197,7 @@ Refine.FixedWidthParserUI.prototype._getColumnWidths = function() {
};
Refine.FixedWidthParserUI.prototype._scheduleUpdatePreview = function() {
- if (this._timerID != null) {
+ if (this._timerID !== null) {
window.clearTimeout(this._timerID);
this._timerID = null;
}
@@ -266,7 +263,7 @@ Refine.FixedWidthPreviewTable.prototype._render = function() {
var addCell = function(tr) {
var index = tr.cells.length;
var td = tr.insertCell(index);
- td.className = (index % 2 == 0) ? 'even' : 'odd';
+ td.className = (index % 2 === 0) ? 'even' : 'odd';
return td;
};
@@ -373,7 +370,7 @@ Refine.FixedWidthPreviewTable.prototype._render = function() {
var newColumnWidths = [];
for (var i = 0; i < columnCharIndexes.length; i++) {
var charIndex = columnCharIndexes[i];
- var columnWidth = (i == 0) ? charIndex : (charIndex - columnCharIndexes[i - 1]);
+ var columnWidth = (i === 0) ? charIndex : (charIndex - columnCharIndexes[i - 1]);
if (columnWidth > 0) {
newColumnWidths.push(columnWidth);
}
diff --git a/main/webapp/modules/core/scripts/index/parser-interfaces/json-parser-ui.js b/main/webapp/modules/core/scripts/index/parser-interfaces/json-parser-ui.js
index 7cacb776a..c5d23f777 100644
--- a/main/webapp/modules/core/scripts/index/parser-interfaces/json-parser-ui.js
+++ b/main/webapp/modules/core/scripts/index/parser-interfaces/json-parser-ui.js
@@ -48,10 +48,10 @@ Refine.JsonParserUI = function(controller, jobID, job, format, config,
this._initialize();
this._showPickRecordNodesUI();
};
-Refine.DefaultImportingController.parserUIs["JsonParserUI"] = Refine.JsonParserUI;
+Refine.DefaultImportingController.parserUIs.JsonParserUI = Refine.JsonParserUI;
Refine.JsonParserUI.prototype.dispose = function() {
- if (this._timerID != null) {
+ if (this._timerID !== null) {
window.clearTimeout(this._timerID);
this._timerID = null;
}
@@ -72,7 +72,7 @@ Refine.JsonParserUI.prototype.getOptions = function() {
var parseIntDefault = function(s, def) {
try {
- var n = parseInt(s);
+ var n = parseInt(s,10);
if (!isNaN(n)) {
return n;
}
@@ -162,7 +162,7 @@ Refine.JsonParserUI.prototype._showPickRecordNodesUI = function() {
var elementNode = null;
for (var i = 0; i < a.length; i++) {
- if (elementNode != null) {
+ if (elementNode !== null) {
$('').addClass('punctuation').text(',').appendTo(elementNode);
}
elementNode = $('').addClass('node').addClass('indented').appendTo(container);
@@ -178,7 +178,7 @@ Refine.JsonParserUI.prototype._showPickRecordNodesUI = function() {
var elementNode = null;
for (var key in o) {
if (o.hasOwnProperty(key)) {
- if (elementNode != null) {
+ if (elementNode !== null) {
$(' ').addClass('punctuation').text(',').appendTo(elementNode);
}
elementNode = $('').addClass('node').addClass('indented').appendTo(container);
@@ -197,7 +197,7 @@ Refine.JsonParserUI.prototype._showPickRecordNodesUI = function() {
registerEvents(container, parentPath);
};
var renderNode = function(node, container, parentPath) {
- if (node == null) {
+ if (node === null) {
$(' ').addClass('literal').text('null').appendTo(container);
} else {
if ($.isPlainObject(node)) {
@@ -214,7 +214,7 @@ Refine.JsonParserUI.prototype._showPickRecordNodesUI = function() {
};
Refine.JsonParserUI.prototype._scheduleUpdatePreview = function() {
- if (this._timerID != null) {
+ if (this._timerID !== null) {
window.clearTimeout(this._timerID);
this._timerID = null;
}
diff --git a/main/webapp/modules/core/scripts/index/parser-interfaces/line-based-parser-ui.js b/main/webapp/modules/core/scripts/index/parser-interfaces/line-based-parser-ui.js
index d7d8c2a77..861b804ee 100644
--- a/main/webapp/modules/core/scripts/index/parser-interfaces/line-based-parser-ui.js
+++ b/main/webapp/modules/core/scripts/index/parser-interfaces/line-based-parser-ui.js
@@ -48,14 +48,14 @@ Refine.LineBasedParserUI = function(controller, jobID, job, format, config,
this._initialize();
this._updatePreview();
};
-Refine.DefaultImportingController.parserUIs["LineBasedParserUI"] = Refine.LineBasedParserUI;
+Refine.DefaultImportingController.parserUIs.LineBasedParserUI = Refine.LineBasedParserUI;
Refine.LineBasedParserUI.prototype.confirmReadyToCreateProject = function() {
return true;
};
Refine.LineBasedParserUI.prototype.dispose = function() {
- if (this._timerID != null) {
+ if (this._timerID !== null) {
window.clearTimeout(this._timerID);
this._timerID = null;
}
@@ -69,7 +69,7 @@ Refine.LineBasedParserUI.prototype.getOptions = function() {
var parseIntDefault = function(s, def) {
try {
- var n = parseInt(s);
+ var n = parseInt(s,10);
if (!isNaN(n)) {
return n;
}
@@ -80,13 +80,10 @@ Refine.LineBasedParserUI.prototype.getOptions = function() {
};
options.linesPerRow = parseIntDefault(this._optionContainerElmts.linesPerRowInput[0].value, 1);
- switch (this._optionContainer.find("input[name='row-separator']:checked")[0].value) {
- case 'new-line':
- options.lineSeparator = "\n";
- break;
- default:
- options.lineSeparator = String.decodeSeparator(
- this._optionContainerElmts.rowSeparatorInput[0].value);
+ if (this._optionContainer.find("input[name='row-separator']:checked")[0].value === "new-line") {
+ options.lineSeparator = "\n";
+ } else {
+ options.lineSeparator = String.decodeSeparator(this._optionContainerElmts.rowSeparatorInput[0].value);
}
if (this._optionContainerElmts.ignoreCheckbox[0].checked) {
@@ -166,7 +163,7 @@ Refine.LineBasedParserUI.prototype._initialize = function() {
};
Refine.LineBasedParserUI.prototype._scheduleUpdatePreview = function() {
- if (this._timerID != null) {
+ if (this._timerID !== null) {
window.clearTimeout(this._timerID);
this._timerID = null;
}
diff --git a/main/webapp/modules/core/scripts/index/parser-interfaces/rdf-triples-parser-ui.js b/main/webapp/modules/core/scripts/index/parser-interfaces/rdf-triples-parser-ui.js
index 36966bb20..b0db21077 100644
--- a/main/webapp/modules/core/scripts/index/parser-interfaces/rdf-triples-parser-ui.js
+++ b/main/webapp/modules/core/scripts/index/parser-interfaces/rdf-triples-parser-ui.js
@@ -48,14 +48,14 @@ Refine.RdfTriplesParserUI = function(controller, jobID, job, format, config,
this._initialize();
this._updatePreview();
};
-Refine.DefaultImportingController.parserUIs["RdfTriplesParserUI"] = Refine.RdfTriplesParserUI;
+Refine.DefaultImportingController.parserUIs.RdfTriplesParserUI = Refine.RdfTriplesParserUI;
Refine.RdfTriplesParserUI.prototype.confirmReadyToCreateProject = function() {
return true;
};
Refine.RdfTriplesParserUI.prototype.dispose = function() {
- if (this._timerID != null) {
+ if (this._timerID !== null) {
window.clearTimeout(this._timerID);
this._timerID = null;
}
@@ -92,7 +92,7 @@ Refine.RdfTriplesParserUI.prototype._initialize = function() {
};
Refine.RdfTriplesParserUI.prototype._scheduleUpdatePreview = function() {
- if (this._timerID != null) {
+ if (this._timerID !== null) {
window.clearTimeout(this._timerID);
this._timerID = null;
}
diff --git a/main/webapp/modules/core/scripts/index/parser-interfaces/separator-based-parser-ui.js b/main/webapp/modules/core/scripts/index/parser-interfaces/separator-based-parser-ui.js
index 36d228b5c..f249dea0a 100644
--- a/main/webapp/modules/core/scripts/index/parser-interfaces/separator-based-parser-ui.js
+++ b/main/webapp/modules/core/scripts/index/parser-interfaces/separator-based-parser-ui.js
@@ -47,10 +47,10 @@ Refine.SeparatorBasedParserUI = function(controller, jobID, job, format, config,
this._initialize();
this._updatePreview();
};
-Refine.DefaultImportingController.parserUIs["SeparatorBasedParserUI"] = Refine.SeparatorBasedParserUI;
+Refine.DefaultImportingController.parserUIs.SeparatorBasedParserUI = Refine.SeparatorBasedParserUI;
Refine.SeparatorBasedParserUI.prototype.dispose = function() {
- if (this._timerID != null) {
+ if (this._timerID !== null) {
window.clearTimeout(this._timerID);
this._timerID = null;
}
@@ -65,14 +65,12 @@ Refine.SeparatorBasedParserUI.prototype.getOptions = function() {
encoding: $.trim(this._optionContainerElmts.encodingInput[0].value)
};
- switch (this._optionContainer.find("input[name='row-separator']:checked")[0].value) {
- case 'new-line':
+ if (this._optionContainer.find("input[name='row-separator']:checked")[0].value === "new-line") {
options.lineSeparator = "\n";
- break;
- default:
- options.lineSeparator = String.decodeSeparator(
- this._optionContainerElmts.rowSeparatorInput[0].value);
+ } else {
+ options.lineSeparator = String.decodeSeparator(this._optionContainerElmts.rowSeparatorInput[0].value);
}
+
switch (this._optionContainer.find("input[name='column-separator']:checked")[0].value) {
case 'comma':
options.separator = ",";
@@ -87,7 +85,7 @@ Refine.SeparatorBasedParserUI.prototype.getOptions = function() {
var parseIntDefault = function(s, def) {
try {
- var n = parseInt(s);
+ var n = parseInt(s,10);
if (!isNaN(n)) {
return n;
}
@@ -198,7 +196,7 @@ Refine.SeparatorBasedParserUI.prototype._initialize = function() {
};
Refine.SeparatorBasedParserUI.prototype._scheduleUpdatePreview = function() {
- if (this._timerID != null) {
+ if (this._timerID !== null) {
window.clearTimeout(this._timerID);
this._timerID = null;
}
diff --git a/main/webapp/modules/core/scripts/index/parser-interfaces/xml-parser-ui.js b/main/webapp/modules/core/scripts/index/parser-interfaces/xml-parser-ui.js
index 543229860..46015bebc 100644
--- a/main/webapp/modules/core/scripts/index/parser-interfaces/xml-parser-ui.js
+++ b/main/webapp/modules/core/scripts/index/parser-interfaces/xml-parser-ui.js
@@ -48,10 +48,10 @@ Refine.XmlParserUI = function(controller, jobID, job, format, config,
this._initialize();
this._showPickRecordElementsUI();
};
-Refine.DefaultImportingController.parserUIs["XmlParserUI"] = Refine.XmlParserUI;
+Refine.DefaultImportingController.parserUIs.XmlParserUI = Refine.XmlParserUI;
Refine.XmlParserUI.prototype.dispose = function() {
- if (this._timerID != null) {
+ if (this._timerID !== null) {
window.clearTimeout(this._timerID);
this._timerID = null;
}
@@ -71,7 +71,7 @@ Refine.XmlParserUI.prototype.getOptions = function() {
};
var parseIntDefault = function(s, def) {
try {
- var n = parseInt(s);
+ var n = parseInt(s,10);
if (!isNaN(n)) {
return n;
}
@@ -210,7 +210,7 @@ Refine.XmlParserUI.prototype._showPickRecordElementsUI = function() {
};
Refine.XmlParserUI.prototype._scheduleUpdatePreview = function() {
- if (this._timerID != null) {
+ if (this._timerID !== null) {
window.clearTimeout(this._timerID);
this._timerID = null;
}
diff --git a/main/webapp/modules/core/scripts/preferences.js b/main/webapp/modules/core/scripts/preferences.js
index d797e2565..c26301e8d 100644
--- a/main/webapp/modules/core/scripts/preferences.js
+++ b/main/webapp/modules/core/scripts/preferences.js
@@ -33,63 +33,6 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
var preferenceUIs = [];
-function onLoad() {
- $.post(
- "/command/core/get-all-preferences",
- null,
- populatePreferences,
- "json"
- );
-}
-
-$(onLoad);
-
-function populatePreferences(prefs) {
- var body = $("#body-info").empty();
-
- $('').text("Preferences").appendTo(body);
-
- var table = $('')
- .addClass("list-table")
- .addClass("preferences")
- .html('Key | Value | | ')
- .appendTo(body)[0];
-
- for (var k in prefs) {
- var tr = table.insertRow(table.rows.length);
- preferenceUIs.push(new PreferenceUI(tr, k, prefs[k]));
- }
-
- var trLast = table.insertRow(table.rows.length);
- var tdLast0 = trLast.insertCell(0);
- trLast.insertCell(1);
- trLast.insertCell(2);
- $(' |