审查视图

public/assets/libs/Sortable/index.html 11.0 KB
王晓刚 authored
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 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344
<!DOCTYPE html>
<html>
<head>
	<meta charset="utf-8"/>
	<meta http-equiv="X-UA-Compatible" content="IE=edge"/>
	<meta property="og:image" content="/st/og-image.png"/>

	<title>Sortable. No jQuery.</title>

	<meta name="keywords" content="sortable, reorder, list, javascript, html5, drag and drop, dnd, animation, groups, angular, ng-sortable, react, mixin, effects, rubaxa"/>
	<meta name="description" content="Sortable - is a minimalist JavaScript library for reorderable drag-and-drop lists on modern browsers and touch devices. No jQuery. Supports Meteor, AngularJS, React and any CSS library, e.g. Bootstrap."/>
	<meta name="viewport" content="width=device-width, initial-scale=0.5"/>

	<link href="//rubaxa.github.io/Ply/ply.css" rel="stylesheet" type="text/css"/>
	<link href="//fonts.googleapis.com/css?family=Roboto:300" rel="stylesheet" type="text/css"/>

	<link href="st/app.css" rel="stylesheet" type="text/css"/>
</head>
<body>

	<a href="https://github.com/RubaXa/Sortable"><img style="position: fixed; top: 0; right: 0; border: 0; z-index: 10000;" src="//s3.amazonaws.com/github/ribbons/forkme_right_orange_ff7600.png" alt="Fork me on GitHub"></a>

	<div class="container">
		<div style="padding: 80px 150px 0; height: 160px;">
			<a class="logo" href="https://github.com/RubaXa/Sortable"><img src="st/logo.png"/></a>
			<h1 data-force="40" data-force-y="2.5">The JavaScript library for modern browsers and touch devices. No&nbsp;jQuery.</h1>
		</div>
	</div>


	<!-- Connected lists -->
	<div class="container" style="height: 520px">
		<div data-force="30" class="layer block" style="left: 14.5%; top: 0; width: 37%">
			<div class="layer title">List A</div>
			<ul id="foo" class="block__list block__list_words">
				<li>бегемот</li>
				<li>корм</li>
				<li>антон</li>
				<li>сало</li>
				<li>железосталь</li>
				<li>валик</li>
				<li>кровать</li>
				<li>краб</li>
			</ul>
		</div>

		<div data-force="18" class="layer block" style="left: 58%; top: 143px; width: 40%;">
			<div class="layer title">List B</div>
			<ul id="bar" class="block__list block__list_tags">
				<li>казнить</li>
				<li>,</li>
				<li>нельзя</li>
				<li>помиловать</li>
			</ul>
		</div>
	</div>


	<!-- Multi connected lists -->
	<a name="m"></a>
	<div class="container">
		<div id="multi" style="margin-left: 30px">
			<div><div data-force="5" class="layer title title_xl">Multi</div></div>

			<div class="layer tile" data-force="30">
				<div class="tile__name">Group A</div>
				<div class="tile__list">
					<img src="st/face-01.jpg"/><!--
					--><img src="st/face-02.jpg"/><!--
					--><img src="st/face-03.jpg"/><!--
					--><img src="st/face-04.jpg"/>
				</div>
			</div>

			<div class="layer tile" data-force="25">
				<div class="tile__name">Group B</div>
				<div class="tile__list">
					<img src="st/face-05.jpg"/><!--
					--><img src="st/face-06.jpg"/><!--
					--><img src="st/face-07.jpg"/>
				</div>
			</div>

			<div class="layer tile" data-force="20">
				<div class="tile__name">Group C</div>
				<div class="tile__list">
					<img src="st/face-08.jpg"/><!--
					--><img src="st/face-09.jpg"/>
				</div>
			</div>

		</div>
	</div>


	<!-- Editable list -->
	<a name="e"></a>
	<div class="container" style="margin-top: 100px">
		<div id="filter" style="margin-left: 30px">
			<div><div data-force="5" class="layer title title_xl">Editable list</div></div>

			<div style="margin-top: -8px; margin-left: 10px" class="block__list block__list_words">
				<ul id="editable">
					<li>Оля<i class="js-remove"></i></li>
					<li>Владимир<i class="js-remove"></i></li>
					<li>Алина<i class="js-remove"></i></li>
				</ul>

				<button id="addUser">Add</button>
			</div>
		</div>
	</div>


	<!-- Advanced connected lists -->
	<a name="ag"></a>
	<div class="container" style="margin-top: 100px;">
		<div id="advanced" style="margin-left: 30px;">
			<div><div data-force="5" class="layer title title_xl">Advanced groups</div></div>

			<div style="width: 25%; float: left; margin-top: 15px; margin-left: 10px" class="block__list block__list_words">
				<div class="block__list-title">pull & put</div>
				<ul id="advanced-1">
					<li>Meat</li>
					<li>Potato</li>
					<li>Tea</li>
				</ul>
			</div>

			<div style="width: 25%; float: left; margin-top: 15px; margin-left: 10px" class="block__list block__list_words">
				<div class="block__list-title">only pull (clone) no&nbsp;reordering</div>
				<ul id="advanced-2">
					<li>Sex</li>
					<li>Drugs</li>
					<li>Rock'n'roll</li>
				</ul>
			</div>

			<div style="width: 25%; float: left; margin-top: 15px; margin-left: 10px" class="block__list block__list_words">
				<div class="block__list-title">only put</div>
				<ul id="advanced-3">
					<li>Money</li>
					<li>Force</li>
					<li>Agility</li>
				</ul>
			</div>

			<div style="clear: both"></div>
		</div>
	</div>


	<!-- 'handle' option -->
	<a name="h"></a>
	<div class="container" style="margin-top: 100px;">
		<div id="handle" style="margin-left: 30px;">
			<div><div data-force="5" class="layer title title_xl">Drag handle and selectable text</div></div>

			<div style="width: 30%; margin-left: 10px" class="block__list_words">
				<ul id="handle-1">
					<li><span class="drag-handle">&#9776;</span>Select text freely</li>
					<li><span class="drag-handle">&#9776;</span>Drag my handle</li>
					<li><span class="drag-handle">&#9776;</span>Best of both worlds</li>
				</ul>
			</div>

			<div style="clear: both"></div>
		</div>
	</div>


	<!-- Angular -->
	<a name="ng"></a>
	<div id="todos" ng-app="todoApp" class="container" style="margin-top: 100px">
		<div style="margin-left: 30px">
			<div><div data-force="5" class="layer title title_xl">AngularJS / ng-sortable</div></div>

			<div style="width: 30%; margin-top: -8px; margin-left: 10px; float: left;" class="block__list block__list_words">
				<div ng-controller="TodoController">
					<span style="padding-left: 20px">{{remaining()}} of {{todos.length}} remaining</span>
					[ <a href="" ng-click="archive()">archive</a> ]
					<ul ng-sortable="{ group: 'todo', animation: 150 }" class="unstyled">
						<li ng-repeat="todo in todos">
							<input type="checkbox" ng-model="todo.done">
							<span class="done-{{todo.done}}">{{todo.text}}</span>
						</li>
					</ul>
					<form ng-submit="addTodo()" style="padding-left: 20px">
						<input type="text" ng-model="todoText" size="30"
							   placeholder="add new todo here">
					</form>
				</div>
			</div>


			<div style="width: 30%; margin-top: -8px; margin-left: 10px; float: left;" class="block__list block__list_words">
				<div ng-controller="TodoControllerNext">
					<span style="padding-left: 20px">{{remaining()}} of {{todos.length}} remaining</span>
					<ul ng-sortable="sortableConfig" class="unstyled">
						<li ng-repeat="todo in todos">
							<input type="checkbox" ng-model="todo.done">
							<span class="done-{{todo.done}}">{{todo.text}}</span>
						</li>
					</ul>
				</div>
			</div>

			<div style="clear: both"></div>
		</div>
	</div>


	<!-- Code example -->
	<a name="c"></a>
	<div class="container" style="margin-top: 100px">
		<div style="margin-left: 30px">
			<div><div class="layer title title_xl">Code example</div></div>
			<pre data-force="100" class="layer javascript" style="margin-top: -8px; margin-left: 10px; width: 90%"><code>// Simple list
var list = document.getElementById("my-ui-list");
Sortable.create(list); // That's all.


// Grouping
var foo = document.getElementById("foo");
Sortable.create(foo, { group: "omega" });

var bar = document.getElementById("bar");
Sortable.create(bar, { group: "omega" });


// Or
var container = document.getElementById("multi");
var sort = Sortable.create(container, {
  animation: 150, // ms, animation speed moving items when sorting, `0` — without animation
  handle: ".tile__title", // Restricts sort start click/touch to the specified element
  draggable: ".tile", // Specifies which items inside the element should be sortable
  onUpdate: function (evt/**Event*/){
     var item = evt.item; // the current dragged HTMLElement
  }
});

// ..
sort.destroy();


// Editable list
var editableList = Sortable.create(editable, {
  filter: '.js-remove',
  onFilter: function (evt) {
    var el = editableList.closest(evt.item); // get dragged item
    el && el.parentNode.removeChild(el);
  }
});
</code></pre>
		</div>

		<div class="container" style="margin: 100px 0;">
			<div style="margin-left: 30px">
				<div><div class="layer title title_xl">See also</div></div>
				<div id="rubaxa-repos" data-force="100" class="layer" style="margin-top: -8px; margin-left: 10px; width: 90%; background-color: #fff;">Loading&hellip;</div>
				<script src="//rubaxa.github.io/repos.js"></script>
			</div>
		</div>

	</div>



	<script src="Sortable.js"></script>
	<script src="//rubaxa.github.io/Ply/Ply.min.js"></script>
	<script src="//ajax.googleapis.com/ajax/libs/angularjs/1.2.26/angular.min.js"></script>
	<script src="ng-sortable.js"></script>

	<script src="st/app.js"></script>



	<!-- highlight.js -->
	<style>
		/* Tomorrow Theme */
		/* http://jmblog.github.com/color-themes-for-google-code-highlightjs */
		/* Original theme - https://github.com/chriskempson/tomorrow-theme */
		/* http://jmblog.github.com/color-themes-for-google-code-highlightjs */
		.tomorrow-comment, pre .comment, pre .title {
		  color: #8e908c;
		}

		.tomorrow-red, pre .variable, pre .attribute, pre .tag, pre .regexp, pre .ruby .constant, pre .xml .tag .title, pre .xml .pi, pre .xml .doctype, pre .html .doctype, pre .css .id, pre .css .class, pre .css .pseudo {
		  color: #c82829;
		}

		.tomorrow-orange, pre .number, pre .preprocessor, pre .built_in, pre .literal, pre .params, pre .constant {
		  color: #f5871f;
		}

		.tomorrow-yellow, pre .class, pre .ruby .class .title, pre .css .rules .attribute {
		  color: #eab700;
		}

		.tomorrow-green, pre .string, pre .value, pre .inheritance, pre .header, pre .ruby .symbol, pre .xml .cdata {
		  color: #718c00;
		}

		.tomorrow-aqua, pre .css .hexcolor {
		  color: #3e999f;
		}

		.tomorrow-blue, pre .function, pre .python .decorator, pre .python .title, pre .ruby .function .title, pre .ruby .title .keyword, pre .perl .sub, pre .javascript .title, pre .coffeescript .title {
		  color: #4271ae;
		}

		.tomorrow-purple, pre .keyword, pre .javascript .function {
		  color: #8959a8;
		}

		pre {
			border: 0;
			background-color: #fff;
		}

		pre code {
		  display: block;
		  color: #4d4d4c;
		  font-size: 15px;
		  font-family: Menlo, Monaco, Consolas, monospace;
		  line-height: 1.5;
		  padding: 30px;
		}
	</style>

	<script src="//yandex.st/highlightjs/7.5/highlight.min.js"></script>
	<script>hljs.initHighlightingOnLoad();</script>

	<script>
	  (function(i,s,o,g,r,a,m){i['GoogleAnalyticsObject']=r;i[r]=i[r]||function(){
	  (i[r].q=i[r].q||[]).push(arguments)},i[r].l=1*new Date();a=s.createElement(o),
	  m=s.getElementsByTagName(o)[0];a.async=1;a.src=g;m.parentNode.insertBefore(a,m)
	  })(window,document,'script','//www.google-analytics.com/analytics.js','ga');

	  ga('create', 'UA-16483888-3', 'rubaxa.github.io');
	  ga('send', 'pageview');
	</script>
</body>
</html>