diff options
author | Maggie Costello Wachs <fg.maggie@gmail.com> | 2009-01-16 22:51:08 +0000 |
---|---|---|
committer | Maggie Costello Wachs <fg.maggie@gmail.com> | 2009-01-16 22:51:08 +0000 |
commit | c3591d49d67b97ca81faabeb5f24558f02d2ed55 (patch) | |
tree | d0d0813cb31b66f5d6b2baeb34fefe975e3d632a | |
parent | 1b7fa8ca13e218d8a2691e3649dab502a1118256 (diff) | |
download | jquery-ui-c3591d49d67b97ca81faabeb5f24558f02d2ed55.tar.gz jquery-ui-c3591d49d67b97ca81faabeb5f24558f02d2ed55.zip |
reorganized/renamed sortable demos
-rw-r--r-- | demos/sortable/connect-lists.html | 50 | ||||
-rw-r--r-- | demos/sortable/delay-start.html | 56 | ||||
-rw-r--r-- | demos/sortable/display-grid.html | 47 | ||||
-rw-r--r-- | demos/sortable/display-portlets.html | 88 | ||||
-rw-r--r-- | demos/sortable/empty-lists.html | 60 |
5 files changed, 301 insertions, 0 deletions
diff --git a/demos/sortable/connect-lists.html b/demos/sortable/connect-lists.html new file mode 100644 index 000000000..569dbfa29 --- /dev/null +++ b/demos/sortable/connect-lists.html @@ -0,0 +1,50 @@ +<!doctype html> +<html lang="en"> +<head> + <title>jQuery UI Sortable - Connect lists</title> + <link type="text/css" href="../../themes/base/ui.all.css" rel="stylesheet" /> + <script type="text/javascript" src="../../jquery-1.3.js"></script> + <script type="text/javascript" src="../../ui/ui.core.js"></script> + <script type="text/javascript" src="../../ui/ui.sortable.js"></script> + <link type="text/css" href="../demos.css" rel="stylesheet" /> + <style type="text/css"> + .demo ul { list-style-type: none; margin: 0; padding: 0; float: left; margin-right: 10px; } + .demo li { margin: 5px; padding: 5px; font-size: 1.2em; width: 120px; } + </style> + <script type="text/javascript"> + $(function() { + $("#sortable1, #sortable2").sortable({ + connectWith: ['.connectedSortable'] + }); + }); + </script> +</head> +<body> +<div class="demo"> + +<ul id="sortable1" class="connectedSortable"> + <li class="ui-state-default">Item 1</li> + <li class="ui-state-default">Item 2</li> + <li class="ui-state-default">Item 3</li> + <li class="ui-state-default">Item 4</li> + <li class="ui-state-default">Item 5</li> +</ul> + +<ul id="sortable2" class="connectedSortable"> + <li class="ui-state-highlight">Item 1</li> + <li class="ui-state-highlight">Item 2</li> + <li class="ui-state-highlight">Item 3</li> + <li class="ui-state-highlight">Item 4</li> + <li class="ui-state-highlight">Item 5</li> +</ul> + +</div><!-- End demo --> + +<div class="demo-description"> + +<p>Sort items from one list into another and vice versa passing an array into the <strong>connectWith</strong> option. The simplest way to do this is to group all related lists with a CSS class, and then pass that class into the sortable function using array notation (i.e., connectWith: ['.myclass']).</p> + +</div><!-- End demo-description --> + +</body> +</html> diff --git a/demos/sortable/delay-start.html b/demos/sortable/delay-start.html new file mode 100644 index 000000000..9952c830e --- /dev/null +++ b/demos/sortable/delay-start.html @@ -0,0 +1,56 @@ +<!doctype html> +<html lang="en"> +<head> + <title>jQuery UI Sortable - Delay start</title> + <link type="text/css" href="../../themes/base/ui.all.css" rel="stylesheet" /> + <script type="text/javascript" src="../../jquery-1.3.js"></script> + <script type="text/javascript" src="../../ui/ui.core.js"></script> + <script type="text/javascript" src="../../ui/ui.sortable.js"></script> + <link type="text/css" href="../demos.css" rel="stylesheet" /> + <style type="text/css"> + .demo ul { list-style-type: none; margin: 0; padding: 0; margin-bottom: 15px; } + .demo li { margin: 5px; padding: 5px; font-size: 1.2em; } + </style> + <script type="text/javascript"> + $(function() { + $("#sortable").sortable({ + delay: 1000 + }); + + $("#sortable2").sortable({ + distance: 50 + }); + }); + </script> +</head> +<body> +<div class="demo"> + +<h3 class="docs">Time delay of 1000ms:</h3> + +<ul id="sortable"> + <li class="ui-state-default">Item 1</li> + <li class="ui-state-default">Item 2</li> + <li class="ui-state-default">Item 3</li> + <li class="ui-state-default">Item 4</li> +</ul> + +<h3>Distance delay of 50px:</h3> + +<ul id="sortable2"> + <li class="ui-state-default">Item 1</li> + <li class="ui-state-default">Item 2</li> + <li class="ui-state-default">Item 3</li> + <li class="ui-state-default">Item 4</li> +</ul> + +</div><!-- End demo --> + +<div class="demo-description"> + +<p>Delay the start of sorting for a number of milliseconds with the <strong>delay</strong> option; prevent sorting until the cursor is held down and dragged a specifed number of pixels with the <strong>distance</strong> option. </p> + +</div><!-- End demo-description --> + +</body> +</html> diff --git a/demos/sortable/display-grid.html b/demos/sortable/display-grid.html new file mode 100644 index 000000000..c0081a3cb --- /dev/null +++ b/demos/sortable/display-grid.html @@ -0,0 +1,47 @@ +<!doctype html> +<html lang="en"> +<head> + <title>jQuery UI Sortable - Display as grid</title> + <link type="text/css" href="../../themes/base/ui.all.css" rel="stylesheet" /> + <script type="text/javascript" src="../../jquery-1.3.js"></script> + <script type="text/javascript" src="../../ui/ui.core.js"></script> + <script type="text/javascript" src="../../ui/ui.sortable.js"></script> + <link type="text/css" href="../demos.css" rel="stylesheet" /> + <style type="text/css"> + #sortable { list-style-type: none; margin: 0; padding: 0; } + #sortable li { margin: 3px; padding: 1px; float: left; width: 100px; height: 90px; font-size: 4em; text-align: center; } + </style> + <script type="text/javascript"> + $(function() { + $("#sortable").sortable(); + }); + </script> +</head> +<body> +<div class="demo"> + +<ul id="sortable"> + <li class="ui-state-default">1</li> + <li class="ui-state-default">2</li> + <li class="ui-state-default">3</li> + <li class="ui-state-default">4</li> + <li class="ui-state-default">5</li> + <li class="ui-state-default">6</li> + <li class="ui-state-default">7</li> + <li class="ui-state-default">8</li> + <li class="ui-state-default">9</li> + <li class="ui-state-default">10</li> + <li class="ui-state-default">11</li> + <li class="ui-state-default">12</li> +</ul> + +</div><!-- End demo --> + +<div class="demo-description"> + +<p>To arrange sortable items as a grid, give them identical dimensions and float them using CSS.</p> + +</div><!-- End demo-description --> + +</body> +</html> diff --git a/demos/sortable/display-portlets.html b/demos/sortable/display-portlets.html new file mode 100644 index 000000000..c71dcd2d3 --- /dev/null +++ b/demos/sortable/display-portlets.html @@ -0,0 +1,88 @@ +<!doctype html> +<html lang="en"> +<head> + <title>jQuery UI Sortable - Display as portlets</title> + <link type="text/css" href="../../themes/base/ui.all.css" rel="stylesheet" /> + <script type="text/javascript" src="../../jquery-1.3.js"></script> + <script type="text/javascript" src="../../ui/ui.core.js"></script> + <script type="text/javascript" src="../../ui/ui.sortable.js"></script> + <link type="text/css" href="../demos.css" rel="stylesheet" /> + <style type="text/css"> + .column { width: 170px; float: left; padding-bottom: 100px; } + .portlet { margin: 1em; } + .portlet-header { margin: 0.3em; padding-left: 0.2em; } + .portlet-header .ui-icon { float: right; } + .portlet-content { padding: 0.4em; } + .ui-sortable-placeholder { border: 1px dotted black; visibility: visible !important; } + .ui-sortable-placeholder * { visibility: hidden; } + </style> + <script type="text/javascript"> + $(function() { + $(".column").sortable({ + connectWith: ['.column'] + }); + + $(".portlet").addClass("ui-widget ui-widget-content ui-helper-clearfix ui-corner-all") + .find(".portlet-header") + .addClass("ui-widget-header ui-corner-all") + .prepend('<span class="ui-icon ui-icon-plusthick"></span>') + .end() + .find(".portlet-content"); + + $(".portlet-header .ui-icon").click(function() { + $(this).toggleClass("ui-icon-minusthick"); + $(this).parents(".portlet:first").find(".portlet-content").toggle(); + }); + }); + </script> +</head> +<body> +<div class="demo"> + +<div class="column"> + +<div class="portlet"> + <div class="portlet-header">Feeds</div> + <div class="portlet-content">Lorem ipsum dolor sit amet, consectetuer adipiscing elit</div> +</div> + +<div class="portlet"> + <div class="portlet-header">News</div> + <div class="portlet-content">Lorem ipsum dolor sit amet, consectetuer adipiscing elit</div> +</div> + +</div> + +<div class="column"> + +<div class="portlet"> + <div class="portlet-header">Shopping</div> + <div class="portlet-content">Lorem ipsum dolor sit amet, consectetuer adipiscing elit</div> +</div> + +</div> + +<div class="column"> + +<div class="portlet"> + <div class="portlet-header">Links</div> + <div class="portlet-content">Lorem ipsum dolor sit amet, consectetuer adipiscing elit</div> +</div> + +<div class="portlet"> + <div class="portlet-header">Images</div> + <div class="portlet-content">Lorem ipsum dolor sit amet, consectetuer adipiscing elit</div> +</div> + +</div> + +</div><!-- End demo --> + +<div class="demo-description"> + +<p>Enable portlets (styled divs) as sortables and use the <strong>connectWith</strong> option to allow sorting between columns.</p> + +</div><!-- End demo-description --> + +</body> +</html> diff --git a/demos/sortable/empty-lists.html b/demos/sortable/empty-lists.html new file mode 100644 index 000000000..7c66515eb --- /dev/null +++ b/demos/sortable/empty-lists.html @@ -0,0 +1,60 @@ +<!doctype html> +<html lang="en"> +<head> + <title>jQuery UI Sortable - Handle empty lists</title> + <link type="text/css" href="../../themes/base/ui.all.css" rel="stylesheet" /> + <script type="text/javascript" src="../../jquery-1.3.js"></script> + <script type="text/javascript" src="../../ui/ui.core.js"></script> + <script type="text/javascript" src="../../ui/ui.sortable.js"></script> + <link type="text/css" href="../demos.css" rel="stylesheet" /> + <style type="text/css"> + .demo ul { list-style-type: none; margin: 0; padding: 0; float: left; margin-right: 10px; background: #eee; padding: 5px; width: 143px;} + .demo li { margin: 5px; padding: 5px; font-size: 1.2em; width: 120px; } + </style> + <script type="text/javascript"> + $(function() { + $("ul.droptrue").sortable({ + connectWith: ['ul'] + }); + + $("ul.dropfalse").sortable({ + connectWith: ['ul'], + dropOnEmpty: false + }); + }); + </script> +</head> +<body> +<div class="demo"> + +<ul class='droptrue'> + <li class="ui-state-default">Can be dropped..</li> + <li class="ui-state-default">..on an empty list</li> + <li class="ui-state-default">Item 3</li> + <li class="ui-state-default">Item 4</li> + <li class="ui-state-default">Item 5</li> +</ul> + +<ul class='dropfalse'> + <li class="ui-state-highlight">Cannot be dropped..</li> + <li class="ui-state-highlight">..on an empty list</li> + <li class="ui-state-highlight">Item 3</li> + <li class="ui-state-highlight">Item 4</li> + <li class="ui-state-highlight">Item 5</li> +</ul> + +<ul class='droptrue'> +</ul> + +<br clear="both" /> + +</div><!-- End demo --> + +<div class="demo-description"> + +<p>Prevent all items in a list from being dropped into a separate, empty list using the <strong>dropOnEmpty</strong> option set to false. By default, sortable items can be dropped on empty lists.</p> + +</div><!-- End demo-description --> + +</body> +</html> |