Skip to content
Permalink
Browse files

Spinner: Update demos to use AMD

Ref #10119
  • Loading branch information...
arschmitz committed Jul 1, 2015
1 parent 1932842 commit ebb8bbf16884cead816830711739181e27ff18de
@@ -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>
@@ -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>
@@ -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>
@@ -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 {
@@ -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>
@@ -4,49 +4,40 @@
<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() {
var current = $( "#spinner" ).timespinner( "value" );
Globalize.culture( $(this).val() );
$( "#spinner" ).timespinner( "value", current );
});
});
</script>
</head>
<body>

0 comments on commit ebb8bbf

Please sign in to comment.
You can’t perform that action at this time.