]> source.dussan.org Git - jquery-ui.git/commitdiff
Spinner: Update demos to use AMD
authorAlexander Schmitz <arschmitz@gmail.com>
Wed, 1 Jul 2015 03:34:08 +0000 (23:34 -0400)
committerAlexander Schmitz <arschmitz@gmail.com>
Tue, 21 Jul 2015 15:00:42 +0000 (11:00 -0400)
Ref #10119

demos/spinner/currency.html
demos/spinner/decimal.html
demos/spinner/default.html
demos/spinner/latlong.html
demos/spinner/overflow.html
demos/spinner/time.html

index 0509e80a084785ddbc5f32c02970ba7717c04371..c19a1b8167988d8329ab42cfd9818db0ae2db743 100644 (file)
@@ -4,18 +4,9 @@
        <meta charset="utf-8">
        <title>jQuery UI Spinner - Currency</title>
        <link rel="stylesheet" href="../../themes/base/all.css">
-       <script src="../../external/jquery/jquery.js"></script>
-       <script src="../../external/jquery-mousewheel/jquery.mousewheel.js"></script>
-       <script src="../../external/globalize/globalize.js"></script>
-       <script src="../../external/globalize/globalize.culture.de-DE.js"></script>
-       <script src="../../external/globalize/globalize.culture.ja-JP.js"></script>
-       <script src="../../ui/core.js"></script>
-       <script src="../../ui/widget.js"></script>
-       <script src="../../ui/button.js"></script>
-       <script src="../../ui/spinner.js"></script>
        <link rel="stylesheet" href="../demos.css">
-       <script>
-       $(function() {
+       <script src="../../external/requirejs/require.js"></script>
+       <script src="../bootstrap.js" data-modules="external/globalize/globalize external/globalize/globalize.culture.de-DE external/globalize/globalize.culture.ja-JP external/jquery-mousewheel/jquery.mousewheel">
                $( "#currency" ).on( "change", function() {
                        $( "#spinner" ).spinner( "option", "culture", $( this ).val() );
                });
@@ -27,7 +18,6 @@
                        start: 1000,
                        numberFormat: "C"
                });
-       });
        </script>
 </head>
 <body>
index 6c3df9439fda2660f8a1de7464e1c063dd9e8059..680d7b3d37f6191dccd50663dce3edd2fd9daf84 100644 (file)
@@ -4,18 +4,9 @@
        <meta charset="utf-8">
        <title>jQuery UI Spinner - Decimal</title>
        <link rel="stylesheet" href="../../themes/base/all.css">
-       <script src="../../external/jquery/jquery.js"></script>
-       <script src="../../external/jquery-mousewheel/jquery.mousewheel.js"></script>
-       <script src="../../external/globalize/globalize.js"></script>
-       <script src="../../external/globalize/globalize.culture.de-DE.js"></script>
-       <script src="../../external/globalize/globalize.culture.ja-JP.js"></script>
-       <script src="../../ui/core.js"></script>
-       <script src="../../ui/widget.js"></script>
-       <script src="../../ui/button.js"></script>
-       <script src="../../ui/spinner.js"></script>
        <link rel="stylesheet" href="../demos.css">
-       <script>
-       $(function() {
+       <script src="../../external/requirejs/require.js"></script>
+       <script src="../bootstrap.js" data-modules="external/globalize/globalize external/globalize/globalize.culture.de-DE external/globalize/globalize.culture.ja-JP external/jquery-mousewheel/jquery.mousewheel">
                $( "#spinner" ).spinner({
                        step: 0.01,
                        numberFormat: "n"
@@ -26,7 +17,6 @@
                        Globalize.culture( $(this).val() );
                        $( "#spinner" ).spinner( "value", current );
                });
-       });
        </script>
 </head>
 <body>
index 328d4d13c4a31730ac9b16a50be48752578ddadd..3d08a60bbd0ab8fdbce3c39e8f7b310dae1084dd 100644 (file)
@@ -4,15 +4,9 @@
        <meta charset="utf-8">
        <title>jQuery UI Spinner - Default functionality</title>
        <link rel="stylesheet" href="../../themes/base/all.css">
-       <script src="../../external/jquery/jquery.js"></script>
-       <script src="../../external/jquery-mousewheel/jquery.mousewheel.js"></script>
-       <script src="../../ui/core.js"></script>
-       <script src="../../ui/widget.js"></script>
-       <script src="../../ui/button.js"></script>
-       <script src="../../ui/spinner.js"></script>
        <link rel="stylesheet" href="../demos.css">
-       <script>
-       $(function() {
+       <script src="../../external/requirejs/require.js"></script>
+       <script src="../bootstrap.js" data-modules="external/jquery-mousewheel/jquery.mousewheel">
                var spinner = $( "#spinner" ).spinner();
 
                $( "#disable" ).on( "click", function() {
@@ -37,7 +31,6 @@
                });
 
                $( "button" ).button();
-       });
        </script>
 </head>
 <body>
index 2921cc076c5029e13a4b66617eb9dd7eb69f559d..9c67de0f9d407212895f484e7e7d98f37410e6d7 100644 (file)
@@ -4,16 +4,10 @@
        <meta charset="utf-8">
        <title>jQuery UI Spinner - Map</title>
        <link rel="stylesheet" href="../../themes/base/all.css">
-       <script src="http://maps.google.com/maps/api/js?sensor=false"></script>
-       <script src="../../external/jquery/jquery.js"></script>
-       <script src="../../external/jquery-mousewheel/jquery.mousewheel.js"></script>
-       <script src="../../ui/core.js"></script>
-       <script src="../../ui/widget.js"></script>
-       <script src="../../ui/button.js"></script>
-       <script src="../../ui/spinner.js"></script>
        <link rel="stylesheet" href="../demos.css">
-       <script>
-       $(function() {
+       <script src="http://maps.google.com/maps/api/js?sensor=false"></script>
+       <script src="../../external/requirejs/require.js"></script>
+       <script src="../bootstrap.js" data-modules="external/jquery-mousewheel/jquery.mousewheel">
                function latlong() {
                        return new google.maps.LatLng( $("#lat").val(), $("#lng").val() );
                }
@@ -31,7 +25,6 @@
                        center: latlong(),
                        mapTypeId: google.maps.MapTypeId.ROADMAP
                });
-       });
        </script>
        <style>
        #map {
index 0b4985d29de99b522296a0b2321e8622af29c3d1..80e3981fc7a08db3f5b59dc3048f0f8ed82ad877 100644 (file)
@@ -4,15 +4,9 @@
        <meta charset="utf-8">
        <title>jQuery UI Spinner - Overflow</title>
        <link rel="stylesheet" href="../../themes/base/all.css">
-       <script src="../../external/jquery/jquery.js"></script>
-       <script src="../../external/jquery-mousewheel/jquery.mousewheel.js"></script>
-       <script src="../../ui/core.js"></script>
-       <script src="../../ui/widget.js"></script>
-       <script src="../../ui/button.js"></script>
-       <script src="../../ui/spinner.js"></script>
        <link rel="stylesheet" href="../demos.css">
-       <script>
-       $(function() {
+       <script src="../../external/requirejs/require.js"></script>
+       <script src="../bootstrap.js" data-modules="external/jquery-mousewheel/jquery.mousewheel">
                $( "#spinner" ).spinner({
                        spin: function( event, ui ) {
                                if ( ui.value > 10 ) {
@@ -24,7 +18,6 @@
                                }
                        }
                });
-       });
        </script>
 </head>
 <body>
index 229b0e6b4bb916a3da09f5c3317a2cd207f0e5f0..ff27b1b750d10bbbbcc77e3e1cb352612023af6d 100644 (file)
@@ -4,41 +4,33 @@
        <meta charset="utf-8">
        <title>jQuery UI Spinner - Time</title>
        <link rel="stylesheet" href="../../themes/base/all.css">
-       <script src="../../external/jquery/jquery.js"></script>
-       <script src="../../external/jquery-mousewheel/jquery.mousewheel.js"></script>
-       <script src="../../external/globalize/globalize.js"></script>
-       <script src="../../external/globalize/globalize.culture.de-DE.js"></script>
-       <script src="../../ui/core.js"></script>
-       <script src="../../ui/widget.js"></script>
-       <script src="../../ui/button.js"></script>
-       <script src="../../ui/spinner.js"></script>
        <link rel="stylesheet" href="../demos.css">
-       <script>
-       $.widget( "ui.timespinner", $.ui.spinner, {
-               options: {
-                       // seconds
-                       step: 60 * 1000,
-                       // hours
-                       page: 60
-               },
+       <script src="../../external/requirejs/require.js"></script>
+       <script src="../bootstrap.js" data-modules="external/globalize/globalize external/globalize/globalize.culture.de-DE external/jquery-mousewheel/jquery.mousewheel">
+               $.widget( "ui.timespinner", $.ui.spinner, {
+                       options: {
+                               // seconds
+                               step: 60 * 1000,
+                               // hours
+                               page: 60
+                       },
 
-               _parse: function( value ) {
-                       if ( typeof value === "string" ) {
-                               // already a timestamp
-                               if ( Number( value ) == value ) {
-                                       return Number( value );
+                       _parse: function( value ) {
+                               if ( typeof value === "string" ) {
+                                       // already a timestamp
+                                       if ( Number( value ) == value ) {
+                                               return Number( value );
+                                       }
+                                       return +Globalize.parseDate( value );
                                }
-                               return +Globalize.parseDate( value );
-                       }
-                       return value;
-               },
+                               return value;
+                       },
 
-               _format: function( value ) {
-                       return Globalize.format( new Date(value), "t" );
-               }
-       });
+                       _format: function( value ) {
+                               return Globalize.format( new Date(value), "t" );
+                       }
+               });
 
-       $(function() {
                $( "#spinner" ).timespinner();
 
                $( "#culture" ).on( "change", function() {
@@ -46,7 +38,6 @@
                        Globalize.culture( $(this).val() );
                        $( "#spinner" ).timespinner( "value", current );
                });
-       });
        </script>
 </head>
 <body>