r1710 - trunk/demos/sortable

r1710 - trunk/demos/sortable


Author: rdworth
Date: Tue Jan 20 05:12:22 2009
New Revision: 1710
Removed:
trunk/demos/sortable/connectwith.html
trunk/demos/sortable/delay.html
trunk/demos/sortable/display-portlets.html
trunk/demos/sortable/distance.html
trunk/demos/sortable/droponempty.html
trunk/demos/sortable/droppable.html
trunk/demos/sortable/floating.html
trunk/demos/sortable/tolerance.html
Modified:
trunk/demos/sortable/connect-lists.html
trunk/demos/sortable/default.html
trunk/demos/sortable/delay-start.html
trunk/demos/sortable/display-grid.html
trunk/demos/sortable/empty-lists.html
trunk/demos/sortable/index.html
trunk/demos/sortable/items.html
trunk/demos/sortable/placeholder.html
trunk/demos/sortable/portlets.html
Log:
demos/sortable: some cleanup and consistency
Modified: trunk/demos/sortable/connect-lists.html
==============================================================================
--- trunk/demos/sortable/connect-lists.html    (original)
+++ trunk/demos/sortable/connect-lists.html    Tue Jan 20 05:12:22 2009
@@ -8,8 +8,8 @@
    <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; }
+    #sortable1, #sortable2 { list-style-type: none; margin: 0; padding: 0;
float: left; margin-right: 10px; }
+    #sortable1 li, #sortable2 li { margin: 0 5px 5px 5px; padding: 5px;
font-size: 1.2em; width: 120px; }
    </style>
    <script type="text/javascript">
    $(function() {
@@ -42,7 +42,12 @@
<div class="demo-description">
-

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']).




+


+    Sort items from one list into another and vice versa, by passing an array
into
+    the <code>connectWith</code> 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., <code>connectWith:
['.myclass']</code>).
+








</div><!-- End demo-description -->
Modified: trunk/demos/sortable/default.html
==============================================================================
--- trunk/demos/sortable/default.html    (original)
+++ trunk/demos/sortable/default.html    Tue Jan 20 05:12:22 2009
@@ -9,7 +9,7 @@
    <link type="text/css" href="../demos.css" rel="stylesheet" />
    <style type="text/css">
    #sortable { list-style-type: none; margin: 0; padding: 0; width: 60%; }
-    #sortable li { margin: 3px; padding: 0.4em; padding-left: 1.5em;
font-size: 1.4em; height: 18px; }
+    #sortable li { margin: 0 3px 3px 3px; padding: 0.4em; padding-left:
1.5em; font-size: 1.4em; height: 18px; }
    #sortable li span { position: absolute; margin-left: -1.3em; }
    </style>
    <script type="text/javascript">
@@ -35,7 +35,11 @@
<div class="demo-description">
-

Enable a group of DOM elements to be sortable. Click on and drag and
element to a new spot within the list, and the other items will adjust to
fit. By default, sortable items share <strong>draggable</strong>
properties.



+


+    Enable a group of DOM elements to be sortable. Click on and drag an
+    element to a new spot within the list, and the other items will adjust to
+    fit. By default, sortable items share <strong>draggable</strong>
properties.
+





</div><!-- End demo-description -->
Modified: trunk/demos/sortable/delay-start.html
==============================================================================
--- trunk/demos/sortable/delay-start.html    (original)
+++ trunk/demos/sortable/delay-start.html    Tue Jan 20 05:12:22 2009
@@ -8,34 +8,36 @@
    <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; }
+    #sortable1, #sortable2 { list-style-type: none; margin: 0; padding: 0;
margin-bottom: 15px; }
+    #sortable1 li, #sortable2 li { margin: 0 5px 5px 5px; padding: 5px;
font-size: 1.2em; }
    </style>
    <script type="text/javascript">
    $(function() {
-        $("#sortable").sortable({
-            delay: 1000
+        $("#sortable1").sortable({
+            delay: 300
        });
        
        $("#sortable2").sortable({
-            distance: 50
+            distance: 15
        });
+
+        $("li").disableSelection();
    });
    </script>
</head>
<body>
<div class="demo">
-<h3 class="docs">Time delay of 1000ms:</h3>
+<h3 class="docs">Time delay of 300ms:</h3>
-<ul id="sortable">
+<ul id="sortable1">
    <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>
+<h3 class="docs">Distance delay of 15px:</h3>
<ul id="sortable2">
    <li class="ui-state-default">Item 1</li>
@@ -48,7 +50,13 @@
<div class="demo-description">
-

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.



+


+    Prevent accidental sorting either by delay (time) or distance. Set a
number of
+    milliseconds the element needs to be dragged before sorting starts
+    with the <code>delay</code> option. Set a distance in pixels the element
+    needs to be dragged before sorting starts with the <code>distance</code>
+    option.
+







</div><!-- End demo-description -->
Modified: trunk/demos/sortable/display-grid.html
==============================================================================
--- trunk/demos/sortable/display-grid.html    (original)
+++ trunk/demos/sortable/display-grid.html    Tue Jan 20 05:12:22 2009
@@ -39,7 +39,10 @@
<div class="demo-description">
-

To arrange sortable items as a grid, give them identical dimensions and
float them using CSS.


+


+    To arrange sortable items as a grid, give them identical dimensions and
+    float them using CSS.
+



</div><!-- End demo-description -->
Modified: trunk/demos/sortable/empty-lists.html
==============================================================================
--- trunk/demos/sortable/empty-lists.html    (original)
+++ trunk/demos/sortable/empty-lists.html    Tue Jan 20 05:12:22 2009
@@ -8,8 +8,8 @@
    <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; }
+    #sortable1, #sortable2, #sortable3 { list-style-type: none; margin: 0;
padding: 0; float: left; margin-right: 10px; background: #eee; padding:
5px; width: 143px;}
+    #sortable1 li, #sortable2 li, #sortable3 li { margin: 5px; padding: 5px;
font-size: 1.2em; width: 120px; }
    </style>
    <script type="text/javascript">
    $(function() {
@@ -27,7 +27,7 @@
<body>
<div class="demo">
-<ul class='droptrue'>
+<ul id="sortable1" 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>
@@ -35,7 +35,7 @@
    <li class="ui-state-default">Item 5</li>
</ul>
-<ul class='dropfalse'>
+<ul id="sortable2" 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>
@@ -43,7 +43,7 @@
    <li class="ui-state-highlight">Item 5</li>
</ul>
-<ul class='droptrue'>
+<ul id="sortable3" class='droptrue'>
</ul>
<br clear="both" />
@@ -52,7 +52,11 @@
<div class="demo-description">
-

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.


+


+    Prevent all items in a list from being dropped into a separate, empty list
+    using the <code>dropOnEmpty</code> option set to <code>false</code>. By
default,
+    sortable items can be dropped on empty lists.
+





</div><!-- End demo-description -->
Modified: trunk/demos/sortable/index.html
==============================================================================
--- trunk/demos/sortable/index.html    (original)
+++ trunk/demos/sortable/index.html    Tue Jan 20 05:12:22 2009
@@ -10,14 +10,13 @@
    <h4>Examples</h4>
    <ul>
        <li class="demo-config-on"><a href="default.html">Default
functionality</a></li>
-        <li><a href="tolerance.html">Drop tolerance (stickiness)</a></li>
        <li><a href="placeholder.html">Drop placeholder</a></li>
        <li><a href="connect-lists.html">Connect lists</a></li>
        <li><a href="empty-lists.html">Handle empty lists</a></li>
-         <li><a href="items.html">Include / exclude items</a></li>
+        <li><a href="items.html">Include / exclude items</a></li>
        <li><a href="delay-start.html">Delay start</a></li>
-        <li><a href="display-portlets.html">Display as portlets</a></li>
        <li><a href="display-grid.html">Display as grid</a></li>        
+        <li><a href="portlets.html">Portlets</a></li>
    </ul>
</div>
Modified: trunk/demos/sortable/items.html
==============================================================================
--- trunk/demos/sortable/items.html    (original)
+++ trunk/demos/sortable/items.html    Tue Jan 20 05:12:22 2009
@@ -8,33 +8,36 @@
    <script type="text/javascript" src="../../ui/ui.sortable.js"></script>
    <link type="text/css" href="../demos.css" rel="stylesheet" />
    <style type="text/css">
-    #sortable, #sortable2 { list-style-type: none; margin: 0; padding: 0; }
-    .demo li { margin: 5px; padding: 3px; font-size: 1.2em; }
+    #sortable1, #sortable2 { list-style-type: none; margin: 0; padding: 0; }
+    #sortable1 li, #sortable2 li { margin: 0 5px 5px 5px; padding: 3px; }
    </style>
    <script type="text/javascript">
    $(function() {
-        $("#sortable").sortable({
+        $("#sortable1").sortable({
            items: 'li:not(.ui-state-disabled)'
        });
+
        $("#sortable2").sortable({
            cancel: '.ui-state-disabled'
        });
+
+        $("#sortable1 li, #sortable2 li").disableSelection();        
    });
    </script>
</head>
<body>
<div class="demo">
-<h3>Specify which items are sortable:</h3>
+<h3 class="docs">Specify which items are sortable:</h3>
-<ul id="sortable">
+<ul id="sortable1">
    <li class="ui-state-default">Item 1</li>
    <li class="ui-state-default ui-state-disabled">(I'm not sortable or a
drop target)</li>
    <li class="ui-state-default ui-state-disabled">(I'm not sortable or a
drop target)</li>
    <li class="ui-state-default">Item 4</li>
</ul>
-<h3>Cancel sorting (but keep as drop targets):</h3>
+<h3 class="docs">Cancel sorting (but keep as drop targets):</h3>
<ul id="sortable2">
    <li class="ui-state-default">Item 1</li>
@@ -47,8 +50,17 @@
<div class="demo-description">
-

Specify which items are eligible to sort by passing a jQuery selector
into the <strong>items</strong> option. Items excluded from this option are
not sortable, nor are they valid targets for sortable items.


-

To only prevent sorting on certain items, pass a jQuery selector into
the <strong>cancel</strong> option. Cancelled items remain valid sort
targets for others.


+


+    Specify which items are eligible to sort by passing a jQuery selector into
+    the <code>items</code> option. Items excluded from this option are not
+    sortable, nor are they valid targets for sortable items.
+




+
+


+    To only prevent sorting on certain items, pass a jQuery selector into the
+    <code>cancel</code> option. Cancelled items remain valid sort targets for
+    others.
+




</div><!-- End demo-description -->
Modified: trunk/demos/sortable/placeholder.html
==============================================================================
--- trunk/demos/sortable/placeholder.html    (original)
+++ trunk/demos/sortable/placeholder.html    Tue Jan 20 05:12:22 2009
@@ -9,7 +9,9 @@
    <link type="text/css" href="../demos.css" rel="stylesheet" />
    <style type="text/css">
    #sortable { list-style-type: none; margin: 0; padding: 0; width: 60%; }
-    #sortable li { margin: 5px; padding: 5px; font-size: 1.2em; }
+    #sortable li { margin: 0 5px 5px 5px; padding: 5px; font-size: 1.2em; }
+    html>body #sortable li { height: 1.5em; line-height: 1.2em; }
+    .ui-state-highlight { height: 1.5em; line-height: 1.2em; }
    </style>
    <script type="text/javascript">
    $(function() {
@@ -36,7 +38,13 @@
<div class="demo-description">
-

When dragging a sortable item to a new location, other items will make
room for the that item by shifting to allow white space between them. Pass
a class into the <strong>placeholder</strong> option to style that space to
be visible. Use the boolean <strong>forcePlaceholderSize</strong> option
to set dimensions on the placeholder.




+


+    When dragging a sortable item to a new location, other items will make
room
+    for the that item by shifting to allow white space between them. Pass a
+    class into the <code>placeholder</code> option to style that space to
+    be visible. Use the boolean <code>forcePlaceholderSize</code> option
+    to set dimensions on the placeholder.
+







</div><!-- End demo-description -->
Modified: trunk/demos/sortable/portlets.html
==============================================================================
--- trunk/demos/sortable/portlets.html    (original)
+++ trunk/demos/sortable/portlets.html    Tue Jan 20 05:12:22 2009
@@ -1,7 +1,7 @@
<!doctype html>
<html lang="en">
<head>
-    <title>jQuery UI Sortable - Portlets Demo</title>
+    <title>jQuery UI Sortable - 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>
@@ -9,11 +9,11 @@
    <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 { margin: 0 1em 1em 1em; }
+    .portlet-header { margin: 0.3em; padding-bottom: 4px; 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 { border: 1px dotted black; visibility:
visible !important; height: 50px !important; }
    .ui-sortable-placeholder * { visibility: hidden; }
    </style>
    <script type="text/javascript">
@@ -41,38 +41,38 @@
<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 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 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 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>
@@ -81,7 +81,8 @@
<div class="demo-description">


-
+    Enable portlets (styled divs) as sortables and use the
<code>connectWith</code>
+    option to allow sorting between columns.






</div><!-- End demo-description -->