aboutsummaryrefslogtreecommitdiffstats
path: root/demos/slider/colorpicker.html
diff options
context:
space:
mode:
authorAlexander Schmitz <arschmitz@gmail.com>2015-06-30 22:58:43 -0400
committerAlexander Schmitz <arschmitz@gmail.com>2015-07-21 11:00:42 -0400
commit78364a2428d56c4867a65c9715f33bbde7459e18 (patch)
tree117d7c5f6a14b81ff60277251335a99126737737 /demos/slider/colorpicker.html
parent0e8d871a264139d5156d924f0925033c483f0c1e (diff)
downloadjquery-ui-78364a2428d56c4867a65c9715f33bbde7459e18.tar.gz
jquery-ui-78364a2428d56c4867a65c9715f33bbde7459e18.zip
Slider: Update demos to use AMD
Ref #10119
Diffstat (limited to 'demos/slider/colorpicker.html')
-rw-r--r--demos/slider/colorpicker.html51
1 files changed, 23 insertions, 28 deletions
diff --git a/demos/slider/colorpicker.html b/demos/slider/colorpicker.html
index 6f438a2e5..32ea4f89e 100644
--- a/demos/slider/colorpicker.html
+++ b/demos/slider/colorpicker.html
@@ -4,11 +4,6 @@
<meta charset="utf-8">
<title>jQuery UI Slider - Colorpicker</title>
<link rel="stylesheet" href="../../themes/base/all.css">
- <script src="../../external/jquery/jquery.js"></script>
- <script src="../../ui/core.js"></script>
- <script src="../../ui/widget.js"></script>
- <script src="../../ui/mouse.js"></script>
- <script src="../../ui/slider.js"></script>
<link rel="stylesheet" href="../demos.css">
<style>
#red, #green, #blue {
@@ -31,28 +26,29 @@
#blue .ui-slider-range { background: #729fcf; }
#blue .ui-slider-handle { border-color: #729fcf; }
</style>
- <script>
- function hexFromRGB(r, g, b) {
- var hex = [
- r.toString( 16 ),
- g.toString( 16 ),
- b.toString( 16 )
- ];
- $.each( hex, function( nr, val ) {
- if ( val.length === 1 ) {
- hex[ nr ] = "0" + val;
- }
- });
- return hex.join( "" ).toUpperCase();
- }
- function refreshSwatch() {
- var red = $( "#red" ).slider( "value" ),
- green = $( "#green" ).slider( "value" ),
- blue = $( "#blue" ).slider( "value" ),
- hex = hexFromRGB( red, green, blue );
- $( "#swatch" ).css( "background-color", "#" + hex );
- }
- $(function() {
+ <script src="../../external/requirejs/require.js"></script>
+ <script src="../bootstrap.js">
+ function hexFromRGB(r, g, b) {
+ var hex = [
+ r.toString( 16 ),
+ g.toString( 16 ),
+ b.toString( 16 )
+ ];
+ $.each( hex, function( nr, val ) {
+ if ( val.length === 1 ) {
+ hex[ nr ] = "0" + val;
+ }
+ });
+ return hex.join( "" ).toUpperCase();
+ }
+ function refreshSwatch() {
+ var red = $( "#red" ).slider( "value" ),
+ green = $( "#green" ).slider( "value" ),
+ blue = $( "#blue" ).slider( "value" ),
+ hex = hexFromRGB( red, green, blue );
+ $( "#swatch" ).css( "background-color", "#" + hex );
+ }
+
$( "#red, #green, #blue" ).slider({
orientation: "horizontal",
range: "min",
@@ -64,7 +60,6 @@
$( "#red" ).slider( "value", 255 );
$( "#green" ).slider( "value", 140 );
$( "#blue" ).slider( "value", 60 );
- });
</script>
</head>
<body class="ui-widget-content" style="border:0;">