]> source.dussan.org Git - jquery-ui.git/commitdiff
Draggable: Update to demos to use AMD
authorAlexander Schmitz <arschmitz@gmail.com>
Tue, 30 Jun 2015 21:12:39 +0000 (17:12 -0400)
committerAlexander Schmitz <arschmitz@gmail.com>
Tue, 21 Jul 2015 15:00:41 +0000 (11:00 -0400)
Ref #10119

demos/draggable/constrain-movement.html
demos/draggable/cursor-style.html
demos/draggable/default.html
demos/draggable/events.html
demos/draggable/handle.html
demos/draggable/revert.html
demos/draggable/scroll.html
demos/draggable/snap-to.html
demos/draggable/sortable.html
demos/draggable/visual-feedback.html

index cca74be210e81b59a3b4dc13e7139ec7f18453fa..adb2f745fcfa2acf32e9b9024ff585b2a84ed2bf 100644 (file)
@@ -4,11 +4,6 @@
        <meta charset="utf-8">
        <title>jQuery UI Draggable - Constrain movement</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/draggable.js"></script>
        <link rel="stylesheet" href="../demos.css">
        <style>
        .draggable { width: 90px; height: 90px; padding: 0.5em; float: left; margin: 0 10px 10px 0; }
        #containment-wrapper { width: 95%; height:150px; border:2px solid #ccc; padding: 10px; }
        h3 { clear: left; }
        </style>
-       <script>
-       $(function() {
+       <script src="../../external/requirejs/require.js"></script>
+       <script src="../bootstrap.js">
                $( "#draggable" ).draggable({ axis: "y" });
                $( "#draggable2" ).draggable({ axis: "x" });
 
                $( "#draggable3" ).draggable({ containment: "#containment-wrapper", scroll: false });
                $( "#draggable5" ).draggable({ containment: "parent" });
-       });
        </script>
 </head>
 <body>
index 7f3b0fda4471321810a755bf28801c8accb0ab5f..56dd4bb3a7416e4800b96bbe6dad0ee060932f85 100644 (file)
@@ -4,21 +4,15 @@
        <meta charset="utf-8">
        <title>jQuery UI Draggable - Cursor style</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/draggable.js"></script>
        <link rel="stylesheet" href="../demos.css">
        <style>
        #draggable, #draggable2, #draggable3 { width: 100px; height: 100px; padding: 0.5em; float: left; margin: 0 10px 10px 0; }
        </style>
-       <script>
-       $(function() {
+       <script src="../../external/requirejs/require.js"></script>
+       <script src="../bootstrap.js">
                $( "#draggable" ).draggable({ cursor: "move", cursorAt: { top: 56, left: 56 } });
                $( "#draggable2" ).draggable({ cursor: "crosshair", cursorAt: { top: -5, left: -5 } });
                $( "#draggable3" ).draggable({ cursorAt: { bottom: 0 } });
-       });
        </script>
 </head>
 <body>
index df6bf9da9d9a5f762eea7263119984346c370460..d164139afa73bd7413632ef35fca35e58595a905 100644 (file)
@@ -4,19 +4,13 @@
        <meta charset="utf-8">
        <title>jQuery UI Draggable - Default functionality</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/draggable.js"></script>
        <link rel="stylesheet" href="../demos.css">
        <style>
        #draggable { width: 150px; height: 150px; padding: 0.5em; }
        </style>
-       <script>
-       $(function() {
+       <script src="../../external/requirejs/require.js"></script>
+       <script src="../bootstrap.js">
                $( "#draggable" ).draggable();
-       });
        </script>
 </head>
 <body>
index ad8a98aafa899972ea158c5fe2292de3544bef64..5496a9486f46ccd4b14fa78faf1ec21e5e333149 100644 (file)
@@ -4,11 +4,6 @@
        <meta charset="utf-8">
        <title>jQuery UI Draggable - Events</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/draggable.js"></script>
        <link rel="stylesheet" href="../demos.css">
        <style>
        #draggable { width: 16em; padding: 0 1em; }
@@ -16,8 +11,8 @@
        #draggable ul li span.ui-icon { float: left; }
        #draggable ul li span.count { font-weight: bold; }
        </style>
-       <script>
-       $(function() {
+       <script src="../../external/requirejs/require.js"></script>
+       <script src="../bootstrap.js">
                var $start_counter = $( "#event-start" ),
                        $drag_counter = $( "#event-drag" ),
                        $stop_counter = $( "#event-stop" ),
@@ -47,7 +42,6 @@
                        // ...then update the numbers
                        $( "span.count", $event_counter ).text( new_count );
                }
-       });
        </script>
 </head>
 <body>
index 2e7fd229534cfbe801d459778c76cb1dae87ea1e..ae8983b8553e7988e1a8eaf093fb9e02d6caafc7 100644 (file)
@@ -4,22 +4,16 @@
        <meta charset="utf-8">
        <title>jQuery UI Draggable - Handles</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/draggable.js"></script>
        <link rel="stylesheet" href="../demos.css">
        <style>
        #draggable, #draggable2 { width: 100px; height: 100px; padding: 0.5em; float: left; margin: 0 10px 10px 0; }
        #draggable p { cursor: move; }
        </style>
-       <script>
-       $(function() {
+       <script src="../../external/requirejs/require.js"></script>
+       <script src="../bootstrap.js">
                $( "#draggable" ).draggable({ handle: "p" });
                $( "#draggable2" ).draggable({ cancel: "p.ui-widget-header" });
                $( "div, p" ).disableSelection();
-       });
        </script>
 </head>
 <body>
index 4371b7f2be2b8f2f2469aede93dde744e6f925c3..5720dbe8818c2dcb80d44c846704e02822692288 100644 (file)
@@ -4,20 +4,14 @@
        <meta charset="utf-8">
        <title>jQuery UI Draggable - Revert position</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/draggable.js"></script>
        <link rel="stylesheet" href="../demos.css">
        <style>
        #draggable, #draggable2 { width: 100px; height: 100px; padding: 0.5em; float: left; margin: 0 10px 10px 0; }
        </style>
-       <script>
-       $(function() {
+       <script src="../../external/requirejs/require.js"></script>
+       <script src="../bootstrap.js">
                $( "#draggable" ).draggable({ revert: true });
                $( "#draggable2" ).draggable({ revert: true, helper: "clone" });
-       });
        </script>
 </head>
 <body>
index d3e97f3267da38aa93744aabb829f8d6b2b98e16..2704842bc819ef64b5498044fcc4e2d1c9774ddf 100644 (file)
@@ -4,21 +4,15 @@
        <meta charset="utf-8">
        <title>jQuery UI Draggable - Auto-scroll</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/draggable.js"></script>
        <link rel="stylesheet" href="../demos.css">
        <style>
        #draggable, #draggable2, #draggable3 { width: 100px; height: 100px; padding: 0.5em; float: left; margin: 0 10px 10px 0; }
        </style>
-       <script>
-       $(function() {
+       <script src="../../external/requirejs/require.js"></script>
+       <script src="../bootstrap.js">
                $( "#draggable" ).draggable({ scroll: true });
                $( "#draggable2" ).draggable({ scroll: true, scrollSensitivity: 100 });
                $( "#draggable3" ).draggable({ scroll: true, scrollSpeed: 100 });
-       });
        </script>
 </head>
 <body>
index 726a513843e45aafa955c0139f0ec48ea2aa44f1..28cb9d5a7f21ce4e5e5c02879049571331d23fd7 100644 (file)
@@ -4,25 +4,19 @@
        <meta charset="utf-8">
        <title>jQuery UI Draggable - Snap to element or grid</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/draggable.js"></script>
        <link rel="stylesheet" href="../demos.css">
        <style>
        .draggable { width: 90px; height: 80px; padding: 5px; float: left; margin: 0 10px 10px 0; font-size: .9em; }
        .ui-widget-header p, .ui-widget-content p { margin: 0; }
        #snaptarget { height: 140px; }
        </style>
-       <script>
-       $(function() {
+       <script src="../../external/requirejs/require.js"></script>
+       <script src="../bootstrap.js">
                $( "#draggable" ).draggable({ snap: true });
                $( "#draggable2" ).draggable({ snap: ".ui-widget-header" });
                $( "#draggable3" ).draggable({ snap: ".ui-widget-header", snapMode: "outer" });
                $( "#draggable4" ).draggable({ grid: [ 20, 20 ] });
                $( "#draggable5" ).draggable({ grid: [ 80, 80 ] });
-       });
        </script>
 </head>
 <body>
index 1251f0e29e011de0b33b4a20dadedefed5b0725b..9f07c47525538e8d2d3333679db7a7f7cde7de13 100644 (file)
@@ -4,19 +4,13 @@
        <meta charset="utf-8">
        <title>jQuery UI Draggable + Sortable</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/draggable.js"></script>
-       <script src="../../ui/sortable.js"></script>
        <link rel="stylesheet" href="../demos.css">
        <style>
        ul { list-style-type: none; margin: 0; padding: 0; margin-bottom: 10px; }
        li { margin: 5px; padding: 5px; width: 150px; }
        </style>
-       <script>
-       $(function() {
+       <script src="../../external/requirejs/require.js"></script>
+       <script src="../bootstrap.js" data-modules="sortable">
                $( "#sortable" ).sortable({
                        revert: true
                });
@@ -26,7 +20,6 @@
                        revert: "invalid"
                });
                $( "ul, li" ).disableSelection();
-       });
        </script>
 </head>
 <body>
index 135d86c2aaaa101ee39606e7fda84f061ac7478d..65f28bb9ec36fbb472feb3e9aff8dda5d8ffd0c6 100644 (file)
@@ -4,11 +4,6 @@
        <meta charset="utf-8">
        <title>jQuery UI Draggable - Visual feedback</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/draggable.js"></script>
        <link rel="stylesheet" href="../demos.css">
        <style>
        #draggable, #draggable2, #draggable3, #set div { width: 90px; height: 90px; padding: 0.5em; float: left; margin: 0 10px 10px 0; }
@@ -16,8 +11,8 @@
        #set { clear:both; float:left; width: 368px; height: 120px; }
        p { clear:both; margin:0; padding:1em 0; }
        </style>
-       <script>
-       $(function() {
+       <script src="../../external/requirejs/require.js"></script>
+       <script src="../bootstrap.js">
                $( "#draggable" ).draggable({ helper: "original" });
                $( "#draggable2" ).draggable({ opacity: 0.7, helper: "clone" });
                $( "#draggable3" ).draggable({
@@ -28,7 +23,6 @@
                        }
                });
                $( "#set div" ).draggable({ stack: "#set div" });
-       });
        </script>
 </head>
 <body>