From fdb77bfa528a8d12fdc5408110605054fb0a557e Mon Sep 17 00:00:00 2001 From: scottjehl Date: Fri, 22 Jul 2011 09:05:55 -0400 Subject: [PATCH] changed new (undocumented) "enhance" event to "create" to better match our existing event name conventions --- js/jquery.mobile.buttonMarkup.js | 2 +- js/jquery.mobile.collapsible.js | 2 +- js/jquery.mobile.controlGroup.js | 2 +- js/jquery.mobile.fieldContain.js | 2 +- js/jquery.mobile.fixHeaderFooter.js | 2 +- js/jquery.mobile.forms.button.js | 2 +- js/jquery.mobile.forms.checkboxradio.js | 2 +- js/jquery.mobile.forms.select.js | 2 +- js/jquery.mobile.forms.slider.js | 2 +- js/jquery.mobile.forms.textinput.js | 2 +- js/jquery.mobile.links.js | 2 +- js/jquery.mobile.listview.js | 2 +- js/jquery.mobile.navbar.js | 2 +- js/jquery.mobile.nojs.js | 2 +- tests/unit/checkboxradio/checkboxradio_core.js | 4 ++-- tests/unit/controlgroup/controlgroup_core.js | 4 ++-- tests/unit/fieldContain/fieldContain_events.js | 4 ++-- tests/unit/listview/listview_core.js | 4 ++-- tests/unit/select/select_events.js | 4 ++-- tests/unit/slider/slider_events.js | 4 ++-- 20 files changed, 26 insertions(+), 26 deletions(-) diff --git a/js/jquery.mobile.buttonMarkup.js b/js/jquery.mobile.buttonMarkup.js index 06527cc2..59f9d94e 100644 --- a/js/jquery.mobile.buttonMarkup.js +++ b/js/jquery.mobile.buttonMarkup.js @@ -140,7 +140,7 @@ var attachEvents = function() { //links in bars, or those with data-role become buttons //auto self-init widgets -$( document ).bind( "pagecreate enhance", function( e ){ +$( document ).bind( "pagecreate create", function( e ){ $( ":jqmData(role='button'), .ui-bar > a, .ui-header > a, .ui-footer > a", e.target ) .not( ".ui-btn, :jqmData(role='none'), :jqmData(role='nojs')" ) diff --git a/js/jquery.mobile.collapsible.js b/js/jquery.mobile.collapsible.js index 7a842524..4b3b1364 100644 --- a/js/jquery.mobile.collapsible.js +++ b/js/jquery.mobile.collapsible.js @@ -7,7 +7,7 @@ (function( $, undefined ) { //auto self-init widgets -$( document ).bind( "pagecreate enhance", function( e ){ +$( document ).bind( "pagecreate create", function( e ){ $( ":jqmData(role='collapsible')", e.target ).collapsible(); }); diff --git a/js/jquery.mobile.controlGroup.js b/js/jquery.mobile.controlGroup.js index 92bd6630..4e5cd1df 100644 --- a/js/jquery.mobile.controlGroup.js +++ b/js/jquery.mobile.controlGroup.js @@ -7,7 +7,7 @@ (function( $, undefined ) { //auto self-init widgets -$( document ).bind( "pagecreate enhance", function( e ){ +$( document ).bind( "pagecreate create", function( e ){ $( ":jqmData(role='controlgroup')", e.target ).controlgroup({ excludeInvisible: false }); }); diff --git a/js/jquery.mobile.fieldContain.js b/js/jquery.mobile.fieldContain.js index 28fb39f1..1cae198d 100644 --- a/js/jquery.mobile.fieldContain.js +++ b/js/jquery.mobile.fieldContain.js @@ -8,7 +8,7 @@ (function( $, undefined ) { //auto self-init widgets -$( document ).bind( "pagecreate enhance", function( e ){ +$( document ).bind( "pagecreate create", function( e ){ $( ":jqmData(role='fieldcontain')", e.target ).fieldcontain(); }); diff --git a/js/jquery.mobile.fixHeaderFooter.js b/js/jquery.mobile.fixHeaderFooter.js index 2899bbcd..97bebef9 100644 --- a/js/jquery.mobile.fixHeaderFooter.js +++ b/js/jquery.mobile.fixHeaderFooter.js @@ -8,7 +8,7 @@ (function( $, undefined ) { //auto self-init widgets -$( document ).bind( "pagecreate enhance", function( e ){ +$( document ).bind( "pagecreate create", function( e ){ if( $( ":jqmData(position='fixed')", e.target ).length ){ $( e.target ).each(function(){ diff --git a/js/jquery.mobile.forms.button.js b/js/jquery.mobile.forms.button.js index 22940fde..b462258c 100644 --- a/js/jquery.mobile.forms.button.js +++ b/js/jquery.mobile.forms.button.js @@ -8,7 +8,7 @@ (function( $, undefined ) { //auto self-init widgets -$( document ).bind( "pagecreate enhance", function( e ){ +$( document ).bind( "pagecreate create", function( e ){ $( "button, [type='button'], [type='submit'], [type='reset'], [type='image']", e.target ) .not( ":jqmData(role='none'), :jqmData(role='nojs')" ) .button(); diff --git a/js/jquery.mobile.forms.checkboxradio.js b/js/jquery.mobile.forms.checkboxradio.js index eb5efb9e..22b8d214 100644 --- a/js/jquery.mobile.forms.checkboxradio.js +++ b/js/jquery.mobile.forms.checkboxradio.js @@ -8,7 +8,7 @@ (function( $, undefined ) { //auto self-init widgets -$( document ).bind( "pagecreate enhance", function( e ){ +$( document ).bind( "pagecreate create", function( e ){ $( "input[type='checkbox'],input[type='radio']", e.target ) .not( ":jqmData(role='none'), :jqmData(role='nojs')" ) .checkboxradio(); diff --git a/js/jquery.mobile.forms.select.js b/js/jquery.mobile.forms.select.js index ac4566b3..fca6ffd3 100644 --- a/js/jquery.mobile.forms.select.js +++ b/js/jquery.mobile.forms.select.js @@ -8,7 +8,7 @@ (function( $, undefined ) { //auto self-init widgets -$( document ).bind( "pagecreate enhance", function( e ){ +$( document ).bind( "pagecreate create", function( e ){ $( "select:not(:jqmData(role='slider'))", e.target ) .not( ":jqmData(role='none'), :jqmData(role='nojs')" ) .selectmenu(); diff --git a/js/jquery.mobile.forms.slider.js b/js/jquery.mobile.forms.slider.js index c58cb15d..0831b5a9 100644 --- a/js/jquery.mobile.forms.slider.js +++ b/js/jquery.mobile.forms.slider.js @@ -8,7 +8,7 @@ ( function( $, undefined ) { //auto self-init widgets -$( document ).bind( "pagecreate enhance", function( e ){ +$( document ).bind( "pagecreate create", function( e ){ var nativeSel = ":jqmData(role='none'), :jqmData(role='nojs')"; diff --git a/js/jquery.mobile.forms.textinput.js b/js/jquery.mobile.forms.textinput.js index fbf98a8a..55a60aa7 100644 --- a/js/jquery.mobile.forms.textinput.js +++ b/js/jquery.mobile.forms.textinput.js @@ -8,7 +8,7 @@ (function( $, undefined ) { //auto self-init widgets -$( document ).bind( "pagecreate enhance", function( e ){ +$( document ).bind( "pagecreate create", function( e ){ $( "input[type='text'], input[type='search'], input[type='number'], input[type='password'], input[type='email'], input[type='url'], input[type='tel'], textarea", e.target ) .not( ":jqmData(role='none'), :jqmData(role='nojs')" ) .textinput(); diff --git a/js/jquery.mobile.links.js b/js/jquery.mobile.links.js index c4620b1f..88f4c709 100644 --- a/js/jquery.mobile.links.js +++ b/js/jquery.mobile.links.js @@ -7,7 +7,7 @@ (function( $, undefined ) { -$( document ).bind( "pagecreate enhance", function( e ){ +$( document ).bind( "pagecreate create", function( e ){ //links within content areas $( e.target ) diff --git a/js/jquery.mobile.listview.js b/js/jquery.mobile.listview.js index 38dd21ae..bd40245c 100644 --- a/js/jquery.mobile.listview.js +++ b/js/jquery.mobile.listview.js @@ -8,7 +8,7 @@ (function( $, undefined ) { //auto self-init widgets -$( document ).bind( "pagecreate enhance", function( e ){ +$( document ).bind( "pagecreate create", function( e ){ $( ":jqmData(role='listview')", e.target ).listview(); }); diff --git a/js/jquery.mobile.navbar.js b/js/jquery.mobile.navbar.js index 4912eac3..c9ab9bb3 100755 --- a/js/jquery.mobile.navbar.js +++ b/js/jquery.mobile.navbar.js @@ -8,7 +8,7 @@ (function( $, undefined ) { //auto self-init widgets -$( document ).bind( "pagecreate enhance", function( e ){ +$( document ).bind( "pagecreate create", function( e ){ $( ":jqmData(role='navbar')", e.target ).navbar(); }); diff --git a/js/jquery.mobile.nojs.js b/js/jquery.mobile.nojs.js index 48c49590..3ea545f8 100644 --- a/js/jquery.mobile.nojs.js +++ b/js/jquery.mobile.nojs.js @@ -7,7 +7,7 @@ (function( $, undefined ) { -$( document ).bind( "pagecreate enhance", function( e ){ +$( document ).bind( "pagecreate create", function( e ){ $( ":jqmData(role='nojs')", e.target ).addClass( "ui-nojs" ); }); diff --git a/tests/unit/checkboxradio/checkboxradio_core.js b/tests/unit/checkboxradio/checkboxradio_core.js index d3dda919..67071d35 100644 --- a/tests/unit/checkboxradio/checkboxradio_core.js +++ b/tests/unit/checkboxradio/checkboxradio_core.js @@ -110,9 +110,9 @@ }); - test( "checkboxradio controls will create when inside a container that receives an 'enhance' event", function(){ + test( "checkboxradio controls will create when inside a container that receives a 'create' event", function(){ ok( !$("#enhancetest").appendTo(".ui-page-active").find(".ui-checkbox").length, "did not have enhancements applied" ); - ok( $("#enhancetest").trigger("enhance").find(".ui-checkbox").length, "enhancements applied" ); + ok( $("#enhancetest").trigger("create").find(".ui-checkbox").length, "enhancements applied" ); }); diff --git a/tests/unit/controlgroup/controlgroup_core.js b/tests/unit/controlgroup/controlgroup_core.js index 1c53d6ed..f16a0133 100644 --- a/tests/unit/controlgroup/controlgroup_core.js +++ b/tests/unit/controlgroup/controlgroup_core.js @@ -119,9 +119,9 @@ }); - test( "controlgroups will create when inside a container that receives an 'enhance' event", function(){ + test( "controlgroups will create when inside a container that receives a 'create' event", function(){ ok( !$("#enhancetest").appendTo(".ui-page-active").find(".ui-controlgroup").length, "did not have enhancements applied" ); - ok( $("#enhancetest").trigger("enhance").find(".ui-controlgroup").length, "enhancements applied" ); + ok( $("#enhancetest").trigger("create").find(".ui-controlgroup").length, "enhancements applied" ); }); diff --git a/tests/unit/fieldContain/fieldContain_events.js b/tests/unit/fieldContain/fieldContain_events.js index c3305b03..7d20c1c2 100644 --- a/tests/unit/fieldContain/fieldContain_events.js +++ b/tests/unit/fieldContain/fieldContain_events.js @@ -8,9 +8,9 @@ ok($('#test-fieldcontain').hasClass('ui-field-contain ui-body ui-br'), 'A fieldcontain element must contain styles "ui-field-contain ui-body ui-br"'); }); - test( "Field container will create when inside a container that receives an 'enhance' event", function(){ + test( "Field container will create when inside a container that receives a 'create' event", function(){ ok( !$("#enhancetest").appendTo(".ui-page-active").find(".ui-field-contain").length, "did not have enhancements applied" ); - ok( $("#enhancetest").trigger("enhance").find(".ui-field-contain").length, "enhancements applied" ); + ok( $("#enhancetest").trigger("create").find(".ui-field-contain").length, "enhancements applied" ); }); })(jQuery); diff --git a/tests/unit/listview/listview_core.js b/tests/unit/listview/listview_core.js index 80150a49..bbf0c1f1 100644 --- a/tests/unit/listview/listview_core.js +++ b/tests/unit/listview/listview_core.js @@ -484,9 +484,9 @@ ]); }); - test( "Listview will create when inside a container that receives an 'enhance' event", function(){ + test( "Listview will create when inside a container that receives a 'create' event", function(){ ok( !$("#enhancetest").appendTo(".ui-page-active").find(".ui-listview").length, "did not have enhancements applied" ); - ok( $("#enhancetest").trigger("enhance").find(".ui-listview").length, "enhancements applied" ); + ok( $("#enhancetest").trigger("create").find(".ui-listview").length, "enhancements applied" ); }); diff --git a/tests/unit/select/select_events.js b/tests/unit/select/select_events.js index 30ba1d90..d9ca0775 100644 --- a/tests/unit/select/select_events.js +++ b/tests/unit/select/select_events.js @@ -48,9 +48,9 @@ same($("#select-choice-native-container div.ui-btn select").length, 1); }); - test( "select controls will create when inside a container that receives an 'enhance' event", function(){ + test( "select controls will create when inside a container that receives a 'create' event", function(){ ok( !$("#enhancetest").appendTo(".ui-page-active").find(".ui-select").length, "did not have enhancements applied" ); - ok( $("#enhancetest").trigger("enhance").find(".ui-select").length, "enhancements applied" ); + ok( $("#enhancetest").trigger("create").find(".ui-select").length, "enhancements applied" ); }); })(jQuery); diff --git a/tests/unit/slider/slider_events.js b/tests/unit/slider/slider_events.js index 6011631a..eb12b488 100644 --- a/tests/unit/slider/slider_events.js +++ b/tests/unit/slider/slider_events.js @@ -157,8 +157,8 @@ }); - test( "slider controls will create when inside a container that receives an 'enhance' event", function(){ + test( "slider controls will create when inside a container that receives a 'create' event", function(){ ok( !$("#enhancetest").appendTo(".ui-page-active").find(".ui-slider").length, "did not have enhancements applied" ); - ok( $("#enhancetest").trigger("enhance").find(".ui-slider").length, "enhancements applied" ); + ok( $("#enhancetest").trigger("create").find(".ui-slider").length, "enhancements applied" ); }); })(jQuery); \ No newline at end of file