Skip to content

Commit

Permalink
Coding standards: liberal spacing, functions go snug to front if it's…
Browse files Browse the repository at this point in the history
… the only argument.
  • Loading branch information
jaspermdegroot committed Jul 9, 2012
1 parent 01ad182 commit 4b95883
Show file tree
Hide file tree
Showing 19 changed files with 168 additions and 168 deletions.
8 changes: 4 additions & 4 deletions js/jquery.mobile.buttonMarkup.js
Expand Up @@ -7,7 +7,7 @@

define( [ "jquery", "./jquery.mobile.core", "./jquery.mobile.vmouse" ], function( $ ) {
//>>excludeEnd("jqmBuildExclude");
( function( $, undefined ) {
(function( $, undefined ) {

$.fn.buttonMarkup = function( options ) {
var $workingSet = this,
Expand Down Expand Up @@ -233,10 +233,10 @@ var attachEvents = function() {
}
}
},
"focusin focus": function( event ){
"focusin focus": function( event ) {
$( closestEnabledButton( event.target ) ).addClass( $.mobile.focusClass );
},
"focusout blur": function( event ){
"focusout blur": function( event ) {
$( closestEnabledButton( event.target ) ).removeClass( $.mobile.focusClass );
}
});
Expand All @@ -246,7 +246,7 @@ var attachEvents = function() {

//links in bars, or those with data-role become buttons
//auto self-init widgets
$( document ).bind( "pagecreate create", function( e ){
$( document ).bind( "pagecreate create", function( e ) {

$( ":jqmData(role='button'), .ui-bar > a, .ui-header > a, .ui-footer > a, .ui-bar > :jqmData(role='controlgroup') > a", e.target )
.not( "button, input, .ui-btn, :jqmData(role='none'), :jqmData(role='nojs')" )
Expand Down
4 changes: 2 additions & 2 deletions js/jquery.mobile.controlGroup.js
Expand Up @@ -33,13 +33,13 @@ $.fn.controlgroup = function( options ) {

// Replace legend with more stylable replacement div
if ( groupheading.length ) {
$( "<div role='heading' class='ui-controlgroup-label'>" + groupheading.html() + "</div>" ).insertBefore( $el.children(0) );
$( "<div role='heading' class='ui-controlgroup-label'>" + groupheading.html() + "</div>" ).insertBefore( $el.children( 0 ) );
groupheading.remove();
}

$el.addClass( "ui-corner-all ui-controlgroup ui-controlgroup-" + o.direction );

flipClasses( $el.find( ".ui-btn" + ( o.excludeInvisible ? ":visible" : "" ) ).not('.ui-slider-handle'), flCorners );
flipClasses( $el.find( ".ui-btn" + ( o.excludeInvisible ? ":visible" : "" ) ).not( '.ui-slider-handle' ), flCorners );
flipClasses( $el.find( ".ui-btn-inner" ), flCorners );

if ( o.shadow ) {
Expand Down
22 changes: 11 additions & 11 deletions js/jquery.mobile.core.js
Expand Up @@ -125,12 +125,12 @@ define( [ "jquery", "text!../version.txt" ], function( $, __version__ ) {
// prevent scrollstart and scrollstop events
$.event.special.scrollstart.enabled = false;

setTimeout(function() {
setTimeout( function() {
window.scrollTo( 0, ypos );
$( document ).trigger( "silentscroll", { x: 0, y: ypos });
}, 20 );

setTimeout(function() {
setTimeout( function() {
$.event.special.scrollstart.enabled = true;
}, 150 );
},
Expand Down Expand Up @@ -185,8 +185,8 @@ define( [ "jquery", "text!../version.txt" ], function( $, __version__ ) {
// doing a similar parent node traversal to the one found in the inherited theme code above
closestPageData: function( $target ) {
return $target
.closest(':jqmData(role="page"), :jqmData(role="dialog")')
.data("page");
.closest( ':jqmData(role="page"), :jqmData(role="dialog")' )
.data( "page" );
},

enhanceable: function( $set ) {
Expand All @@ -198,7 +198,7 @@ define( [ "jquery", "text!../version.txt" ], function( $, __version__ ) {
},

haveParents: function( $set, attr ) {
if( !$.mobile.ignoreContentEnabled ){
if ( !$.mobile.ignoreContentEnabled ) {
return $set;
}

Expand Down Expand Up @@ -230,7 +230,7 @@ define( [ "jquery", "text!../version.txt" ], function( $, __version__ ) {
return $newSet;
},

getScreenHeight: function(){
getScreenHeight: function() {
// Native innerHeight returns more accurate value for this across platforms,
// jQuery version is here as a normalized fallback for platforms like Symbian
return window.innerHeight || $( window ).height();
Expand Down Expand Up @@ -273,25 +273,25 @@ define( [ "jquery", "text!../version.txt" ], function( $, __version__ ) {
$.removeWithDependents = function( elem ) {
var $elem = $( elem );

( $elem.jqmData('dependents') || $() ).remove();
( $elem.jqmData( 'dependents' ) || $() ).remove();
$elem.remove();
};

$.fn.addDependents = function( newDependents ) {
$.addDependents( $(this), newDependents );
$.addDependents( $( this ), newDependents );
};

$.addDependents = function( elem, newDependents ) {
var dependents = $(elem).jqmData( 'dependents' ) || $();
var dependents = $( elem ).jqmData( 'dependents' ) || $();

$(elem).jqmData( 'dependents', $.merge(dependents, newDependents) );
$( elem ).jqmData( 'dependents', $.merge( dependents, newDependents ) );
};

// note that this helper doesn't attempt to handle the callback
// or setting of an html elements text, its only purpose is
// to return the html encoded version of the text in all cases. (thus the name)
$.fn.getEncodedText = function() {
return $( "<div/>" ).text( $(this).text() ).html();
return $( "<div/>" ).text( $( this ).text() ).html();
};

// fluent helper function for the mobile namespaced equivalent
Expand Down
2 changes: 1 addition & 1 deletion js/jquery.mobile.define.js
@@ -1,5 +1,5 @@
// creates the define method on window, only used where async loading
// is not desired in the docs and experiments
window.define = function(){
window.define = function() {
Array.prototype.slice.call( arguments ).pop()( window.jQuery );
};
6 changes: 3 additions & 3 deletions js/jquery.mobile.degradeInputs.js
Expand Up @@ -26,11 +26,11 @@ $.mobile.page.prototype.options.degradeInputs = {


//auto self-init widgets
$( document ).bind( "pagecreate create", function( e ){
$( document ).bind( "pagecreate create", function( e ) {

var page = $.mobile.closestPageData($(e.target)), options;
var page = $.mobile.closestPageData( $( e.target ) ), options;

if( !page ) {
if ( !page ) {
return;
}

Expand Down
2 changes: 1 addition & 1 deletion js/jquery.mobile.fieldContain.js
Expand Up @@ -19,7 +19,7 @@ $.fn.fieldcontain = function( options ) {
};

//auto self-init widgets
$( document ).bind( "pagecreate create", function( e ){
$( document ).bind( "pagecreate create", function( e ) {
$( ":jqmData(role='fieldcontain')", e.target ).jqmEnhanceable().fieldcontain();
});

Expand Down
4 changes: 2 additions & 2 deletions js/jquery.mobile.grid.js
Expand Up @@ -15,9 +15,9 @@ $.fn.grid = function( options ) {
var $this = $( this ),
o = $.extend({
grid: null
},options),
}, options ),
$kids = $this.children(),
gridCols = {solo:1, a:2, b:3, c:4, d:5},
gridCols = { solo:1, a:2, b:3, c:4, d:5 },
grid = o.grid,
iterator;

Expand Down
16 changes: 8 additions & 8 deletions js/jquery.mobile.init.js
Expand Up @@ -7,13 +7,13 @@
define( [ "jquery", "./jquery.mobile.core", "./jquery.mobile.support", "./jquery.mobile.navigation",
"./jquery.mobile.navigation.pushstate", "./widgets/loader", "./jquery.mobile.vmouse", "depend!./jquery.hashchange[jquery]" ], function( $ ) {
//>>excludeEnd("jqmBuildExclude");
( function( $, window, undefined ) {
(function( $, window, undefined ) {
var $html = $( "html" ),
$head = $( "head" ),
$window = $( window );

//remove initial build class (only present on first pageshow)
function hideRenderingClass(){
function hideRenderingClass() {
$html.removeClass( "ui-mobile-rendering" );
}

Expand All @@ -40,7 +40,7 @@ define( [ "jquery", "./jquery.mobile.core", "./jquery.mobile.support", "./jquery
// this ensures the rendering class is removed after 5 seconds, so content is visible and accessible
setTimeout( hideRenderingClass, 5000 );

$.extend($.mobile, {
$.extend( $.mobile, {
// find and enhance the pages in the dom and transition to the first page.
initializePage: function() {
// find present pages
Expand All @@ -53,10 +53,10 @@ define( [ "jquery", "./jquery.mobile.core", "./jquery.mobile.support", "./jquery

// add dialogs, set data-url attrs
$pages.each(function() {
var $this = $(this);
var $this = $( this );

// unless the data url is already set set it to the pathname
if ( !$this.jqmData("url") ) {
if ( !$this.jqmData( "url" ) ) {
$this.attr( "data-" + $.mobile.ns + "url", $this.attr( "id" ) || location.pathname + location.search );
}
});
Expand Down Expand Up @@ -106,21 +106,21 @@ define( [ "jquery", "./jquery.mobile.core", "./jquery.mobile.support", "./jquery
// if defaultHomeScroll hasn't been set yet, see if scrollTop is 1
// it should be 1 in most browsers, but android treats 1 as 0 (for hiding addr bar)
// so if it's 1, use 0 from now on
$.mobile.defaultHomeScroll = ( !$.support.scrollTop || $(window).scrollTop() === 1 ) ? 0 : 1;
$.mobile.defaultHomeScroll = ( !$.support.scrollTop || $( window ).scrollTop() === 1 ) ? 0 : 1;


// TODO: Implement a proper registration mechanism with dependency handling in order to not have exceptions like the one below
//auto self-init widgets for those widgets that have a soft dependency on others
if ( $.fn.controlgroup ) {
$( document ).bind( "pagecreate create", function( e ){
$( document ).bind( "pagecreate create", function( e ) {
$( ":jqmData(role='controlgroup')", e.target )
.jqmEnhanceable()
.controlgroup({ excludeInvisible: false });
});
}

//dom-ready inits
if( $.mobile.autoInitializePage ){
if ( $.mobile.autoInitializePage ) {
$.mobile.initializePage();
}

Expand Down
2 changes: 1 addition & 1 deletion js/jquery.mobile.links.js
Expand Up @@ -8,7 +8,7 @@ define( [ "jquery" ], function( $ ) {
//>>excludeEnd("jqmBuildExclude");
(function( $, undefined ) {

$( document ).bind( "pagecreate create", function( e ){
$( document ).bind( "pagecreate create", function( e ) {

//links within content areas, tests included with page
$( e.target )
Expand Down
2 changes: 1 addition & 1 deletion js/jquery.mobile.media.js
Expand Up @@ -32,7 +32,7 @@ $.mobile.media = (function() {
//must set type for IE!
styleBlock.type = "text/css";

if ( styleBlock.styleSheet ){
if ( styleBlock.styleSheet ) {
styleBlock.styleSheet.cssText = cssrule;
} else {
styleBlock.appendChild( document.createTextNode(cssrule) );
Expand Down

0 comments on commit 4b95883

Please sign in to comment.