Index: misc/ahah.js
===================================================================
RCS file: /cvs/drupal/drupal/misc/ahah.js,v
retrieving revision 1.7.2.1
diff -u -p -r1.7.2.1 ahah.js
--- misc/ahah.js 11 Feb 2008 14:46:27 -0000 1.7.2.1
+++ misc/ahah.js 19 Feb 2009 19:01:21 -0000
@@ -136,7 +136,7 @@ Drupal.ahah.prototype.beforeSubmit = fun
else if (this.progress.type == 'throbber') {
this.progress.element = $('
');
if (this.progress.message) {
- $('.throbber', this.progress.element).after('' + this.progress.message + '
')
+ $('.throbber', this.progress.element).after('' + this.progress.message + '
');
}
$(this.element).after(this.progress.element);
}
Index: misc/autocomplete.js
===================================================================
RCS file: /cvs/drupal/drupal/misc/autocomplete.js,v
retrieving revision 1.23
diff -u -p -r1.23 autocomplete.js
--- misc/autocomplete.js 4 Jan 2008 11:53:21 -0000 1.23
+++ misc/autocomplete.js 19 Feb 2009 19:02:30 -0000
@@ -1,7 +1,7 @@
// $Id: autocomplete.js,v 1.23 2008/01/04 11:53:21 goba Exp $
/**
- * Attaches the autocomplete behavior to all required fields
+ * Attaches the autocomplete behavior to all required fields.
*/
Drupal.behaviors.autocomplete = function (context) {
var acdb = [];
@@ -29,7 +29,7 @@ Drupal.autocompleteSubmit = function ()
};
/**
- * An AutoComplete object
+ * An AutoComplete object.
*/
Drupal.jsAC = function (input, db) {
var ac = this;
@@ -44,53 +44,53 @@ Drupal.jsAC = function (input, db) {
};
/**
- * Handler for the "keydown" event
+ * Handler for the "keydown" event.
*/
Drupal.jsAC.prototype.onkeydown = function (input, e) {
if (!e) {
e = window.event;
}
switch (e.keyCode) {
- case 40: // down arrow
+ case 40: // down arrow.
this.selectDown();
return false;
- case 38: // up arrow
+ case 38: // up arrow.
this.selectUp();
return false;
- default: // all other keys
+ default: // All other keys.
return true;
}
};
/**
- * Handler for the "keyup" event
+ * Handler for the "keyup" event.
*/
Drupal.jsAC.prototype.onkeyup = function (input, e) {
if (!e) {
e = window.event;
}
switch (e.keyCode) {
- case 16: // shift
- case 17: // ctrl
- case 18: // alt
- case 20: // caps lock
- case 33: // page up
- case 34: // page down
- case 35: // end
- case 36: // home
- case 37: // left arrow
- case 38: // up arrow
- case 39: // right arrow
- case 40: // down arrow
+ case 16: // shift.
+ case 17: // ctrl.
+ case 18: // alt.
+ case 20: // caps lock.
+ case 33: // page up.
+ case 34: // page down.
+ case 35: // end.
+ case 36: // home.
+ case 37: // left arrow.
+ case 38: // up arrow.
+ case 39: // right arrow.
+ case 40: // down arrow.
return true;
- case 9: // tab
- case 13: // enter
- case 27: // esc
+ case 9: // tab.
+ case 13: // enter.
+ case 27: // esc.
this.hidePopup(e.keyCode);
return true;
- default: // all other keys
+ default: // All other keys.
if (input.value.length > 0)
this.populatePopup();
else
@@ -100,14 +100,14 @@ Drupal.jsAC.prototype.onkeyup = function
};
/**
- * Puts the currently highlighted suggestion into the autocomplete field
+ * Puts the currently highlighted suggestion into the autocomplete field.
*/
Drupal.jsAC.prototype.select = function (node) {
this.input.value = node.autocompleteValue;
};
/**
- * Highlights the next suggestion
+ * Highlights the next suggestion.
*/
Drupal.jsAC.prototype.selectDown = function () {
if (this.selected && this.selected.nextSibling) {
@@ -122,7 +122,7 @@ Drupal.jsAC.prototype.selectDown = funct
};
/**
- * Highlights the previous suggestion
+ * Highlights the previous suggestion.
*/
Drupal.jsAC.prototype.selectUp = function () {
if (this.selected && this.selected.previousSibling) {
@@ -131,7 +131,7 @@ Drupal.jsAC.prototype.selectUp = functio
};
/**
- * Highlights a suggestion
+ * Highlights a suggestion.
*/
Drupal.jsAC.prototype.highlight = function (node) {
if (this.selected) {
@@ -142,7 +142,7 @@ Drupal.jsAC.prototype.highlight = functi
};
/**
- * Unhighlights a suggestion
+ * Unhighlights a suggestion.
*/
Drupal.jsAC.prototype.unhighlight = function (node) {
$(node).removeClass('selected');
@@ -150,14 +150,14 @@ Drupal.jsAC.prototype.unhighlight = func
};
/**
- * Hides the autocomplete suggestions
+ * Hides the autocomplete suggestions.
*/
Drupal.jsAC.prototype.hidePopup = function (keycode) {
- // Select item if the right key or mousebutton was pressed
+ // Select item if the right key or mousebutton was pressed.
if (this.selected && ((keycode && keycode != 46 && keycode != 8 && keycode != 27) || !keycode)) {
this.input.value = this.selected.autocompleteValue;
}
- // Hide popup
+ // Hide popup.
var popup = this.popup;
if (popup) {
this.popup = null;
@@ -167,10 +167,10 @@ Drupal.jsAC.prototype.hidePopup = functi
};
/**
- * Positions the suggestions popup and starts a search
+ * Positions the suggestions popup and starts a search.
*/
Drupal.jsAC.prototype.populatePopup = function () {
- // Show popup
+ // Show popup.
if (this.popup) {
$(this.popup).remove();
}
@@ -185,13 +185,13 @@ Drupal.jsAC.prototype.populatePopup = fu
});
$(this.input).before(this.popup);
- // Do search
+ // Do search.
this.db.owner = this;
this.db.search(this.input.value);
};
/**
- * Fills the suggestion popup with any matches received
+ * Fills the suggestion popup with any matches received.
*/
Drupal.jsAC.prototype.found = function (matches) {
// If no value in the textfield, do not show the popup.
@@ -199,7 +199,7 @@ Drupal.jsAC.prototype.found = function (
return false;
}
- // Prepare matches
+ // Prepare matches.
var ul = document.createElement('ul');
var ac = this;
for (key in matches) {
@@ -213,7 +213,7 @@ Drupal.jsAC.prototype.found = function (
$(ul).append(li);
}
- // Show popup with matches, if any
+ // Show popup with matches, if any.
if (this.popup) {
if (ul.childNodes.length > 0) {
$(this.popup).empty().append(ul).show();
@@ -239,7 +239,7 @@ Drupal.jsAC.prototype.setStatus = functi
};
/**
- * An AutoComplete DataBase object
+ * An AutoComplete DataBase object.
*/
Drupal.ACDB = function (uri) {
this.uri = uri;
@@ -248,25 +248,25 @@ Drupal.ACDB = function (uri) {
};
/**
- * Performs a cached and delayed search
+ * Performs a cached and delayed search.
*/
Drupal.ACDB.prototype.search = function (searchString) {
var db = this;
this.searchString = searchString;
- // See if this key has been searched for before
+ // See if this key has been searched for before.
if (this.cache[searchString]) {
return this.owner.found(this.cache[searchString]);
}
- // Initiate delayed search
+ // Initiate delayed search.
if (this.timer) {
clearTimeout(this.timer);
}
this.timer = setTimeout(function() {
db.owner.setStatus('begin');
- // Ajax GET request for autocompletion
+ // Ajax GET request for autocompletion.
$.ajax({
type: "GET",
url: db.uri +'/'+ Drupal.encodeURIComponent(searchString),
@@ -274,7 +274,7 @@ Drupal.ACDB.prototype.search = function
success: function (matches) {
if (typeof matches['status'] == 'undefined' || matches['status'] != 0) {
db.cache[searchString] = matches;
- // Verify if these are still the matches the user wants to see
+ // Verify if these are still the matches the user wants to see.
if (db.searchString == searchString) {
db.owner.found(matches);
}
@@ -289,7 +289,7 @@ Drupal.ACDB.prototype.search = function
};
/**
- * Cancels the current autocomplete request
+ * Cancels the current autocomplete request.
*/
Drupal.ACDB.prototype.cancel = function() {
if (this.owner) this.owner.setStatus('cancel');
Index: misc/drupal.js
===================================================================
RCS file: /cvs/drupal/drupal/misc/drupal.js,v
retrieving revision 1.41.2.3
diff -u -p -r1.41.2.3 drupal.js
--- misc/drupal.js 25 Jun 2008 09:06:57 -0000 1.41.2.3
+++ misc/drupal.js 19 Feb 2009 19:03:59 -0000
@@ -3,7 +3,7 @@
var Drupal = Drupal || { 'settings': {}, 'behaviors': {}, 'themes': {}, 'locale': {} };
/**
- * Set the variable that indicates if JavaScript behaviors should be applied
+ * Set the variable that indicates if JavaScript behaviors should be applied.
*/
Drupal.jsEnabled = document.getElementsByTagName && document.createElement && document.createTextNode && document.documentElement && document.getElementById;
@@ -82,17 +82,17 @@ Drupal.t = function(str, args) {
}
if (args) {
- // Transform arguments before inserting them
+ // Transform arguments before inserting them.
for (var key in args) {
switch (key.charAt(0)) {
- // Escaped only
+ // Escaped only.
case '@':
args[key] = Drupal.checkPlain(args[key]);
break;
- // Pass-through
+ // Pass-through.
case '!':
break;
- // Escaped and placeholder
+ // Escaped and placeholder.
case '%':
default:
args[key] = Drupal.theme('placeholder', args[key]);
@@ -211,7 +211,7 @@ Drupal.freezeHeight = function () {
};
/**
- * Unfreeze the body height
+ * Unfreeze the body height.
*/
Drupal.unfreezeHeight = function () {
$('#freeze-height').remove();
@@ -232,7 +232,7 @@ Drupal.encodeURIComponent = function (it
*/
Drupal.getSelection = function (element) {
if (typeof(element.selectionStart) != 'number' && document.selection) {
- // The current selection
+ // The current selection.
var range1 = document.selection.createRange();
var range2 = range1.duplicate();
// Select all text.
@@ -265,11 +265,11 @@ Drupal.ahahError = function(xmlhttp, uri
return message;
}
-// Global Killswitch on the element
+// Global Killswitch on the element.
if (Drupal.jsEnabled) {
- // Global Killswitch on the element
+ // Global Killswitch on the element.
$(document.documentElement).addClass('js');
- // 'js enabled' cookie
+ // 'js enabled' cookie.
document.cookie = 'has_js=1; path=/';
// Attach all behaviors.
$(document).ready(function() {
Index: misc/form.js
===================================================================
RCS file: /cvs/drupal/drupal/misc/form.js,v
retrieving revision 1.1
diff -u -p -r1.1 form.js
--- misc/form.js 12 Sep 2007 18:29:32 -0000 1.1
+++ misc/form.js 19 Feb 2009 19:04:24 -0000
@@ -2,7 +2,7 @@
Drupal.behaviors.multiselectSelector = function() {
// Automatically selects the right radio button in a multiselect control.
- $('.multiselect select:not(.multiselectSelector-processed)')
+ $('.multiselect select:not(.multiselectSelector-processed)', context)
.addClass('multiselectSelector-processed').change(function() {
$('.multiselect input:radio[value="'+ this.id.substr(5) +'"]')
.attr('checked', true);
Index: misc/progress.js
===================================================================
RCS file: /cvs/drupal/drupal/misc/progress.js,v
retrieving revision 1.20
diff -u -p -r1.20 progress.js
--- misc/progress.js 4 Jan 2008 11:53:21 -0000 1.20
+++ misc/progress.js 19 Feb 2009 19:05:00 -0000
@@ -53,7 +53,7 @@ Drupal.progressBar.prototype.startMonito
*/
Drupal.progressBar.prototype.stopMonitoring = function () {
clearTimeout(this.timer);
- // This allows monitoring to be stopped from within the callback
+ // This allows monitoring to be stopped from within the callback.
this.uri = null;
};
@@ -74,14 +74,14 @@ Drupal.progressBar.prototype.sendPing =
data: '',
dataType: 'json',
success: function (progress) {
- // Display errors
+ // Display errors.
if (progress.status == 0) {
pb.displayError(progress.data);
return;
}
- // Update display
+ // Update display.
pb.setProgress(progress.percentage, progress.message);
- // Schedule next timer
+ // Schedule next timer.
pb.timer = setTimeout(function() { pb.sendPing(); }, pb.delay);
},
error: function (xmlhttp) {
Index: misc/tabledrag.js
===================================================================
RCS file: /cvs/drupal/drupal/misc/tabledrag.js,v
retrieving revision 1.13.2.4
diff -u -p -r1.13.2.4 tabledrag.js
--- misc/tabledrag.js 17 Sep 2008 07:59:39 -0000 1.13.2.4
+++ misc/tabledrag.js 19 Feb 2009 19:06:53 -0000
@@ -275,7 +275,7 @@ Drupal.tableDrag.prototype.makeDraggable
keyChange = true;
if ($(item).is('.tabledrag-root')) {
- // Swap with the previous top-level row..
+ // Swap with the previous top-level row.
var groupHeight = 0;
while (previousRow && $('.indentation', previousRow).size()) {
previousRow = $(previousRow).prev('tr').get(0);
@@ -319,7 +319,9 @@ Drupal.tableDrag.prototype.makeDraggable
var groupHeight = 0;
nextGroup = new self.row(nextRow, 'keyboard', self.indentEnabled, self.maxDepth, false);
if (nextGroup) {
- $(nextGroup.group).each(function () {groupHeight += $(this).is(':hidden') ? 0 : this.offsetHeight});
+ $(nextGroup.group).each(function () {
+ groupHeight += $(this).is(':hidden') ? 0 : this.offsetHeight;
+ });
nextGroupRow = $(nextGroup.group).filter(':last').get(0);
self.rowObject.swap('after', nextGroupRow);
// No need to check for indentation, 0 is the only valid one.
@@ -355,7 +357,7 @@ Drupal.tableDrag.prototype.makeDraggable
});
// Compatibility addition, return false on keypress to prevent unwanted scrolling.
- // IE and Safari will supress scrolling on keydown, but all other browsers
+ // IE and Safari will suppress scrolling on keydown, but all other browsers
// need to return false on keypress. http://www.quirksmode.org/js/keys.html
handle.keypress(function(event) {
switch (event.keyCode) {
@@ -490,7 +492,7 @@ Drupal.tableDrag.prototype.getPosition =
// 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 (element.offsetHeight == 0) {
- element = element.firstChild; // a table cell
+ element = element.firstChild; // A table cell.
}
while (element.offsetParent){
@@ -590,7 +592,7 @@ Drupal.tableDrag.prototype.findDropTarge
Drupal.tableDrag.prototype.updateFields = function(changedRow) {
for (var group in this.tableSettings) {
// Each group may have a different setting for relationship, so we find
- // the source rows for each seperately.
+ // the source rows for each separately.
this.updateField(changedRow, group);
}
};
@@ -651,7 +653,7 @@ Drupal.tableDrag.prototype.updateField =
// Otherwise we went all the way to the left of the table without finding
// a parent, meaning this item has been placed at the root level.
else {
- // Use the first row in the table as source, because it's garanteed to
+ // Use the first row in the table as source, because it's guaranteed to
// be at the root level. Find the first item, then compare this row
// against it as a sibling.
sourceRow = $('tr.draggable:first').get(0);
@@ -701,7 +703,7 @@ Drupal.tableDrag.prototype.updateField =
var maxVal = values[values.length - 1];
// Populate the values in the siblings.
$(targetClass, siblings).each(function() {
- // If there are more items than possible values, assign the maximum value to the row.
+ // If there are more items than possible values, assign the maximum value to the row.
if (values.length > 0) {
this.value = values.shift();
}
@@ -773,7 +775,7 @@ Drupal.tableDrag.prototype.setScroll = f
};
Drupal.tableDrag.prototype.restripeTable = function() {
- // :even and :odd are reversed because jquery counts from 0 and
+ // :even and :odd are reversed because jQuery counts from 0 and
// we count from 1, so we're out of sync.
$('tr.draggable', this.table)
.filter(':odd').filter('.odd')
@@ -955,7 +957,7 @@ Drupal.tableDrag.prototype.row.prototype
}
return {'min':minIndent, 'max':maxIndent};
-}
+};
/**
* Indent a row within the legal bounds of the table.
@@ -1017,9 +1019,9 @@ Drupal.tableDrag.prototype.row.prototype
// Check that the sibling contains a similar target field.
if ($('.' + rowSettings.target, checkRow)) {
// Either add immediately if this is a flat table, or check to ensure
- // that this row has the same level of indentaiton.
+ // that this row has the same level of indentation.
if (this.indentEnabled) {
- var checkRowIndentation = $('.indentation', checkRow).length
+ var checkRowIndentation = $('.indentation', checkRow).length;
}
if (!(this.indentEnabled) || (checkRowIndentation == rowIndentation)) {
Index: misc/tableheader.js
===================================================================
RCS file: /cvs/drupal/drupal/misc/tableheader.js,v
retrieving revision 1.16.2.1
diff -u -p -r1.16.2.1 tableheader.js
--- misc/tableheader.js 1 Oct 2008 23:30:36 -0000 1.16.2.1
+++ misc/tableheader.js 19 Feb 2009 19:11:28 -0000
@@ -28,7 +28,7 @@ Drupal.behaviors.tableHeader = function
// Store parent table.
var table = $(this).parent('table')[0];
headerClone.table = table;
- // Finish initialzing header positioning.
+ // Finish initializing header positioning.
tracker(headerClone);
$(table).addClass('sticky-table');
@@ -70,7 +70,7 @@ Drupal.behaviors.tableHeader = function
// Get the height of the header table and scroll up that amount.
if (prevAnchor != location.hash) {
if (location.hash != '') {
- var scrollLocation = $('td'+ location.hash).offset().top - $(e).height();
+ var scrollLocation = $('td' + location.hash).offset().top - $(e).height();
$('body, html').scrollTop(scrollLocation);
}
prevAnchor = location.hash;
@@ -105,7 +105,7 @@ Drupal.behaviors.tableHeader = function
this.viewHeight = 0;
tracker(this);
});
- // Reset timer
+ // Reset timer.
time = null;
}, 250);
};
Index: misc/teaser.js
===================================================================
RCS file: /cvs/drupal/drupal/misc/teaser.js,v
retrieving revision 1.12
diff -u -p -r1.12 teaser.js
--- misc/teaser.js 9 Jan 2008 12:10:04 -0000 1.12
+++ misc/teaser.js 19 Feb 2009 19:09:15 -0000
@@ -56,10 +56,10 @@ Drupal.behaviors.teaser = function(conte
// Note: using val() fails sometimes. jQuery bug?
teaser[0].value = trim(text.slice(0, split));
body[0].value = trim(text.slice(split));
- // Reveal and enable teaser
+ // Reveal and enable teaser.
$(teaser).attr('disabled', '');
$(teaser).parent().slideDown('fast');
- // Change label
+ // Change label.
$(this).val(Drupal.t('Join summary'));
// Show separate teaser checkbox, restore checked value.
$(checkbox).show().children('input').attr('checked', checked);
@@ -87,7 +87,7 @@ Drupal.behaviors.teaser = function(conte
if (Drupal.behaviors.textarea && teaser.is(('.form-textarea:not(.textarea-processed)'))) {
Drupal.behaviors.textarea(teaser.parentNode);
}
- // Set initial visibility
+ // Set initial visibility.
if ($(teaser).is('[@disabled]')) {
$(teaser).parent().hide();
}
Index: misc/textarea.js
===================================================================
RCS file: /cvs/drupal/drupal/misc/textarea.js,v
retrieving revision 1.22
diff -u -p -r1.22 textarea.js
--- misc/textarea.js 17 Jan 2008 19:31:56 -0000 1.22
+++ misc/textarea.js 19 Feb 2009 19:10:26 -0000
@@ -4,11 +4,11 @@ Drupal.behaviors.textarea = function(con
$('textarea.resizable:not(.textarea-processed)', context).each(function() {
// Avoid non-processed teasers.
if ($(this).is(('textarea.teaser:not(.teaser-processed)'))) {
- return false;
+ return false;
}
var textarea = $(this).addClass('textarea-processed'), staticOffset = null;
- // When wrapping the text area, work around an IE margin bug. See:
+ // When wrapping the text area, work around an IE margin bug. See:
// http://jaspan.com/ie-inherited-margin-bug-form-elements-and-haslayout
$(this).wrap('
')
.parent().append($('').mousedown(startDrag));
Index: modules/block/block.js
===================================================================
RCS file: /cvs/drupal/drupal/modules/block/block.js,v
retrieving revision 1.2
diff -u -p -r1.2 block.js
--- modules/block/block.js 16 Dec 2007 10:36:53 -0000 1.2
+++ modules/block/block.js 19 Feb 2009 19:13:18 -0000
@@ -82,7 +82,7 @@ Drupal.behaviors.blockDrag = function(co
rowObject.swap('after', this);
}
}
- // This region has become empty
+ // This region has become empty.
if ($(this).next('tr').is(':not(.draggable)') || $(this).next('tr').size() == 0) {
$(this).removeClass('region-populated').addClass('region-empty');
}
Index: modules/color/color.js
===================================================================
RCS file: /cvs/drupal/drupal/modules/color/color.js,v
retrieving revision 1.6
diff -u -p -r1.6 color.js
--- modules/color/color.js 12 Sep 2007 18:29:32 -0000 1.6
+++ modules/color/color.js 19 Feb 2009 19:15:15 -0000
@@ -11,17 +11,17 @@ Drupal.behaviors.color = function (conte
var locks = [];
var focused = null;
- // Add Farbtastic
+ // Add Farbtastic.
$(form).prepend('').addClass('color-processed');
var farb = $.farbtastic('#placeholder');
- // Decode reference colors to HSL
+ // Decode reference colors to HSL.
var reference = Drupal.settings.color.reference;
for (i in reference) {
reference[i] = farb.RGBToHSL(farb.unpack(reference[i]));
}
- // Build preview
+ // Build a preview.
$('#preview:not(.color-processed)')
.append('')
.addClass('color-processed');
@@ -31,7 +31,7 @@ Drupal.behaviors.color = function (conte
gradient.append('');
}
- // Fix preview background in IE6
+ // Fix preview background in IE6.
if (navigator.appVersion.match(/MSIE [0-6]\./)) {
var e = $('#preview #img')[0];
var image = e.currentStyle.backgroundImage;
@@ -39,7 +39,7 @@ Drupal.behaviors.color = function (conte
e.style.filter = "progid:DXImageTransform.Microsoft.AlphaImageLoader(enabled=true, sizingMethod=crop, src='" + image.substring(5, image.length - 2) + "')";
}
- // Set up colorscheme selector
+ // Set up colorscheme selector.
$('#edit-scheme', form).change(function () {
var colors = this.options[this.selectedIndex].value;
if (colors != '') {
@@ -55,14 +55,14 @@ Drupal.behaviors.color = function (conte
* Render the preview.
*/
function preview() {
- // Solid background
+ // Solid background.
$('#preview', form).css('backgroundColor', inputs[0].value);
// Text preview
$('#text', form).css('color', inputs[4].value);
$('#text a, #text h2', form).css('color', inputs[1].value);
- // Set up gradient
+ // Set up gradient.
var top = farb.unpack(inputs[2].value);
var bottom = farb.unpack(inputs[3].value);
if (top && bottom) {
@@ -72,7 +72,7 @@ Drupal.behaviors.color = function (conte
}
var accum = top;
- // Render gradient lines
+ // Render gradient lines.
$('#gradient > div', form).each(function () {
for (i in accum) {
accum[i] += delta[i];
@@ -92,13 +92,13 @@ Drupal.behaviors.color = function (conte
* then shift_color(d, b, a) == c.
*/
function shift_color(given, ref1, ref2) {
- // Convert to HSL
+ // Convert to HSL.
given = farb.RGBToHSL(farb.unpack(given));
- // Hue: apply delta
+ // Hue: apply delta.
given[0] += ref2[0] - ref1[0];
- // Saturation: interpolate
+ // Saturation: interpolate.
if (ref1[1] == 0 || ref2[1] == 0) {
given[1] = ref2[1];
}
@@ -112,7 +112,7 @@ Drupal.behaviors.color = function (conte
}
}
- // Luminance: interpolate
+ // Luminance: interpolate.
if (ref1[2] == 0 || ref2[2] == 0) {
given[2] = ref2[2];
}
@@ -133,17 +133,17 @@ Drupal.behaviors.color = function (conte
* Callback for Farbtastic when a new color is chosen.
*/
function callback(input, color, propagate, colorscheme) {
- // Set background/foreground color
+ // Set background/foreground colors.
$(input).css({
backgroundColor: color,
'color': farb.RGBToHSL(farb.unpack(color))[2] > 0.5 ? '#000' : '#fff'
});
- // Change input value
+ // Change input value.
if (input.value && input.value != color) {
input.value = color;
- // Update locked values
+ // Update locked values.
if (propagate) {
var i = input.i;
for (j = i + 1; ; ++j) {
@@ -157,11 +157,11 @@ Drupal.behaviors.color = function (conte
callback(inputs[j], matched, false);
}
- // Update preview
+ // Update preview.
preview();
}
- // Reset colorscheme selector
+ // Reset colorscheme selector.
if (!colorscheme) {
resetScheme();
}
@@ -181,12 +181,12 @@ Drupal.behaviors.color = function (conte
// Focus the Farbtastic on a particular field.
function focus() {
var input = this;
- // Remove old bindings
+ // Remove old bindings.
focused && $(focused).unbind('keyup', farb.updateValue)
.unbind('keyup', preview).unbind('keyup', resetScheme)
.parent().removeClass('item-selected');
- // Add new bindings
+ // Add new bindings.
focused = this;
farb.linkTo(function (color) { callback(input, color, true, false); });
farb.setColor(this.value);
@@ -194,7 +194,7 @@ Drupal.behaviors.color = function (conte
.parent().addClass('item-selected');
}
- // Initialize color fields
+ // Initialize color fields.
$('#palette input.form-text', form)
.each(function () {
// Extract palette field name
@@ -203,7 +203,7 @@ Drupal.behaviors.color = function (conte
// Link to color picker temporarily to initialize.
farb.linkTo(function () {}).setColor('#000').linkTo(this);
- // Add lock
+ // Add lock.
var i = inputs.length;
if (inputs.length) {
var lock = $('').toggle(
@@ -230,7 +230,7 @@ Drupal.behaviors.color = function (conte
locks.push(lock);
};
- // Add hook
+ // Add hook.
var hook = $('');
$(this).after(hook);
hooks.push(hook);
@@ -243,9 +243,9 @@ Drupal.behaviors.color = function (conte
$('#palette label', form);
- // Focus first color
+ // Focus first color.
focus.call(inputs[0]);
- // Render preview
+ // Render preview.
preview();
};
Index: modules/system/system.js
===================================================================
RCS file: /cvs/drupal/drupal/modules/system/system.js,v
retrieving revision 1.14.2.1
diff -u -p -r1.14.2.1 system.js
--- modules/system/system.js 7 Feb 2008 18:23:30 -0000 1.14.2.1
+++ modules/system/system.js 19 Feb 2009 19:18:06 -0000
@@ -74,7 +74,7 @@ Drupal.behaviors.copyFieldValue = functi
for (var sourceId in Drupal.settings.copyFieldValue) {
// Get the list of target fields.
targetIds = Drupal.settings.copyFieldValue[sourceId];
- if (!$('#'+ sourceId + '.copy-field-values-processed').size(), context) {
+ if (!$('#'+ sourceId + '.copy-field-values-processed', context).size()) {
// Add the behavior to update target fields on blur of the primary field.
sourceField = $('#' + sourceId);
sourceField.bind('blur', function() {