Commit 675803d8 authored by Dries's avatar Dries
Browse files

- Patch #1428534 by nod_: Use === and !==

parent 81c90b3c
......@@ -24,7 +24,7 @@ Drupal.behaviors.AJAX = {
// Load all Ajax behaviors specified in the settings.
for (var base in settings.ajax) {
var element_settings = settings.ajax[base];
if (typeof element_settings.selector == 'undefined') {
if (typeof element_settings.selector === 'undefined') {
element_settings.selector = '#' + base;
}
$(element_settings.selector).once('drupal-ajax', function() {
......@@ -151,14 +151,14 @@ Drupal.ajax = function (base, element, element_settings) {
success: function (response, status) {
// Sanity check for browser support (object expected).
// When using iFrame uploads, responses must be returned as a string.
if (typeof response == 'string') {
if (typeof response === 'string') {
response = $.parseJSON(response);
}
return ajax.success(response, status);
},
complete: function (response, status) {
ajax.ajaxing = false;
if (status == 'error' || status == 'parsererror') {
if (status === 'error' || status === 'parsererror') {
return ajax.error(response, ajax.url);
}
},
......@@ -206,7 +206,7 @@ Drupal.ajax.prototype.keypressResponse = function (element, event) {
// except for form elements of type 'text' and 'textarea', where the
// spacebar activation causes inappropriate activation if #ajax['keypress'] is
// TRUE. On a text-type widget a space should always be a space.
if (event.which == 13 || (event.which == 32 && element.type != 'text' && element.type != 'textarea')) {
if (event.which === 13 || (event.which === 32 && element.type !== 'text' && element.type !== 'textarea')) {
$(ajax.element_settings.element).trigger(ajax.element_settings.event);
return false;
}
......@@ -257,7 +257,7 @@ Drupal.ajax.prototype.eventResponse = function (element, event) {
// For radio/checkbox, allow the default event. On IE, this means letting
// it actually check the box.
if (typeof element.type != 'undefined' && (element.type == 'checkbox' || element.type == 'radio')) {
if (typeof element.type !== 'undefined' && (element.type === 'checkbox' || element.type === 'radio')) {
return true;
}
else {
......@@ -352,7 +352,7 @@ Drupal.ajax.prototype.beforeSend = function (xmlhttprequest, options) {
$(this.element).addClass('progress-disabled').attr('disabled', true);
// Insert progressbar or throbber.
if (this.progress.type == 'bar') {
if (this.progress.type === 'bar') {
var progressBar = new Drupal.progressBar('ajax-progress-' + this.element.id, $.noop, this.progress.method, $.noop);
if (this.progress.message) {
progressBar.setProgress(-1, this.progress.message);
......@@ -364,7 +364,7 @@ Drupal.ajax.prototype.beforeSend = function (xmlhttprequest, options) {
this.progress.object = progressBar;
$(this.element).after(this.progress.element);
}
else if (this.progress.type == 'throbber') {
else if (this.progress.type === 'throbber') {
this.progress.element = $('<div class="ajax-progress ajax-progress-throbber"><div class="throbber">&nbsp;</div></div>');
if (this.progress.message) {
this.progress.element.find('.throbber').after('<div class="message">' + this.progress.message + '</div>');
......@@ -418,12 +418,12 @@ Drupal.ajax.prototype.getEffect = function (response) {
var speed = response.speed || this.speed;
var effect = {};
if (type == 'none') {
if (type === 'none') {
effect.showEffect = 'show';
effect.hideEffect = 'hide';
effect.showSpeed = '';
}
else if (type == 'fade') {
else if (type === 'fade') {
effect.showEffect = 'fadeIn';
effect.hideEffect = 'fadeOut';
effect.showSpeed = speed;
......@@ -492,7 +492,7 @@ Drupal.ajax.prototype.commands = {
// content satisfies the requirement of a single top-level element, and
// only use the container DIV created above when it doesn't. For more
// information, please see http://drupal.org/node/736066.
if (new_content.length != 1 || new_content.get(0).nodeType != 1) {
if (new_content.length !== 1 || new_content.get(0).nodeType !== 1) {
new_content = new_content_wrapped;
}
......@@ -511,7 +511,7 @@ Drupal.ajax.prototype.commands = {
wrapper[method](new_content);
// Immediately hide the new content if we're using any effects.
if (effect.showEffect != 'show') {
if (effect.showEffect !== 'show') {
new_content.hide();
}
......@@ -522,7 +522,7 @@ Drupal.ajax.prototype.commands = {
new_content.show();
new_content.find('.ajax-new-content')[effect.showEffect](effect.showSpeed);
}
else if (effect.showEffect != 'show') {
else if (effect.showEffect !== 'show') {
new_content[effect.showEffect](effect.showSpeed);
}
......
......@@ -12,7 +12,7 @@ Drupal.behaviors.batch = {
// Success: redirect to the summary.
var updateCallback = function (progress, status, pb) {
if (progress == 100) {
if (progress === '100') {
pb.stopMonitoring();
window.location = settings.batch.uri + '&op=finished';
}
......
......@@ -60,8 +60,8 @@ Drupal.behaviors.collapse = {
$(context).find('fieldset.collapsible').once('collapse', function () {
var $fieldset = $(this);
// Expand fieldset if there are errors inside, or if it contains an
// element that is targeted by the uri fragment identifier.
var anchor = location.hash && location.hash != '#' ? ', ' + location.hash : '';
// element that is targeted by the uri fragment identifier.
var anchor = location.hash && location.hash !== '#' ? ', ' + location.hash : '';
if ($fieldset.find('.error' + anchor).length) {
$fieldset.removeClass('collapsed');
}
......
......@@ -245,12 +245,12 @@ Drupal.formatPlural = function (count, singular, plural, args, options) {
args = args || {};
args['@count'] = count;
// Determine the index of the plural form.
var index = Drupal.locale.pluralFormula ? Drupal.locale.pluralFormula(args['@count']) : ((args['@count'] == 1) ? 0 : 1);
var index = Drupal.locale.pluralFormula ? Drupal.locale.pluralFormula(args['@count']) : ((args['@count'] === 1) ? 0 : 1);
if (index == 0) {
if (index === 0) {
return Drupal.t(singular, args, options);
}
else if (index == 1) {
else if (index === 1) {
return Drupal.t(plural, args, options);
}
else {
......@@ -322,7 +322,7 @@ Drupal.encodePath = function (item) {
*/
Drupal.getSelection = function (element) {
var range1, range2, start, end;
if (typeof element.selectionStart != 'number' && document.selection) {
if (typeof element.selectionStart !== 'number' && document.selection) {
// The current selection.
range1 = document.selection.createRange();
range2 = range1.duplicate();
......@@ -352,7 +352,7 @@ Drupal.ajaxError = function (xmlhttp, uri) {
statusCode += "\n" + Drupal.t("Debugging information follows.");
pathText = "\n" + Drupal.t("Path: !uri", {'!uri': uri} );
statusText = '';
// In some cases, when statusCode == 0, xmlhttp.statusText may not be defined.
// In some cases, when statusCode === 0, xmlhttp.statusText may not be defined.
// Unfortunately, testing for it with typeof, etc, doesn't seem to catch that
// and the test causes an exception. So we need to catch the exception here.
try {
......@@ -372,7 +372,7 @@ Drupal.ajaxError = function (xmlhttp, uri) {
responseText = responseText.replace(/[\n]+\s+/g,"\n");
// We don't need readyState except for status == 0.
readyStateText = xmlhttp.status == 0 ? ("\n" + Drupal.t("ReadyState: !readyState", {'!readyState': xmlhttp.readyState})) : "";
readyStateText = xmlhttp.status === 0 ? ("\n" + Drupal.t("ReadyState: !readyState", {'!readyState': xmlhttp.readyState})) : "";
message = statusCode + pathText + statusText + responseText + readyStateText;
return message;
......
......@@ -22,7 +22,7 @@ $.fn.drupalSetSummary = function (callback) {
// To facilitate things, the callback should always be a function. If it's
// not, we wrap it into an anonymous function which just returns the value.
if (typeof callback != 'function') {
if (typeof callback !== 'function') {
var val = callback;
callback = function () { return val; };
}
......
......@@ -51,7 +51,7 @@ Drupal.behaviors.machineName = {
// Determine the initial machine name value. Unless the machine name form
// element is disabled or not empty, the initial default value is based on
// the human-readable form element value.
if ($target.is(':disabled') || $target.val() != '') {
if ($target.is(':disabled') || $target.val() !== '') {
var machine = $target.val();
}
else {
......@@ -84,12 +84,12 @@ Drupal.behaviors.machineName = {
// Preview the machine name in realtime when the human-readable name
// changes, but only if there is no machine name yet; i.e., only upon
// initial creation, not when editing.
if ($target.val() == '') {
if ($target.val() === '') {
$source.bind('keyup.machineName change.machineName', function () {
machine = self.transliterate($(this).val(), options);
// Set the machine name to the transliterated value.
if (machine != '') {
if (machine != options.replace) {
if (machine !== '') {
if (machine !== options.replace) {
$target.val(machine);
$preview.html(options.field_prefix + Drupal.checkPlain(machine) + options.field_suffix);
}
......
......@@ -77,7 +77,7 @@ Drupal.progressBar.prototype.sendPing = function () {
dataType: 'json',
success: function (progress) {
// Display errors.
if (progress.status == 0) {
if (progress.status === 0) {
pb.displayError(progress.data);
return;
}
......
......@@ -202,7 +202,7 @@ states.Dependent.prototype = {
// This constraint is an array (OR or XOR).
var hasXor = $.inArray('xor', constraints) === -1;
for (var i = 0, len = constraints.length; i < len; i++) {
if (constraints[i] != 'xor') {
if (constraints[i] !== 'xor') {
var constraint = this.checkConstraints(constraints[i], selector, i);
// Return if this is OR and we have a satisfied constraint or if this
// is XOR and we have a second satisfied constraint.
......@@ -320,7 +320,7 @@ states.Trigger.prototype = {
initialize: function () {
var trigger = states.Trigger.states[this.state];
if (typeof trigger == 'function') {
if (typeof trigger === 'function') {
// We have a custom trigger initialization function.
trigger.call(window, this.element);
}
......@@ -369,7 +369,7 @@ states.Trigger.states = {
'keyup': function () {
// The function associated to that trigger returns the new value for the
// state.
return this.val() == '';
return this.val() === '';
}
},
......@@ -428,7 +428,7 @@ states.State = function(state) {
// Normalize the state name.
while (true) {
// Iteratively remove exclamation marks and invert the value.
while (this.name.charAt(0) == '!') {
while (this.name.charAt(0) === '!') {
this.name = this.name.substring(1);
this.invert = !this.invert;
}
......
......@@ -46,7 +46,7 @@ Drupal.tableDrag = function (table, tableSettings) {
this.oldY = 0; // Used to determine up or down direction from last mouse move.
this.changed = false; // Whether anything in the entire table has changed.
this.maxDepth = 0; // Maximum amount of allowed parenting.
this.rtl = $(this.table).css('direction') == 'rtl' ? -1 : 1; // Direction of the table.
this.rtl = $(this.table).css('direction') === 'rtl' ? -1 : 1; // Direction of the table.
// Configure the scroll settings.
this.scrollSettings = { amount: 4, interval: 50, trigger: 70 };
......@@ -60,7 +60,7 @@ Drupal.tableDrag = function (table, tableSettings) {
this.indentEnabled = false;
for (var group in tableSettings) {
for (var n in tableSettings[group]) {
if (tableSettings[group][n].relationship == 'parent') {
if (tableSettings[group][n].relationship === 'parent') {
this.indentEnabled = true;
}
if (tableSettings[group][n].limit > 0) {
......@@ -90,7 +90,7 @@ Drupal.tableDrag = function (table, tableSettings) {
$table.before($('<a href="#" class="tabledrag-toggle-weight"></a>')
.attr('title', Drupal.t('Re-order rows by numerical weight instead of dragging.'))
.click(function () {
if ($.cookie('Drupal.tableDrag.showWeight') == 1) {
if ($.cookie('Drupal.tableDrag.showWeight') === '1') {
self.hideColumns();
}
else {
......@@ -176,7 +176,7 @@ Drupal.tableDrag.prototype.initColumns = function () {
}
// Check cookie value and show/hide weight columns accordingly.
else {
if ($.cookie('Drupal.tableDrag.showWeight') == 1) {
if ($.cookie('Drupal.tableDrag.showWeight') === '1') {
this.showColumns();
}
else {
......@@ -277,9 +277,9 @@ Drupal.tableDrag.prototype.makeDraggable = function (item) {
// Add hover action for the handle.
handle.hover(function () {
self.dragObject == null ? $(this).addClass('tabledrag-handle-hover') : null;
self.dragObject === null ? $(this).addClass('tabledrag-handle-hover') : null;
}, function () {
self.dragObject == null ? $(this).removeClass('tabledrag-handle-hover') : null;
self.dragObject === null ? $(this).removeClass('tabledrag-handle-hover') : null;
});
// Add the mousedown action for the handle.
......@@ -345,7 +345,7 @@ Drupal.tableDrag.prototype.makeDraggable = function (item) {
// Add arrow-key support to the handle.
handle.keydown(function (event) {
// If a rowObject doesn't yet exist and this isn't the tab key.
if (event.keyCode != 9 && !self.rowObject) {
if (event.keyCode !== 9 && !self.rowObject) {
self.rowObject = new self.row(item, 'keyboard', self.indentEnabled, self.maxDepth, true);
}
......@@ -383,7 +383,7 @@ Drupal.tableDrag.prototype.makeDraggable = function (item) {
window.scrollBy(0, -groupHeight);
}
}
else if (self.table.tBodies[0].rows[0] != previousRow || $previousRow.is('.draggable')) {
else if (self.table.tBodies[0].rows[0] !== previousRow || $previousRow.is('.draggable')) {
// Swap with the previous row (unless previous row is the first one
// and undraggable).
self.rowObject.swap('before', previousRow);
......@@ -438,7 +438,7 @@ Drupal.tableDrag.prototype.makeDraggable = function (item) {
break;
}
if (self.rowObject && self.rowObject.changed == true) {
if (self.rowObject && self.rowObject.changed === true) {
$(item).addClass('drag');
if (self.oldRowElement) {
$(self.oldRowElement).removeClass('drag-previous');
......@@ -479,7 +479,7 @@ Drupal.tableDrag.prototype.dragRow = function (event, self) {
var x = self.currentMouseCoords.x - self.dragObject.initMouseOffset.x;
// Check for row swapping and vertical scrolling.
if (y != self.oldY) {
if (y !== self.oldY) {
self.rowObject.direction = y > self.oldY ? 'down' : 'up';
self.oldY = y; // Update the old value.
......@@ -488,14 +488,14 @@ Drupal.tableDrag.prototype.dragRow = function (event, self) {
// Stop any current scrolling.
clearInterval(self.scrollInterval);
// Continue scrolling if the mouse has moved in the scroll direction.
if (scrollAmount > 0 && self.rowObject.direction == 'down' || scrollAmount < 0 && self.rowObject.direction == 'up') {
if (scrollAmount > 0 && self.rowObject.direction === 'down' || scrollAmount < 0 && self.rowObject.direction === 'up') {
self.setScroll(scrollAmount);
}
// If we have a valid target, perform the swap and restripe the table.
var currentRow = self.findDropTargetRow(x, y);
if (currentRow) {
if (self.rowObject.direction == 'down') {
if (self.rowObject.direction === 'down') {
self.rowObject.swap('after', currentRow, self);
}
else {
......@@ -528,11 +528,11 @@ Drupal.tableDrag.prototype.dragRow = function (event, self) {
*/
Drupal.tableDrag.prototype.dropRow = function (event, self) {
// Drop row functionality shared between mouseup and blur events.
if (self.rowObject != null) {
if (self.rowObject !== null) {
var droppedRow = self.rowObject.element;
var $droppedRow = $(droppedRow);
// The row is already in the right place so we just release it.
if (self.rowObject.changed == true) {
if (self.rowObject.changed === true) {
// Update the fields in the dropped row.
self.updateFields(droppedRow);
......@@ -540,7 +540,7 @@ Drupal.tableDrag.prototype.dropRow = function (event, self) {
// fields in the entire dragged group.
for (var group in self.tableSettings) {
var rowSettings = self.rowSettings(group, droppedRow);
if (rowSettings.relationship == 'group') {
if (rowSettings.relationship === 'group') {
for (var n in self.rowObject.children) {
self.updateField(self.rowObject.children[n], group);
}
......@@ -548,7 +548,7 @@ Drupal.tableDrag.prototype.dropRow = function (event, self) {
}
self.rowObject.markChanged();
if (self.changed == false) {
if (self.changed === false) {
$(Drupal.theme('tableDragChangedWarning')).insertBefore(self.table).hide().fadeIn('slow');
self.changed = true;
}
......@@ -567,7 +567,7 @@ Drupal.tableDrag.prototype.dropRow = function (event, self) {
}
// Functionality specific only to mouseup event.
if (self.dragObject != null) {
if (self.dragObject !== null) {
$droppedRow.find('.tabledrag-handle').removeClass('tabledrag-handle-hover');
self.dragObject = null;
......@@ -618,7 +618,7 @@ Drupal.tableDrag.prototype.findDropTargetRow = function (x, y) {
// Because Safari does not report offsetHeight on table rows, but does on
// table cells, grab the firstChild of the row and use that instead.
// http://jacob.peargrove.com/blog/2006/technical/table-row-offsettop-bug-in-safari.
if (row.offsetHeight == 0) {
if (row.offsetHeight === 0) {
var rowHeight = parseInt(row.firstChild.offsetHeight, 10) / 2;
}
// Other browsers.
......@@ -631,14 +631,14 @@ Drupal.tableDrag.prototype.findDropTargetRow = function (x, y) {
if (this.indentEnabled) {
// Check that this row is not a child of the row being dragged.
for (var n in this.rowObject.group) {
if (this.rowObject.group[n] == row) {
if (this.rowObject.group[n] === row) {
return null;
}
}
}
else {
// Do not allow a row to be swapped with itself.
if (row == this.rowObject.element) {
if (row === this.rowObject.element) {
return null;
}
}
......@@ -690,11 +690,11 @@ Drupal.tableDrag.prototype.updateField = function (changedRow, group) {
var $changedRow = $(changedRow);
// Set the row as its own target.
if (rowSettings.relationship == 'self' || rowSettings.relationship == 'group') {
if (rowSettings.relationship === 'self' || rowSettings.relationship === 'group') {
var sourceRow = changedRow;
}
// Siblings are easy, check previous and next rows.
else if (rowSettings.relationship == 'sibling') {
else if (rowSettings.relationship === 'sibling') {
var $previousRow = $changedRow.prev('tr').eq(0);
var previousRow = $previousRow.get(0);
var $nextRow = $changedRow.next('tr').eq(0);
......@@ -702,7 +702,7 @@ Drupal.tableDrag.prototype.updateField = function (changedRow, group) {
var sourceRow = changedRow;
if ($previousRow.is('.draggable') && $previousRow.find('.' + group).length) {
if (this.indentEnabled) {
if ($previousRow.find('.indentations').length == $changedRow.find('.indentations')) {
if ($previousRow.find('.indentations').length === $changedRow.find('.indentations').length) {
sourceRow = previousRow;
}
}
......@@ -712,7 +712,7 @@ Drupal.tableDrag.prototype.updateField = function (changedRow, group) {
}
else if ($nextRow.is('.draggable') && $nextRow.find('.' + group).length) {
if (this.indentEnabled) {
if ($nextRow.find('.indentations').length == $changedRow.find('.indentations')) {
if ($nextRow.find('.indentations').length === $changedRow.find('.indentations').length) {
sourceRow = nextRow;
}
}
......@@ -723,7 +723,7 @@ Drupal.tableDrag.prototype.updateField = function (changedRow, group) {
}
// Parents, look up the tree until we find a field not in this group.
// Go up as many parents as indentations in the changed row.
else if (rowSettings.relationship == 'parent') {
else if (rowSettings.relationship === 'parent') {
var $previousRow = $changedRow.prev('tr');
var previousRow = $previousRow;
while ($previousRow.length && $previousRow.find('.indentation').length >= this.rowObject.indents) {
......@@ -741,7 +741,7 @@ Drupal.tableDrag.prototype.updateField = function (changedRow, group) {
// be at the root level. Find the first item, then compare this row
// against it as a sibling.
sourceRow = $(this.table).find('tr.draggable:first').get(0);
if (sourceRow == this.rowObject.element) {
if (sourceRow === this.rowObject.element) {
sourceRow = $(this.rowObject.group[this.rowObject.group.length - 1]).next('tr.draggable').get(0);
}
var useSibling = true;
......@@ -826,7 +826,7 @@ Drupal.tableDrag.prototype.checkScroll = function (cursorY) {
var de = document.documentElement;
var b = document.body;
var windowHeight = this.windowHeight = window.innerHeight || (de.clientHeight && de.clientWidth != 0 ? de.clientHeight : b.offsetHeight);
var windowHeight = this.windowHeight = window.innerHeight || (de.clientHeight && de.clientWidth !== 0 ? de.clientHeight : b.offsetHeight);
var scrollY = this.scrollY = (document.all ? (!de.scrollTop ? b.scrollTop : de.scrollTop) : (window.pageYOffset ? window.pageYOffset : window.scrollY));
var trigger = this.scrollSettings.trigger;
var delta = 0;
......@@ -939,10 +939,10 @@ Drupal.tableDrag.prototype.row.prototype.findChildren = function (addClasses) {
rows.push(currentRow[0]);
if (addClasses) {
currentRow.find('.indentation').each(function (indentNum) {
if (child == 1 && (indentNum == parentIndentation)) {
if (child === 1 && (indentNum === parentIndentation)) {
$(this).addClass('tree-child-first');
}
if (indentNum == parentIndentation) {
if (indentNum === parentIndentation) {
$(this).addClass('tree-child');
}
else if (indentNum > parentIndentation) {
......@@ -972,7 +972,7 @@ Drupal.tableDrag.prototype.row.prototype.isValidSwap = function (row) {
var $row = $(row);
if (this.indentEnabled) {
var prevRow, nextRow;
if (this.direction == 'down') {
if (this.direction === 'down') {
prevRow = row;
nextRow = $row.next('tr').get(0);
}
......@@ -989,7 +989,7 @@ Drupal.tableDrag.prototype.row.prototype.isValidSwap = function (row) {
}
// Do not let an un-draggable first row have anything put before it.
if (this.table.tBodies[0].rows[0] == row && $row.is(':not(.draggable)')) {
if (this.table.tBodies[0].rows[0] === row && $row.is(':not(.draggable)')) {
return false;
}
......@@ -1117,7 +1117,7 @@ Drupal.tableDrag.prototype.row.prototype.findSiblings = function (rowSettings) {
var checkRowIndentation = checkRow.find('.indentation').length;
}
if (!(this.indentEnabled) || (checkRowIndentation == rowIndentation)) {
if (!(this.indentEnabled) || (checkRowIndentation === rowIndentation)) {
siblings.push(checkRow[0]);
}
else if (checkRowIndentation < rowIndentation) {
......@@ -1132,7 +1132,7 @@ Drupal.tableDrag.prototype.row.prototype.findSiblings = function (rowSettings) {
}
// Since siblings are added in reverse order for previous, reverse the
// completed list of previous siblings. Add the current row and continue.
if (directions[d] == 'prev') {
if (directions[d] === 'prev') {
siblings.reverse();
siblings.push(this.element);
}
......@@ -1159,7 +1159,7 @@ Drupal.tableDrag.prototype.row.prototype.removeIndentClasses = function () {
Drupal.tableDrag.prototype.row.prototype.markChanged = function () {
var marker = Drupal.theme('tableDragChangedMarker');
var cell = $(this.element).find('td:first');
if (cell.find('abbr.tabledrag-changed').length == 0) {
if (cell.find('abbr.tabledrag-changed').length === 0) {
cell.append(marker);
}
};
......
......@@ -11,7 +11,7 @@ Drupal.behaviors.tableSelect = {
Drupal.tableSelect = function () {
// Do not add a "Select all" checkbox if there are no rows with checkboxes in the table
if ($(this).find('td input:checkbox').length == 0) {
if ($(this).find('td input:checkbox').length === 0) {
return;
}
......@@ -49,13 +49,13 @@ Drupal.tableSelect = function () {
// If this is a shift click, we need to highlight everything in the range.
// Also make sure that we are actually checking checkboxes over a range and
// that a checkbox has been checked or unchecked before.
if (e.shiftKey && lastChecked && lastChecked != e.target) {
if (e.shiftKey && lastChecked && lastChecked !== e.target) {
// We use the checkbox's parent TR to do our range searching.
Drupal.tableSelectRange($(e.target).closest('tr')[0], $(lastChecked).closest('tr')[0], e.target.checked);
}
// If all checkboxes are checked, make sure the select-all one is checked too, otherwise keep unchecked.
updateSelectAll((checkboxes.length == checkboxes.filter(':checked').length));
updateSelectAll((checkboxes.length === checkboxes.filter(':checked').length));
// Keep track of the last checked checkbox.
lastChecked = e.target;
......@@ -69,7 +69,7 @@ Drupal.tableSelectRange = function (from, to, state) {
// Traverse through the sibling nodes.
for (var i = from[mode], $i; i; i = i[mode]) {
// Make sure that we're only dealing with elements.
if (i.nodeType != 1) {
if (i.nodeType !== 1) {
continue;
}
$i = $(i);
......@@ -81,7 +81,7 @@ Drupal.tableSelectRange = function (from, to, state) {
if (to.nodeType) {
// If we are at the end of the range, stop.
if (i == to) {
if (i === to) {
break;
}
}
......
......@@ -31,12 +31,12 @@ Drupal.behaviors.setTimezone = {
var isDaylightSavingTime;
// If the offset from UTC is identical on January 1 and July 1,
// assume daylight saving time is not used in this time zone.
if (offsetJan == offsetJul) {
if (offsetJan === offsetJul) {
isDaylightSavingTime = '';
}
// If the maximum annual offset is equivalent to the current offset,
// assume daylight saving time is in effect.
else if (Math.max(offsetJan, offsetJul) == offsetNow) {
else if (Math.max(offsetJan, offsetJul) === offsetNow) {
isDaylightSavingTime = 1;
}
// Otherwise, assume daylight saving time is not in effect.
......
......@@ -22,7 +22,7 @@ Drupal.behaviors.verticalTabs = {
// Check if there are some fieldsets that can be converted to vertical-tabs
var $fieldsets = $this.find('> fieldset');
if ($fieldsets.length == 0) {
if ($fieldsets.length === 0) {
return;
}
......@@ -42,7 +42,7 @@ Drupal.behaviors.verticalTabs = {
.removeClass('collapsible collapsed')
.addClass('vertical-tabs-pane')
.data('verticalTab', vertical_tab);
if (this.id == focusID) {
if (this.id === focusID) {
tab_focus = $this;
}
});
......@@ -88,7 +88,7 @@ Drupal.verticalTab = function (settings) {
// Keyboard events added:
// Pressing the Enter key will open the tab pane.
this.link.keyd