" ).data( "test", function() {} );
shouldHaveData( "data set to function" );
-});
+} );
test( "focusable - visible, enabled elements", function() {
expect( 18 );
@@ -108,7 +108,7 @@ test( "focusable - visible, enabled elements", function() {
isNotFocusable( "#visibleAncestor-div", "div" );
isFocusable( "#visibleAncestor-spanWithTabindex", "span with tabindex" );
isFocusable( "#visibleAncestor-divWithNegativeTabindex", "div with tabindex" );
-});
+} );
test( "focusable - disabled elements", function() {
expect( 9 );
@@ -122,7 +122,7 @@ test( "focusable - disabled elements", function() {
isNotFocusable( "#disabledElement-button", "button" );
isNotFocusable( "#disabledElement-select", "select" );
isNotFocusable( "#disabledElement-textarea", "textarea" );
-});
+} );
test( "focusable - hidden styles", function() {
expect( 8 );
@@ -138,7 +138,7 @@ test( "focusable - hidden styles", function() {
isNotFocusable( "#displayNone-span", "span with tabindex, display: none" );
isNotFocusable( "#visibilityHidden-span", "span with tabindex, visibility: hidden" );
-});
+} );
test( "focusable - natively focusable with various tabindex", function() {
expect( 4 );
@@ -147,7 +147,7 @@ test( "focusable - natively focusable with various tabindex", function() {
isFocusable( "#inputTabindex10", "input, tabindex 10" );
isFocusable( "#inputTabindex-1", "input, tabindex -1" );
isFocusable( "#inputTabindex-50", "input, tabindex -50" );
-});
+} );
test( "focusable - not natively focusable with various tabindex", function() {
expect( 4 );
@@ -156,7 +156,7 @@ test( "focusable - not natively focusable with various tabindex", function() {
isFocusable( "#spanTabindex10", "span, tabindex 10" );
isFocusable( "#spanTabindex-1", "span, tabindex -1" );
isFocusable( "#spanTabindex-50", "span, tabindex -50" );
-});
+} );
test( "focusable - area elements", function() {
expect( 3 );
@@ -164,13 +164,13 @@ test( "focusable - area elements", function() {
isFocusable( "#areaCoordsHref", "coords and href" );
isFocusable( "#areaNoCoordsHref", "href but no coords" );
isNotFocusable( "#areaNoImg", "not associated with an image" );
-});
+} );
test( "focusable - dimensionless parent with overflow", function() {
expect( 1 );
isFocusable( "#dimensionlessParent", "input" );
-});
+} );
test( "tabbable - visible, enabled elements", function() {
expect( 18 );
@@ -193,7 +193,7 @@ test( "tabbable - visible, enabled elements", function() {
isNotTabbable( "#visibleAncestor-div", "div" );
isTabbable( "#visibleAncestor-spanWithTabindex", "span with tabindex" );
isNotTabbable( "#visibleAncestor-divWithNegativeTabindex", "div with tabindex" );
-});
+} );
test( "tabbable - disabled elements", function() {
expect( 9 );
@@ -207,7 +207,7 @@ test( "tabbable - disabled elements", function() {
isNotTabbable( "#disabledElement-button", "button" );
isNotTabbable( "#disabledElement-select", "select" );
isNotTabbable( "#disabledElement-textarea", "textarea" );
-});
+} );
test( "tabbable - hidden styles", function() {
expect( 8 );
@@ -223,7 +223,7 @@ test( "tabbable - hidden styles", function() {
isNotTabbable( "#displayNone-span", "span with tabindex, display: none" );
isNotTabbable( "#visibilityHidden-span", "span with tabindex, visibility: hidden" );
-});
+} );
test( "tabbable - natively tabbable with various tabindex", function() {
expect( 4 );
@@ -232,7 +232,7 @@ test( "tabbable - natively tabbable with various tabindex", function() {
isTabbable( "#inputTabindex10", "input, tabindex 10" );
isNotTabbable( "#inputTabindex-1", "input, tabindex -1" );
isNotTabbable( "#inputTabindex-50", "input, tabindex -50" );
-});
+} );
test( "tabbable - not natively tabbable with various tabindex", function() {
expect( 4 );
@@ -241,7 +241,7 @@ test( "tabbable - not natively tabbable with various tabindex", function() {
isTabbable( "#spanTabindex10", "span, tabindex 10" );
isNotTabbable( "#spanTabindex-1", "span, tabindex -1" );
isNotTabbable( "#spanTabindex-50", "span, tabindex -50" );
-});
+} );
test( "tabbable - area elements", function() {
expect( 3 );
@@ -249,13 +249,13 @@ test( "tabbable - area elements", function() {
isTabbable( "#areaCoordsHref", "coords and href" );
isTabbable( "#areaNoCoordsHref", "href but no coords" );
isNotTabbable( "#areaNoImg", "not associated with an image" );
-});
+} );
test( "tabbable - dimensionless parent with overflow", function() {
expect( 1 );
isTabbable( "#dimensionlessParent", "input" );
-});
+} );
test( "escapeSelector", function() {
expect( 1 );
diff --git a/tests/unit/datepicker/events.js b/tests/unit/datepicker/events.js
index f33351b57a5..4a5654d09e9 100644
--- a/tests/unit/datepicker/events.js
+++ b/tests/unit/datepicker/events.js
@@ -4,151 +4,159 @@ define( [
"ui/widgets/datepicker"
], function( $, testHelper ) {
-module("datepicker: events");
+module( "datepicker: events" );
var selectedThis = null,
selectedDate = null,
selectedInst = null;
-function callback(date, inst) {
+function callback( date, inst ) {
selectedThis = this;
selectedDate = date;
selectedInst = inst;
}
-function callback2(year, month, inst) {
+function callback2( year, month, inst ) {
selectedThis = this;
selectedDate = year + "/" + month;
selectedInst = inst;
}
-test("events", function() {
+test( "events", function() {
expect( 26 );
var dateStr, newMonthYear, inp2,
- inp = testHelper.init("#inp", {onSelect: callback}),
+ inp = testHelper.init( "#inp", { onSelect: callback } ),
date = new Date();
+
// onSelect
- inp.val("").datepicker("show").
- simulate("keydown", {keyCode: $.ui.keyCode.ENTER});
- equal(selectedThis, inp[0], "Callback selected this");
- equal(selectedInst, $.data(inp[0], testHelper.PROP_NAME), "Callback selected inst");
- equal(selectedDate, $.datepicker.formatDate("mm/dd/yy", date),
- "Callback selected date");
- inp.val("").datepicker("show").
- simulate("keydown", {ctrlKey: true, keyCode: $.ui.keyCode.DOWN}).
- simulate("keydown", {keyCode: $.ui.keyCode.ENTER});
- date.setDate(date.getDate() + 7);
- equal(selectedDate, $.datepicker.formatDate("mm/dd/yy", date),
- "Callback selected date - ctrl+down");
- inp.val("").datepicker("show").
- simulate("keydown", {keyCode: $.ui.keyCode.ESCAPE});
- equal(selectedDate, $.datepicker.formatDate("mm/dd/yy", date),
- "Callback selected date - esc");
+ inp.val( "" ).datepicker( "show" ).
+ simulate( "keydown", { keyCode: $.ui.keyCode.ENTER } );
+ equal( selectedThis, inp[ 0 ], "Callback selected this" );
+ equal( selectedInst, $.data( inp[ 0 ], testHelper.PROP_NAME ), "Callback selected inst" );
+ equal( selectedDate, $.datepicker.formatDate( "mm/dd/yy", date ),
+ "Callback selected date" );
+ inp.val( "" ).datepicker( "show" ).
+ simulate( "keydown", { ctrlKey: true, keyCode: $.ui.keyCode.DOWN } ).
+ simulate( "keydown", { keyCode: $.ui.keyCode.ENTER } );
+ date.setDate( date.getDate() + 7 );
+ equal( selectedDate, $.datepicker.formatDate( "mm/dd/yy", date ),
+ "Callback selected date - ctrl+down" );
+ inp.val( "" ).datepicker( "show" ).
+ simulate( "keydown", { keyCode: $.ui.keyCode.ESCAPE } );
+ equal( selectedDate, $.datepicker.formatDate( "mm/dd/yy", date ),
+ "Callback selected date - esc" );
dateStr = "02/04/2008";
- inp.val(dateStr).datepicker("show").
- simulate("keydown", {keyCode: $.ui.keyCode.ENTER});
- equal(dateStr, selectedDate,
- "onSelect is called after enter keydown");
+ inp.val( dateStr ).datepicker( "show" ).
+ simulate( "keydown", { keyCode: $.ui.keyCode.ENTER } );
+ equal( dateStr, selectedDate,
+ "onSelect is called after enter keydown" );
+
// onChangeMonthYear
- inp.datepicker("option", {onChangeMonthYear: callback2, onSelect: null}).
- val("").datepicker("show");
- newMonthYear = function(date) {
- return date.getFullYear() + "/" + (date.getMonth() + 1);
+ inp.datepicker( "option", { onChangeMonthYear: callback2, onSelect: null } ).
+ val( "" ).datepicker( "show" );
+ newMonthYear = function( date ) {
+ return date.getFullYear() + "/" + ( date.getMonth() + 1 );
};
date = new Date();
- date.setDate(1);
- inp.simulate("keydown", {keyCode: $.ui.keyCode.PAGE_UP});
- date.setMonth(date.getMonth() - 1);
- equal(selectedThis, inp[0], "Callback change month/year this");
- equal(selectedInst, $.data(inp[0], testHelper.PROP_NAME), "Callback change month/year inst");
- equal(selectedDate, newMonthYear(date),
- "Callback change month/year date - pgup");
- inp.simulate("keydown", {keyCode: $.ui.keyCode.PAGE_DOWN});
- date.setMonth(date.getMonth() + 1);
- equal(selectedDate, newMonthYear(date),
- "Callback change month/year date - pgdn");
- inp.simulate("keydown", {ctrlKey: true, keyCode: $.ui.keyCode.PAGE_UP});
- date.setFullYear(date.getFullYear() - 1);
- equal(selectedDate, newMonthYear(date),
- "Callback change month/year date - ctrl+pgup");
- inp.simulate("keydown", {ctrlKey: true, keyCode: $.ui.keyCode.HOME});
- date.setFullYear(date.getFullYear() + 1);
- equal(selectedDate, newMonthYear(date),
- "Callback change month/year date - ctrl+home");
- inp.simulate("keydown", {ctrlKey: true, keyCode: $.ui.keyCode.PAGE_DOWN});
- date.setFullYear(date.getFullYear() + 1);
- equal(selectedDate, newMonthYear(date),
- "Callback change month/year date - ctrl+pgdn");
- inp.datepicker("setDate", new Date(2007, 1 - 1, 26));
- equal(selectedDate, "2007/1", "Callback change month/year date - setDate");
+ date.setDate( 1 );
+ inp.simulate( "keydown", { keyCode: $.ui.keyCode.PAGE_UP } );
+ date.setMonth( date.getMonth() - 1 );
+ equal( selectedThis, inp[ 0 ], "Callback change month/year this" );
+ equal( selectedInst, $.data( inp[ 0 ], testHelper.PROP_NAME ), "Callback change month/year inst" );
+ equal( selectedDate, newMonthYear( date ),
+ "Callback change month/year date - pgup" );
+ inp.simulate( "keydown", { keyCode: $.ui.keyCode.PAGE_DOWN } );
+ date.setMonth( date.getMonth() + 1 );
+ equal( selectedDate, newMonthYear( date ),
+ "Callback change month/year date - pgdn" );
+ inp.simulate( "keydown", { ctrlKey: true, keyCode: $.ui.keyCode.PAGE_UP } );
+ date.setFullYear( date.getFullYear() - 1 );
+ equal( selectedDate, newMonthYear( date ),
+ "Callback change month/year date - ctrl+pgup" );
+ inp.simulate( "keydown", { ctrlKey: true, keyCode: $.ui.keyCode.HOME } );
+ date.setFullYear( date.getFullYear() + 1 );
+ equal( selectedDate, newMonthYear( date ),
+ "Callback change month/year date - ctrl+home" );
+ inp.simulate( "keydown", { ctrlKey: true, keyCode: $.ui.keyCode.PAGE_DOWN } );
+ date.setFullYear( date.getFullYear() + 1 );
+ equal( selectedDate, newMonthYear( date ),
+ "Callback change month/year date - ctrl+pgdn" );
+ inp.datepicker( "setDate", new Date( 2007, 1 - 1, 26 ) );
+ equal( selectedDate, "2007/1", "Callback change month/year date - setDate" );
selectedDate = null;
- inp.datepicker("setDate", new Date(2007, 1 - 1, 12));
- ok(selectedDate == null, "Callback change month/year date - setDate no change");
+ inp.datepicker( "setDate", new Date( 2007, 1 - 1, 12 ) );
+ ok( selectedDate == null, "Callback change month/year date - setDate no change" );
+
// onChangeMonthYear step by 2
- inp.datepicker("option", {stepMonths: 2}).
- datepicker("hide").val("").datepicker("show").
- simulate("keydown", {keyCode: $.ui.keyCode.PAGE_UP});
- date.setMonth(date.getMonth() - 14);
- equal(selectedDate, newMonthYear(date),
- "Callback change month/year by 2 date - pgup");
- inp.simulate("keydown", {ctrlKey: true, keyCode: $.ui.keyCode.PAGE_UP});
- date.setMonth(date.getMonth() - 12);
- equal(selectedDate, newMonthYear(date),
- "Callback change month/year by 2 date - ctrl+pgup");
- inp.simulate("keydown", {keyCode: $.ui.keyCode.PAGE_DOWN});
- date.setMonth(date.getMonth() + 2);
- equal(selectedDate, newMonthYear(date),
- "Callback change month/year by 2 date - pgdn");
- inp.simulate("keydown", {ctrlKey: true, keyCode: $.ui.keyCode.PAGE_DOWN});
- date.setMonth(date.getMonth() + 12);
- equal(selectedDate, newMonthYear(date),
- "Callback change month/year by 2 date - ctrl+pgdn");
+ inp.datepicker( "option", { stepMonths: 2 } ).
+ datepicker( "hide" ).val( "" ).datepicker( "show" ).
+ simulate( "keydown", { keyCode: $.ui.keyCode.PAGE_UP } );
+ date.setMonth( date.getMonth() - 14 );
+ equal( selectedDate, newMonthYear( date ),
+ "Callback change month/year by 2 date - pgup" );
+ inp.simulate( "keydown", { ctrlKey: true, keyCode: $.ui.keyCode.PAGE_UP } );
+ date.setMonth( date.getMonth() - 12 );
+ equal( selectedDate, newMonthYear( date ),
+ "Callback change month/year by 2 date - ctrl+pgup" );
+ inp.simulate( "keydown", { keyCode: $.ui.keyCode.PAGE_DOWN } );
+ date.setMonth( date.getMonth() + 2 );
+ equal( selectedDate, newMonthYear( date ),
+ "Callback change month/year by 2 date - pgdn" );
+ inp.simulate( "keydown", { ctrlKey: true, keyCode: $.ui.keyCode.PAGE_DOWN } );
+ date.setMonth( date.getMonth() + 12 );
+ equal( selectedDate, newMonthYear( date ),
+ "Callback change month/year by 2 date - ctrl+pgdn" );
+
// onClose
- inp.datepicker("option", {onClose: callback, onChangeMonthYear: null, stepMonths: 1}).
- val("").datepicker("show").
- simulate("keydown", {keyCode: $.ui.keyCode.ESCAPE});
- equal(selectedThis, inp[0], "Callback close this");
- equal(selectedInst, $.data(inp[0], testHelper.PROP_NAME), "Callback close inst");
- equal(selectedDate, "", "Callback close date - esc");
- inp.val("").datepicker("show").
- simulate("keydown", {keyCode: $.ui.keyCode.ENTER});
- equal(selectedDate, $.datepicker.formatDate("mm/dd/yy", new Date()),
- "Callback close date - enter");
- inp.val("02/04/2008").datepicker("show").
- simulate("keydown", {keyCode: $.ui.keyCode.ESCAPE});
- equal(selectedDate, "02/04/2008", "Callback close date - preset");
- inp.val("02/04/2008").datepicker("show").
- simulate("keydown", {ctrlKey: true, keyCode: $.ui.keyCode.END});
- equal(selectedDate, "", "Callback close date - ctrl+end");
-
- inp2 = testHelper.init("#inp2");
- inp2.datepicker().datepicker("option", {onClose: callback}).datepicker("show");
- inp.datepicker("show");
- equal(selectedThis, inp2[0], "Callback close this");
-});
-
-test("beforeShowDay-getDate", function() {
+ inp.datepicker( "option", { onClose: callback, onChangeMonthYear: null, stepMonths: 1 } ).
+ val( "" ).datepicker( "show" ).
+ simulate( "keydown", { keyCode: $.ui.keyCode.ESCAPE } );
+ equal( selectedThis, inp[ 0 ], "Callback close this" );
+ equal( selectedInst, $.data( inp[ 0 ], testHelper.PROP_NAME ), "Callback close inst" );
+ equal( selectedDate, "", "Callback close date - esc" );
+ inp.val( "" ).datepicker( "show" ).
+ simulate( "keydown", { keyCode: $.ui.keyCode.ENTER } );
+ equal( selectedDate, $.datepicker.formatDate( "mm/dd/yy", new Date() ),
+ "Callback close date - enter" );
+ inp.val( "02/04/2008" ).datepicker( "show" ).
+ simulate( "keydown", { keyCode: $.ui.keyCode.ESCAPE } );
+ equal( selectedDate, "02/04/2008", "Callback close date - preset" );
+ inp.val( "02/04/2008" ).datepicker( "show" ).
+ simulate( "keydown", { ctrlKey: true, keyCode: $.ui.keyCode.END } );
+ equal( selectedDate, "", "Callback close date - ctrl+end" );
+
+ inp2 = testHelper.init( "#inp2" );
+ inp2.datepicker().datepicker( "option", { onClose: callback } ).datepicker( "show" );
+ inp.datepicker( "show" );
+ equal( selectedThis, inp2[ 0 ], "Callback close this" );
+} );
+
+test( "beforeShowDay-getDate", function() {
expect( 3 );
- var inp = testHelper.init("#inp", {beforeShowDay: function() { inp.datepicker("getDate"); return [true, ""]; }}),
- dp = $("#ui-datepicker-div");
- inp.val("01/01/2010").datepicker("show");
+ var inp = testHelper.init( "#inp", { beforeShowDay: function() { inp.datepicker( "getDate" ); return [ true, "" ]; } } ),
+ dp = $( "#ui-datepicker-div" );
+ inp.val( "01/01/2010" ).datepicker( "show" );
+
// contains non-breaking space
- equal($("div.ui-datepicker-title").text(),
- // support: IE <9, jQuery <1.8
+ equal( $( "div.ui-datepicker-title" ).text(),
+
+ // Support: IE <9, jQuery <1.8
// In IE7/8 with jQuery <1.8, encoded spaces behave in strange ways
- $( "
January 2010" ).text(), "Initial month");
- $("a.ui-datepicker-next", dp).trigger( "click" );
- $("a.ui-datepicker-next", dp).trigger( "click" );
+ $( "
January 2010" ).text(), "Initial month" );
+ $( "a.ui-datepicker-next", dp ).trigger( "click" );
+ $( "a.ui-datepicker-next", dp ).trigger( "click" );
+
// contains non-breaking space
- equal($("div.ui-datepicker-title").text(),
- $( "
March 2010" ).text(), "After next clicks");
- inp.datepicker("hide").datepicker("show");
- $("a.ui-datepicker-prev", dp).trigger( "click" );
- $("a.ui-datepicker-prev", dp).trigger( "click" );
+ equal( $( "div.ui-datepicker-title" ).text(),
+ $( "
March 2010" ).text(), "After next clicks" );
+ inp.datepicker( "hide" ).datepicker( "show" );
+ $( "a.ui-datepicker-prev", dp ).trigger( "click" );
+ $( "a.ui-datepicker-prev", dp ).trigger( "click" );
+
// contains non-breaking space
- equal($("div.ui-datepicker-title").text(),
- $( "
November 2009" ).text(), "After prev clicks");
- inp.datepicker("hide");
-});
+ equal( $( "div.ui-datepicker-title" ).text(),
+ $( "
November 2009" ).text(), "After prev clicks" );
+ inp.datepicker( "hide" );
+} );
} );
diff --git a/tests/unit/dialog/common-deprecated.js b/tests/unit/dialog/common-deprecated.js
index 69153039ce4..26f7cb201bd 100644
--- a/tests/unit/dialog/common-deprecated.js
+++ b/tests/unit/dialog/common-deprecated.js
@@ -36,7 +36,7 @@ common.testWidget( "dialog", {
title: null,
width: 300,
- // callbacks
+ // Callbacks
beforeClose: null,
close: null,
create: null,
diff --git a/tests/unit/dialog/common.js b/tests/unit/dialog/common.js
index 8722d1753bf..b1884b8cc4c 100644
--- a/tests/unit/dialog/common.js
+++ b/tests/unit/dialog/common.js
@@ -35,7 +35,7 @@ common.testWidget( "dialog", {
title: null,
width: 300,
- // callbacks
+ // Callbacks
beforeClose: null,
close: null,
create: null,
diff --git a/tests/unit/dialog/core.js b/tests/unit/dialog/core.js
index 1560c34acdf..b351b0aeb0e 100644
--- a/tests/unit/dialog/core.js
+++ b/tests/unit/dialog/core.js
@@ -224,7 +224,7 @@ asyncTest( "Prevent tabbing out of dialogs", function() {
function checkTab() {
equal( document.activeElement, inputs[ 0 ], "Tab key event moved focus within the modal" );
- // check shift tab
+ // Check shift tab
$( document.activeElement ).simulate( "keydown", { keyCode: $.ui.keyCode.TAB, shiftKey: true });
setTimeout( checkShiftTab );
}
diff --git a/tests/unit/dialog/events.js b/tests/unit/dialog/events.js
index 13c4525011a..8a56699ab23 100644
--- a/tests/unit/dialog/events.js
+++ b/tests/unit/dialog/events.js
@@ -76,7 +76,7 @@ test( "focus", function() {
other.dialog( "moveToTop" );
element.trigger( "mousedown" );
- // triggers just once when already on top
+ // Triggers just once when already on top
element.dialog( "open" );
element.dialog( "moveToTop" );
element.trigger( "mousedown" );
diff --git a/tests/unit/dialog/options.js b/tests/unit/dialog/options.js
index c4f1b3e15e7..aa659f04178 100644
--- a/tests/unit/dialog/options.js
+++ b/tests/unit/dialog/options.js
@@ -344,7 +344,7 @@ test("minWidth", function( assert ) {
test( "position, default center on window", function( assert ) {
expect( 2 );
- // dialogs alter the window width and height in Firefox
+ // Dialogs alter the window width and height in Firefox
// so we collect that information before creating the dialog
// Support: Firefox
var winWidth = $( window ).width(),
@@ -360,7 +360,7 @@ test( "position, default center on window", function( assert ) {
test( "position, right bottom at right bottom via ui.position args", function( assert ) {
expect( 2 );
- // dialogs alter the window width and height in Firefox
+ // Dialogs alter the window width and height in Firefox
// so we collect that information before creating the dialog
// Support: Firefox
var winWidth = $( window ).width(),
@@ -469,7 +469,7 @@ test( "title", function() {
equal( titleText(), "foo", "title after init" );
element.remove();
- // make sure attroperties are properly ignored - #5742 - .attr() might return a DOMElement
+ // Make sure attroperties are properly ignored - #5742 - .attr() might return a DOMElement
element = $( "
" ).dialog();
// some browsers return a non-breaking space and some return " "
// so we get the text to normalize to the actual non-breaking space
diff --git a/tests/unit/draggable/common.js b/tests/unit/draggable/common.js
index d09e6b7b75e..c9a687ce3c7 100644
--- a/tests/unit/draggable/common.js
+++ b/tests/unit/draggable/common.js
@@ -37,7 +37,7 @@ common.testWidget( "draggable", {
distance: 1,
iframeFix: false,
- // callbacks
+ // Callbacks
create: null,
drag: null,
start: null,
diff --git a/tests/unit/draggable/core.js b/tests/unit/draggable/core.js
index 30563b622e9..d6eaeb2aaba 100644
--- a/tests/unit/draggable/core.js
+++ b/tests/unit/draggable/core.js
@@ -67,11 +67,11 @@ test( "resizable handle with complex markup (#8756 / #8757)", function() {
var handle = $(".ui-resizable-w div"),
target = $( "#draggable1" ).draggable().resizable({ handles: "all" });
- // todo: fix resizable so it doesn't require a mouseover
+ // Todo: fix resizable so it doesn't require a mouseover
handle.simulate("mouseover").simulate( "drag", { dx: -50 } );
equal( target.width(), 250, "compare width" );
- // todo: fix resizable so it doesn't require a mouseover
+ // Todo: fix resizable so it doesn't require a mouseover
handle.simulate("mouseover").simulate( "drag", { dx: 50 } );
equal( target.width(), 200, "compare width" );
});
@@ -215,7 +215,7 @@ test( "scroll offset with fixed ancestors", function() {
$( [ "hidden", "auto", "scroll" ] ).each(function() {
var overflow = this;
- // http://bugs.jqueryui.com/ticket/9379 - position bug in scrollable div
+ // Http://bugs.jqueryui.com/ticket/9379 - position bug in scrollable div
// http://bugs.jqueryui.com/ticket/10147 - Wrong position in a parent with "overflow: hidden"
test( "position in scrollable parent with overflow: " + overflow, function() {
expect( 2 );
@@ -230,7 +230,7 @@ $( [ "hidden", "auto", "scroll" ] ).each(function() {
dragDelta = 20,
delta = 100,
- // we scroll after each drag event, so subtract 1 from number of moves for expected
+ // We scroll after each drag event, so subtract 1 from number of moves for expected
expected = delta + ( ( moves - 1 ) * dragDelta ),
element = $( "#dragged" ).draggable({
drag: function() {
@@ -300,13 +300,13 @@ asyncTest( "blur behavior", function() {
testHelper.move( focusElement, 1, 1 );
- // http://bugs.jqueryui.com/ticket/10527
+ // Http://bugs.jqueryui.com/ticket/10527
// Draggable: Can't select option in modal dialog (IE8)
strictEqual( document.activeElement, focusElement.get( 0 ), "test element is focused after mousing down on itself" );
testHelper.move( element, 50, 50 );
- // http://bugs.jqueryui.com/ticket/4261
+ // Http://bugs.jqueryui.com/ticket/4261
// active element should blur when mousing down on a draggable
notStrictEqual( document.activeElement, focusElement.get( 0 ), "test element is no longer focused after mousing down on a draggable" );
start();
diff --git a/tests/unit/draggable/options.js b/tests/unit/draggable/options.js
index e1fd8288ab4..bc7370e8b5c 100644
--- a/tests/unit/draggable/options.js
+++ b/tests/unit/draggable/options.js
@@ -278,12 +278,12 @@ test( "connectToSortable, dragging out of a sortable", function() {
// Position issue when connected to sortable
deepEqual( ui.helper.offset(), offsetExpected, "draggable offset is correct" );
- // http://bugs.jqueryui.com/ticket/7734
+ // Http://bugs.jqueryui.com/ticket/7734
// HTML IDs are removed when dragging to a Sortable
equal( sortItem[ 0 ], dragHelper[ 0 ], "both have the same helper" );
equal( sortItem.attr( "id" ), dragHelper.attr( "id" ), "both have the same id" );
- // http://bugs.jqueryui.com/ticket/9481
+ // Http://bugs.jqueryui.com/ticket/9481
// connectToSortable causes sortable revert to fail on second attempt
equal( sortable.sortable( "option", "revert" ), 100, "sortable revert behavior is preserved" );
});
@@ -357,7 +357,7 @@ test( "connectToSortable, dragging multiple elements in and out of sortable", fu
moves: 10
});
- // http://bugs.jqueryui.com/ticket/9675
+ // Http://bugs.jqueryui.com/ticket/9675
// Animation issue with revert and connectToSortable
sortable.one( "sortstop", function( event, ui ) {
ok( !$.contains( document, ui.placeholder[ 0 ] ), "placeholder was removed" );
@@ -419,7 +419,7 @@ test( "connectToSortable, dragging through a sortable", function() {
sortable = $( "#sortable2" ).sortable(),
sortableOffset = sortable.offset();
- // http://bugs.jqueryui.com/ticket/10669
+ // Http://bugs.jqueryui.com/ticket/10669
// Draggable: Position issue with connectToSortable
draggable.one( "dragstop", function() {
equal( draggable.parent().attr( "id" ), "sortable", "restored draggable to original parent" );
@@ -1022,7 +1022,7 @@ asyncTest( "revert and revertDuration", function() {
}
});
- // animation are async, so test for it asynchronously
+ // Animation are async, so test for it asynchronously
testHelper.move( element, 50, 50 );
setTimeout( function() {
ok( $( "#draggable2" ).is( ":animated" ), "revert: true with revertDuration should animate" );
@@ -1191,7 +1191,7 @@ test( "snap, snapMode, and snapTolerance", function( assert ) {
}),
element2 = $( "#draggable2" ).draggable();
- // http://bugs.jqueryui.com/ticket/9724
+ // Http://bugs.jqueryui.com/ticket/9724
// Draggable: Snapping coordinates thrown off by margin on draggable
element.css( "margin", "3px" );
diff --git a/tests/unit/droppable/common-deprecated.js b/tests/unit/droppable/common-deprecated.js
index e9fdc69cc8f..ecbc9b1a1b7 100644
--- a/tests/unit/droppable/common-deprecated.js
+++ b/tests/unit/droppable/common-deprecated.js
@@ -15,7 +15,7 @@ common.testWidget( "droppable", {
scope: "default",
tolerance: "intersect",
- // callbacks
+ // Callbacks
activate: null,
create: null,
deactivate: null,
diff --git a/tests/unit/droppable/common.js b/tests/unit/droppable/common.js
index d3bffc67b6a..5d0e55d6f7a 100644
--- a/tests/unit/droppable/common.js
+++ b/tests/unit/droppable/common.js
@@ -13,7 +13,7 @@ common.testWidget( "droppable", {
scope: "default",
tolerance: "intersect",
- // callbacks
+ // Callbacks
activate: null,
create: null,
deactivate: null,
diff --git a/tests/unit/droppable/options.js b/tests/unit/droppable/options.js
index 2fdf483d20a..c2035ce8cc4 100644
--- a/tests/unit/droppable/options.js
+++ b/tests/unit/droppable/options.js
@@ -114,7 +114,7 @@ test( "tolerance, intersect", function() {
height: 10,
position: "absolute",
- // http://bugs.jqueryui.com/ticket/6876
+ // Http://bugs.jqueryui.com/ticket/6876
// Droppable: droppable region is offset by draggables margin
marginTop: 3,
marginLeft: 3
@@ -183,7 +183,7 @@ test( "tolerance, pointer", function() {
});
});
- // http://bugs.jqueryui.com/ticket/4977 - tolerance, pointer - bug when pointer outside draggable
+ // Http://bugs.jqueryui.com/ticket/4977 - tolerance, pointer - bug when pointer outside draggable
draggable.css({ top: 0, left: 0 }).draggable( "option", "axis", "x" );
droppable.css({ top: 15, left: 15 });
diff --git a/tests/unit/effects/core.js b/tests/unit/effects/core.js
index c8e7c26321d..5f634a78293 100644
--- a/tests/unit/effects/core.js
+++ b/tests/unit/effects/core.js
@@ -30,7 +30,7 @@ function notPresent( value, array, message ) {
// minDuration is used for "short" animate tests where we are only concerned about the final
var minDuration = 15,
- // duration is used for "long" animates where we plan on testing properties during animation
+ // Duration is used for "long" animates where we plan on testing properties during animation
duration = 200;
module( "effects.core" );
@@ -115,11 +115,11 @@ asyncTest( "animateClass works with colors", function() {
expect(2);
- // we want to catch the first frame of animation
+ // We want to catch the first frame of animation
jQuery.fx.step.backgroundColor = function( fx ) {
oldStep.apply( this, arguments );
- // make sure it has animated somewhere we can detect
+ // Make sure it has animated somewhere we can detect
if ( fx.pos > 255 / 2000 ) {
jQuery.fx.step.backgroundColor = oldStep;
notPresent( test.css("backgroundColor"),
@@ -206,14 +206,14 @@ function( assert ) {
expect( 2 );
var test = $( "div.ticket7106" );
- // ensure the class stays and that the css property stays
+ // Ensure the class stays and that the css property stays
function animationComplete() {
assert.hasClasses( test, "testClass", "class change during animateClass was not lost" );
equal( test.height(), 100, "css change during animateClass was not lost" );
start();
}
- // add a class and change a style property after starting an animated class
+ // Add a class and change a style property after starting an animated class
test.addClass( "animate", minDuration, animationComplete )
.addClass( "testClass" )
.height( 100 );
diff --git a/tests/unit/menu/common.js b/tests/unit/menu/common.js
index 81674be351c..adb74cf0a9a 100644
--- a/tests/unit/menu/common.js
+++ b/tests/unit/menu/common.js
@@ -18,7 +18,7 @@ common.testWidget( "menu", {
},
role: "menu",
- // callbacks
+ // Callbacks
blur: null,
create: null,
focus: null,
diff --git a/tests/unit/menu/events.js b/tests/unit/menu/events.js
index 8a4b92fff97..790e5912c23 100644
--- a/tests/unit/menu/events.js
+++ b/tests/unit/menu/events.js
@@ -333,7 +333,7 @@ asyncTest( "handle keyboard navigation on menu without scroll and with submenus"
element.simulate( "keydown", { keyCode: $.ui.keyCode.LEFT } );
equal( logOutput(), "keydown,4", "Keydown LEFT (close submenu)" );
- // re-open submenu
+ // Re-open submenu
element.simulate( "keydown", { keyCode: $.ui.keyCode.RIGHT } );
setTimeout( menukeyboard3 );
}
@@ -525,7 +525,7 @@ asyncTest( "handle keyboard navigation on menu with scroll and with submenus", f
element.simulate( "keydown", { keyCode: $.ui.keyCode.LEFT } );
equal( logOutput(), "keydown,1", "Keydown LEFT (close submenu)" );
- // re-open submenu
+ // Re-open submenu
element.simulate( "keydown", { keyCode: $.ui.keyCode.RIGHT } );
setTimeout( menukeyboard3, 50 );
}
diff --git a/tests/unit/resizable/common.js b/tests/unit/resizable/common.js
index 6096446f324..3f1f82bced9 100644
--- a/tests/unit/resizable/common.js
+++ b/tests/unit/resizable/common.js
@@ -29,7 +29,7 @@ common.testWidget( "resizable", {
minWidth: 10,
zIndex: 90,
- // callbacks
+ // Callbacks
create: null,
resize: null,
start: null,
diff --git a/tests/unit/resizable/events.js b/tests/unit/resizable/events.js
index eb64400c668..b77130741f4 100644
--- a/tests/unit/resizable/events.js
+++ b/tests/unit/resizable/events.js
@@ -203,7 +203,7 @@ test( "resize (containment) works with parent with negative offset", function()
fixedContainer = absoluteContainer.wrap( "
" ).parent(),
increaseWidthBy = 50;
- // position fixed container in window top left
+ // Position fixed container in window top left
fixedContainer.css({
width: 400,
height: 100,
@@ -212,7 +212,7 @@ test( "resize (containment) works with parent with negative offset", function()
left: 0
});
- // position absolute container within fixed on slightly outside window
+ // Position absolute container within fixed on slightly outside window
absoluteContainer.css({
width: 400,
height: 100,
@@ -221,7 +221,7 @@ test( "resize (containment) works with parent with negative offset", function()
left: -50
});
- // set up resizable to be contained within absolute container
+ // Set up resizable to be contained within absolute container
target.resizable({
handles: "all",
containment: "parent"
diff --git a/tests/unit/resizable/options.js b/tests/unit/resizable/options.js
index 1e643a576bc..23434830979 100644
--- a/tests/unit/resizable/options.js
+++ b/tests/unit/resizable/options.js
@@ -126,7 +126,7 @@ test("aspectRatio: 'preserve' (ne)", function() {
test( "aspectRatio: Resizing can move objects", function() {
expect( 7 );
- // http://bugs.jqueryui.com/ticket/7018 - Resizing can move objects
+ // Http://bugs.jqueryui.com/ticket/7018 - Resizing can move objects
var handleW = ".ui-resizable-w",
handleNW = ".ui-resizable-nw",
target = $( "#resizable1" ).resizable({
@@ -143,7 +143,7 @@ test( "aspectRatio: Resizing can move objects", function() {
equal( target.height(), 100, "compare height - no size change" );
equal( target.position().left, 75, "compare left - no movement" );
- // http://bugs.jqueryui.com/ticket/9107 - aspectRatio and containment not handled correctly
+ // Http://bugs.jqueryui.com/ticket/9107 - aspectRatio and containment not handled correctly
$( "#container" ).css({ width: 200, height: 300, position: "absolute", left: 100, top: 100 });
$( "#resizable1" ).css({ width: 100, height: 100, left: 0, top: 0 });
@@ -173,7 +173,7 @@ test( "containment", function() {
test( "containment - not immediate parent", function() {
expect( 4 );
- // http://bugs.jqueryui.com/ticket/7485 - Resizable: Containment calculation is wrong
+ // Http://bugs.jqueryui.com/ticket/7485 - Resizable: Containment calculation is wrong
// when containment element is not the immediate parent
var element = $( "#child" ).resizable({
containment: "#container2",
@@ -205,7 +205,7 @@ test( "containment - not immediate parent", function() {
test( "containment - immediate parent", function() {
expect( 4 );
- // http://bugs.jqueryui.com/ticket/10140 - Resizable: Width calculation is wrong when containment element is "position: relative"
+ // Http://bugs.jqueryui.com/ticket/10140 - Resizable: Width calculation is wrong when containment element is "position: relative"
// when containment element is immediate parent
var element = $( "#child" ).resizable({
containment: "parent",
@@ -302,7 +302,7 @@ test( "grid - Resizable: can be moved when grid option is set (#9611)", function
test( "grid - maintains grid with padding and border when approaching no dimensions", function() {
expect( 2 );
- // http://bugs.jqueryui.com/ticket/10437 - Resizable: border with grid option working wrong
+ // Http://bugs.jqueryui.com/ticket/10437 - Resizable: border with grid option working wrong
var handle = ".ui-resizable-nw",
target = $( "#resizable1" ).css({
padding: 5,
diff --git a/tests/unit/selectable/common.js b/tests/unit/selectable/common.js
index 317fde562bf..460ea0602a0 100644
--- a/tests/unit/selectable/common.js
+++ b/tests/unit/selectable/common.js
@@ -15,7 +15,7 @@ common.testWidget( "selectable", {
filter: "*",
tolerance: "touch",
- // callbacks
+ // Callbacks
create: null,
selected: null,
selecting: null,
diff --git a/tests/unit/selectmenu/common.js b/tests/unit/selectmenu/common.js
index 758e004badb..8582247caf1 100644
--- a/tests/unit/selectmenu/common.js
+++ b/tests/unit/selectmenu/common.js
@@ -21,7 +21,7 @@ common.testWidget( "selectmenu", {
},
width: false,
- // callbacks
+ // Callbacks
change: null,
close: null,
create: null,
diff --git a/tests/unit/slider/common.js b/tests/unit/slider/common.js
index e623a74029f..5cc3e66c596 100644
--- a/tests/unit/slider/common.js
+++ b/tests/unit/slider/common.js
@@ -23,7 +23,7 @@ common.testWidget( "slider", {
value: 0,
values: null,
- // callbacks
+ // Callbacks
create: null,
change: null,
slide: null,
diff --git a/tests/unit/slider/methods.js b/tests/unit/slider/methods.js
index 5a87edfda57..a4187bd7ffb 100644
--- a/tests/unit/slider/methods.js
+++ b/tests/unit/slider/methods.js
@@ -88,7 +88,7 @@ test( "value", function() {
equal( element.slider( "value", 2 ), element, "value method is chainable" );
equal( element.slider( "option", "value" ), 1, "value method set respects max" );
- // set max value with step 0.01
+ // Set max value with step 0.01
element.slider( "option", {
min: 2,
value: 2,
diff --git a/tests/unit/slider/options.js b/tests/unit/slider/options.js
index 3853c4c5d51..f6b61a2b362 100644
--- a/tests/unit/slider/options.js
+++ b/tests/unit/slider/options.js
@@ -20,7 +20,7 @@ test( "disabled", function( assert ){
count++;
});
- // enabled
+ // Enabled
assert.lacksClasses( element, "ui-slider-disabled" );
equal( element.slider( "option", "disabled" ), false , "is not disabled" );
@@ -30,7 +30,7 @@ test( "disabled", function( assert ){
handle().simulate( "keydown", { keyCode: $.ui.keyCode.RIGHT } );
equal( count, 2, "slider moved" );
- // disabled
+ // Disabled
element.slider( "option", "disabled", true );
assert.hasClasses( element, "ui-slider-disabled" );
equal( element.slider( "option", "disabled" ), true, "is disabled" );
@@ -240,7 +240,7 @@ test( "step", function() {
test( "values", function() {
expect( 2 );
- // testing multiple ranges on the same page, the object reference to the values
+ // Testing multiple ranges on the same page, the object reference to the values
// property is preserved via multiple range elements, so updating options.values
// of 1 slider updates options.values of all the others
var ranges = $([
@@ -270,7 +270,7 @@ test( "range", function( assert ) {
expect( 32 );
var range;
- // min
+ // Min
element = $( "
" ).slider({
range: "min",
min: 1,
@@ -282,7 +282,7 @@ test( "range", function( assert ) {
equal( element.find( ".ui-slider-range-min" ).length, 1, "range min" );
element.slider( "destroy" );
- // max
+ // Max
element = $( "
" ).slider({
range: "max",
min: 1,
@@ -294,7 +294,7 @@ test( "range", function( assert ) {
equal( element.find( ".ui-slider-range-max" ).length, 1, "range max" );
element.slider( "destroy" );
- // true
+ // True
element = $( "
" ).slider({
range: true,
min: 1,
diff --git a/tests/unit/sortable/common.js b/tests/unit/sortable/common.js
index aefb28b70c0..a28c2511aa3 100644
--- a/tests/unit/sortable/common.js
+++ b/tests/unit/sortable/common.js
@@ -33,7 +33,7 @@ common.testWidget( "sortable", {
tolerance: "intersect",
zIndex: 1000,
- // callbacks
+ // Callbacks
activate: null,
beforeStop: null,
change: null,
diff --git a/tests/unit/sortable/events.js b/tests/unit/sortable/events.js
index bf5579fde42..74f10dfebca 100644
--- a/tests/unit/sortable/events.js
+++ b/tests/unit/sortable/events.js
@@ -25,7 +25,7 @@ test("start", function() {
ok(hash.item, "UI hash includes: item");
ok(!hash.sender, "UI hash does not include: sender");
- // todo: see if these events should actually have sane values in them
+ // Todo: see if these events should actually have sane values in them
ok("position" in hash, "UI hash includes: position");
ok("offset" in hash, "UI hash includes: offset");
});
diff --git a/tests/unit/sortable/options.js b/tests/unit/sortable/options.js
index 7448390965c..5d24a3606f1 100644
--- a/tests/unit/sortable/options.js
+++ b/tests/unit/sortable/options.js
@@ -136,7 +136,7 @@ test( "#8792: issues with floated items in connected lists", function() {
element = $( "#qunit-fixture li:eq(0)" );
- // move the first li to the right of the second li in the first ul
+ // Move the first li to the right of the second li in the first ul
element.simulate( "drag", {
dx: 55,
moves: 15
@@ -144,7 +144,7 @@ test( "#8792: issues with floated items in connected lists", function() {
equal( changeCount, 1, "change fired only once (no jitters) when dragging a floated sortable in it's own container" );
- // move the first li ( which is now in the second spot )
+ // Move the first li ( which is now in the second spot )
// through the first spot in the second ul to the second spot in the second ul
element.simulate( "drag", {
dx: 100,
diff --git a/tests/unit/spinner/common-deprecated.js b/tests/unit/spinner/common-deprecated.js
index 8ff50fa25bf..ece9adeace8 100644
--- a/tests/unit/spinner/common-deprecated.js
+++ b/tests/unit/spinner/common-deprecated.js
@@ -23,7 +23,7 @@ common.testWidget( "spinner", {
page: 10,
step: 1,
- // callbacks
+ // Callbacks
change: null,
create: null,
spin: null,
diff --git a/tests/unit/spinner/common.js b/tests/unit/spinner/common.js
index 8ff50fa25bf..ece9adeace8 100644
--- a/tests/unit/spinner/common.js
+++ b/tests/unit/spinner/common.js
@@ -23,7 +23,7 @@ common.testWidget( "spinner", {
page: 10,
step: 1,
- // callbacks
+ // Callbacks
change: null,
create: null,
spin: null,
diff --git a/tests/unit/spinner/options.js b/tests/unit/spinner/options.js
index d43c968cdb9..c3a9f74a288 100644
--- a/tests/unit/spinner/options.js
+++ b/tests/unit/spinner/options.js
@@ -147,7 +147,7 @@ test( "culture, null", function() {
element.spinner( "stepUp" );
equal( element.val(), "¥1", "formatted after step" );
- // reset culture
+ // Reset culture
Globalize.culture( "default" );
});
diff --git a/tests/unit/subsuite.js b/tests/unit/subsuite.js
index a591ae71136..31a279c2818 100644
--- a/tests/unit/subsuite.js
+++ b/tests/unit/subsuite.js
@@ -1,4 +1,4 @@
-(function() {
+( function() {
var versions = [
"1.7.0", "1.7.1", "1.7.2",
@@ -9,6 +9,7 @@ var versions = [
"compat-git"
],
additionalTests = {
+
// component: [ "other_test.html" ]
};
@@ -18,8 +19,8 @@ window.testAllVersions = function( widget ) {
function( test ) {
return $.map( versions, function( version ) {
return test + "?jquery=" + version;
- });
- }));
+ } );
+ } ) );
};
-}());
+}() );
diff --git a/tests/unit/tabs/common.js b/tests/unit/tabs/common.js
index 42dd0c2fc50..40c899847be 100644
--- a/tests/unit/tabs/common.js
+++ b/tests/unit/tabs/common.js
@@ -19,7 +19,7 @@ common.testWidget( "tabs", {
hide: null,
show: null,
- // callbacks
+ // Callbacks
activate: null,
beforeActivate: null,
beforeLoad: null,
diff --git a/tests/unit/tabs/core.js b/tests/unit/tabs/core.js
index b64f1d8f36f..9c62817eba4 100644
--- a/tests/unit/tabs/core.js
+++ b/tests/unit/tabs/core.js
@@ -191,7 +191,7 @@ asyncTest( "keyboard support - LEFT, RIGHT, UP, DOWN, HOME, END, SPACE, ENTER",
equal( tabs.filter( ".ui-state-focus" ).length, 0, "no tabs focused on init" );
tabs.eq( 0 ).simulate( "focus" );
- // down, right, down (wrap), up (wrap)
+ // Down, right, down (wrap), up (wrap)
function step1() {
assert.hasClasses( tabs.eq( 0 ), "ui-state-focus", "first tab has focus" );
equal( tabs.eq( 0 ).attr( "aria-selected" ), "true", "first tab has aria-selected=true" );
@@ -242,7 +242,7 @@ asyncTest( "keyboard support - LEFT, RIGHT, UP, DOWN, HOME, END, SPACE, ENTER",
setTimeout( step2, 25 );
}
- // left, home, space
+ // Left, home, space
function step2() {
equal( tabs.eq( 2 ).attr( "aria-selected" ), "true", "third tab has aria-selected=true" );
equal( tabs.eq( 0 ).attr( "aria-selected" ), "false", "first tab has aria-selected=false" );
@@ -280,7 +280,7 @@ asyncTest( "keyboard support - LEFT, RIGHT, UP, DOWN, HOME, END, SPACE, ENTER",
setTimeout( step3 );
}
- // end, enter
+ // End, enter
function step3() {
equal( tabs.eq( 0 ).attr( "aria-selected" ), "true", "first tab has aria-selected=true" );
equal( tabs.eq( 2 ).attr( "aria-selected" ), "false", "third tab has aria-selected=false" );
@@ -307,7 +307,7 @@ asyncTest( "keyboard support - LEFT, RIGHT, UP, DOWN, HOME, END, SPACE, ENTER",
setTimeout( step4 );
}
- // enter (collapse)
+ // Enter (collapse)
function step4() {
equal( tabs.eq( 2 ).attr( "aria-selected" ), "true", "third tab has aria-selected=true" );
ok( panels.eq( 2 ).is( ":visible" ), "third panel is visible" );
@@ -347,7 +347,7 @@ $.each({
equal( tabs.filter( ".ui-state-focus" ).length, 0, "no tabs focused on init" );
tabs.eq( 0 ).simulate( "focus" );
- // down
+ // Down
function step1() {
var eventProperties = { keyCode: keyCode.DOWN };
eventProperties[ modifier + "Key" ] = true;
@@ -371,7 +371,7 @@ $.each({
setTimeout( step2, 25 );
}
- // right
+ // Right
function step2() {
var eventProperties = { keyCode: keyCode.RIGHT };
eventProperties[ modifier + "Key" ] = true;
@@ -398,7 +398,7 @@ $.each({
setTimeout( step3, 25 );
}
- // down (wrap)
+ // Down (wrap)
function step3() {
var eventProperties = { keyCode: keyCode.DOWN };
eventProperties[ modifier + "Key" ] = true;
@@ -421,7 +421,7 @@ $.each({
setTimeout( step4, 25 );
}
- // up (wrap)
+ // Up (wrap)
function step4() {
var eventProperties = { keyCode: keyCode.UP };
eventProperties[ modifier + "Key" ] = true;
@@ -445,7 +445,7 @@ $.each({
setTimeout( step5, 25 );
}
- // left
+ // Left
function step5() {
var eventProperties = { keyCode: keyCode.LEFT };
eventProperties[ modifier + "Key" ] = true;
@@ -472,7 +472,7 @@ $.each({
setTimeout( step6, 25 );
}
- // home
+ // Home
function step6() {
var eventProperties = { keyCode: keyCode.HOME };
eventProperties[ modifier + "Key" ] = true;
@@ -499,7 +499,7 @@ $.each({
setTimeout( step7, 25 );
}
- // end
+ // End
function step7() {
var eventProperties = { keyCode: keyCode.END };
eventProperties[ modifier + "Key" ] = true;
@@ -523,7 +523,7 @@ $.each({
setTimeout( step8, 25 );
}
- // space
+ // Space
function step8() {
equal( tabs.eq( 0 ).attr( "aria-selected" ), "true", "first tab has aria-selected=true" );
ok( panels.eq( 0 ).is( ":visible" ), "first panel is visible" );
diff --git a/tests/unit/tabs/events.js b/tests/unit/tabs/events.js
index 7e3d27fdaed..307e110fdbe 100644
--- a/tests/unit/tabs/events.js
+++ b/tests/unit/tabs/events.js
@@ -58,7 +58,7 @@ test( "beforeActivate", function() {
anchors = tabs.find( ".ui-tabs-anchor" ),
panels = element.find( ".ui-tabs-panel" );
- // from collapsed
+ // From collapsed
element.one( "tabsbeforeactivate", function( event, ui ) {
ok( !( "originalEvent" in event ), "originalEvent" );
equal( ui.oldTab.length, 0, "oldTab length" );
@@ -72,7 +72,7 @@ test( "beforeActivate", function() {
element.tabs( "option", "active", 0 );
state( element, 1, 0, 0 );
- // switching tabs
+ // Switching tabs
element.one( "tabsbeforeactivate", function( event, ui ) {
equal( event.originalEvent.type, "click", "originalEvent" );
equal( ui.oldTab.length, 1, "oldTab length" );
@@ -88,7 +88,7 @@ test( "beforeActivate", function() {
anchors.eq( 1 ).trigger( "click" );
state( element, 0, 1, 0 );
- // collapsing
+ // Collapsing
element.one( "tabsbeforeactivate", function( event, ui ) {
ok( !( "originalEvent" in event ), "originalEvent" );
equal( ui.oldTab.length, 1, "oldTab length" );
@@ -102,7 +102,7 @@ test( "beforeActivate", function() {
element.tabs( "option", "active", false );
state( element, 0, 0, 0 );
- // prevent activation
+ // Prevent activation
element.one( "tabsbeforeactivate", function( event, ui ) {
ok( !( "originalEvent" in event ), "originalEvent" );
equal( ui.oldTab.length, 0, "oldTab length" );
@@ -129,7 +129,7 @@ test( "activate", function() {
anchors = element.find( ".ui-tabs-anchor" ),
panels = element.find( ".ui-tabs-panel" );
- // from collapsed
+ // From collapsed
element.one( "tabsactivate", function( event, ui ) {
ok( !( "originalEvent" in event ), "originalEvent" );
equal( ui.oldTab.length, 0, "oldTab length" );
@@ -143,7 +143,7 @@ test( "activate", function() {
element.tabs( "option", "active", 0 );
state( element, 1, 0, 0 );
- // switching tabs
+ // Switching tabs
element.one( "tabsactivate", function( event, ui ) {
equal( event.originalEvent.type, "click", "originalEvent" );
equal( ui.oldTab.length, 1, "oldTab length" );
@@ -159,7 +159,7 @@ test( "activate", function() {
anchors.eq( 1 ).trigger( "click" );
state( element, 0, 1, 0 );
- // collapsing
+ // Collapsing
element.one( "tabsactivate", function( event, ui ) {
ok( !( "originalEvent" in event ), "originalEvent" );
equal( ui.oldTab.length, 1, "oldTab length" );
@@ -173,7 +173,7 @@ test( "activate", function() {
element.tabs( "option", "active", false );
state( element, 0, 0, 0 );
- // prevent activation
+ // Prevent activation
element.one( "tabsbeforeactivate", function( event ) {
ok( true, "tabsbeforeactivate" );
event.preventDefault();
@@ -190,7 +190,7 @@ test( "beforeLoad", function() {
var tab, panelId, panel,
element = $( "#tabs2" );
- // init
+ // Init
element.one( "tabsbeforeload", function( event, ui ) {
tab = element.find( ".ui-tabs-nav li" ).eq( 2 );
panelId = tab.attr( "aria-controls" );
@@ -234,7 +234,7 @@ test( "beforeLoad", function() {
state( element, 0, 0, 1, 0, 0 );
equal( panel.html(), "", "panel html after" );
- // click, change panel content
+ // Click, change panel content
element.one( "tabsbeforeload", function( event, ui ) {
tab = element.find( ".ui-tabs-nav li" ).eq( 3 );
panelId = tab.attr( "aria-controls" );
@@ -263,7 +263,7 @@ asyncTest( "load", function() {
var tab, panelId, panel,
element = $( "#tabs2" );
- // init
+ // Init
element.one( "tabsload", function( event, ui ) {
tab = element.find( ".ui-tabs-nav li" ).eq( 2 );
panelId = tab.attr( "aria-controls" );
diff --git a/tests/unit/tabs/methods.js b/tests/unit/tabs/methods.js
index 3be31c5f8a1..d904ac53040 100644
--- a/tests/unit/tabs/methods.js
+++ b/tests/unit/tabs/methods.js
@@ -110,13 +110,13 @@ test( "refresh", function() {
state( element, 1, 0, 0 );
disabled( element, false );
- // disable tab via markup
+ // Disable tab via markup
element.find( ".ui-tabs-nav li" ).eq( 1 ).addClass( "ui-state-disabled" );
element.tabs( "refresh" );
state( element, 1, 0, 0 );
disabled( element, [ 1 ] );
- // add remote tab
+ // Add remote tab
element.find( ".ui-tabs-nav" ).append( "
new" );
element.tabs( "refresh" );
state( element, 1, 0, 0, 0 );
@@ -124,13 +124,13 @@ test( "refresh", function() {
equal( element.find( "#" + $( "#newTab" ).attr( "aria-controls" ) ).length, 1,
"panel added for remote tab" );
- // remove all tabs
+ // Remove all tabs
element.find( ".ui-tabs-nav li, .ui-tabs-panel" ).remove();
element.tabs( "refresh" );
state( element );
equal( element.tabs( "option", "active" ), false, "no active tab" );
- // add tabs
+ // Add tabs
element.find( ".ui-tabs-nav" )
.append( "
new 2" )
.append( "
new 3" )
@@ -145,26 +145,26 @@ test( "refresh", function() {
state( element, 0, 0, 0, 0 );
disabled( element, [ 0 ] );
- // activate third tab
+ // Activate third tab
element.tabs( "option", "active", 2 );
state( element, 0, 0, 1, 0 );
disabled( element, [ 0 ] );
- // remove fourth tab, third tab should stay active
+ // Remove fourth tab, third tab should stay active
element.find( ".ui-tabs-nav li" ).eq( 3 ).remove();
element.find( ".ui-tabs-panel" ).eq( 3 ).remove();
element.tabs( "refresh" );
state( element, 0, 0, 1 );
disabled( element, [ 0 ] );
- // remove third (active) tab, second tab should become active
+ // Remove third (active) tab, second tab should become active
element.find( ".ui-tabs-nav li" ).eq( 2 ).remove();
element.find( ".ui-tabs-panel" ).eq( 2 ).remove();
element.tabs( "refresh" );
state( element, 0, 1 );
disabled( element, [ 0 ] );
- // remove first tab, previously active tab (now first) should stay active
+ // Remove first tab, previously active tab (now first) should stay active
element.find( ".ui-tabs-nav li" ).eq( 0 ).remove();
element.find( ".ui-tabs-panel" ).eq( 0 ).remove();
element.tabs( "refresh" );
@@ -182,7 +182,7 @@ test( "refresh - looping", function() {
state( element, 0, 1, 0 );
disabled( element, [ 0 ] );
- // remove active, jump to previous
+ // Remove active, jump to previous
// previous is disabled, just back one more
// reached first tab, move to end
// activate last tab
@@ -197,7 +197,7 @@ asyncTest( "load", function() {
var element = $( "#tabs2" ).tabs();
- // load content of inactive tab
+ // Load content of inactive tab
// useful for preloading content with custom caching
element.one( "tabsbeforeload", function( event, ui ) {
var tab = element.find( ".ui-tabs-nav li" ).eq( 3 ),
diff --git a/tests/unit/tabs/options.js b/tests/unit/tabs/options.js
index 39771efe6ce..f615e165ee7 100644
--- a/tests/unit/tabs/options.js
+++ b/tests/unit/tabs/options.js
@@ -155,7 +155,7 @@ test( "collapsible", function( assert ) {
test( "disabled", function( assert ) {
expect( 23 );
- // fully enabled by default
+ // Fully enabled by default
var event,
element = $( "#tabs1" ).tabs();
disabled( element, false );
@@ -164,7 +164,7 @@ test( "disabled", function( assert ) {
assert.lacksClasses( element.tabs( "widget" ), "ui-tabs-disabled" );
ok( !element.tabs( "widget" ).attr( "aria-disabled" ), "after: wrapper doesn't have aria-disabled attr" );
- // disable single tab
+ // Disable single tab
element.tabs( "option", "disabled", [ 1 ] );
disabled( element, [ 1 ] );
@@ -172,7 +172,7 @@ test( "disabled", function( assert ) {
assert.lacksClasses( element.tabs( "widget" ), "ui-tabs-disabled" );
ok( !element.tabs( "widget" ).attr( "aria-disabled" ), "after: wrapper doesn't have aria-disabled attr" );
- // disabled active tab
+ // Disabled active tab
element.tabs( "option", "disabled", [ 0, 1 ] );
disabled( element, [ 0, 1 ] );
@@ -180,7 +180,7 @@ test( "disabled", function( assert ) {
assert.lacksClasses( element.tabs( "widget" ), "ui-tabs-disabled" );
ok( !element.tabs( "widget" ).attr( "aria-disabled" ), "after: wrapper doesn't have aria-disabled attr" );
- // disable all tabs
+ // Disable all tabs
element.tabs( "option", "disabled", [ 0, 1, 2 ] );
disabled( element, true );
@@ -192,7 +192,7 @@ test( "disabled", function( assert ) {
element.find( ".ui-tabs-anchor" ).eq( 0 ).trigger( event );
ok( event.isDefaultPrevented(), "click is prevented for disabled tab" );
- // enable all tabs
+ // Enable all tabs
element.tabs( "option", "disabled", [] );
disabled( element, false );
});
@@ -209,7 +209,7 @@ test( "{ event: null }", function() {
equal( element.tabs( "option", "active" ), 1 );
state( element, 0, 1, 0 );
- // ensure default click handler isn't bound
+ // Ensure default click handler isn't bound
element.find( ".ui-tabs-nav .ui-tabs-anchor" ).eq( 2 ).trigger( "click" );
equal( element.tabs( "option", "active" ), 1 );
state( element, 0, 1, 0 );
@@ -227,7 +227,7 @@ test( "{ event: custom }", function() {
equal( element.tabs( "option", "active" ), 1 );
state( element, 0, 1, 0 );
- // ensure default click handler isn't bound
+ // Ensure default click handler isn't bound
element.find( ".ui-tabs-nav .ui-tabs-anchor" ).eq( 2 ).trigger( "click" );
equal( element.tabs( "option", "active" ), 1 );
state( element, 0, 1, 0 );
@@ -238,7 +238,7 @@ test( "{ event: custom }", function() {
element.tabs( "option", "event", "custom3" );
- // ensure old event handlers are unbound
+ // Ensure old event handlers are unbound
element.find( ".ui-tabs-nav .ui-tabs-anchor" ).eq( 1 ).trigger( "custom1" );
equal( element.tabs( "option", "active" ), 2 );
state( element, 0, 0, 1 );
diff --git a/tests/unit/tooltip/common-deprecated.js b/tests/unit/tooltip/common-deprecated.js
index 9e3c5ef5930..75a688f0a0c 100644
--- a/tests/unit/tooltip/common-deprecated.js
+++ b/tests/unit/tooltip/common-deprecated.js
@@ -21,7 +21,7 @@ common.testWidget( "tooltip", {
tooltipClass: null,
track: false,
- // callbacks
+ // Callbacks
close: null,
create: null,
open: null
diff --git a/tests/unit/tooltip/common.js b/tests/unit/tooltip/common.js
index 77e3f02b8f0..15c9dfad833 100644
--- a/tests/unit/tooltip/common.js
+++ b/tests/unit/tooltip/common.js
@@ -20,7 +20,7 @@ common.testWidget( "tooltip", {
show: true,
track: false,
- // callbacks
+ // Callbacks
close: null,
create: null,
open: null
diff --git a/tests/unit/tooltip/methods.js b/tests/unit/tooltip/methods.js
index b5b6ca6e9f3..d4c56e1f3d1 100644
--- a/tests/unit/tooltip/methods.js
+++ b/tests/unit/tooltip/methods.js
@@ -13,7 +13,7 @@ test( "destroy", function( assert ) {
element.tooltip().tooltip( "destroy" );
});
- // make sure that open tooltips are removed on destroy
+ // Make sure that open tooltips are removed on destroy
assert.domEqual( "#tooltipped1", function() {
element
.tooltip()
diff --git a/tests/unit/tooltip/options.js b/tests/unit/tooltip/options.js
index 6aa576583bd..2833e68ddb6 100644
--- a/tests/unit/tooltip/options.js
+++ b/tests/unit/tooltip/options.js
@@ -161,7 +161,7 @@ test( "items", function() {
element.tooltip( "open", event );
deepEqual( $( "#" + $( "#fixture-span" ).data( "ui-tooltip-id" ) ).text(), "title-text" );
- // make sure default [title] doesn't get used
+ // Make sure default [title] doesn't get used
event.target = $( "#tooltipped1" )[ 0 ];
element.tooltip( "open", event );
deepEqual( $( "#tooltipped1" ).data( "ui-tooltip-id" ), undefined );
diff --git a/tests/visual/tooltip/tooltip.html b/tests/visual/tooltip/tooltip.html
index c0ba7a11cea..176af85d86c 100644
--- a/tests/visual/tooltip/tooltip.html
+++ b/tests/visual/tooltip/tooltip.html
@@ -20,7 +20,7 @@
// default
$( "#context1, form, #childish, #nested-input" ).tooltip();
- // custom class, replaces ui-widget-content
+ // Custom class, replaces ui-widget-content
$( "#context2" ).tooltip({
classes: {
"ui-tooltip": "ui-corner-all ui-widget-header"
@@ -32,7 +32,7 @@
}
});
- // synchronous content
+ // Synchronous content
$( "#footnotes" ).tooltip({
items: "[href^='#']",
content: function() {
@@ -40,7 +40,7 @@
}
});
- // asynchronous content
+ // Asynchronous content
$( "#async" ).tooltip({
content: function( response ) {
setTimeout(function() {
@@ -50,7 +50,7 @@
}
});
- // asynchronous content with caching
+ // Asynchronous content with caching
var content;
$( "#async2" ).tooltip({
content: function( response ) {
@@ -65,7 +65,7 @@
}
});
- // custom position
+ // Custom position
$( "#right2" ).tooltip({
classes: {
"ui-tooltip": "ui-corner-all ui-state-highlight"
diff --git a/ui/data.js b/ui/data.js
index e989902da6c..f76098d8c0b 100644
--- a/ui/data.js
+++ b/ui/data.js
@@ -30,7 +30,8 @@ return $.extend( $.expr[ ":" ], {
return !!$.data( elem, dataName );
};
} ) :
- // support: jQuery <1.8
+
+ // Support: jQuery <1.8
function( elem, i, match ) {
return !!$.data( elem, match[ 3 ] );
}
diff --git a/ui/effect.js b/ui/effect.js
index 7fa45cfc0c6..322c31a981f 100644
--- a/ui/effect.js
+++ b/ui/effect.js
@@ -13,7 +13,7 @@
//>>docs: http://api.jqueryui.com/category/effects-core/
//>>demos: http://jqueryui.com/effect/
-(function( factory ) {
+( function( factory ) {
if ( typeof define === "function" && define.amd ) {
// AMD. Register as an anonymous module.
@@ -23,7 +23,7 @@
// Browser globals
factory( jQuery );
}
-}(function( $ ) {
+}( function( $ ) {
var dataSpace = "ui-effects-",
dataSpaceStyle = "ui-effects-style",
@@ -47,13 +47,14 @@ $.effects = {
*
* Date: Wed Jan 16 08:47:09 2013 -0600
*/
-(function( jQuery, undefined ) {
+( function( jQuery, undefined ) {
var stepHooks = "backgroundColor borderBottomColor borderLeftColor borderRightColor borderTopColor color columnRuleColor outlineColor textDecorationColor textEmphasisColor",
- // plusequals test for += 100 -= 100
+ // Plusequals test for += 100 -= 100
rplusequals = /^([\-+])=\s*(\d+\.?\d*)/,
- // a set of RE's that can match strings and generate color tuples.
+
+ // A set of RE's that can match strings and generate color tuples.
stringParsers = [ {
re: /rgba?\(\s*(\d{1,3})\s*,\s*(\d{1,3})\s*,\s*(\d{1,3})\s*(?:,\s*(\d?(?:\.\d+)?)\s*)?\)/,
parse: function( execResult ) {
@@ -75,7 +76,8 @@ $.effects = {
];
}
}, {
- // this regex ignores A-F because it's compared against an already lowercased string
+
+ // This regex ignores A-F because it's compared against an already lowercased string
re: /#([a-f0-9]{2})([a-f0-9]{2})([a-f0-9]{2})/,
parse: function( execResult ) {
return [
@@ -85,7 +87,8 @@ $.effects = {
];
}
}, {
- // this regex ignores A-F because it's compared against an already lowercased string
+
+ // This regex ignores A-F because it's compared against an already lowercased string
re: /#([a-f0-9])([a-f0-9])([a-f0-9])/,
parse: function( execResult ) {
return [
@@ -107,7 +110,7 @@ $.effects = {
}
} ],
- // jQuery.Color( )
+ // JQuery.Color( )
color = jQuery.Color = function( color, green, blue, alpha ) {
return new jQuery.Color.fn.parse( color, green, blue, alpha );
},
@@ -161,20 +164,20 @@ $.effects = {
},
support = color.support = {},
- // element for support tests
+ // Element for support tests
supportElem = jQuery( "
" )[ 0 ],
- // colors = jQuery.Color.names
+ // Colors = jQuery.Color.names
colors,
- // local aliases of functions called often
+ // Local aliases of functions called often
each = jQuery.each;
-// determine rgba support immediately
+// Determine rgba support immediately
supportElem.style.cssText = "background-color:rgba(1,1,1,.5)";
support.rgba = supportElem.style.backgroundColor.indexOf( "rgba" ) > -1;
-// define cache name and alpha properties
+// Define cache name and alpha properties
// for rgba and hsla spaces
each( spaces, function( spaceName, space ) {
space.cache = "_" + spaceName;
@@ -183,13 +186,13 @@ each( spaces, function( spaceName, space ) {
type: "percent",
def: 1
};
-});
+} );
function clamp( value, prop, allowEmpty ) {
var type = propTypes[ prop.type ] || {};
if ( value == null ) {
- return (allowEmpty || !prop.def) ? null : prop.def;
+ return ( allowEmpty || !prop.def ) ? null : prop.def;
}
// ~~ is an short way of doing floor for positive numbers
@@ -202,12 +205,13 @@ function clamp( value, prop, allowEmpty ) {
}
if ( type.mod ) {
- // we add mod before modding to make sure that negatives values
+
+ // We add mod before modding to make sure that negatives values
// get converted properly: -10 -> 350
- return (value + type.mod) % type.mod;
+ return ( value + type.mod ) % type.mod;
}
- // for now all property types without mod have min and max
+ // For now all property types without mod have min and max
return 0 > value ? 0 : type.max < value ? type.max : value;
}
@@ -226,20 +230,20 @@ function stringParse( string ) {
if ( values ) {
parsed = inst[ spaceName ]( values );
- // if this was an rgba parse the assignment might happen twice
+ // If this was an rgba parse the assignment might happen twice
// oh well....
inst[ spaces[ spaceName ].cache ] = parsed[ spaces[ spaceName ].cache ];
rgba = inst._rgba = parsed._rgba;
- // exit each( stringParsers ) here because we matched
+ // Exit each( stringParsers ) here because we matched
return false;
}
- });
+ } );
// Found a stringParser that handled it
if ( rgba.length ) {
- // if this came from a parsed string, force "transparent" when alpha is 0
+ // If this came from a parsed string, force "transparent" when alpha is 0
// chrome, (and maybe others) return "transparent" as rgba(0,0,0,0)
if ( rgba.join() === "0,0,0,0" ) {
jQuery.extend( rgba, colors.transparent );
@@ -247,7 +251,7 @@ function stringParse( string ) {
return inst;
}
- // named colors
+ // Named colors
return colors[ string ];
}
@@ -266,7 +270,7 @@ color.fn = jQuery.extend( color.prototype, {
type = jQuery.type( red ),
rgba = this._rgba = [];
- // more than 1 argument specified - assume ( red, green, blue, alpha )
+ // More than 1 argument specified - assume ( red, green, blue, alpha )
if ( green !== undefined ) {
red = [ red, green, blue, alpha ];
type = "array";
@@ -279,7 +283,7 @@ color.fn = jQuery.extend( color.prototype, {
if ( type === "array" ) {
each( spaces.rgba.props, function( key, prop ) {
rgba[ prop.idx ] = clamp( red[ prop.idx ], prop );
- });
+ } );
return this;
}
@@ -289,16 +293,16 @@ color.fn = jQuery.extend( color.prototype, {
if ( red[ space.cache ] ) {
inst[ space.cache ] = red[ space.cache ].slice();
}
- });
+ } );
} else {
each( spaces, function( spaceName, space ) {
var cache = space.cache;
each( space.props, function( key, prop ) {
- // if the cache doesn't exist, and we know how to convert
+ // If the cache doesn't exist, and we know how to convert
if ( !inst[ cache ] && space.to ) {
- // if the value was null, we don't need to copy it
+ // If the value was null, we don't need to copy it
// if the key was alpha, we don't need to copy it either
if ( key === "alpha" || red[ key ] == null ) {
return;
@@ -306,20 +310,21 @@ color.fn = jQuery.extend( color.prototype, {
inst[ cache ] = space.to( inst._rgba );
}
- // this is the only case where we allow nulls for ALL properties.
+ // This is the only case where we allow nulls for ALL properties.
// call clamp with alwaysAllowEmpty
inst[ cache ][ prop.idx ] = clamp( red[ key ], prop, true );
- });
+ } );
- // everything defined but alpha?
+ // Everything defined but alpha?
if ( inst[ cache ] && jQuery.inArray( null, inst[ cache ].slice( 0, 3 ) ) < 0 ) {
- // use the default of 1
+
+ // Use the default of 1
inst[ cache ][ 3 ] = 1;
if ( space.from ) {
inst._rgba = space.from( inst[ cache ] );
}
}
- });
+ } );
}
return this;
}
@@ -332,17 +337,17 @@ color.fn = jQuery.extend( color.prototype, {
each( spaces, function( _, space ) {
var localCache,
isCache = is[ space.cache ];
- if (isCache) {
+ if ( isCache ) {
localCache = inst[ space.cache ] || space.to && space.to( inst._rgba ) || [];
each( space.props, function( _, prop ) {
if ( isCache[ prop.idx ] != null ) {
same = ( isCache[ prop.idx ] === localCache[ prop.idx ] );
return same;
}
- });
+ } );
}
return same;
- });
+ } );
return same;
},
_space: function() {
@@ -352,7 +357,7 @@ color.fn = jQuery.extend( color.prototype, {
if ( inst[ space.cache ] ) {
used.push( spaceName );
}
- });
+ } );
return used.pop();
},
transition: function( other, distance ) {
@@ -370,11 +375,12 @@ color.fn = jQuery.extend( color.prototype, {
endValue = end[ index ],
type = propTypes[ prop.type ] || {};
- // if null, don't override start value
+ // If null, don't override start value
if ( endValue === null ) {
return;
}
- // if null - use end
+
+ // If null - use end
if ( startValue === null ) {
result[ index ] = endValue;
} else {
@@ -387,11 +393,12 @@ color.fn = jQuery.extend( color.prototype, {
}
result[ index ] = clamp( ( endValue - startValue ) * distance + startValue, prop );
}
- });
+ } );
return this[ spaceName ]( result );
},
blend: function( opaque ) {
- // if we are already opaque - return ourself
+
+ // If we are already opaque - return ourself
if ( this._rgba[ 3 ] === 1 ) {
return this;
}
@@ -402,13 +409,13 @@ color.fn = jQuery.extend( color.prototype, {
return color( jQuery.map( rgb, function( v, i ) {
return ( 1 - a ) * blend[ i ] + a * v;
- }));
+ } ) );
},
toRgbaString: function() {
var prefix = "rgba(",
rgba = jQuery.map( this._rgba, function( v, i ) {
return v == null ? ( i > 2 ? 1 : 0 ) : v;
- });
+ } );
if ( rgba[ 3 ] === 1 ) {
rgba.pop();
@@ -424,12 +431,12 @@ color.fn = jQuery.extend( color.prototype, {
v = i > 2 ? 1 : 0;
}
- // catch 1 and 2
+ // Catch 1 and 2
if ( i && i < 3 ) {
v = Math.round( v * 100 ) + "%";
}
return v;
- });
+ } );
if ( hsla[ 3 ] === 1 ) {
hsla.pop();
@@ -447,18 +454,18 @@ color.fn = jQuery.extend( color.prototype, {
return "#" + jQuery.map( rgba, function( v ) {
- // default to 0 when nulls exist
+ // Default to 0 when nulls exist
v = ( v || 0 ).toString( 16 );
return v.length === 1 ? "0" + v : v;
- }).join("");
+ } ).join( "" );
},
toString: function() {
return this._rgba[ 3 ] === 0 ? "transparent" : this.toRgbaString();
}
-});
+} );
color.fn.parse.prototype = color.fn;
-// hsla conversions adapted from:
+// Hsla conversions adapted from:
// https://code.google.com/p/maashaack/source/browse/packages/graphics/trunk/src/graphics/colors/HUE2RGB.as?r=5021
function hue2rgb( p, q, h ) {
@@ -466,7 +473,7 @@ function hue2rgb( p, q, h ) {
if ( h * 6 < 1 ) {
return p + ( q - p ) * h * 6;
}
- if ( h * 2 < 1) {
+ if ( h * 2 < 1 ) {
return q;
}
if ( h * 3 < 2 ) {
@@ -500,7 +507,7 @@ spaces.hsla.to = function( rgba ) {
h = ( 60 * ( r - g ) / diff ) + 240;
}
- // chroma (diff) == 0 means greyscale which, by definition, saturation = 0%
+ // Chroma (diff) == 0 means greyscale which, by definition, saturation = 0%
// otherwise, saturation is based on the ratio of chroma (diff) to lightness (add)
if ( diff === 0 ) {
s = 0;
@@ -509,7 +516,7 @@ spaces.hsla.to = function( rgba ) {
} else {
s = diff / ( 2 - add );
}
- return [ Math.round(h) % 360, s, l, a == null ? 1 : a ];
+ return [ Math.round( h ) % 360, s, l, a == null ? 1 : a ];
};
spaces.hsla.from = function( hsla ) {
@@ -537,10 +544,10 @@ each( spaces, function( spaceName, space ) {
to = space.to,
from = space.from;
- // makes rgba() and hsla()
+ // Makes rgba() and hsla()
color.fn[ spaceName ] = function( value ) {
- // generate a cache for this space if it doesn't exist
+ // Generate a cache for this space if it doesn't exist
if ( to && !this[ cache ] ) {
this[ cache ] = to( this._rgba );
}
@@ -559,7 +566,7 @@ each( spaces, function( spaceName, space ) {
val = local[ prop.idx ];
}
local[ prop.idx ] = clamp( val, prop );
- });
+ } );
if ( from ) {
ret = color( from( local ) );
@@ -570,9 +577,10 @@ each( spaces, function( spaceName, space ) {
}
};
- // makes red() green() blue() alpha() hue() saturation() lightness()
+ // Makes red() green() blue() alpha() hue() saturation() lightness()
each( props, function( key, prop ) {
- // alpha is included in more than one space
+
+ // Alpha is included in more than one space
if ( color.fn[ key ] ) {
return;
}
@@ -603,10 +611,10 @@ each( spaces, function( spaceName, space ) {
local[ prop.idx ] = value;
return this[ fn ]( local );
};
- });
-});
+ } );
+} );
-// add cssHook and .fx.step function for each named hook.
+// Add cssHook and .fx.step function for each named hook.
// accept a space separated string of properties
color.hook = function( hook ) {
var hooks = hook.split( " " );
@@ -621,7 +629,7 @@ color.hook = function( hook ) {
if ( !support.rgba && value._rgba[ 3 ] !== 1 ) {
curElem = hook === "backgroundColor" ? elem.parentNode : elem;
while (
- (backgroundColor === "" || backgroundColor === "transparent") &&
+ ( backgroundColor === "" || backgroundColor === "transparent" ) &&
curElem && curElem.style
) {
try {
@@ -641,7 +649,8 @@ color.hook = function( hook ) {
try {
elem.style[ hook ] = value;
} catch ( e ) {
- // wrapped to prevent IE from throwing errors on "invalid" values like 'auto' or 'inherit'
+
+ // Wrapped to prevent IE from throwing errors on "invalid" values like 'auto' or 'inherit'
}
}
};
@@ -653,7 +662,7 @@ color.hook = function( hook ) {
}
jQuery.cssHooks[ hook ].set( fx.elem, fx.start.transition( fx.end, fx.pos ) );
};
- });
+ } );
};
@@ -665,7 +674,7 @@ jQuery.cssHooks.borderColor = {
each( [ "Top", "Right", "Bottom", "Left" ], function( i, part ) {
expanded[ "border" + part + "Color" ] = value;
- });
+ } );
return expanded;
}
};
@@ -674,6 +683,7 @@ jQuery.cssHooks.borderColor = {
// Usage of any of the other color names requires adding yourself or including
// jquery.color.svg-names.js.
colors = jQuery.Color.names = {
+
// 4.1. Basic color keywords
aqua: "#00ffff",
black: "#000000",
@@ -698,12 +708,12 @@ colors = jQuery.Color.names = {
_default: "#ffffff"
};
-})( jQuery );
+} )( jQuery );
/******************************************************************************/
/****************************** CLASS ANIMATIONS ******************************/
/******************************************************************************/
-(function() {
+( function() {
var classAnimationActions = [ "add", "remove", "toggle" ],
shorthandStyles = {
@@ -718,14 +728,14 @@ var classAnimationActions = [ "add", "remove", "toggle" ],
padding: 1
};
-$.each([ "borderLeftStyle", "borderRightStyle", "borderBottomStyle", "borderTopStyle" ], function( _, prop ) {
+$.each( [ "borderLeftStyle", "borderRightStyle", "borderBottomStyle", "borderTopStyle" ], function( _, prop ) {
$.fx.step[ prop ] = function( fx ) {
if ( fx.end !== "none" && !fx.setAttr || fx.pos === 1 && !fx.setAttr ) {
jQuery.style( fx.elem, prop, fx.end );
fx.setAttr = true;
}
};
-});
+} );
function getElementStyles( elem ) {
var key, len,
@@ -742,7 +752,8 @@ function getElementStyles( elem ) {
styles[ $.camelCase( key ) ] = style[ key ];
}
}
- // support: Opera, IE <9
+
+ // Support: Opera, IE <9
} else {
for ( key in style ) {
if ( typeof style[ key ] === "string" ) {
@@ -772,7 +783,7 @@ function styleDifference( oldStyle, newStyle ) {
return diff;
}
-// support: jQuery <1.8
+// Support: jQuery <1.8
if ( !$.fn.addBack ) {
$.fn.addBack = function( selector ) {
return this.add( selector == null ?
@@ -790,136 +801,139 @@ $.effects.animateClass = function( value, duration, easing, callback ) {
applyClassChange,
allAnimations = o.children ? animated.find( "*" ).addBack() : animated;
- // map the animated objects to store the original styles.
- allAnimations = allAnimations.map(function() {
+ // Map the animated objects to store the original styles.
+ allAnimations = allAnimations.map( function() {
var el = $( this );
return {
el: el,
start: getElementStyles( this )
};
- });
+ } );
- // apply class change
+ // Apply class change
applyClassChange = function() {
- $.each( classAnimationActions, function(i, action) {
+ $.each( classAnimationActions, function( i, action ) {
if ( value[ action ] ) {
animated[ action + "Class" ]( value[ action ] );
}
- });
+ } );
};
applyClassChange();
- // map all animated objects again - calculate new styles and diff
- allAnimations = allAnimations.map(function() {
+ // Map all animated objects again - calculate new styles and diff
+ allAnimations = allAnimations.map( function() {
this.end = getElementStyles( this.el[ 0 ] );
this.diff = styleDifference( this.start, this.end );
return this;
- });
+ } );
- // apply original class
+ // Apply original class
animated.attr( "class", baseClass );
- // map all animated objects again - this time collecting a promise
- allAnimations = allAnimations.map(function() {
+ // Map all animated objects again - this time collecting a promise
+ allAnimations = allAnimations.map( function() {
var styleInfo = this,
dfd = $.Deferred(),
- opts = $.extend({}, o, {
+ opts = $.extend( {}, o, {
queue: false,
complete: function() {
dfd.resolve( styleInfo );
}
- });
+ } );
this.el.animate( this.diff, opts );
return dfd.promise();
- });
+ } );
- // once all animations have completed:
- $.when.apply( $, allAnimations.get() ).done(function() {
+ // Once all animations have completed:
+ $.when.apply( $, allAnimations.get() ).done( function() {
- // set the final class
+ // Set the final class
applyClassChange();
- // for each animated element,
+ // For each animated element,
// clear all css properties that were animated
$.each( arguments, function() {
var el = this.el;
- $.each( this.diff, function(key) {
+ $.each( this.diff, function( key ) {
el.css( key, "" );
- });
- });
+ } );
+ } );
- // this is guarnteed to be there if you use jQuery.speed()
+ // This is guarnteed to be there if you use jQuery.speed()
// it also handles dequeuing the next anim...
o.complete.call( animated[ 0 ] );
- });
- });
+ } );
+ } );
};
-$.fn.extend({
- addClass: (function( orig ) {
+$.fn.extend( {
+ addClass: ( function( orig ) {
return function( classNames, speed, easing, callback ) {
return speed ?
$.effects.animateClass.call( this,
{ add: classNames }, speed, easing, callback ) :
orig.apply( this, arguments );
};
- })( $.fn.addClass ),
+ } )( $.fn.addClass ),
- removeClass: (function( orig ) {
+ removeClass: ( function( orig ) {
return function( classNames, speed, easing, callback ) {
return arguments.length > 1 ?
$.effects.animateClass.call( this,
{ remove: classNames }, speed, easing, callback ) :
orig.apply( this, arguments );
};
- })( $.fn.removeClass ),
+ } )( $.fn.removeClass ),
- toggleClass: (function( orig ) {
+ toggleClass: ( function( orig ) {
return function( classNames, force, speed, easing, callback ) {
if ( typeof force === "boolean" || force === undefined ) {
if ( !speed ) {
- // without speed parameter
+
+ // Without speed parameter
return orig.apply( this, arguments );
} else {
return $.effects.animateClass.call( this,
- (force ? { add: classNames } : { remove: classNames }),
+ ( force ? { add: classNames } : { remove: classNames } ),
speed, easing, callback );
}
} else {
- // without force parameter
+
+ // Without force parameter
return $.effects.animateClass.call( this,
{ toggle: classNames }, force, speed, easing );
}
};
- })( $.fn.toggleClass ),
+ } )( $.fn.toggleClass ),
- switchClass: function( remove, add, speed, easing, callback) {
+ switchClass: function( remove, add, speed, easing, callback ) {
return $.effects.animateClass.call( this, {
add: add,
remove: remove
}, speed, easing, callback );
}
-});
+} );
-})();
+} )();
/******************************************************************************/
/*********************************** EFFECTS **********************************/
/******************************************************************************/
-(function() {
+( function() {
if ( $.expr && $.expr.filters && $.expr.filters.animated ) {
- $.expr.filters.animated = (function( orig ) {
+ $.expr.filters.animated = ( function( orig ) {
return function( elem ) {
return !!$( elem ).data( dataSpaceAnimated ) || orig( elem );
};
- })( $.expr.filters.animated );
+ } )( $.expr.filters.animated );
}
if ( $.uiBackCompat !== false ) {
$.extend( $.effects, {
+
// Saves a set of properties in a data storage
save: function( element, set ) {
var i = 0, length = set.length;
@@ -951,12 +965,12 @@ if ( $.uiBackCompat !== false ) {
// Wraps the element around a wrapper that copies position properties
createWrapper: function( element ) {
- // if the element is already wrapped, return it
+ // If the element is already wrapped, return it
if ( element.parent().is( ".ui-effects-wrapper" ) ) {
return element.parent();
}
- // wrap the element
+ // Wrap the element
var props = {
width: element.outerWidth( true ),
height: element.outerHeight( true ),
@@ -964,13 +978,14 @@ if ( $.uiBackCompat !== false ) {
},
wrapper = $( "
" )
.addClass( "ui-effects-wrapper" )
- .css({
+ .css( {
fontSize: "100%",
background: "transparent",
border: "none",
margin: 0,
padding: 0
- }),
+ } ),
+
// Store the size in case width/height are defined in % - Fixes #5245
size = {
width: element.width(),
@@ -978,7 +993,7 @@ if ( $.uiBackCompat !== false ) {
},
active = document.activeElement;
- // support: Firefox
+ // Support: Firefox
// Firefox incorrectly exposes anonymous content
// https://bugzilla.mozilla.org/show_bug.cgi?id=561664
try {
@@ -996,30 +1011,30 @@ if ( $.uiBackCompat !== false ) {
wrapper = element.parent(); //Hotfix for jQuery 1.4 since some change in wrap() seems to actually lose the reference to the wrapped element
- // transfer positioning properties to the wrapper
+ // Transfer positioning properties to the wrapper
if ( element.css( "position" ) === "static" ) {
- wrapper.css({ position: "relative" });
- element.css({ position: "relative" });
+ wrapper.css( { position: "relative" } );
+ element.css( { position: "relative" } );
} else {
$.extend( props, {
position: element.css( "position" ),
zIndex: element.css( "z-index" )
- });
- $.each([ "top", "left", "bottom", "right" ], function(i, pos) {
+ } );
+ $.each( [ "top", "left", "bottom", "right" ], function( i, pos ) {
props[ pos ] = element.css( pos );
if ( isNaN( parseInt( props[ pos ], 10 ) ) ) {
props[ pos ] = "auto";
}
- });
- element.css({
+ } );
+ element.css( {
position: "relative",
top: 0,
left: 0,
right: "auto",
bottom: "auto"
- });
+ } );
}
- element.css(size);
+ element.css( size );
return wrapper.css( props ).show();
},
@@ -1038,7 +1053,7 @@ if ( $.uiBackCompat !== false ) {
return element;
}
- });
+ } );
}
$.extend( $.effects, {
@@ -1167,19 +1182,19 @@ $.extend( $.effects, {
// will change margin if you explicitly set height
// see: http://jsfiddle.net/JZSMt/3/ https://bugs.webkit.org/show_bug.cgi?id=107380
// Support: Safari
- element.css({
+ element.css( {
marginTop: element.css( "marginTop" ),
marginBottom: element.css( "marginBottom" ),
marginLeft: element.css( "marginLeft" ),
marginRight: element.css( "marginRight" )
- })
+ } )
.outerWidth( element.outerWidth() )
.outerHeight( element.outerHeight() );
if ( /^(static|relative)/.test( cssPosition ) ) {
cssPosition = "absolute";
- placeholder = $( "<" + element[ 0 ].nodeName + ">" ).insertAfter( element ).css({
+ placeholder = $( "<" + element[ 0 ].nodeName + ">" ).insertAfter( element ).css( {
// Convert inline to inline block to account for inline elements
// that turn to inline block based on content (like img)
@@ -1192,7 +1207,7 @@ $.extend( $.effects, {
marginLeft: element.css( "marginLeft" ),
marginRight: element.css( "marginRight" ),
"float": element.css( "float" )
- })
+ } )
.outerWidth( element.outerWidth() )
.outerHeight( element.outerHeight() )
.addClass( "ui-effects-placeholder" );
@@ -1200,11 +1215,11 @@ $.extend( $.effects, {
element.data( dataSpace + "placeholder", placeholder );
}
- element.css({
+ element.css( {
position: cssPosition,
left: position.left,
top: position.top
- });
+ } );
return placeholder;
},
@@ -1233,49 +1248,49 @@ $.extend( $.effects, {
if ( unit[ 0 ] > 0 ) {
value[ x ] = unit[ 0 ] * factor + unit[ 1 ];
}
- });
+ } );
return value;
}
-});
+} );
-// return an effect options object for the given parameters:
+// Return an effect options object for the given parameters:
function _normalizeArguments( effect, options, speed, callback ) {
- // allow passing all options as the first parameter
+ // Allow passing all options as the first parameter
if ( $.isPlainObject( effect ) ) {
options = effect;
effect = effect.effect;
}
- // convert to an object
+ // Convert to an object
effect = { effect: effect };
- // catch (effect, null, ...)
+ // Catch (effect, null, ...)
if ( options == null ) {
options = {};
}
- // catch (effect, callback)
+ // Catch (effect, callback)
if ( $.isFunction( options ) ) {
callback = options;
speed = null;
options = {};
}
- // catch (effect, speed, ?)
+ // Catch (effect, speed, ?)
if ( typeof options === "number" || $.fx.speeds[ options ] ) {
callback = speed;
speed = options;
options = {};
}
- // catch (effect, options, callback)
+ // Catch (effect, options, callback)
if ( $.isFunction( speed ) ) {
callback = speed;
speed = null;
}
- // add options to effect
+ // Add options to effect
if ( options ) {
$.extend( effect, options );
}
@@ -1292,6 +1307,7 @@ function _normalizeArguments( effect, options, speed, callback ) {
}
function standardAnimationOption( option ) {
+
// Valid standard speeds (nothing, number, named speed)
if ( !option || typeof option === "number" || $.fx.speeds[ option ] ) {
return true;
@@ -1316,8 +1332,8 @@ function standardAnimationOption( option ) {
return false;
}
-$.fn.extend({
- effect: function( /* effect, options, speed, callback */ ) {
+$.fn.extend( {
+ effect: function( /* Effect, options, speed, callback */ ) {
var args = _normalizeArguments.apply( this, arguments ),
effectMethod = $.effects.effect[ args.effect ],
defaultMode = effectMethod.mode,
@@ -1354,7 +1370,8 @@ $.fn.extend({
};
if ( $.fx.off || !effectMethod ) {
- // delegate to the original method (e.g., .show()) if possible
+
+ // Delegate to the original method (e.g., .show()) if possible
if ( mode ) {
return this[ mode ]( args.duration, complete );
} else {
@@ -1362,7 +1379,7 @@ $.fn.extend({
if ( complete ) {
complete.call( this );
}
- });
+ } );
}
}
@@ -1424,7 +1441,7 @@ $.fn.extend({
this.queue( queueName, prefilter ).queue( queueName, run );
},
- show: (function( orig ) {
+ show: ( function( orig ) {
return function( option ) {
if ( standardAnimationOption( option ) ) {
return orig.apply( this, arguments );
@@ -1434,9 +1451,9 @@ $.fn.extend({
return this.effect.call( this, args );
}
};
- })( $.fn.show ),
+ } )( $.fn.show ),
- hide: (function( orig ) {
+ hide: ( function( orig ) {
return function( option ) {
if ( standardAnimationOption( option ) ) {
return orig.apply( this, arguments );
@@ -1446,9 +1463,9 @@ $.fn.extend({
return this.effect.call( this, args );
}
};
- })( $.fn.hide ),
+ } )( $.fn.hide ),
- toggle: (function( orig ) {
+ toggle: ( function( orig ) {
return function( option ) {
if ( standardAnimationOption( option ) || typeof option === "boolean" ) {
return orig.apply( this, arguments );
@@ -1458,9 +1475,9 @@ $.fn.extend({
return this.effect.call( this, args );
}
};
- })( $.fn.toggle ),
+ } )( $.fn.toggle ),
- cssUnit: function(key) {
+ cssUnit: function( key ) {
var style = this.css( key ),
val = [];
@@ -1468,14 +1485,14 @@ $.fn.extend({
if ( style.indexOf( unit ) > 0 ) {
val = [ parseFloat( style ), unit ];
}
- });
+ } );
return val;
},
cssClip: function( clipObj ) {
return clipObj ?
this.css( "clip", "rect(" + clipObj.top + "px " + clipObj.right + "px " + clipObj.bottom + "px " + clipObj.left + "px)" ) :
- parseClip( this.css("clip"), this );
+ parseClip( this.css( "clip" ), this );
},
transfer: function( options, done ) {
@@ -1496,21 +1513,21 @@ $.fn.extend({
transfer = $( "
" )
.appendTo( "body" )
.addClass( options.className )
- .css({
+ .css( {
top: startPosition.top - fixTop,
left: startPosition.left - fixLeft,
height: element.innerHeight(),
width: element.innerWidth(),
position: targetFixed ? "fixed" : "absolute"
- })
+ } )
.animate( animation, options.duration, options.easing, function() {
transfer.remove();
if ( $.isFunction( done ) ) {
done();
}
- });
+ } );
}
-});
+} );
function parseClip( str, element ) {
var outerWidth = element.outerWidth(),
@@ -1535,23 +1552,23 @@ $.fx.step.clip = function( fx ) {
fx.clipInit = true;
}
- $( fx.elem ).cssClip({
- top: fx.pos * (fx.end.top - fx.start.top) + fx.start.top,
- right: fx.pos * (fx.end.right - fx.start.right) + fx.start.right,
- bottom: fx.pos * (fx.end.bottom - fx.start.bottom) + fx.start.bottom,
- left: fx.pos * (fx.end.left - fx.start.left) + fx.start.left
- });
+ $( fx.elem ).cssClip( {
+ top: fx.pos * ( fx.end.top - fx.start.top ) + fx.start.top,
+ right: fx.pos * ( fx.end.right - fx.start.right ) + fx.start.right,
+ bottom: fx.pos * ( fx.end.bottom - fx.start.bottom ) + fx.start.bottom,
+ left: fx.pos * ( fx.end.left - fx.start.left ) + fx.start.left
+ } );
};
-})();
+} )();
/******************************************************************************/
/*********************************** EASING ***********************************/
/******************************************************************************/
-(function() {
+( function() {
-// based on easing equations from Robert Penner (http://www.robertpenner.com/easing)
+// Based on easing equations from Robert Penner (http://www.robertpenner.com/easing)
var baseEasings = {};
@@ -1559,7 +1576,7 @@ $.each( [ "Quad", "Cubic", "Quart", "Quint", "Expo" ], function( i, name ) {
baseEasings[ name ] = function( p ) {
return Math.pow( p, i + 2 );
};
-});
+} );
$.extend( baseEasings, {
Sine: function( p ) {
@@ -1570,7 +1587,7 @@ $.extend( baseEasings, {
},
Elastic: function( p ) {
return p === 0 || p === 1 ? p :
- -Math.pow( 2, 8 * (p - 1) ) * Math.sin( ( (p - 1) * 80 - 7.5 ) * Math.PI / 15 );
+ -Math.pow( 2, 8 * ( p - 1 ) ) * Math.sin( ( ( p - 1 ) * 80 - 7.5 ) * Math.PI / 15 );
},
Back: function( p ) {
return p * p * ( 3 * p - 2 );
@@ -1582,7 +1599,7 @@ $.extend( baseEasings, {
while ( p < ( ( pow2 = Math.pow( 2, --bounce ) ) - 1 ) / 11 ) {}
return 1 / Math.pow( 4, 3 - bounce ) - 7.5625 * Math.pow( ( pow2 * 3 - 2 ) / 22 - p, 2 );
}
-});
+} );
$.each( baseEasings, function( name, easeIn ) {
$.easing[ "easeIn" + name ] = easeIn;
@@ -1594,10 +1611,10 @@ $.each( baseEasings, function( name, easeIn ) {
easeIn( p * 2 ) / 2 :
1 - easeIn( p * -2 + 2 ) / 2;
};
-});
+} );
-})();
+} )();
return $.effects;
-}));
+} ) );
diff --git a/ui/effects/effect-bounce.js b/ui/effects/effect-bounce.js
index 06bc84426dd..1743ef50398 100644
--- a/ui/effects/effect-bounce.js
+++ b/ui/effects/effect-bounce.js
@@ -33,7 +33,7 @@ return $.effects.define( "bounce", function( options, done ) {
var upAnim, downAnim, refValue,
element = $( this ),
- // defaults:
+ // Defaults:
mode = options.mode,
hide = mode === "hide",
show = mode === "show",
@@ -41,12 +41,12 @@ return $.effects.define( "bounce", function( options, done ) {
distance = options.distance,
times = options.times || 5,
- // number of internal animations
+ // Number of internal animations
anims = times * 2 + ( show || hide ? 1 : 0 ),
speed = options.duration / anims,
easing = options.easing,
- // utility:
+ // Utility:
ref = ( direction === "up" || direction === "down" ) ? "top" : "left",
motion = ( direction === "up" || direction === "left" ),
i = 0,
@@ -57,7 +57,7 @@ return $.effects.define( "bounce", function( options, done ) {
refValue = element.css( ref );
- // default distance for the BIGGEST bounce is the outer Distance / 3
+ // Default distance for the BIGGEST bounce is the outer Distance / 3
if ( !distance ) {
distance = element[ ref === "top" ? "outerHeight" : "outerWidth" ]() / 3;
}
@@ -66,7 +66,7 @@ return $.effects.define( "bounce", function( options, done ) {
downAnim = { opacity: 1 };
downAnim[ ref ] = refValue;
- // if we are showing, force opacity 0 and set the initial position
+ // If we are showing, force opacity 0 and set the initial position
// then do the "first" animation
element
.css( "opacity", 0 )
@@ -74,13 +74,14 @@ return $.effects.define( "bounce", function( options, done ) {
.animate( downAnim, speed, easing );
}
- // start at the smallest distance if we are hiding
+ // Start at the smallest distance if we are hiding
if ( hide ) {
distance = distance / Math.pow( 2, times - 1 );
}
downAnim = {};
downAnim[ ref ] = refValue;
+
// Bounces up/down/left/right then back to 0 -- times * 2 animations happen here
for ( ; i < times; i++ ) {
upAnim = {};
diff --git a/ui/effects/effect-explode.js b/ui/effects/effect-explode.js
index 55c247d3e89..92b83f5452f 100644
--- a/ui/effects/effect-explode.js
+++ b/ui/effects/effect-explode.js
@@ -38,15 +38,15 @@ return $.effects.define( "explode", "hide", function( options, done ) {
mode = options.mode,
show = mode === "show",
- // show and then visibility:hidden the element before calculating offset
+ // Show and then visibility:hidden the element before calculating offset
offset = element.show().css( "visibility", "hidden" ).offset(),
- // width and height of a piece
+ // Width and height of a piece
width = Math.ceil( element.outerWidth() / cells ),
height = Math.ceil( element.outerHeight() / rows ),
pieces = [];
- // children animate complete:
+ // Children animate complete:
function childComplete() {
pieces.push( this );
if ( pieces.length === rows * cells ) {
@@ -54,7 +54,7 @@ return $.effects.define( "explode", "hide", function( options, done ) {
}
}
- // clone the element for each row and cell.
+ // Clone the element for each row and cell.
for ( i = 0; i < rows; i++ ) { // ===>
top = offset.top + i * height;
my = i - ( rows - 1 ) / 2;
@@ -76,7 +76,7 @@ return $.effects.define( "explode", "hide", function( options, done ) {
top: -i * height
} )
- // select the wrapper - make it overflow: hidden and absolute positioned based on
+ // Select the wrapper - make it overflow: hidden and absolute positioned based on
// where the original was located +left and +top equal to the size of pieces
.parent()
.addClass( "ui-effects-explode" )
diff --git a/ui/focusable.js b/ui/focusable.js
index b6e86e0622a..a50598cd4ea 100644
--- a/ui/focusable.js
+++ b/ui/focusable.js
@@ -24,7 +24,7 @@
}
} ( function( $ ) {
-// selectors
+// Selectors
$.ui.focusable = function( element, hasTabindex ) {
var map, mapName, img,
nodeName = element.nodeName.toLowerCase();
@@ -42,7 +42,8 @@ $.ui.focusable = function( element, hasTabindex ) {
"a" === nodeName ?
element.href || hasTabindex :
hasTabindex ) &&
- // the element and all of its ancestors must be visible
+
+ // The element and all of its ancestors must be visible
visible( element );
};
diff --git a/ui/i18n/datepicker-af.js b/ui/i18n/datepicker-af.js
index 6c535569677..f13315e1045 100644
--- a/ui/i18n/datepicker-af.js
+++ b/ui/i18n/datepicker-af.js
@@ -1,37 +1,37 @@
/* Afrikaans initialisation for the jQuery UI date picker plugin. */
/* Written by Renier Pretorius. */
-(function( factory ) {
+( function( factory ) {
if ( typeof define === "function" && define.amd ) {
// AMD. Register as an anonymous module.
- define([ "../widgets/datepicker" ], factory );
+ define( [ "../widgets/datepicker" ], factory );
} else {
// Browser globals
factory( jQuery.datepicker );
}
-}(function( datepicker ) {
+}( function( datepicker ) {
-datepicker.regional['af'] = {
- closeText: 'Selekteer',
- prevText: 'Vorige',
- nextText: 'Volgende',
- currentText: 'Vandag',
- monthNames: ['Januarie','Februarie','Maart','April','Mei','Junie',
- 'Julie','Augustus','September','Oktober','November','Desember'],
- monthNamesShort: ['Jan', 'Feb', 'Mrt', 'Apr', 'Mei', 'Jun',
- 'Jul', 'Aug', 'Sep', 'Okt', 'Nov', 'Des'],
- dayNames: ['Sondag', 'Maandag', 'Dinsdag', 'Woensdag', 'Donderdag', 'Vrydag', 'Saterdag'],
- dayNamesShort: ['Son', 'Maa', 'Din', 'Woe', 'Don', 'Vry', 'Sat'],
- dayNamesMin: ['So','Ma','Di','Wo','Do','Vr','Sa'],
+datepicker.regional[ "af" ] = {
+ closeText: "Selekteer",
+ prevText: "Vorige",
+ nextText: "Volgende",
+ currentText: "Vandag",
+ monthNames: [ "Januarie","Februarie","Maart","April","Mei","Junie",
+ "Julie","Augustus","September","Oktober","November","Desember" ],
+ monthNamesShort: [ "Jan", "Feb", "Mrt", "Apr", "Mei", "Jun",
+ "Jul", "Aug", "Sep", "Okt", "Nov", "Des" ],
+ dayNames: [ "Sondag", "Maandag", "Dinsdag", 'Woensdag', 'Donderdag', 'Vrydag', 'Saterdag' ],
+ dayNamesShort: [ 'Son', 'Maa', 'Din', 'Woe', 'Don', 'Vry', 'Sat' ],
+ dayNamesMin: [ 'So','Ma','Di','Wo','Do','Vr','Sa' ],
weekHeader: 'Wk',
dateFormat: 'dd/mm/yy',
firstDay: 1,
isRTL: false,
showMonthAfterYear: false,
- yearSuffix: ''};
-datepicker.setDefaults(datepicker.regional['af']);
+ yearSuffix: '' };
+datepicker.setDefaults( datepicker.regional[ 'af' ] );
-return datepicker.regional['af'];
+return datepicker.regional[ 'af' ];
-}));
+} ) );
diff --git a/ui/i18n/datepicker-ar-DZ.js b/ui/i18n/datepicker-ar-DZ.js
index ff003c9986b..ab8c1f08b2e 100644
--- a/ui/i18n/datepicker-ar-DZ.js
+++ b/ui/i18n/datepicker-ar-DZ.js
@@ -1,37 +1,37 @@
/* Algerian Arabic Translation for jQuery UI date picker plugin. (can be used for Tunisia)*/
/* Mohamed Cherif BOUCHELAGHEM -- cherifbouchelaghem@yahoo.fr */
-(function( factory ) {
+( function( factory ) {
if ( typeof define === "function" && define.amd ) {
// AMD. Register as an anonymous module.
- define([ "../widgets/datepicker" ], factory );
+ define( [ "../widgets/datepicker" ], factory );
} else {
// Browser globals
factory( jQuery.datepicker );
}
-}(function( datepicker ) {
+}( function( datepicker ) {
-datepicker.regional['ar-DZ'] = {
- closeText: 'إغلاق',
- prevText: '<السابق',
- nextText: 'التالي>',
- currentText: 'اليوم',
- monthNames: ['جانفي', 'فيفري', 'مارس', 'أفريل', 'ماي', 'جوان',
- 'جويلية', 'أوت', 'سبتمبر','أكتوبر', 'نوفمبر', 'ديسمبر'],
- monthNamesShort: ['1', '2', '3', '4', '5', '6', '7', '8', '9', '10', '11', '12'],
- dayNames: ['الأحد', 'الاثنين', 'الثلاثاء', 'الأربعاء', 'الخميس', 'الجمعة', 'السبت'],
- dayNamesShort: ['الأحد', 'الاثنين', 'الثلاثاء', 'الأربعاء', 'الخميس', 'الجمعة', 'السبت'],
- dayNamesMin: ['الأحد', 'الاثنين', 'الثلاثاء', 'الأربعاء', 'الخميس', 'الجمعة', 'السبت'],
+datepicker.regional[ "ar-DZ" ] = {
+ closeText: "إغلاق",
+ prevText: "<السابق",
+ nextText: "التالي>",
+ currentText: "اليوم",
+ monthNames: [ "جانفي", "فيفري", "مارس", "أفريل", "ماي", "جوان",
+ "جويلية", "أوت", "سبتمبر","أكتوبر", "نوفمبر", "ديسمبر" ],
+ monthNamesShort: [ "1", "2", "3", "4", "5", "6", "7", "8", "9", "10", "11", '12' ],
+ dayNames: [ 'الأحد', 'الاثنين', 'الثلاثاء', 'الأربعاء', 'الخميس', 'الجمعة', 'السبت' ],
+ dayNamesShort: [ 'الأحد', 'الاثنين', 'الثلاثاء', 'الأربعاء', 'الخميس', 'الجمعة', 'السبت' ],
+ dayNamesMin: [ 'الأحد', 'الاثنين', 'الثلاثاء', 'الأربعاء', 'الخميس', 'الجمعة', 'السبت' ],
weekHeader: 'أسبوع',
dateFormat: 'dd/mm/yy',
firstDay: 6,
isRTL: true,
showMonthAfterYear: false,
- yearSuffix: ''};
-datepicker.setDefaults(datepicker.regional['ar-DZ']);
+ yearSuffix: '' };
+datepicker.setDefaults( datepicker.regional[ 'ar-DZ' ] );
-return datepicker.regional['ar-DZ'];
+return datepicker.regional[ 'ar-DZ' ];
-}));
+} ) );
diff --git a/ui/jquery-1-7.js b/ui/jquery-1-7.js
index 29e008e8af8..8d25f8807e5 100644
--- a/ui/jquery-1-7.js
+++ b/ui/jquery-1-7.js
@@ -24,7 +24,7 @@
}
}( function( $ ) {
-// support: jQuery 1.7 only
+// Support: jQuery 1.7 only
// Not a great way to check versions, but since we only support 1.7+ and only
// need to detect <1.8, this is a simple check that should suffice. Checking
// for "1.7." would be a bit safer, but the version string is 1.7, not 1.7.0
diff --git a/ui/position.js b/ui/position.js
index e9e805bb6ad..64f86173e42 100644
--- a/ui/position.js
+++ b/ui/position.js
@@ -159,7 +159,7 @@ $.fn.position = function( options ) {
return _position.apply( this, arguments );
}
- // make a copy, we don't want to modify arguments
+ // Make a copy, we don't want to modify arguments
options = $.extend( {}, options );
var atOffset, targetWidth, targetHeight, targetOffset, basePosition, dimensions,
@@ -171,16 +171,18 @@ $.fn.position = function( options ) {
dimensions = getDimensions( target );
if ( target[ 0 ].preventDefault ) {
- // force left top to allow flipping
+
+ // Force left top to allow flipping
options.at = "left top";
}
targetWidth = dimensions.width;
targetHeight = dimensions.height;
targetOffset = dimensions.offset;
- // clone to reuse original targetOffset later
+
+ // Clone to reuse original targetOffset later
basePosition = $.extend( {}, targetOffset );
- // force my and at to have valid horizontal and vertical positions
+ // Force my and at to have valid horizontal and vertical positions
// if a value is missing or invalid, it will be converted to center
$.each( [ "my", "at" ], function() {
var pos = ( options[ this ] || "" ).split( " " ),
@@ -197,7 +199,7 @@ $.fn.position = function( options ) {
pos[ 0 ] = rhorizontal.test( pos[ 0 ] ) ? pos[ 0 ] : "center";
pos[ 1 ] = rvertical.test( pos[ 1 ] ) ? pos[ 1 ] : "center";
- // calculate offsets
+ // Calculate offsets
horizontalOffset = roffset.exec( pos[ 0 ] );
verticalOffset = roffset.exec( pos[ 1 ] );
offsets[ this ] = [
@@ -205,14 +207,14 @@ $.fn.position = function( options ) {
verticalOffset ? verticalOffset[ 0 ] : 0
];
- // reduce to just the positions without the offsets
+ // Reduce to just the positions without the offsets
options[ this ] = [
rposition.exec( pos[ 0 ] )[ 0 ],
rposition.exec( pos[ 1 ] )[ 0 ]
];
} );
- // normalize collision option
+ // Normalize collision option
if ( collision.length === 1 ) {
collision[ 1 ] = collision[ 0 ];
}
@@ -260,7 +262,7 @@ $.fn.position = function( options ) {
position.left += myOffset[ 0 ];
position.top += myOffset[ 1 ];
- // if the browser doesn't support fractions, then round for consistent results
+ // If the browser doesn't support fractions, then round for consistent results
if ( !supportsOffsetFractions() ) {
position.left = round( position.left );
position.top = round( position.top );
@@ -291,7 +293,8 @@ $.fn.position = function( options ) {
} );
if ( options.using ) {
- // adds feedback as second argument to using callback, if present
+
+ // Adds feedback as second argument to using callback, if present
using = function( props ) {
var left = targetOffset.left - position.left,
right = left + targetWidth - elemWidth,
@@ -345,16 +348,19 @@ $.ui.position = {
overRight = collisionPosLeft + data.collisionWidth - outerWidth - withinOffset,
newOverRight;
- // element is wider than within
+ // Element is wider than within
if ( data.collisionWidth > outerWidth ) {
- // element is initially over the left side of within
+
+ // Element is initially over the left side of within
if ( overLeft > 0 && overRight <= 0 ) {
newOverRight = position.left + overLeft + data.collisionWidth - outerWidth - withinOffset;
position.left += overLeft - newOverRight;
- // element is initially over right side of within
+
+ // Element is initially over right side of within
} else if ( overRight > 0 && overLeft <= 0 ) {
position.left = withinOffset;
- // element is initially over both left and right sides of within
+
+ // Element is initially over both left and right sides of within
} else {
if ( overLeft > overRight ) {
position.left = withinOffset + outerWidth - data.collisionWidth;
@@ -362,13 +368,16 @@ $.ui.position = {
position.left = withinOffset;
}
}
- // too far left -> align with left edge
+
+ // Too far left -> align with left edge
} else if ( overLeft > 0 ) {
position.left += overLeft;
- // too far right -> align with right edge
+
+ // Too far right -> align with right edge
} else if ( overRight > 0 ) {
position.left -= overRight;
- // adjust based on position and margin
+
+ // Adjust based on position and margin
} else {
position.left = max( position.left - collisionPosLeft, position.left );
}
@@ -382,16 +391,19 @@ $.ui.position = {
overBottom = collisionPosTop + data.collisionHeight - outerHeight - withinOffset,
newOverBottom;
- // element is taller than within
+ // Element is taller than within
if ( data.collisionHeight > outerHeight ) {
- // element is initially over the top of within
+
+ // Element is initially over the top of within
if ( overTop > 0 && overBottom <= 0 ) {
newOverBottom = position.top + overTop + data.collisionHeight - outerHeight - withinOffset;
position.top += overTop - newOverBottom;
- // element is initially over bottom of within
+
+ // Element is initially over bottom of within
} else if ( overBottom > 0 && overTop <= 0 ) {
position.top = withinOffset;
- // element is initially over both top and bottom of within
+
+ // Element is initially over both top and bottom of within
} else {
if ( overTop > overBottom ) {
position.top = withinOffset + outerHeight - data.collisionHeight;
@@ -399,13 +411,16 @@ $.ui.position = {
position.top = withinOffset;
}
}
- // too far up -> align with top
+
+ // Too far up -> align with top
} else if ( overTop > 0 ) {
position.top += overTop;
- // too far down -> align with bottom edge
+
+ // Too far down -> align with bottom edge
} else if ( overBottom > 0 ) {
position.top -= overBottom;
- // adjust based on position and margin
+
+ // Adjust based on position and margin
} else {
position.top = max( position.top - collisionPosTop, position.top );
}
diff --git a/ui/widget.js b/ui/widget.js
index c6f228efd0a..e15648a97a2 100644
--- a/ui/widget.js
+++ b/ui/widget.js
@@ -40,7 +40,7 @@ $.cleanData = ( function( orig ) {
$( elem ).triggerHandler( "remove" );
}
- // http://bugs.jquery.com/ticket/8235
+ // Http://bugs.jquery.com/ticket/8235
} catch ( e ) {}
}
orig( elems );
@@ -49,7 +49,8 @@ $.cleanData = ( function( orig ) {
$.widget = function( name, base, prototype ) {
var fullName, existingConstructor, constructor, basePrototype,
- // proxiedPrototype allows the provided prototype to remain unmodified
+
+ // ProxiedPrototype allows the provided prototype to remain unmodified
// so that it can be used as a mixin for multiple widgets (#8876)
proxiedPrototype = {},
namespace = name.split( "." )[ 0 ];
@@ -66,7 +67,7 @@ $.widget = function( name, base, prototype ) {
prototype = $.extend.apply( null, [ {} ].concat( prototype ) );
}
- // create selector for plugin
+ // Create selector for plugin
$.expr[ ":" ][ fullName.toLowerCase() ] = function( elem ) {
return !!$.data( elem, fullName );
};
@@ -74,30 +75,35 @@ $.widget = function( name, base, prototype ) {
$[ namespace ] = $[ namespace ] || {};
existingConstructor = $[ namespace ][ name ];
constructor = $[ namespace ][ name ] = function( options, element ) {
- // allow instantiation without "new" keyword
+
+ // Allow instantiation without "new" keyword
if ( !this._createWidget ) {
return new constructor( options, element );
}
- // allow instantiation without initializing for simple inheritance
+ // Allow instantiation without initializing for simple inheritance
// must use "new" keyword (the code above always passes args)
if ( arguments.length ) {
this._createWidget( options, element );
}
};
- // extend with the existing constructor to carry over any static properties
+
+ // Extend with the existing constructor to carry over any static properties
$.extend( constructor, existingConstructor, {
version: prototype.version,
- // copy the object used to create the prototype in case we need to
+
+ // Copy the object used to create the prototype in case we need to
// redefine the widget later
_proto: $.extend( {}, prototype ),
- // track widgets that inherit from this widget in case this widget is
+
+ // Track widgets that inherit from this widget in case this widget is
// redefined after a widget inherits from it
_childConstructors: []
} );
basePrototype = new base();
- // we need to make the options hash a property directly on the new instance
+
+ // We need to make the options hash a property directly on the new instance
// otherwise we'll modify the options hash on the prototype that we're
// inheriting from
basePrototype.options = $.widget.extend( {}, basePrototype.options );
@@ -131,6 +137,7 @@ $.widget = function( name, base, prototype ) {
} )();
} );
constructor.prototype = $.widget.extend( basePrototype, {
+
// TODO: remove support for widgetEventPrefix
// always use the name + a colon as the prefix, e.g., draggable:start
// don't prefix for widgets that aren't DOM-based
@@ -150,11 +157,12 @@ $.widget = function( name, base, prototype ) {
$.each( existingConstructor._childConstructors, function( i, child ) {
var childPrototype = child.prototype;
- // redefine the child widget using the same prototype that was
+ // Redefine the child widget using the same prototype that was
// originally used, but inherit from the new version of the base
$.widget( childPrototype.namespace + "." + childPrototype.widgetName, constructor, child._proto );
} );
- // remove the list of existing child constructors from the old constructor
+
+ // Remove the list of existing child constructors from the old constructor
// so the old child constructors can be garbage collected
delete existingConstructor._childConstructors;
} else {
@@ -176,12 +184,15 @@ $.widget.extend = function( target ) {
for ( key in input[ inputIndex ] ) {
value = input[ inputIndex ][ key ];
if ( input[ inputIndex ].hasOwnProperty( key ) && value !== undefined ) {
+
// Clone objects
if ( $.isPlainObject( value ) ) {
target[ key ] = $.isPlainObject( target[ key ] ) ?
$.widget.extend( {}, target[ key ], value ) :
+
// Don't extend strings, arrays, etc. with objects
$.widget.extend( {}, value );
+
// Copy everything else by reference
} else {
target[ key ] = value;
@@ -246,7 +257,7 @@ $.widget.bridge = function( name, object ) {
};
};
-$.Widget = function( /* options, element */ ) {};
+$.Widget = function( /* Options, element */ ) {};
$.Widget._childConstructors = [];
$.Widget.prototype = {
@@ -257,7 +268,7 @@ $.Widget.prototype = {
classes: {},
disabled: false,
- // callbacks
+ // Callbacks
create: null
},
_createWidget: function( options, element ) {
@@ -281,9 +292,11 @@ $.Widget.prototype = {
}
} );
this.document = $( element.style ?
- // element within the document
+
+ // Element within the document
element.ownerDocument :
- // element is window or document
+
+ // Element is window or document
element.document || element );
this.window = $( this.document[ 0 ].defaultView || this.document[ 0 ].parentWindow );
}
@@ -310,7 +323,7 @@ $.Widget.prototype = {
that._removeClass( value, key );
} );
- // we can probably remove the unbind calls in 2.0
+ // We can probably remove the unbind calls in 2.0
// all event bindings should go through this._on()
this.element
.off( this.eventNamespace )
@@ -319,7 +332,7 @@ $.Widget.prototype = {
.off( this.eventNamespace )
.removeAttr( "aria-disabled" );
- // clean up events and states
+ // Clean up events and states
this.bindings.off( this.eventNamespace );
},
_destroy: $.noop,
@@ -335,12 +348,14 @@ $.Widget.prototype = {
i;
if ( arguments.length === 0 ) {
- // don't return a reference to the internal hash
+
+ // Don't return a reference to the internal hash
return $.widget.extend( {}, this.options );
}
if ( typeof key === "string" ) {
- // handle nested keys, e.g., "foo.bar" => { foo: { bar: ___ } }
+
+ // Handle nested keys, e.g., "foo.bar" => { foo: { bar: ___ } }
options = {};
parts = key.split( "." );
key = parts.shift();
@@ -494,14 +509,14 @@ $.Widget.prototype = {
var delegateElement,
instance = this;
- // no suppressDisabledCheck flag, shuffle arguments
+ // No suppressDisabledCheck flag, shuffle arguments
if ( typeof suppressDisabledCheck !== "boolean" ) {
handlers = element;
element = suppressDisabledCheck;
suppressDisabledCheck = false;
}
- // no element argument, shuffle and use this.element
+ // No element argument, shuffle and use this.element
if ( !handlers ) {
handlers = element;
element = this.element;
@@ -513,7 +528,8 @@ $.Widget.prototype = {
$.each( handlers, function( event, handler ) {
function handlerProxy() {
- // allow widgets to customize the disabled handling
+
+ // Allow widgets to customize the disabled handling
// - disabled as an array instead of boolean
// - disabled class as method for disabling individual parts
if ( !suppressDisabledCheck &&
@@ -525,7 +541,7 @@ $.Widget.prototype = {
.apply( instance, arguments );
}
- // copy the guid so direct unbinding works
+ // Copy the guid so direct unbinding works
if ( typeof handler !== "string" ) {
handlerProxy.guid = handler.guid =
handler.guid || handlerProxy.guid || $.guid++;
@@ -595,11 +611,12 @@ $.Widget.prototype = {
event.type = ( type === this.widgetEventPrefix ?
type :
this.widgetEventPrefix + type ).toLowerCase();
- // the original event may come from any element
+
+ // The original event may come from any element
// so we need to reset the target on the new event
event.target = this.element[ 0 ];
- // copy original event properties over to the new event
+ // Copy original event properties over to the new event
orig = event.originalEvent;
if ( orig ) {
for ( prop in orig ) {
diff --git a/ui/widgets/accordion.js b/ui/widgets/accordion.js
index 88e9bdb6f26..8c16df38f6d 100644
--- a/ui/widgets/accordion.js
+++ b/ui/widgets/accordion.js
@@ -53,7 +53,7 @@ return $.widget( "ui.accordion", {
header: "ui-icon-triangle-1-e"
},
- // callbacks
+ // Callbacks
activate: null,
beforeActivate: null
},
@@ -81,7 +81,7 @@ return $.widget( "ui.accordion", {
this._addClass( "ui-accordion", "ui-widget ui-helper-reset" );
this.element.attr( "role", "tablist" );
- // don't allow collapsible: false and active: false / null
+ // Don't allow collapsible: false and active: false / null
if ( !options.collapsible && ( options.active === false || options.active == null ) ) {
options.active = 0;
}
@@ -124,17 +124,17 @@ return $.widget( "ui.accordion", {
_destroy: function() {
var contents;
- // clean up main element
+ // Clean up main element
this.element.removeAttr( "role" );
- // clean up headers
+ // Clean up headers
this.headers
.removeAttr( "role aria-expanded aria-selected aria-controls tabIndex" )
.removeUniqueId();
this._destroyIcons();
- // clean up content panels
+ // Clean up content panels
contents = this.headers.next()
.css( "display", "" )
.removeAttr( "role aria-hidden aria-labelledby" )
@@ -161,7 +161,7 @@ return $.widget( "ui.accordion", {
this._super( key, value );
- // setting collapsible: false while collapsed; open first panel
+ // Setting collapsible: false while collapsed; open first panel
if ( key === "collapsible" && !value && this.options.active === false ) {
this._activate( 0 );
}
@@ -234,7 +234,7 @@ return $.widget( "ui.accordion", {
var options = this.options;
this._processPanels();
- // was collapsed or no panel
+ // Was collapsed or no panel
if ( ( options.active === false && options.collapsible === true ) || !this.headers.length ) {
options.active = false;
this.active = $();
@@ -318,7 +318,7 @@ return $.widget( "ui.accordion", {
} )
.hide();
- // make sure at least one header is in the tab order
+ // Make sure at least one header is in the tab order
if ( !this.active.length ) {
this.headers.eq( 0 ).attr( "tabIndex", 0 );
} else {
@@ -372,12 +372,12 @@ return $.widget( "ui.accordion", {
_activate: function( index ) {
var active = this._findActive( index )[ 0 ];
- // trying to activate the already active panel
+ // Trying to activate the already active panel
if ( active === this.active[ 0 ] ) {
return;
}
- // trying to collapse, simulate a click on the currently active header
+ // Trying to collapse, simulate a click on the currently active header
active = active || this.active[ 0 ];
this._eventHandler( {
@@ -436,12 +436,12 @@ return $.widget( "ui.accordion", {
options.active = collapsing ? false : this.headers.index( clicked );
- // when the call to ._toggle() comes after the class changes
+ // When the call to ._toggle() comes after the class changes
// it causes a very odd bug in IE 8 (see #6720)
this.active = clickedIsActive ? $() : clicked;
this._toggle( eventData );
- // switch classes
+ // Switch classes
// corner classes on the previously active header stay after the animation
this._removeClass( active, "ui-accordion-header-active", "ui-state-active" );
if ( options.icons ) {
@@ -467,7 +467,7 @@ return $.widget( "ui.accordion", {
var toShow = data.newPanel,
toHide = this.prevShow.length ? this.prevShow : data.oldPanel;
- // handle activating a panel during the animation for another activation
+ // Handle activating a panel during the animation for another activation
this.prevShow.add( this.prevHide ).stop( true, true );
this.prevShow = toShow;
this.prevHide = toHide;
diff --git a/ui/widgets/autocomplete.js b/ui/widgets/autocomplete.js
index a36282dd56f..954258e23ca 100644
--- a/ui/widgets/autocomplete.js
+++ b/ui/widgets/autocomplete.js
@@ -51,7 +51,7 @@ $.widget( "ui.autocomplete", {
},
source: null,
- // callbacks
+ // Callbacks
change: null,
close: null,
focus: null,
@@ -165,7 +165,7 @@ $.widget( "ui.autocomplete", {
return;
}
- // replicate some key handlers to allow them to repeat in Firefox and Opera
+ // Replicate some key handlers to allow them to repeat in Firefox and Opera
var keyCode = $.ui.keyCode;
switch ( event.keyCode ) {
case keyCode.PAGE_UP:
@@ -239,7 +239,7 @@ $.widget( "ui.autocomplete", {
}
} );
- // clicking on the scrollbar causes focus to shift to the body
+ // Clicking on the scrollbar causes focus to shift to the body
// but we can't detect a mouseup or a click immediately afterward
// so we have to track the next mousedown and close the menu if
// the user clicks somewhere outside of the autocomplete
@@ -293,7 +293,7 @@ $.widget( "ui.autocomplete", {
var item = ui.item.data( "ui-autocomplete-item" ),
previous = this.previous;
- // only trigger when focus was lost (click on menu)
+ // Only trigger when focus was lost (click on menu)
if ( this.element[ 0 ] !== $.ui.safeActiveElement( this.document[ 0 ] ) ) {
this.element.trigger( "focus" );
this.previous = previous;
@@ -327,7 +327,7 @@ $.widget( "ui.autocomplete", {
this._addClass( this.liveRegion, null, "ui-helper-hidden-accessible" );
- // turning off autocomplete prevents the browser from remembering the
+ // Turning off autocomplete prevents the browser from remembering the
// value when navigating through history, so we re-enable autocomplete
// if the page is unloaded before the widget is destroyed. #7790
this._on( this.window, {
@@ -427,7 +427,7 @@ $.widget( "ui.autocomplete", {
search: function( value, event ) {
value = value != null ? value : this._value();
- // always save the actual value, not the one passed as an argument
+ // Always save the actual value, not the one passed as an argument
this.term = this._value();
if ( value.length < this.options.minLength ) {
@@ -523,7 +523,7 @@ $.widget( "ui.autocomplete", {
this.isNewMenu = true;
this.menu.refresh();
- // size and position menu
+ // Size and position menu
ul.show();
this._resizeMenu();
ul.position( $.extend( {
@@ -592,7 +592,7 @@ $.widget( "ui.autocomplete", {
if ( !this.isMultiLine || this.menu.element.is( ":visible" ) ) {
this._move( keyEvent, event );
- // prevents moving cursor to beginning/end of the text field in some browsers
+ // Prevents moving cursor to beginning/end of the text field in some browsers
event.preventDefault();
}
}
@@ -610,7 +610,7 @@ $.extend( $.ui.autocomplete, {
}
} );
-// live region extension, adding a `messages` option
+// Live region extension, adding a `messages` option
// NOTE: This is an experimental API. We are still investigating
// a full solution for string manipulation and internationalization.
$.widget( "ui.autocomplete", $.ui.autocomplete, {
diff --git a/ui/widgets/datepicker.js b/ui/widgets/datepicker.js
index 85b658319bb..36e7ef327b9 100644
--- a/ui/widgets/datepicker.js
+++ b/ui/widgets/datepicker.js
@@ -360,7 +360,7 @@ $.extend(Datepicker.prototype, {
[(browserWidth / 2) - 100 + scrollX, (browserHeight / 2) - 150 + scrollY];
}
- // move input on screen for focus, but hidden behind dialog
+ // Move input on screen for focus, but hidden behind dialog
this._dialogInput.css("left", (this._pos[0] + 20) + "px").css("top", this._pos[1] + "px");
inst.settings.onSelect = onSelect;
this._inDialog = true;
@@ -547,7 +547,7 @@ $.extend(Datepicker.prototype, {
}
},
- // change method deprecated
+ // Change method deprecated
_changeDatepicker: function(target, name, value) {
this._optionDatepicker(target, name, value);
},
@@ -611,7 +611,7 @@ $.extend(Datepicker.prototype, {
if (onSelect) {
dateStr = $.datepicker._formatDate(inst);
- // trigger custom callback
+ // Trigger custom callback
onSelect.apply((inst.input ? inst.input[0] : null), [dateStr, inst]);
} else {
$.datepicker._hideDatepicker();
@@ -836,7 +836,7 @@ $.extend(Datepicker.prototype, {
inst.input.trigger( "focus" );
}
- // deffered render of the years select (to avoid flashes on Firefox)
+ // Deffered render of the years select (to avoid flashes on Firefox)
if( inst.yearshtml ){
origyearshtml = inst.yearshtml;
setTimeout(function(){
@@ -869,7 +869,7 @@ $.extend(Datepicker.prototype, {
offset.left -= (isFixed && offset.left === inst.input.offset().left) ? $(document).scrollLeft() : 0;
offset.top -= (isFixed && offset.top === (inst.input.offset().top + inputHeight)) ? $(document).scrollTop() : 0;
- // now check if datepicker is showing outside window viewport - move to a better place if so.
+ // Now check if datepicker is showing outside window viewport - move to a better place if so.
offset.left -= Math.min(offset.left, (offset.left + dpWidth > viewWidth && viewWidth > dpWidth) ?
Math.abs(offset.left + dpWidth - viewWidth) : 0);
offset.top -= Math.min(offset.top, (offset.top + dpHeight > viewHeight && viewHeight > dpHeight) ?
@@ -1824,7 +1824,7 @@ $.extend(Datepicker.prototype, {
html = "
",
monthHtml = "";
- // month selection
+ // Month selection
if (secondary || !changeMonth) {
monthHtml += "" + monthNames[drawMonth] + "";
} else {
@@ -1845,7 +1845,7 @@ $.extend(Datepicker.prototype, {
html += monthHtml + (secondary || !(changeMonth && changeYear) ? " " : "");
}
- // year selection
+ // Year selection
if ( !inst.yearshtml ) {
inst.yearshtml = "";
if (secondary || !changeYear) {
diff --git a/ui/widgets/dialog.js b/ui/widgets/dialog.js
index 40f6c614f58..abff0e535c6 100644
--- a/ui/widgets/dialog.js
+++ b/ui/widgets/dialog.js
@@ -81,7 +81,7 @@ $.widget( "ui.dialog", {
title: null,
width: 300,
- // callbacks
+ // Callbacks
beforeClose: null,
close: null,
drag: null,
@@ -353,7 +353,7 @@ $.widget( "ui.dialog", {
return;
}
- // prevent tabbing out of dialogs
+ // Prevent tabbing out of dialogs
if ( event.keyCode !== $.ui.keyCode.TAB || event.isDefaultPrevented() ) {
return;
}
@@ -408,7 +408,7 @@ $.widget( "ui.dialog", {
}
} );
- // support: IE
+ // Support: IE
// Use type="button" to prevent enter keypresses in textboxes from closing the
// dialog in IE (#9312)
this.uiDialogTitlebarClose = $( "" )
@@ -464,7 +464,7 @@ $.widget( "ui.dialog", {
var that = this,
buttons = this.options.buttons;
- // if we already have a button pane, remove it
+ // If we already have a button pane, remove it
this.uiDialogButtonPane.remove();
this.uiButtonSet.empty();
@@ -722,12 +722,12 @@ $.widget( "ui.dialog", {
uiDialog.resizable( "destroy" );
}
- // currently resizable, changing handles
+ // Currently resizable, changing handles
if ( isResizable && typeof value === "string" ) {
uiDialog.resizable( "option", "handles", value );
}
- // currently non-resizable, becoming resizable
+ // Currently non-resizable, becoming resizable
if ( !isResizable && value !== false ) {
this._makeResizable();
}
@@ -756,7 +756,7 @@ $.widget( "ui.dialog", {
options.width = options.minWidth;
}
- // reset wrapper sizing
+ // Reset wrapper sizing
// determine the height of all the non-content elements
nonContentHeight = this.uiDialog.css( {
height: "auto",
diff --git a/ui/widgets/draggable.js b/ui/widgets/draggable.js
index ab9d2466778..b2c56509fd5 100644
--- a/ui/widgets/draggable.js
+++ b/ui/widgets/draggable.js
@@ -65,7 +65,7 @@ $.widget("ui.draggable", $.ui.mouse, {
stack: false,
zIndex: false,
- // callbacks
+ // Callbacks
drag: null,
start: null,
stop: null
@@ -108,7 +108,7 @@ $.widget("ui.draggable", $.ui.mouse, {
this._blurActiveElement( event );
- // among others, prevent a drag on a resizable-handle
+ // Among others, prevent a drag on a resizable-handle
if (this.helper || o.disabled || $(event.target).closest(".ui-resizable-handle").length > 0) {
return false;
}
@@ -362,7 +362,7 @@ $.widget("ui.draggable", $.ui.mouse, {
helper.appendTo((o.appendTo === "parent" ? this.element[0].parentNode : o.appendTo));
}
- // http://bugs.jqueryui.com/ticket/9446
+ // Http://bugs.jqueryui.com/ticket/9446
// a helper function can return the original element
// which wouldn't have been set to relative in _create
if ( helperIsFunction && helper[ 0 ] === this.element[ 0 ] ) {
@@ -700,7 +700,7 @@ $.ui.plugin.add( "draggable", "connectToSortable", {
if ( sortable && !sortable.options.disabled ) {
draggable.sortables.push( sortable );
- // refreshPositions is called at drag start to refresh the containerCache
+ // RefreshPositions is called at drag start to refresh the containerCache
// which is used in drag. This ensures it's initialized and synchronized
// with any changes that might have happened on the page since initialization.
sortable.refreshPositions();
@@ -825,7 +825,7 @@ $.ui.plugin.add( "draggable", "connectToSortable", {
this.refreshPositions();
});
- // hack so receive/update callbacks work (mostly)
+ // Hack so receive/update callbacks work (mostly)
draggable.currentItem = draggable.element;
sortable.fromOutside = draggable;
}
@@ -854,7 +854,7 @@ $.ui.plugin.add( "draggable", "connectToSortable", {
sortable._trigger( "out", event, sortable._uiHash( sortable ) );
sortable._mouseStop( event, true );
- // restore sortable behaviors that were modfied
+ // Restore sortable behaviors that were modfied
// when the draggable entered the sortable area (#9481)
sortable.options.revert = sortable.options._revert;
sortable.options.helper = sortable.options._helper;
diff --git a/ui/widgets/droppable.js b/ui/widgets/droppable.js
index 3a8bd71094f..6ba8d8c8090 100644
--- a/ui/widgets/droppable.js
+++ b/ui/widgets/droppable.js
@@ -41,7 +41,7 @@ $.widget( "ui.droppable", {
scope: "default",
tolerance: "intersect",
- // callbacks
+ // Callbacks
activate: null,
deactivate: null,
drop: null,
@@ -388,7 +388,7 @@ $.ui.ddmanager = {
}
}
- // we just moved into a greedy child
+ // We just moved into a greedy child
if ( parentInstance && c === "isover" ) {
parentInstance.isover = false;
parentInstance.isout = true;
@@ -399,7 +399,7 @@ $.ui.ddmanager = {
this[c === "isout" ? "isover" : "isout"] = false;
this[c === "isover" ? "_over" : "_out"].call( this, event );
- // we just moved out of a greedy child
+ // We just moved out of a greedy child
if ( parentInstance && c === "isout" ) {
parentInstance.isout = false;
parentInstance.isover = true;
diff --git a/ui/widgets/menu.js b/ui/widgets/menu.js
index 3e1f71a3bb1..48258e85e95 100644
--- a/ui/widgets/menu.js
+++ b/ui/widgets/menu.js
@@ -52,7 +52,7 @@ return $.widget( "ui.menu", {
},
role: "menu",
- // callbacks
+ // Callbacks
blur: null,
focus: null,
select: null
diff --git a/ui/widgets/mouse.js b/ui/widgets/mouse.js
index 80242c0b73a..2114f187000 100644
--- a/ui/widgets/mouse.js
+++ b/ui/widgets/mouse.js
@@ -78,7 +78,7 @@ return $.widget("ui.mouse", {
this._mouseMoved = false;
- // we may have missed mouseup (out of window)
+ // We may have missed mouseup (out of window)
(this._mouseStarted && this._mouseUp(event));
this._mouseDownEvent = event;
@@ -112,7 +112,7 @@ return $.widget("ui.mouse", {
$.removeData(event.target, this.widgetName + ".preventClickEvent");
}
- // these delegates are required to keep context
+ // These delegates are required to keep context
this._mouseMoveDelegate = function(event) {
return that._mouseMove(event);
};
diff --git a/ui/widgets/progressbar.js b/ui/widgets/progressbar.js
index a52cbb71345..07ffaa97f8d 100644
--- a/ui/widgets/progressbar.js
+++ b/ui/widgets/progressbar.js
@@ -90,7 +90,7 @@ return $.widget( "ui.progressbar", {
this.indeterminate = newValue === false;
- // sanitize value
+ // Sanitize value
if ( typeof newValue !== "number" ) {
newValue = 0;
}
diff --git a/ui/widgets/resizable.js b/ui/widgets/resizable.js
index 95cf918d941..cc6f9f186de 100644
--- a/ui/widgets/resizable.js
+++ b/ui/widgets/resizable.js
@@ -60,7 +60,7 @@ $.widget("ui.resizable", $.ui.mouse, {
// See #7960
zIndex: 90,
- // callbacks
+ // Callbacks
resize: null,
start: null,
stop: null
@@ -153,7 +153,7 @@ $.widget("ui.resizable", $.ui.mouse, {
display: "block"
}) );
- // support: IE9
+ // Support: IE9
// avoid IE jump (hard set the margin)
this.originalElement.css({ margin: this.originalElement.css("margin") });
@@ -796,7 +796,7 @@ $.ui.plugin.add("resizable", "animate", {
$(pr[0]).css({ width: data.width, height: data.height });
}
- // propagating resize, and updating values for each animation step
+ // Propagating resize, and updating values for each animation step
that._updateCache(data);
that._propagate("resize", event);
diff --git a/ui/widgets/selectable.js b/ui/widgets/selectable.js
index 4edf46ad68d..0dadac9627d 100644
--- a/ui/widgets/selectable.js
+++ b/ui/widgets/selectable.js
@@ -40,7 +40,7 @@ return $.widget("ui.selectable", $.ui.mouse, {
filter: "*",
tolerance: "touch",
- // callbacks
+ // Callbacks
selected: null,
selecting: null,
start: null,
@@ -55,7 +55,7 @@ return $.widget("ui.selectable", $.ui.mouse, {
this.dragged = false;
- // cache selectee children based on filter
+ // Cache selectee children based on filter
this.refresh = function() {
that.selectees = $(that.options.filter, that.element[0]);
that._addClass( that.selectees, "ui-selectee" );
diff --git a/ui/widgets/selectmenu.js b/ui/widgets/selectmenu.js
index bf415a82629..273e68594c0 100644
--- a/ui/widgets/selectmenu.js
+++ b/ui/widgets/selectmenu.js
@@ -58,7 +58,7 @@ return $.widget( "ui.selectmenu", {
},
width: false,
- // callbacks
+ // Callbacks
change: null,
close: null,
focus: null,
@@ -169,7 +169,7 @@ return $.widget( "ui.selectmenu", {
select: function( event, ui ) {
event.preventDefault();
- // support: IE8
+ // Support: IE8
// If the item was selected via a click, the text selection
// will be destroyed in IE
that._setSelection();
@@ -410,12 +410,12 @@ return $.widget( "ui.selectmenu", {
selection.removeAllRanges();
selection.addRange( this.range );
- // support: IE8
+ // Support: IE8
} else {
this.range.select();
}
- // support: IE
+ // Support: IE
// Setting the text selection kills the button focus in IE, but
// restoring the focus doesn't kill the selection.
this.button.focus();
@@ -446,7 +446,7 @@ return $.widget( "ui.selectmenu", {
this.range = selection.getRangeAt( 0 );
}
- // support: IE8
+ // Support: IE8
} else {
this.range = document.selection.createRange();
}
@@ -638,7 +638,7 @@ return $.widget( "ui.selectmenu", {
this.menu.outerWidth( Math.max(
this.button.outerWidth(),
- // support: IE10
+ // Support: IE10
// IE10 wraps long text (possibly a rounding bug)
// so we add 1px to avoid the wrapping
this.menu.width( "" ).outerWidth() + 1
diff --git a/ui/widgets/slider.js b/ui/widgets/slider.js
index 1ab319ebbf7..792fa4da2da 100644
--- a/ui/widgets/slider.js
+++ b/ui/widgets/slider.js
@@ -57,14 +57,14 @@ return $.widget( "ui.slider", $.ui.mouse, {
value: 0,
values: null,
- // callbacks
+ // Callbacks
change: null,
slide: null,
start: null,
stop: null
},
- // number of pages in a slider
+ // Number of pages in a slider
// (how many times can you page up/down to go through the whole range)
numPages: 5,
@@ -516,7 +516,7 @@ return $.widget( "ui.slider", $.ui.mouse, {
}
},
- // returns the step-aligned value that val is closest to, between (inclusive) min and max
+ // Returns the step-aligned value that val is closest to, between (inclusive) min and max
_trimAlignValue: function( val ) {
if ( val <= this._valueMin() ) {
return this._valueMin();
diff --git a/ui/widgets/sortable.js b/ui/widgets/sortable.js
index 1d384a80e6c..bea58defd86 100644
--- a/ui/widgets/sortable.js
+++ b/ui/widgets/sortable.js
@@ -62,7 +62,7 @@ return $.widget("ui.sortable", $.ui.mouse, {
tolerance: "intersect",
zIndex: 1000,
- // callbacks
+ // Callbacks
activate: null,
beforeStop: null,
change: null,
@@ -258,7 +258,7 @@ return $.widget("ui.sortable", $.ui.mouse, {
if( o.cursor && o.cursor !== "auto" ) { // cursor option
body = this.document.find( "body" );
- // support: IE
+ // Support: IE
this.storedCursor = body.css( "cursor" );
body.css( "cursor", o.cursor );
@@ -400,7 +400,7 @@ return $.widget("ui.sortable", $.ui.mouse, {
continue;
}
- // cannot intersect with itself
+ // Cannot intersect with itself
// no useless actions that have been done before
// no action if the item moved is the parent of the item checked
if (itemElement !== this.currentItem[0] &&
@@ -860,17 +860,17 @@ return $.widget("ui.sortable", $.ui.mouse, {
innermostContainer = null,
innermostIndex = null;
- // get innermost container that intersects with item
+ // Get innermost container that intersects with item
for (i = this.containers.length - 1; i >= 0; i--) {
- // never consider a container that's located within the item itself
+ // Never consider a container that's located within the item itself
if($.contains(this.currentItem[0], this.containers[i].element[0])) {
continue;
}
if(this._intersectsWith(this.containers[i].containerCache)) {
- // if we've already found a container and it's more "inner" than this, then continue
+ // If we've already found a container and it's more "inner" than this, then continue
if(innermostContainer && $.contains(this.containers[i].element[0], innermostContainer.element[0])) {
continue;
}
@@ -888,12 +888,12 @@ return $.widget("ui.sortable", $.ui.mouse, {
}
- // if no intersecting containers found, return
+ // If no intersecting containers found, return
if(!innermostContainer) {
return;
}
- // move the item into the container if it's not there already
+ // Move the item into the container if it's not there already
if(this.containers.length === 1) {
if (!this.containers[innermostIndex].containerCache.over) {
this.containers[innermostIndex]._trigger("over", event, this._uiHash(this));
diff --git a/ui/widgets/spinner.js b/ui/widgets/spinner.js
index bc0535700bd..712d99bad8c 100644
--- a/ui/widgets/spinner.js
+++ b/ui/widgets/spinner.js
@@ -91,7 +91,7 @@ $.widget( "ui.spinner", {
this._on( this._events );
this._refresh();
- // turning off autocomplete prevents the browser from remembering the
+ // Turning off autocomplete prevents the browser from remembering the
// value when navigating through history, so we re-enable autocomplete
// if the page is unloaded before the widget is destroyed. #7790
this._on( this.window, {
@@ -178,11 +178,11 @@ $.widget( "ui.spinner", {
}
}
- // ensure focus is on (or stays on) the text field
+ // Ensure focus is on (or stays on) the text field
event.preventDefault();
checkFocus.call( this );
- // support: IE
+ // Support: IE
// IE doesn't prevent moving focus even with event.preventDefault()
// so we set a flag to know when we should ignore the blur event
// and check (again) if focus moved off of the input.
@@ -242,7 +242,7 @@ $.widget( "ui.spinner", {
this.element.attr( "role", "spinbutton" );
- // button bindings
+ // Button bindings
this.buttons = this.uiSpinner.children( "a" )
.attr( "tabIndex", -1 )
.button();
@@ -264,7 +264,7 @@ $.widget( "ui.spinner", {
this.uiSpinner.height( this.uiSpinner.height() );
}
- // disable spinner if element was already disabled
+ // Disable spinner if element was already disabled
if ( this.options.disabled ) {
this.disable();
}
@@ -360,7 +360,7 @@ $.widget( "ui.spinner", {
var base, aboveMin,
options = this.options;
- // make sure we're at a valid step
+ // Make sure we're at a valid step
// - find out where we are relative to the base (min or 0)
base = options.min !== null ? options.min : 0;
aboveMin = value - base;
@@ -369,10 +369,10 @@ $.widget( "ui.spinner", {
// - rounding is based on 0, so adjust back to our base
value = base + aboveMin;
- // fix precision from bad JS floating point math
+ // Fix precision from bad JS floating point math
value = parseFloat( value.toFixed( this._precision() ) );
- // clamp the value
+ // Clamp the value
if ( options.max !== null && value > options.max ) {
return options.max;
}
@@ -461,16 +461,16 @@ $.widget( "ui.spinner", {
isValid: function() {
var value = this.value();
- // null is invalid
+ // Null is invalid
if ( value === null ) {
return false;
}
- // if value gets adjusted, it's invalid
+ // If value gets adjusted, it's invalid
return value === this._adjustValue( value );
},
- // update the value without triggering change
+ // Update the value without triggering change
_value: function( value, allowAny ) {
var parsed;
if ( value !== "" ) {
diff --git a/ui/widgets/tabs.js b/ui/widgets/tabs.js
index 0b7bf585087..034dcc3aa16 100644
--- a/ui/widgets/tabs.js
+++ b/ui/widgets/tabs.js
@@ -53,7 +53,7 @@ $.widget( "ui.tabs", {
hide: null,
show: null,
- // callbacks
+ // Callbacks
activate: null,
beforeActivate: null,
beforeLoad: null,
@@ -69,7 +69,7 @@ $.widget( "ui.tabs", {
anchorUrl = anchor.href.replace( rhash, "" );
locationUrl = location.href.replace( rhash, "" );
- // decoding may throw an error if the URL isn't UTF-8 (#9518)
+ // Decoding may throw an error if the URL isn't UTF-8 (#9518)
try {
anchorUrl = decodeURIComponent( anchorUrl );
} catch ( error ) {}
@@ -103,7 +103,7 @@ $.widget( "ui.tabs", {
) ).sort();
}
- // check for length avoids error when initializing empty list
+ // Check for length avoids error when initializing empty list
if ( this.options.active !== false && this.anchors.length ) {
this.active = this._findActive( options.active );
} else {
@@ -133,18 +133,18 @@ $.widget( "ui.tabs", {
} );
}
- // check for a tab marked active via a class
+ // Check for a tab marked active via a class
if ( active === null ) {
active = this.tabs.index( this.tabs.filter( ".ui-tabs-active" ) );
}
- // no active tab, set to false
+ // No active tab, set to false
if ( active === null || active === -1 ) {
active = this.tabs.length ? 0 : false;
}
}
- // handle numbers: negative, out of range
+ // Handle numbers: negative, out of range
if ( active !== false ) {
active = this.tabs.index( this.tabs.eq( active ) );
if ( active === -1 ) {
@@ -152,7 +152,7 @@ $.widget( "ui.tabs", {
}
}
- // don't allow collapsible: false and active: false
+ // Don't allow collapsible: false and active: false
if ( !collapsible && active === false && this.anchors.length ) {
active = 0;
}
@@ -320,7 +320,7 @@ $.widget( "ui.tabs", {
var options = this.options,
lis = this.tablist.children( ":has(a[href])" );
- // get disabled tabs from class attribute from HTML
+ // Get disabled tabs from class attribute from HTML
// this will get converted to a boolean if needed in _refresh()
options.disabled = $.map( lis.filter( ".ui-state-disabled" ), function( tab ) {
return lis.index( tab );
@@ -328,7 +328,7 @@ $.widget( "ui.tabs", {
this._processTabs();
- // was collapsed or no tabs
+ // Was collapsed or no tabs
if ( options.active === false || !this.anchors.length ) {
options.active = false;
this.active = $();
@@ -404,7 +404,7 @@ $.widget( "ui.tabs", {
}
} )
- // support: IE <9
+ // Support: IE <9
// Preventing the default action in mousedown doesn't prevent IE
// from focusing the element, so if the anchor gets focused, blur.
// We don't have to worry about focusing the previously focused
@@ -440,7 +440,7 @@ $.widget( "ui.tabs", {
tab = $( anchor ).closest( "li" ),
originalAriaControls = tab.attr( "aria-controls" );
- // inline tab
+ // Inline tab
if ( that._isLocal( anchor ) ) {
selector = anchor.hash;
panelId = selector.substring( 1 );
@@ -483,7 +483,7 @@ $.widget( "ui.tabs", {
}
},
- // allow overriding how to find the list for rare usage scenarios (#7715)
+ // Allow overriding how to find the list for rare usage scenarios (#7715)
_getList: function() {
return this.tablist || this.element.find( "ol, ul" ).eq( 0 );
},
@@ -505,7 +505,7 @@ $.widget( "ui.tabs", {
}
}
- // disable tabs
+ // Disable tabs
for ( i = 0; ( li = this.tabs[ i ] ); i++ ) {
currentItem = $( li );
if ( disabled === true || $.inArray( i, disabled ) !== -1 ) {
@@ -625,7 +625,7 @@ $.widget( "ui.tabs", {
this._toggle( event, eventData );
},
- // handles show/hide for selecting tabs
+ // Handles show/hide for selecting tabs
_toggle: function( event, eventData ) {
var that = this,
toShow = eventData.newPanel,
@@ -649,7 +649,7 @@ $.widget( "ui.tabs", {
}
}
- // start out by hiding, then showing, then completing
+ // Start out by hiding, then showing, then completing
if ( toHide.length && this.options.hide ) {
this._hide( toHide, this.options.hide, function() {
that._removeClass( eventData.oldTab.closest( "li" ),
@@ -692,12 +692,12 @@ $.widget( "ui.tabs", {
var anchor,
active = this._findActive( index );
- // trying to activate the already active panel
+ // Trying to activate the already active panel
if ( active[ 0 ] === this.active[ 0 ] ) {
return;
}
- // trying to collapse, simulate a click on the current active header
+ // Trying to collapse, simulate a click on the current active header
if ( !active.length ) {
active = this.active;
}
@@ -832,14 +832,14 @@ $.widget( "ui.tabs", {
}
};
- // not remote
+ // Not remote
if ( this._isLocal( anchor[ 0 ] ) ) {
return;
}
this.xhr = $.ajax( this._ajaxSettings( anchor, event, eventData ) );
- // support: jQuery <1.8
+ // Support: jQuery <1.8
// jQuery <1.8 returns false if the request is canceled in beforeSend,
// but as of 1.8, $.ajax() always returns a jqXHR object.
if ( this.xhr && this.xhr.statusText !== "canceled" ) {
diff --git a/ui/widgets/tooltip.js b/ui/widgets/tooltip.js
index 1c919582efa..6c4493052d7 100644
--- a/ui/widgets/tooltip.js
+++ b/ui/widgets/tooltip.js
@@ -59,7 +59,7 @@ $.widget( "ui.tooltip", {
show: true,
track: false,
- // callbacks
+ // Callbacks
close: null,
open: null
},
@@ -139,14 +139,14 @@ $.widget( "ui.tooltip", {
_disable: function() {
var that = this;
- // close open tooltips
+ // Close open tooltips
$.each( this.tooltips, function( id, tooltipData ) {
var event = $.Event( "blur" );
event.target = event.currentTarget = tooltipData.element[ 0 ];
that.close( event, true );
} );
- // remove title attributes to prevent native tooltips
+ // Remove title attributes to prevent native tooltips
this.element.find( this.options.items ).addBack().each( function() {
var element = $( this );
if ( element.is( "[title]" ) ) {
@@ -185,7 +185,7 @@ $.widget( "ui.tooltip", {
target.data( "ui-tooltip-open", true );
- // kill parent tooltips, custom or native, for hover
+ // Kill parent tooltips, custom or native, for hover
if ( event && event.type === "mouseover" ) {
target.parents().each( function() {
var parent = $( this ),
@@ -232,7 +232,7 @@ $.widget( "ui.tooltip", {
return;
}
- // jQuery creates a special event for focusin when it doesn't
+ // JQuery creates a special event for focusin when it doesn't
// exist natively. To improve performance, the native event
// object is reused and the type is changed. Therefore, we can't
// rely on the type being correct after the event finished
@@ -264,7 +264,7 @@ $.widget( "ui.tooltip", {
return;
}
- // if we have a title, clear it to prevent the native tooltip
+ // If we have a title, clear it to prevent the native tooltip
// we have to check first to avoid defining a title if none exists
// (we don't want to cause an element to start matching [title])
//
@@ -377,7 +377,7 @@ $.widget( "ui.tooltip", {
tooltip = tooltipData.tooltip;
- // disabling closes the tooltip, so we need to track when we're closing
+ // Disabling closes the tooltip, so we need to track when we're closing
// to avoid an infinite loop in case the tooltip becomes disabled on close
if ( tooltipData.closing ) {
return;
@@ -386,7 +386,7 @@ $.widget( "ui.tooltip", {
// Clear the interval for delayed tracking tooltips
clearInterval( this.delayedShow );
- // only set title if we had one before (see comment in _open())
+ // Only set title if we had one before (see comment in _open())
// If the title attribute has changed since open(), don't restore
if ( target.data( "ui-tooltip-title" ) && !target.attr( "title" ) ) {
target.attr( "title", target.data( "ui-tooltip-title" ) );
@@ -462,7 +462,7 @@ $.widget( "ui.tooltip", {
_destroy: function() {
var that = this;
- // close open tooltips
+ // Close open tooltips
$.each( this.tooltips, function( id, tooltipData ) {
// Delegate to close method to handle common cleanup
var event = $.Event( "blur" ),