summaryrefslogtreecommitdiff
path: root/engines/kokompe/temp/jquery.ui/demos/ui.sortable.html
blob: 608baa1d21f43244c67417da2ec45c0e1ba256d8 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
<head>
<meta http-equiv="Content-Language" content="en" />
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>Sortable Demo</title>
<link rel="stylesheet" href="../themes/flora/flora.all.css" type="text/css" media="screen" title="Flora (Default)" />
<link rel="stylesheet" href="css/style.css" type="text/css" />

<script src="../jquery-1.2.3.min.js" type="text/javascript"></script>
<script type="text/javascript" src="../jquery.dimensions.js"></script>

<script type="text/javascript" src="../ui.mouse.js"></script>
<script type="text/javascript" src="../ui.sortable.js"></script>
<script type="text/javascript" src="../ui.sortable.ext.js"></script>

<style type="text/css">
.hover { background: #000; }
</style>
</head>
<body class="flora">

<h2>1. Default, no options</h2>
<div class="playground">
	<ul id="example1" style="cursor: hand; cursor: pointer; float: left;">
		<li id='ex_1'>Drag us</li>
		<li id='ex_2'>around</li>
		<li id='ex_3'>and change</li>
		<li id='ex_4'>our</li>
		<li id='ex_5'>positions</li>
	</ul>
	
	<ul id="example1_2" style="cursor: hand; cursor: pointer; float: left;">
		<li>Drag us</li>
		<li>around</li>
		<li>and change</li>
		<li>our</li>
		<li>positions</li>
	</ul>
	<br style='clear: both;' />
	<button onclick="$('#example1').sortable('enable')">Enable</button>
	<button onclick="$('#example1').sortable('disable')">Disable</button>
	<button onclick="alert($('#example1').sortable('serialize'))">Serialize!</button>
</div>

<h2>2. Default, no options (Floats)</h2>
<div class="playground">
	<ul id="example2" style="list-style-position: inside; height: 30px; cursor: hand; cursor: pointer;">
		<li style='float: left; padding: 5px; border: 1px solid #bbb; margin: 3px; background: #fff;'>Drag us</li>
		<li style='float: left; padding: 5px; border: 1px solid #bbb; margin: 3px; background: #fff;'>around</li>
		<li style='float: left; padding: 5px; border: 1px solid #bbb; margin: 3px; background: #fff;'>and change</li>
		<li style='float: left; padding: 5px; border: 1px solid #bbb; margin: 3px; background: #fff;'>our</li>
		<li style='float: left; padding: 5px; border: 1px solid #bbb; margin: 3px; background: #fff;'>positions</li>
	</ul>
</div>

<h2>3. Nested lists</h2>
<div class="playground">
	<ul id="example3" style="cursor: hand; cursor: pointer;">
		<li>Drag us</li>
		<li>around</li>
		<li>and change
			<ul>
			    <li>Lorem</li>
			    <li>Ipsum</li>
			</ul>
		</li>
		<li>our</li>
		<li>positions
			<ul>
			    <li>Something else</li>
			    <li>Foo bar</li>
			</ul>
		</li>
	</ul>
</div>

<h2>4. Floating, with defined placeholder class</h2>
<div class="playground">
	<ul id="example4" style="list-style-position: inside; height: 30px; cursor: hand; cursor: pointer;">
		<li style='float: left; padding: 5px; border: 1px solid #bbb; margin: 3px; background: #fff;'>Drag us</li>
		<li style='float: left; padding: 5px; border: 1px solid #bbb; margin: 3px; background: #fff;'>around</li>
		<li style='float: left; padding: 5px; border: 1px solid #bbb; margin: 3px; background: #fff;'>and change</li>
		<li style='float: left; padding: 5px; border: 1px solid #bbb; margin: 3px; background: #fff;'>our</li>
		<li style='float: left; padding: 5px; border: 1px solid #bbb; margin: 3px; background: #fff;'>positions</li>
	</ul>
</div>

<script type="text/javascript">
if(!window.console) {
 window.console = {
 	log: function() {
 		alert(arguments[0]);	
 	}	
 }	
}

$(window).bind("load",function(){


	$("#example1").sortable({ connectWith: ['#example1_2'], revert: true, containment: 'document', update: function(e,ui) { console.log($(this).sortable('serialize')); } });
	$("#example1_2").sortable({ connectWith: ['#example1'], revert: true });
	
	$("#example2").sortable({ revert: true });
	$("#example3").sortable({ items: "li", revert: true, tree: true });
	$("#example4").sortable({ placeholder: "hover", revert: true });

});
</script>
</body>
</html>