From 8a602fe453469620dab6fe5a209f7212de9817c5 Mon Sep 17 00:00:00 2001 From: David Chambers Date: Fri, 14 Dec 2012 16:57:12 -0800 Subject: [PATCH 1/8] fix incorrectly anchored regular expressions > /^ul|ol$/i.test('symbol') true --- jquery.sortable.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/jquery.sortable.js b/jquery.sortable.js index 350d172..719103a 100644 --- a/jquery.sortable.js +++ b/jquery.sortable.js @@ -13,7 +13,7 @@ $.fn.sortable = function(options) { connectWith: false }, options); return this.each(function() { - if (/^enable|disable|destroy$/.test(method)) { + if (/^(enable|disable|destroy)$/.test(method)) { var items = $(this).children($(this).data('items')).attr('draggable', method == 'enable'); if (method == 'destroy') { items.add(this).removeData('connectWith items') @@ -22,7 +22,7 @@ $.fn.sortable = function(options) { return; } var isHandle, index, items = $(this).children(options.items); - var placeholder = $('<' + (/^ul|ol$/i.test(this.tagName) ? 'li' : 'div') + ' class="sortable-placeholder">'); + var placeholder = $('<' + (/^(ul|ol)$/i.test(this.tagName) ? 'li' : 'div') + ' class="sortable-placeholder">'); items.find(options.handle).mousedown(function() { isHandle = true; }).mouseup(function() { From 8538fd5e511ed0c1f2e185c90369b6887005c021 Mon Sep 17 00:00:00 2001 From: Bruno Batista Date: Wed, 25 Jun 2014 22:35:52 -0300 Subject: [PATCH 2/8] Added support for bower --- bower.json | 26 ++++++++++++++++++++++++++ 1 file changed, 26 insertions(+) create mode 100644 bower.json diff --git a/bower.json b/bower.json new file mode 100644 index 0000000..2e8a123 --- /dev/null +++ b/bower.json @@ -0,0 +1,26 @@ +{ + "name": "html5sortable", + "version": "0.0.1", + "homepage": "http://farhadi.ir/projects/html5sortable/", + "authors": [ + "Ali Farhadi " + ], + "description": "Lightweight jQuery plugin to create sortable lists and grids using native HTML5 drag and drop API.", + "main": "./jquery.sortable.js", + "keywords": [ + "html5", + "sortable", + "jquery" + ], + "license": "MIT", + "ignore": [ + "**/.*", + "node_modules", + "bower_components", + "test", + "tests" + ], + "dependencies": { + "jquery": ">= 1.9.1" + }, +} From 7e421eb5caa6c9742cdc99e4f8d166641665fdf6 Mon Sep 17 00:00:00 2001 From: Bruno Batista Date: Wed, 25 Jun 2014 22:59:42 -0300 Subject: [PATCH 3/8] Added minified version --- jquery.sortable.js | 2 +- jquery.sortable.min.js | 8 ++++++++ 2 files changed, 9 insertions(+), 1 deletion(-) create mode 100644 jquery.sortable.min.js diff --git a/jquery.sortable.js b/jquery.sortable.js index 350d172..dfb63e7 100644 --- a/jquery.sortable.js +++ b/jquery.sortable.js @@ -1,7 +1,7 @@ /* * HTML5 Sortable jQuery Plugin * http://farhadi.ir/projects/html5sortable - * + * * Copyright 2012, Ali Farhadi * Released under the MIT license. */ diff --git a/jquery.sortable.min.js b/jquery.sortable.min.js new file mode 100644 index 0000000..7e90810 --- /dev/null +++ b/jquery.sortable.min.js @@ -0,0 +1,8 @@ +/* + * HTML5 Sortable jQuery Plugin + * http://farhadi.ir/projects/html5sortable + * + * Copyright 2012, Ali Farhadi + * Released under the MIT license. + */ +(function(e){var t,n=e();e.fn.sortable=function(r){var i=String(r);r=e.extend({connectWith:false},r);return this.each(function(){if(/^enable|disable|destroy$/.test(i)){var s=e(this).children(e(this).data("items")).attr("draggable",i=="enable");if(i=="destroy"){s.add(this).removeData("connectWith items").off("dragstart.h5s dragend.h5s selectstart.h5s dragover.h5s dragenter.h5s drop.h5s")}return}var o,u,s=e(this).children(r.items);var a=e("<"+(/^ul|ol$/i.test(this.tagName)?"li":"div")+' class="sortable-placeholder">');s.find(r.handle).mousedown(function(){o=true}).mouseup(function(){o=false});e(this).data("items",r.items);n=n.add(a);if(r.connectWith){e(r.connectWith).add(this).data("connectWith",r.connectWith)}s.attr("draggable","true").on("dragstart.h5s",function(n){if(r.handle&&!o){return false}o=false;var i=n.originalEvent.dataTransfer;i.effectAllowed="move";i.setData("Text","dummy");u=(t=e(this)).addClass("sortable-dragging").index()}).on("dragend.h5s",function(){if(!t){return}t.removeClass("sortable-dragging").show();n.detach();if(u!=t.index()){t.parent().trigger("sortupdate",{item:t})}t=null}).not("a[href], img").on("selectstart.h5s",function(){this.dragDrop&&this.dragDrop();return false}).end().add([this,a]).on("dragover.h5s dragenter.h5s drop.h5s",function(i){if(!s.is(t)&&r.connectWith!==e(t).parent().data("connectWith")){return true}if(i.type=="drop"){i.stopPropagation();n.filter(":visible").after(t);t.trigger("dragend.h5s");return false}i.preventDefault();i.originalEvent.dataTransfer.dropEffect="move";if(s.is(this)){if(r.forcePlaceholderSize){a.height(t.outerHeight())}t.hide();e(this)[a.index() Date: Wed, 25 Jun 2014 23:12:26 -0300 Subject: [PATCH 4/8] Update bower.json Small issue --- bower.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/bower.json b/bower.json index 2e8a123..39fc86c 100644 --- a/bower.json +++ b/bower.json @@ -22,5 +22,5 @@ ], "dependencies": { "jquery": ">= 1.9.1" - }, + } } From c436dab52ac5df3ead3a3446a737e5976b4a694f Mon Sep 17 00:00:00 2001 From: Ali Farhadi Date: Thu, 31 Jul 2014 20:53:25 +0430 Subject: [PATCH 5/8] Updating README.md --- README.md | 3 +++ 1 file changed, 3 insertions(+) diff --git a/README.md b/README.md index a3d888f..3013526 100644 --- a/README.md +++ b/README.md @@ -1,3 +1,6 @@ +I failed to mainttain this project in the past two years. +For an updated version see [voidberg's fork](https://github.com/voidberg/html5sortable) + HTML5 Sortable jQuery Plugin ============================ From 2ec331daf8947a1e35f1bd2cace8665c88afb66a Mon Sep 17 00:00:00 2001 From: Alexandru Badiu Date: Fri, 21 Nov 2014 14:04:22 +0200 Subject: [PATCH 6/8] Update README.md --- README.md | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/README.md b/README.md index 3013526..b1fdca8 100644 --- a/README.md +++ b/README.md @@ -1,5 +1,4 @@ -I failed to mainttain this project in the past two years. -For an updated version see [voidberg's fork](https://github.com/voidberg/html5sortable) +This project is not mantained anymore. For an updated version please use [voidberg's fork](https://github.com/voidberg/html5sortable) HTML5 Sortable jQuery Plugin ============================ From 6e597f82ac46b82d94a216e345482bebd9ebd7ae Mon Sep 17 00:00:00 2001 From: Alexandru Badiu Date: Fri, 21 Nov 2014 14:11:28 +0200 Subject: [PATCH 7/8] Update README.md --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index b1fdca8..27d6c0b 100644 --- a/README.md +++ b/README.md @@ -1,4 +1,4 @@ -This project is not mantained anymore. For an updated version please use [voidberg's fork](https://github.com/voidberg/html5sortable) +This project is not mantained anymore. For an updated version please use [voidberg's fork](https://github.com/voidberg/html5sortable). HTML5 Sortable jQuery Plugin ============================ From 3459fdc25dec91e48c1017b95b8d56f87910e7bd Mon Sep 17 00:00:00 2001 From: Ali Farhadi Date: Sun, 15 Nov 2015 11:53:17 +0330 Subject: [PATCH 8/8] Updating deprecation notice --- README.md | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index 27d6c0b..b27b814 100644 --- a/README.md +++ b/README.md @@ -1,4 +1,6 @@ -This project is not mantained anymore. For an updated version please use [voidberg's fork](https://github.com/voidberg/html5sortable). +DEPRECATION NOTICE +------------------ +This project is not mantained anymore. I recommend using [RubaXa's Sortable](https://github.com/RubaXa/Sortable) or [voidberg's fork](https://github.com/voidberg/html5sortable) instead. HTML5 Sortable jQuery Plugin ============================