Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

lint fixes for js/*

  • Loading branch information...
commit 5f96df7d658570ffdc8508c7668bd499304cd32d 1 parent bf1c8e0
@johnbender johnbender authored
View
31 js/jquery.mobile.forms.select.custom.js
@@ -3,7 +3,7 @@
*/
//>>excludeStart("jqmBuildExclude", pragmas.jqmBuildExclude);
-//>>description: Extension to select menus to support menu styling, placeholder options, and multi-select features.
+//>>description: Extension to select menus to support menu styling, placeholder options, and multi-select features.
//>>label: Selects: Custom menus
//>>group: Forms
//>>css: ../css/themes/default/jquery.mobile.theme.css, ../css/structure/jquery.mobile.forms.select.css
@@ -101,9 +101,9 @@ define( [
// Button events
self.button.bind( "vclick keydown" , function( event ) {
- if ( event.type == "vclick" ||
- event.keyCode && ( event.keyCode === $.mobile.keyCode.ENTER ||
- event.keyCode === $.mobile.keyCode.SPACE ) ) {
+ if (event.type === "vclick" ||
+ event.keyCode && (event.keyCode === $.mobile.keyCode.ENTER ||
+ event.keyCode === $.mobile.keyCode.SPACE)) {
self.open();
event.preventDefault();
@@ -160,7 +160,7 @@ define( [
// switch logic based on which key was pressed
switch ( event.keyCode ) {
// up or left arrow keys
- case 38:
+ case 38:
prev = li.prev().not( ".ui-selectmenu-placeholder" );
if( prev.is( ".ui-li-divider" ) ) {
@@ -177,10 +177,8 @@ define( [
}
return false;
- break;
-
// down or right arrow keys
- case 40:
+ case 40:
next = li.next();
if( next.is( ".ui-li-divider" ) ) {
@@ -197,15 +195,12 @@ define( [
}
return false;
- break;
-
// If enter or space is pressed, trigger click
- case 13:
- case 32:
+ case 13:
+ case 32:
target.trigger( "click" );
return false;
- break;
}
});
@@ -238,7 +233,7 @@ define( [
// Close button on small overlays
if( self.isMultiple ){
self.headerClose.click( function() {
- if ( self.menuType == "overlay" ) {
+ if ( self.menuType === "overlay" ) {
self.close();
return false;
}
@@ -308,7 +303,7 @@ define( [
var self = this;
- if ( self.menuType == "page" ) {
+ if ( self.menuType === "page" ) {
// doesn't solve the possible issue with calling change page
// where the objects don't define data urls which prevents dialog key
// stripping - changePage has incoming refactor
@@ -365,7 +360,7 @@ define( [
self.thisPage.unbind( "pagehide.remove" );
//for WebOS/Opera Mini (set lastscroll using button offset)
- if ( scrollTop == 0 && btnOffset > screenHeight ) {
+ if ( scrollTop === 0 && btnOffset > screenHeight ) {
self.thisPage.one( "pagehide", function() {
$( this ).jqmData( "lastScroll", btnOffset );
});
@@ -468,7 +463,7 @@ define( [
// Are we inside an optgroup?
if (parent !== select && parent.nodeName.toLowerCase() === "optgroup"){
var optLabel = parent.getAttribute('label');
- if ( optLabel != optGroup) {
+ if ( optLabel !== optGroup) {
var divider = document.createElement('li');
divider.setAttribute(dataRoleAttr,'list-divider');
divider.setAttribute('role','option');
@@ -479,7 +474,7 @@ define( [
}
}
- if (needPlaceholder && (!option.getAttribute( "value" ) || text.length == 0 || $option.jqmData( "placeholder" ))) {
+ if (needPlaceholder && (!option.getAttribute( "value" ) || text.length === 0 || $option.jqmData( "placeholder" ))) {
needPlaceholder = false;
if ( o.hidePlaceholderMenuItems ) {
classes.push( "ui-selectmenu-placeholder" );
View
6 js/jquery.mobile.listview.js
@@ -197,7 +197,7 @@ $.widget( "mobile.listview", $.mobile.widget, {
theme: itemTheme
});
- if ( ( icon != false ) && ( a.length == 1 ) ) {
+ if ( ( icon !== false ) && ( a.length === 1 ) ) {
item.addClass( "ui-li-has-arrow" );
}
@@ -342,8 +342,8 @@ $.widget( "mobile.listview", $.mobile.widget, {
list = $( this ),
listId = list.attr( "id" ) || parentListId + "-" + i,
parent = list.parent(),
- nodeEls = $( list.prevAll().toArray().reverse() ),
- nodeEls = nodeEls.length ? nodeEls : $( "<span>" + $.trim(parent.contents()[ 0 ].nodeValue) + "</span>" ),
+ nodeElsFull = $( list.prevAll().toArray().reverse() ),
+ nodeEls = nodeElsFull.length ? nodeElsFull : $( "<span>" + $.trim(parent.contents()[ 0 ].nodeValue) + "</span>" ),
title = nodeEls.first().getEncodedText(),//url limits to first 30 chars of text
id = ( parentUrl || "" ) + "&" + $.mobile.subPageUrlKey + "=" + listId,
theme = list.jqmData( "theme" ) || o.theme,
View
20 js/jquery.mobile.loader.js
@@ -58,9 +58,9 @@ define( [ "jquery", "./jquery.mobile.core", "./jquery.mobile.init" ], function(
},
defaultHtml: "<div class='" + loaderClass + "'>" +
- "<span class='ui-icon ui-icon-loading'></span>" +
- "<h1></h1>" +
- "</div>",
+ "<span class='ui-icon ui-icon-loading'></span>" +
+ "<h1></h1>" +
+ "</div>",
// For non-fixed supportin browsers. Position at y center (if scrollTop supported), above the activeBtn (if defined), or just 100px from top
fakeFixLoader: function(){
@@ -103,7 +103,7 @@ define( [ "jquery", "./jquery.mobile.core", "./jquery.mobile.init" ], function(
var loadSettings;
// support for object literal params
- if( $.type(theme) == "object" ){
+ if( $.type(theme) === "object" ){
loadSettings = $.extend({}, this.options, theme);
// prefer object property from the param then the old theme setting
@@ -115,22 +115,22 @@ define( [ "jquery", "./jquery.mobile.core", "./jquery.mobile.init" ], function(
$html.addClass( "ui-loading" );
- if ( $.mobile.loadingMessage != false || loadSettings.html ) {
+ if ( $.mobile.loadingMessage !== false || loadSettings.html ) {
// text visibility from argument takes priority
var textVisible, message, $header;
// boolean values require a bit more work :P
// support object properties and old settings
- if( $.mobile.loadingMessageTextVisible != undefined ) {
+ if( $.mobile.loadingMessageTextVisible !== undefined ) {
textVisible = $.mobile.loadingMessageTextVisible;
} else {
textVisible = loadSettings.textVisible;
}
- this.element.attr( "class", loaderClass +
- " ui-corner-all ui-body-" + theme +
- " ui-loader-" + ( textVisible ? "verbose" : "default" )
- + ( loadSettings.textonly || textonly ? " ui-loader-textonly" : "" ) );
+ this.element.attr("class", loaderClass +
+ " ui-corner-all ui-body-" + theme +
+ " ui-loader-" + ( textVisible ? "verbose" : "default" ) +
+ ( loadSettings.textonly || textonly ? " ui-loader-textonly" : "" ) );
// TODO verify that jquery.fn.html is ok to use in both cases here
// this might be overly defensive in preventing unknowing xss
View
52 js/jquery.mobile.transition.js
@@ -10,12 +10,12 @@ define( [ "jquery", "./jquery.mobile.core" ], function( $ ) {
(function( $, window, undefined ) {
var createHandler = function( sequential ){
-
+
// Default to sequential
if( sequential === undefined ){
sequential = true;
}
-
+
return function( name, reverse, $to, $from ) {
var deferred = new $.Deferred(),
@@ -33,9 +33,9 @@ var createHandler = function( sequential ){
// By using scrollTo instead of silentScroll, we can keep things better in order
// Just to be precautios, disable scrollstart listening like silentScroll would
$.event.special.scrollstart.enabled = false;
-
+
window.scrollTo( 0, toScroll );
-
+
// reenable scrollstart listening like silentScroll would
setTimeout(function() {
$.event.special.scrollstart.enabled = true;
@@ -52,66 +52,66 @@ var createHandler = function( sequential ){
doneOut();
}
else {
- $from.animationComplete( doneOut );
+ $from.animationComplete( doneOut );
}
-
+
// Set the from page's height and start it transitioning out
// Note: setting an explicit height helps eliminate tiling in the transitions
$from
.height( screenHeight + $(window ).scrollTop() )
.addClass( name + " out" + reverseClass );
},
-
+
doneOut = function() {
if ( $from && sequential ) {
cleanFrom();
}
-
+
startIn();
},
-
- startIn = function(){
-
- $to.addClass( $.mobile.activePageClass + toPreClass );
-
+
+ startIn = function(){
+
+ $to.addClass( $.mobile.activePageClass + toPreClass );
+
// Send focus to page as it is now display: block
$.mobile.focusPage( $to );
// Set to page height
$to.height( screenHeight + toScroll );
-
+
scrollPage();
-
+
if( !none ){
$to.animationComplete( doneIn );
}
-
+
$to
.removeClass( toPreClass )
.addClass( name + " in" + reverseClass );
-
+
if( none ){
doneIn();
}
-
+
},
-
+
doneIn = function() {
-
+
if ( !sequential ) {
-
+
if( $from ){
cleanFrom();
}
}
-
+
$to
.removeClass( "out in reverse " + name )
.height( "" );
-
+
toggleViewportClass();
-
+
// In some browsers (iOS5), 3D transitions block the ability to scroll to the desired location during transition
// This ensures we jump to that spot after the fact, if we aren't there already.
if( $( window ).scrollTop() !== toScroll ){
@@ -122,7 +122,7 @@ var createHandler = function( sequential ){
};
toggleViewportClass();
-
+
if ( $from && !none ) {
startOut();
}
@@ -132,7 +132,7 @@ var createHandler = function( sequential ){
return deferred.promise();
};
-}
+};
// generate the handlers from the above
var sequentialHandler = createHandler(),
Please sign in to comment.
Something went wrong with that request. Please try again.