now it's jslint time to be happier: (!= null) -> (!== null)

git-svn-id: http://google-refine.googlecode.com/svn/trunk@432 7d457c2a-affb-35e4-300a-418c747d4874
This commit is contained in:
Stefano Mazzocchi 2010-04-09 01:00:44 +00:00
parent f0ba42f355
commit 16a2600a49
16 changed files with 53 additions and 53 deletions

View File

@ -274,7 +274,7 @@ ExpressionPreviewDialog.Widget.prototype._renderExpressionHistory = function(dat
};
ExpressionPreviewDialog.Widget.prototype._scheduleUpdate = function() {
if (this._timerID != null) {
if (this._timerID !== null) {
window.clearTimeout(this._timerID);
}
var self = this;
@ -332,7 +332,7 @@ ExpressionPreviewDialog.Widget.prototype._renderPreview = function(expression, d
}
};
if (this._results != null) {
if (this._results !== null) {
this._elmts.expressionPreviewErrorContainer.empty();
} else {
var message = (data.type == "parser") ? data.message : "Internal error";
@ -347,7 +347,7 @@ ExpressionPreviewDialog.Widget.prototype._renderPreview = function(expression, d
renderValue($(tr.insertCell(1)), this._values[i]);
var tdValue = $(tr.insertCell(2));
if (this._results != null) {
if (this._results !== null) {
var v = this._results[i];
renderValue(tdValue, v);
}

View File

@ -351,7 +351,7 @@ ExtendDataPreviewDialog.prototype._renderPreview = function(data) {
for (var c = 0; c < row.length; c++) {
var td = tr.insertCell(tr.cells.length);
var cell = row[c];
if (cell != null) {
if (cell !== null) {
if ($.isPlainObject(cell)) {
$('<a>').attr("href", "http://www.freebase.com/view" + cell.id).text(cell.name).appendTo(td);
} else {

View File

@ -224,7 +224,7 @@ ReconDialog.prototype._onDoHeuristic = function() {
var type = this._elmts.heuristicTypeInput.data("data.suggest");
var choices = $('input[name="recon-dialog-type-choice"]:checked');
if (choices != null && choices.length > 0 && choices[0].value != "") {
if (choices !== null && choices.length > 0 && choices[0].value != "") {
type = {
id: choices[0].value,
name: choices.attr("typeName")
@ -238,7 +238,7 @@ ReconDialog.prototype._onDoHeuristic = function() {
var propertyInputs = $('input[name="recon-dialog-heuristic-property"]');
$.each(propertyInputs, function() {
var property = $(this).data("data.suggest");
if (property != null) {
if (property !== null) {
columnDetails.push({
column: this.getAttribute("columnName"),
property: {

View File

@ -47,8 +47,8 @@ ListFacet.prototype.getJSON = function() {
omitBlank: "omitBlank" in this._config ? this._config.omitBlank : false,
omitError: "omitError" in this._config ? this._config.omitError : false,
selection: [],
selectBlank: this._blankChoice != null && this._blankChoice.s,
selectError: this._errorChoice != null && this._errorChoice.s
selectBlank: this._blankChoice !== null && this._blankChoice.s,
selectError: this._errorChoice !== null && this._errorChoice.s
};
for (var i = 0; i < this._selection.length; i++) {
var choice = {
@ -61,8 +61,8 @@ ListFacet.prototype.getJSON = function() {
ListFacet.prototype.hasSelection = function() {
return this._selection.length > 0 ||
(this._blankChoice != null && this._blankChoice.s) ||
(this._errorChoice != null && this._errorChoice.s);
(this._blankChoice !== null && this._blankChoice.s) ||
(this._errorChoice !== null && this._errorChoice.s);
};
ListFacet.prototype.updateState = function(data) {
@ -132,8 +132,8 @@ ListFacet.prototype.render = function() {
bodyDiv.appendTo(container);
} else {
var selectionCount = this._selection.length
+ (this._blankChoice != null && this._blankChoice.s ? 1 : 0)
+ (this._errorChoice != null && this._errorChoice.s ? 1 : 0);
+ (this._blankChoice !== null && this._blankChoice.s ? 1 : 0)
+ (this._errorChoice !== null && this._errorChoice.s ? 1 : 0);
if (selectionCount > 0) {
var reset = function() {
@ -207,10 +207,10 @@ ListFacet.prototype.render = function() {
for (var i = 0; i < choices.length; i++) {
renderChoice(choices[i]);
}
if (this._blankChoice != null) {
if (this._blankChoice !== null) {
renderChoice(this._blankChoice, "(blank)");
}
if (this._errorChoice != null) {
if (this._errorChoice !== null) {
renderChoice(this._errorChoice, "(error)");
}
@ -342,10 +342,10 @@ ListFacet.prototype._editChoice = function(choice, choiceDiv) {
ListFacet.prototype._select = function(choice, only) {
if (only) {
this._selection = [];
if (this._blankChoice != null) {
if (this._blankChoice !== null) {
this._blankChoice.s = false;
}
if (this._errorChoice != null) {
if (this._errorChoice !== null) {
this._errorChoice.s = false;
}
}

View File

@ -72,12 +72,12 @@ RangeFacet.prototype.getJSON = function() {
};
if (this._config.mode == "min" || this._config.mode == "range") {
if (this._from != null) {
if (this._from !== null) {
o.from = this._from;
}
}
if (this._config.mode == "max" || this._config.mode == "range") {
if (this._to != null) {
if (this._to !== null) {
o.to = this._to;
}
}
@ -92,12 +92,12 @@ RangeFacet.prototype.hasSelection = function() {
switch (this._config.mode) {
case "min":
return this._from != null && (!this._initializedUI || this._from > this._config.min);
return this._from !== null && (!this._initializedUI || this._from > this._config.min);
case "max":
return this._to != null && (!this._initializedUI || this._to < this._config.max);
return this._to !== null && (!this._initializedUI || this._to < this._config.max);
default:
return (this._from != null && (!this._initializedUI || this._from > this._config.min)) ||
(this._to != null && (!this._initializedUI || this._to < this._config.max));
return (this._from !== null && (!this._initializedUI || this._from > this._config.min)) ||
(this._to !== null && (!this._initializedUI || this._to < this._config.max));
}
};

View File

@ -40,7 +40,7 @@ TextSearchFacet.prototype.getJSON = function() {
};
TextSearchFacet.prototype.hasSelection = function() {
return this._query != null;
return this._query !== null;
};
TextSearchFacet.prototype._initializeUI = function() {
@ -70,13 +70,13 @@ TextSearchFacet.prototype._initializeUI = function() {
elmts.caseSensitiveCheckbox.bind("change", function() {
self._config.caseSensitive = this.checked;
if (self._query != null && self._query.length > 0) {
if (self._query !== null && self._query.length > 0) {
self._scheduleUpdate();
}
});
elmts.regexCheckbox.bind("change", function() {
self._config.mode = this.checked ? "regex" : "text";
if (self._query != null && self._query.length > 0) {
if (self._query !== null && self._query.length > 0) {
self._scheduleUpdate();
}
});

View File

@ -39,7 +39,7 @@ ProcessWidget.prototype.update = function(updateOptions, onDone) {
this._onDones.push(onDone);
}
if (this._timerID != null) {
if (this._timerID !== null) {
return;
}
@ -71,7 +71,7 @@ ProcessWidget.prototype.showUndo = function(historyEntry) {
};
ProcessWidget.prototype.undo = function() {
if (this._latestHistoryEntry != null) {
if (this._latestHistoryEntry !== null) {
Gridworks.postProcess(
"undo-redo",
{ undoID: this._latestHistoryEntry.id },

View File

@ -46,7 +46,7 @@ SchemaAlignmentDialog.UILink = function(dialog, link, table, options, parentUINo
SchemaAlignmentDialog.UILink.prototype._renderMain = function() {
$(this._tdMain).empty();
var label = this._link.property != null ? this._link.property.id : "property?";
var label = this._link.property !== null ? this._link.property.id : "property?";
var self = this;
@ -93,10 +93,10 @@ SchemaAlignmentDialog.UILink.prototype._renderDetails = function() {
SchemaAlignmentDialog.UILink.prototype._startEditProperty = function(elmt) {
var sourceTypeID = this._parentUINode.getExpectedType();
var targetTypeID = "type" in this._link.target && this._link.target.type != null ? this._link.target.type.id : null;
var targetTypeID = "type" in this._link.target && this._link.target.type !== null ? this._link.target.type.id : null;
var targetTypeName = "columnName" in this._link.target ? this._link.target.columnName : null;
if (sourceTypeID != null) {
if (sourceTypeID !== null) {
var self = this;
var dismissBusy = DialogSystem.showBusy();
@ -299,7 +299,7 @@ SchemaAlignmentDialog.UILink.prototype._showPropertySuggestPopup = function(elmt
var suggestOptions = {
type : '/type/property'
};
if (this._link.target != null && "type" in this._link.target && this._link.target.type != null) {
if (this._link.target !== null && "type" in this._link.target && this._link.target.type !== null) {
/*
suggestOptions.mql_filter = [{
"/type/property/expected_type" : {
@ -309,7 +309,7 @@ SchemaAlignmentDialog.UILink.prototype._showPropertySuggestPopup = function(elmt
*/
} else {
var sourceTypeID = this._parentUINode.getExpectedType();
if (sourceTypeID != null) {
if (sourceTypeID !== null) {
suggestOptions.schema = sourceTypeID;
}
}
@ -319,11 +319,11 @@ SchemaAlignmentDialog.UILink.prototype._showPropertySuggestPopup = function(elmt
};
SchemaAlignmentDialog.UILink.prototype.getJSON = function() {
if ("property" in this._link && this._link.property != null &&
"target" in this._link && this._link.target != null) {
if ("property" in this._link && this._link.property !== null &&
"target" in this._link && this._link.target !== null) {
var targetJSON = this._targetUI.getJSON();
if (targetJSON != null) {
if (targetJSON !== null) {
return {
property: cloneDeep(this._link.property),
target: targetJSON

View File

@ -152,7 +152,7 @@ SchemaAlignmentDialog.UINode.prototype._renderDetails = function() {
this._tableLinks = $('<table></table>').addClass("schema-alignment-table-layout").appendTo(this._expandedDetailDiv)[0];
if ("links" in this._node && this._node.links != null) {
if ("links" in this._node && this._node.links !== null) {
for (var i = 0; i < this._node.links.length; i++) {
this._linkUIs.push(new SchemaAlignmentDialog.UILink(
this._dialog,
@ -614,7 +614,7 @@ SchemaAlignmentDialog.UINode.prototype._showNodeConfigDialog = function() {
$('<button></button>').html("&nbsp;&nbsp;OK&nbsp;&nbsp;").click(function() {
var node = getResultJSON();
if (node != null) {
if (node !== null) {
DialogSystem.dismissUntil(level - 1);
self._node = node;
@ -701,7 +701,7 @@ SchemaAlignmentDialog.UINode.prototype.getJSON = function() {
var links = [];
for (var i = 0; i < this._linkUIs.length; i++) {
var link = this._linkUIs[i].getJSON();
if (link != null) {
if (link !== null) {
links.push(link);
}
}

View File

@ -10,7 +10,7 @@ SchemaAlignment.autoAlign = function() {
for (var c = 0; c < columns.length; c++) {
var column = columns[c];
var typed = "reconConfig" in column && column.reconConfig != null;
var typed = "reconConfig" in column && column.reconConfig !== null;
var candidate = {
status: "unbound",
typed: typed,
@ -101,7 +101,7 @@ SchemaAlignment.createNewRootNode = function() {
columnName: column.name,
createForNoReconMatch: true
};
if ("reconConfig" in column && column.reconConfig != null) {
if ("reconConfig" in column && column.reconConfig !== null) {
target.type = {
id: column.reconConfig.type.id,
name: column.reconConfig.type.name
@ -239,7 +239,7 @@ SchemaAlignmentDialog.prototype.getJSON = function() {
var rootNodes = [];
for (var i = 0; i < this._nodeUIs.length; i++) {
var node = this._nodeUIs[i].getJSON();
if (node != null) {
if (node !== null) {
rootNodes.push(node);
}
}

View File

@ -12,7 +12,7 @@ DOM.bind = function(elmt) {
DOM._bindDOMElement = function(elmt, map) {
var bind = elmt.getAttribute("bind");
if (bind != null && bind.length > 0) {
if (bind !== null && bind.length > 0) {
map[bind] = $(elmt);
elmt.removeAttribute("bind");
}
@ -24,7 +24,7 @@ DOM._bindDOMElement = function(elmt, map) {
DOM._bindDOMChildren = function(elmt, map) {
var node = elmt.firstChild;
while (node != null) {
while (node !== null) {
var node2 = node.nextSibling;
if (node.nodeType == 1) {
DOM._bindDOMElement(node, map);

View File

@ -42,8 +42,8 @@ HistogramWidget.prototype.update = function(min, max, step, binMatrix, from, to)
};
HistogramWidget.prototype._update = function() {
if (this._binMatrix != null) {
if (this._highlight != null) {
if (this._binMatrix !== null) {
if (this._highlight !== null) {
this._highlight.from = Math.max(this._highlight.from, this._range.min);
this._highlight.to = Math.min(this._highlight.to, this._range.max);
}
@ -135,7 +135,7 @@ HistogramWidget.prototype._render = function() {
/*
* Draw highlight
*/
if (this._highlight != null) {
if (this._highlight !== null) {
ctx.fillStyle = "rgba(192,192,192, 0.5)";
ctx.globalCompositeOperation = "source-over";
if (this._highlight.from > this._range.min) {

View File

@ -26,7 +26,7 @@ MenuSystem.showMenu = function(elmt, onDismiss) {
MenuSystem.dismissAll = function() {
MenuSystem.dismissUntil(0);
if (MenuSystem._overlay != null) {
if (MenuSystem._overlay !== null) {
MenuSystem._overlay.remove();
MenuSystem._overlay = null;
}

View File

@ -43,7 +43,7 @@ DataTableCellUI.prototype._render = function() {
.appendTo(divContent).click(function(evt) {
self._doRematch();
});
} else if (r.j == "matched" && "m" in r && r.m != null) {
} else if (r.j == "matched" && "m" in r && r.m !== null) {
var match = cell.r.m;
$('<a></a>')
.text(match.name)
@ -207,7 +207,7 @@ DataTableCellUI.prototype._searchForMatch = function() {
var match = null;
var commit = function() {
if (match != null) {
if (match !== null) {
var query = {
"id" : match.id,
"type" : []

View File

@ -895,7 +895,7 @@ DataTableColumnHeaderUI.prototype._doRemoveColumn = function() {
DataTableColumnHeaderUI.prototype._doRenameColumn = function() {
var newColumnName = window.prompt("Enter new column name", this._column.name);
if (newColumnName != null) {
if (newColumnName !== null) {
Gridworks.postProcess(
"rename-column",
{
@ -910,7 +910,7 @@ DataTableColumnHeaderUI.prototype._doRenameColumn = function() {
DataTableColumnHeaderUI.prototype._doJoinMultiValueCells = function() {
var separator = window.prompt("Enter separator to use between values", ", ");
if (separator != null) {
if (separator !== null) {
Gridworks.postProcess(
"join-multi-value-cells",
{
@ -926,7 +926,7 @@ DataTableColumnHeaderUI.prototype._doJoinMultiValueCells = function() {
DataTableColumnHeaderUI.prototype._doSplitMultiValueCells = function() {
var separator = window.prompt("What separator currently separates the values?", ",");
if (separator != null) {
if (separator !== null) {
Gridworks.postProcess(
"split-multi-value-cells",
{

View File

@ -399,7 +399,7 @@ DataTableView.sampleVisibleRows = function(column) {
var v = null;
if (column.cellIndex < row.cells.length) {
var cell = row.cells[column.cellIndex];
if (cell != null) {
if (cell !== null) {
v = cell.v;
}
}