]> source.dussan.org Git - jquery-ui.git/commitdiff
Spinner demos: Cleanup.
authorScott González <scott.gonzalez@gmail.com>
Sun, 7 Aug 2011 16:59:50 +0000 (12:59 -0400)
committerScott González <scott.gonzalez@gmail.com>
Sun, 7 Aug 2011 16:59:50 +0000 (12:59 -0400)
demos/spinner/currency.html
demos/spinner/decimal.html
demos/spinner/default.html
demos/spinner/index.html
demos/spinner/latlong.html
demos/spinner/overflow.html
demos/spinner/time.html

index a1768ff490e28b417ba7f3c55afd3201832783e4..18d479de8c1a62b55232b71dcb9bb338ec754e83 100644 (file)
@@ -1,35 +1,34 @@
-<!DOCTYPE html>
+<!doctype html>
 <html lang="en">
 <head>
        <meta charset="utf-8">
        <title>jQuery UI Spinner - Default functionality</title>
-       <link type="text/css" href="../../themes/base/jquery.ui.all.css" rel="stylesheet" />
-       <script type="text/javascript" src="../../jquery-1.6.2.js"></script>
-       <script type="text/javascript" src="../../external/jquery.mousewheel-3.0.4.js"></script>
-       <script type="text/javascript" src="../../external/jquery.global.js"></script>
-       <script type="text/javascript" src="../../external/jquery.global.de-DE.js"></script>
-       <script type="text/javascript" src="../../external/jquery.global.ja-JP.js"></script>
-       <script type="text/javascript" src="../../ui/jquery.ui.core.js"></script>
-       <script type="text/javascript" src="../../ui/jquery.ui.widget.js"></script>
-       <script type="text/javascript" src="../../ui/jquery.ui.button.js"></script>
-       <script type="text/javascript" src="../../ui/jquery.ui.spinner.js"></script>
-       <link type="text/css" href="../demos.css" rel="stylesheet" />
-       <script type="text/javascript">
+       <link rel="stylesheet" href="../../themes/base/jquery.ui.all.css">
+       <script src="../../jquery-1.6.2.js"></script>
+       <script src="../../external/jquery.mousewheel-3.0.4.js"></script>
+       <script src="../../external/jquery.global.js"></script>
+       <script src="../../external/jquery.global.de-DE.js"></script>
+       <script src="../../external/jquery.global.ja-JP.js"></script>
+       <script src="../../ui/jquery.ui.core.js"></script>
+       <script src="../../ui/jquery.ui.widget.js"></script>
+       <script src="../../ui/jquery.ui.button.js"></script>
+       <script src="../../ui/jquery.ui.spinner.js"></script>
+       <link rel="stylesheet" href="../demos.css">
+       <script>
        $(function() {
-               $("#currency").change(function() {
-                       var current = $("#spinner").spinner("value");
-                       $.global.preferCulture($(this).val());
-                       $("#spinner").spinner("value", current);
-               })
-               
-               $("#spinner").spinner({
+               $( "#currency" ).change(function() {
+                       var current = $( "#spinner" ).spinner( "value" );
+                       $.global.preferCulture( $(this).val() );
+                       $( "#spinner" ).spinner( "value", current );
+               });
+
+               $( "#spinner" ).spinner({
                        min: 5,
                        max: 2500,
                        step: 25,
                        start: 1000,
                        numberFormat: "C"
                });     
-               
        });
        </script>
 </head>
 </p>
 <p>
        <label for="spinner">Amount to donate:</label>
-       <input id="spinner" name="spinner" value="5" />
+       <input id="spinner" name="spinner" value="5">
 </p>
-</div>
+
+</div><!-- End demo -->
+
+
 
 <div class="demo-description">
-<p>
-       Example of a donation form, with currency selection and amout spinner.
-</p>
-</div>
+<p>Example of a donation form, with currency selection and amout spinner.</p>
+</div><!-- End demo-description -->
 
 </body>
 </html>
index 0444aa1042121ff23568eb42bdff9b9fb751739d..70e0e99fdb4b8824412ef0d462f9454daa495ee1 100644 (file)
@@ -1,40 +1,41 @@
-<!DOCTYPE html>
+<!doctype html>
 <html lang="en">
 <head>
        <meta charset="utf-8">
-       <title>jQuery UI Spinner - decimal</title>
-       <link type="text/css" href="../../themes/base/jquery.ui.all.css" rel="stylesheet" />
-       <script type="text/javascript" src="../../jquery-1.6.2.js"></script>
-       <script type="text/javascript" src="../../external/jquery.mousewheel-3.0.4.js"></script>
-       <script type="text/javascript" src="../../external/jquery.global.js"></script>
-       <script type="text/javascript" src="../../external/jquery.global.de-DE.js"></script>
-       <script type="text/javascript" src="../../external/jquery.global.ja-JP.js"></script>
-       <script type="text/javascript" src="../../ui/jquery.ui.core.js"></script>
-       <script type="text/javascript" src="../../ui/jquery.ui.widget.js"></script>
-       <script type="text/javascript" src="../../ui/jquery.ui.button.js"></script>
-       <script type="text/javascript" src="../../ui/jquery.ui.spinner.js"></script>
-       <link type="text/css" href="../demos.css" rel="stylesheet" />
-       <script type="text/javascript">
+       <title>jQuery UI Spinner - Decimal</title>
+       <link rel="stylesheet" href="../../themes/base/jquery.ui.all.css">
+       <script src="../../jquery-1.6.2.js"></script>
+       <script src="../../external/jquery.mousewheel-3.0.4.js"></script>
+       <script src="../../external/jquery.global.js"></script>
+       <script src="../../external/jquery.global.de-DE.js"></script>
+       <script src="../../external/jquery.global.ja-JP.js"></script>
+       <script src="../../ui/jquery.ui.core.js"></script>
+       <script src="../../ui/jquery.ui.widget.js"></script>
+       <script src="../../ui/jquery.ui.button.js"></script>
+       <script src="../../ui/jquery.ui.spinner.js"></script>
+       <link rel="stylesheet" href="../demos.css">
+       <script>
        $(function() {
-               $("#spinner").spinner({
+               $( "#spinner" ).spinner({
                        step: 0.01,
                        numberFormat: "n"
                });     
-               
-               $("#culture").change(function() {
-                       var current = $("#spinner").spinner("value");
-                       $.global.preferCulture($(this).val());
-                       $("#spinner").spinner("value", current);
-               })
+
+               $( "#culture" ).change(function() {
+                       var current = $( "#spinner" ).spinner( "value" );
+                       $.global.preferCulture( $(this).val() );
+                       $( "#spinner" ).spinner( "value", current );
+               });
        });
        </script>
 </head>
 <body>
 
 <div class="demo">
+
 <p>
        <label for="spinner">Decimal spinner:</label>
-       <input id="spinner" name="spinner" value="5.06" />
+       <input id="spinner" name="spinner" value="5.06">
 </p>
 <p>
        <label for="culture">Select a culture to use for formatting:</label>
                <option value="ja-JP">Japanese</option>
        </select>
 </p>
-</div>
+
+</div><!-- End demo -->
+
+
 
 <div class="demo-description">
 <p>
        Example of a decimal spinner. Step is set to 0.01.
-       <br/>The code handling the culture change reads the current spinner value,
+       <br>The code handling the culture change reads the current spinner value,
        then changes the culture, then sets the value again, resulting in an updated
        formatting, based on the new culture.
 </p>
-</div>
+</div><!-- End demo-description -->
 
 </body>
 </html>
index 53fd81bf5cb1295fa2c52803feb7f79ea8b1bc44..c78c36d68318fc8d5a57952c12e00f84d289debe 100644 (file)
@@ -1,43 +1,38 @@
-<!DOCTYPE html>
+<!doctype html>
 <html lang="en">
 <head>
        <meta charset="utf-8">
        <title>jQuery UI Spinner - Default functionality</title>
-       <link type="text/css" href="../../themes/base/jquery.ui.all.css" rel="stylesheet" />
-       <script type="text/javascript" src="../../jquery-1.6.2.js"></script>
-       <script type="text/javascript" src="../../external/jquery.mousewheel-3.0.4.js"></script>
-       <script type="text/javascript" src="../../external/jquery.global.js"></script>
-       <script type="text/javascript" src="../../ui/jquery.ui.core.js"></script>
-       <script type="text/javascript" src="../../ui/jquery.ui.widget.js"></script>
-       <script type="text/javascript" src="../../ui/jquery.ui.button.js"></script>
-       <script type="text/javascript" src="../../ui/jquery.ui.spinner.js"></script>
-       <link type="text/css" href="../demos.css" rel="stylesheet" />
-       <script type="text/javascript">
+       <link rel="stylesheet" href="../../themes/base/jquery.ui.all.css">
+       <script src="../../jquery-1.6.2.js"></script>
+       <script src="../../external/jquery.mousewheel-3.0.4.js"></script>
+       <script src="../../ui/jquery.ui.core.js"></script>
+       <script src="../../ui/jquery.ui.widget.js"></script>
+       <script src="../../ui/jquery.ui.button.js"></script>
+       <script src="../../ui/jquery.ui.spinner.js"></script>
+       <link rel="stylesheet" href="../demos.css">
+       <script>
        $(function() {
-               $("#spinner").spinner({
-                       change: function() {
-                               console.log( "change" );
-                       }
-               });
+               var spinner = $( "#spinner" ).spinner();
                
-               $("#disable").toggle(function() {
-                       $("#spinner").spinner("disable");
+               $( "#disable" ).toggle(function() {
+                       spinner.spinner( "disable" );
                }, function() {
-                       $("#spinner").spinner("enable");
+                       spinner.spinner( "enable" );
                });
-               $("#destroy").toggle(function() {
-                       $("#spinner").spinner("destroy");
+               $( "#destroy" ).toggle(function() {
+                       spinner.spinner( "destroy" );
                }, function() {
-                       $("#spinner").spinner();
+                       spinner.spinner();
                });
-               $("#getvalue").click(function() {
-                       alert($("#spinner").spinner("value"));
+               $( "#getvalue" ).click(function() {
+                       alert( spinner.spinner( "value" ) );
                });
-               $("#setvalue").click(function() {
-                       $("#spinner").spinner("value", 5);
+               $( "#setvalue" ).click(function() {
+                       spinner.spinner( "value", 5 );
                });
-               
-               $("button").button();
+
+               $( "button" ).button();
        });
        </script>
 </head>
 
 <div class="demo">
 
-<p><label for="spinner">Select a value:</label>
-<input id="spinner" name="value" /></p>
+<p>
+       <label for="spinner">Select a value:</label>
+       <input id="spinner" name="value">
+</p>
 
 <p>
-<button id="disable">Toggle disable/enable</button>
-<button id="destroy">Toggle widget</button>
+       <button id="disable">Toggle disable/enable</button>
+       <button id="destroy">Toggle widget</button>
 </p>
 
 <p>
-<button id="getvalue">Get value</button>
-<button id="setvalue">Set value to 5</button>
+       <button id="getvalue">Get value</button>
+       <button id="setvalue">Set value to 5</button>
 </p>
 
 </div><!-- End demo -->
 
+
+
 <div class="demo-description">
-<p>
-Default spinner.
-</p>
+<p>Default spinner.</p>
 </div><!-- End demo-description -->
 
 </body>
index 2bbb796f08b711cdcd1b3e70b3a5c759a6b89086..594fd9399379785052180df6af289e9c199fc32f 100644 (file)
@@ -1,20 +1,23 @@
-<!DOCTYPE html>
+<!doctype html>
 <html lang="en">
 <head>
+       <meta charset="utf-8">
        <title>jQuery UI Spinner Demos</title>
-       <link type="text/css" href="../demos.css" rel="stylesheet" />
+       <link rel="stylesheet" href="../demos.css">
 </head>
 <body>
-       <div class="demos-nav">
-               <h4>Examples</h4>
-               <ul>
-                       <li class="demo-config-on"><a href="default.html">Default functionality</a></li>
-                       <li><a href="decimal.html">Decimal</a></li>
-                       <li><a href="currency.html">Currency</a></li>
-                       <li><a href="latlong.html">Map</a></li>
-                       <li><a href="time.html">Time</a></li>
-                       <li><a href="overflow.html">Overflow</a></li>
-               </ul>
-       </div>
+
+<div class="demos-nav">
+       <h4>Examples</h4>
+       <ul>
+               <li class="demo-config-on"><a href="default.html">Default functionality</a></li>
+               <li><a href="decimal.html">Decimal</a></li>
+               <li><a href="currency.html">Currency</a></li>
+               <li><a href="latlong.html">Map</a></li>
+               <li><a href="time.html">Time</a></li>
+               <li><a href="overflow.html">Overflow</a></li>
+       </ul>
+</div>
+
 </body>
 </html>
index 954f839966ef36b0c7d1173e95dec7ae26d35fac..d1dc612b4cbcca517f977307fb5d2e6cbd1035b3 100644 (file)
@@ -1,31 +1,31 @@
-<!DOCTYPE html>
+<!doctype html>
 <html lang="en">
 <head>
        <meta charset="utf-8">
        <title>jQuery UI Spinner - Map</title>
-       <link type="text/css" href="../../themes/base/jquery.ui.all.css" rel="stylesheet" />
-       <script type="text/javascript" src="http://maps.google.com/maps/api/js?sensor=false"></script>
-       <script type="text/javascript" src="../../jquery-1.6.2.js"></script>
-       <script type="text/javascript" src="../../external/jquery.mousewheel-3.0.4.js"></script>
-       <script type="text/javascript" src="../../ui/jquery.ui.core.js"></script>
-       <script type="text/javascript" src="../../ui/jquery.ui.widget.js"></script>
-       <script type="text/javascript" src="../../ui/jquery.ui.button.js"></script>
-       <script type="text/javascript" src="../../ui/jquery.ui.spinner.js"></script>
-       <link type="text/css" href="../demos.css" rel="stylesheet" />
-       <script type="text/javascript">
+       <link rel="stylesheet" href="../../themes/base/jquery.ui.all.css">
+       <script src="http://maps.google.com/maps/api/js?sensor=false"></script>
+       <script src="../../jquery-1.6.2.js"></script>
+       <script src="../../external/jquery.mousewheel-3.0.4.js"></script>
+       <script src="../../ui/jquery.ui.core.js"></script>
+       <script src="../../ui/jquery.ui.widget.js"></script>
+       <script src="../../ui/jquery.ui.button.js"></script>
+       <script src="../../ui/jquery.ui.spinner.js"></script>
+       <link rel="stylesheet" href="../demos.css">
+       <script>
        $(function() {
                function latlong() {
-                       return new google.maps.LatLng($("#lat").val(),$("#lng").val());
+                       return new google.maps.LatLng( $("#lat").val(), $("#lng").val() );
                }
                function position() {
-                       map.setCenter(latlong());
+                       map.setCenter( latlong() );
                }
-               $("#lat, #lng").spinner({
+               $( "#lat, #lng" ).spinner({
                        precision: 6,
                        change: position
                });
-               
-               var map = new google.maps.Map($("#map")[0], {
+
+               var map = new google.maps.Map( $("#map")[0], {
                        zoom: 8,
                        center: latlong(),
                        mapTypeId: google.maps.MapTypeId.ROADMAP
        });
        </script>
        <style>
-               #map { width:500px; height:500px; }
+       #map {
+               width:500px;
+               height:500px;
+       }
        </style>
 </head>
 <body>
 <div class="demo">
 
 <label for="lat">Latitude</label>
-<input id="lat" name="lat" value="44.797916" />
-<br/>
+<input id="lat" name="lat" value="44.797916">
+<br>
 <label for="lng">Longitude</label>
-<input id="lng" name="lng" value="-93.278046" />
+<input id="lng" name="lng" value="-93.278046">
 
 <div id="map"></div>
 
 </div><!-- End demo -->
 
+
+
 <div class="demo-description">
-<p>
-Google Maps integration, using spinners to change latidude and longitude.
-</p>
+<p>Google Maps integration, using spinners to change latidude and longitude.</p>
 </div><!-- End demo-description -->
 
 </body>
index 45b8f9573b64b8800b0f05eda6f9427f158f036a..d55a48b01032073d1097bae18f252079a146f5b5 100644 (file)
@@ -1,25 +1,25 @@
-<!DOCTYPE html>
+<!doctype html>
 <html lang="en">
 <head>
        <meta charset="utf-8">
-       <title>jQuery UI Spinner - Default functionality</title>
-       <link type="text/css" href="../../themes/base/jquery.ui.all.css" rel="stylesheet" />
-       <script type="text/javascript" src="../../jquery-1.6.2.js"></script>
-       <script type="text/javascript" src="../../external/jquery.mousewheel-3.0.4.js"></script>
-       <script type="text/javascript" src="../../ui/jquery.ui.core.js"></script>
-       <script type="text/javascript" src="../../ui/jquery.ui.widget.js"></script>
-       <script type="text/javascript" src="../../ui/jquery.ui.button.js"></script>
-       <script type="text/javascript" src="../../ui/jquery.ui.spinner.js"></script>
-       <link type="text/css" href="../demos.css" rel="stylesheet" />
-       <script type="text/javascript">
+       <title>jQuery UI Spinner - Overflow</title>
+       <link rel="stylesheet" href="../../themes/base/jquery.ui.all.css">
+       <script src="../../jquery-1.6.2.js"></script>
+       <script src="../../external/jquery.mousewheel-3.0.4.js"></script>
+       <script src="../../ui/jquery.ui.core.js"></script>
+       <script src="../../ui/jquery.ui.widget.js"></script>
+       <script src="../../ui/jquery.ui.button.js"></script>
+       <script src="../../ui/jquery.ui.spinner.js"></script>
+       <link rel="stylesheet" href="../demos.css">
+       <script>
        $(function() {
-               $("#spinner").spinner({
-                       spin: function(event, ui) {
-                               if (ui.value > 10) {
-                                       $(this).spinner("value", -10);
+               $( "#spinner" ).spinner({
+                       spin: function( event, ui ) {
+                               if ( ui.value > 10 ) {
+                                       $( this ).spinner( "value", -10 );
                                        return false;
-                               } else if (ui.value < -10) {
-                                       $(this).spinner("value", 10);
+                               } else if ( ui.value < -10 ) {
+                                       $( this ).spinner( "value", 10 );
                                        return false;
                                }
                        }
 <body>
 
 <div class="demo">
-       <p>
-               <label for="spinner">Select a value:</label>
-               <input id="spinner" name="value" />
-       </p>
-</div>
+
+<p>
+       <label for="spinner">Select a value:</label>
+       <input id="spinner" name="value" />
+</p>
+
+</div><!-- End demo -->
+
+
 
 <div class="demo-description">
-       <p>
-               Overflowing spinner restricted to a range of -10 to 10.
-               For anything above 10, it'll overflow to -10, and the other way round.
-       </p>
-</div>
+<p>
+Overflowing spinner restricted to a range of -10 to 10.
+For anything above 10, it'll overflow to -10, and the other way round.
+</p>
+</div><!-- End demo-description -->
 
 </body>
 </html>
index 3ae06da466c5ff011748b97a24c385661aa1c958..5a3c3767ea75eadb14542a13311402e6a515030b 100644 (file)
@@ -1,44 +1,46 @@
-<!DOCTYPE html>
+<!doctype html>
 <html lang="en">
 <head>
        <meta charset="utf-8">
-       <title>jQuery UI Spinner - decimal</title>
-       <link type="text/css" href="../../themes/base/jquery.ui.all.css" rel="stylesheet" />
-       <script type="text/javascript" src="../../jquery-1.6.2.js"></script>
-       <script type="text/javascript" src="../../external/jquery.mousewheel-3.0.4.js"></script>
-       <script type="text/javascript" src="../../external/jquery.global.js"></script>
-       <script type="text/javascript" src="../../external/jquery.global.de-DE.js"></script>
-       <script type="text/javascript" src="../../ui/jquery.ui.core.js"></script>
-       <script type="text/javascript" src="../../ui/jquery.ui.widget.js"></script>
-       <script type="text/javascript" src="../../ui/jquery.ui.button.js"></script>
-       <script type="text/javascript" src="../../ui/jquery.ui.spinner.js"></script>
-       <link type="text/css" href="../demos.css" rel="stylesheet" />
-       <script type="text/javascript">
-       $.widget("ui.timespinner", $.ui.spinner, {
+       <title>jQuery UI Spinner - Time</title>
+       <link rel="stylesheet" href="../../themes/base/jquery.ui.all.css">
+       <script src="../../jquery-1.6.2.js"></script>
+       <script src="../../external/jquery.mousewheel-3.0.4.js"></script>
+       <script src="../../external/jquery.global.js"></script>
+       <script src="../../external/jquery.global.de-DE.js"></script>
+       <script src="../../ui/jquery.ui.core.js"></script>
+       <script src="../../ui/jquery.ui.widget.js"></script>
+       <script src="../../ui/jquery.ui.button.js"></script>
+       <script src="../../ui/jquery.ui.spinner.js"></script>
+       <link rel="stylesheet" href="../demos.css">
+       <script>
+       $.widget( "ui.timespinner", $.ui.spinner, {
                options: {
                        // seconds
                        step: 60 * 1000,
                        // hours
                        page: 60
                },
-               
-               _parse: function(value) {
-                       if (typeof value == 'string') {
-                               return +$.global.parseDate(value)
+
+               _parse: function( value ) {
+                       if ( typeof value === "string" ) {
+                               return +$.global.parseDate( value );
                        }
                        return value;
                },
+
                _format: function() {
-                       this.element.val( $.global.format(new Date(this.options.value), "t") );
+                       this.element.val( $.global.format( new Date(this.options.value), "t" ) );
                }
-       })
+       });
+
        $(function() {
-               $("#spinner").timespinner();
-               
-               $("#culture").change(function() {
-                       var current = $("#spinner").timespinner("value");
-                       $.global.preferCulture($(this).val());
-                       $("#spinner").timespinner("value", current);
+               $( "#spinner" ).timespinner();
+
+               $( "#culture" ).change(function() {
+                       var current = $( "#spinner" ).timespinner( "value" );
+                       $.global.preferCulture( $(this).val() );
+                       $( "#spinner" ).timespinner( "value", current );
                });
        });
        </script>
@@ -48,7 +50,7 @@
 <div class="demo">
 <p>
        <label for="spinner">Time spinner:</label>
-       <input id="spinner" name="spinner" value="08:30 PM" />
+       <input id="spinner" name="spinner" value="08:30 PM">
 </p>
 <p>
        <label for="culture">Select a culture to use for formatting:</label>
@@ -57,7 +59,9 @@
                <option value="de-DE">German</option>
        </select>
 </p>
-</div>
+</div><!-- End demo -->
+
+
 
 <div class="demo-description">
 <p>
@@ -65,7 +69,7 @@
        a timestamp, with custom step and page options. Cursor up/down spins minutes, page up/down
        spins hours.
 </p>
-</div>
+</div><!-- End demo-description -->
 
 </body>
 </html>