diff --git a/.gitignore b/.gitignore index 840d87c..115f20f 100644 --- a/.gitignore +++ b/.gitignore @@ -1,3 +1,4 @@ node_modules mock.png .*.sw* +.build* diff --git a/Sortable.js b/Sortable.js index ae9d073..63ad49e 100644 --- a/Sortable.js +++ b/Sortable.js @@ -14,6 +14,9 @@ else if( typeof module != "undefined" && typeof module.exports != "undefined" ){ module.exports = factory(); } + else if( typeof Package !== "undefined" ){ + Sortable = factory(); // export for Meteor.js + } else { window["Sortable"] = factory(); } diff --git a/bower.json b/bower.json index 6c98261..da4c8d7 100644 --- a/bower.json +++ b/bower.json @@ -6,7 +6,7 @@ "authors": [ "RubaXa " ], - "description": "Sortable is a minimalist JavaScript library for modern browsers and touch devices. No jQuery.", + "description": "Minimalist library for reorderable drag-and-drop lists on modern browsers and touch devices. No jQuery.", "keywords": [ "sortable", "reorder", diff --git a/component.json b/component.json index 8f7638a..b6bed44 100644 --- a/component.json +++ b/component.json @@ -7,7 +7,7 @@ "authors": [ "RubaXa " ], - "description": "Sortable is a minimalist JavaScript library for modern browsers and touch devices. No jQuery.", + "description": "Minimalist library for reorderable drag-and-drop lists on modern browsers and touch devices. No jQuery.", "keywords": [ "sortable", "reorder", diff --git a/index.html b/index.html index 489570b..8eeaa54 100644 --- a/index.html +++ b/index.html @@ -62,27 +62,27 @@
Group A
- +
Group B
- +
Group C
- +
diff --git a/meteor/package.js b/meteor/package.js new file mode 100644 index 0000000..183fc53 --- /dev/null +++ b/meteor/package.js @@ -0,0 +1,24 @@ +var packageName = 'rubaxa:sortable'; + +Package.describe({ + name: packageName, + summary: 'Sortable (official): minimalist reorderable drag-and-drop lists on modern browsers and touch devices', + version: '0.5.2', + git: 'https://github.com/RubaXa/Sortable.git' +}); + +Package.onUse(function (api) { + api.versionsFrom('0.9.0'); + api.export('Sortable'); + api.addFiles([ + 'Sortable.js' + ], 'client' + ); +}); + +Package.onTest(function (api) { + api.use(packageName, 'client'); + api.use('tinytest', 'client'); + + api.addFiles('meteor/test.js', 'client'); +}); diff --git a/meteor/publish.sh b/meteor/publish.sh new file mode 100755 index 0000000..45c12ba --- /dev/null +++ b/meteor/publish.sh @@ -0,0 +1,23 @@ +# Publish package on Meteor's Atmosphere.js + +# Make sure Meteor is installed, per https://www.meteor.com/install. The curl'ed script is totally safe; takes 2 minutes to read its source and check. +type meteor >/dev/null 2>&1 || { curl https://install.meteor.com/ | sh; } + +# sanity check: make sure we're in the root directory of the checkout +DIR=$( cd "$( dirname "$0" )" && pwd ) +cd $DIR/.. + +# Meteor expects package.js to be in the root directory of the checkout, so copy it there temporarily +cp meteor/package.js ./ + +# publish package, creating it if it's the first time we're publishing +PACKAGE_NAME=$(grep -i name package.js | head -1 | cut -d "'" -f 2) +PACKAGE_EXISTS=$(meteor search $PACKAGE_NAME 2>/dev/null | wc -l) + +if [ $PACKAGE_EXISTS -gt 0 ]; then + meteor publish +else + meteor publish --create +fi + +rm package.js diff --git a/meteor/runtests.sh b/meteor/runtests.sh new file mode 100755 index 0000000..949462f --- /dev/null +++ b/meteor/runtests.sh @@ -0,0 +1,28 @@ +# Test Meteor package before publishing to Atmosphere.js + +# Make sure Meteor is installed, per https://www.meteor.com/install. The curl'ed script is totally safe; takes 2 minutes to read its source and check. +type meteor >/dev/null 2>&1 || { curl https://install.meteor.com/ | sh; } + +# sanity check: make sure we're in the root directory of the checkout +DIR=$( cd "$( dirname "$0" )" && pwd ) +cd $DIR/.. + +# Meteor expects package.js to be in the root directory of the checkout, so copy it there temporarily +cp meteor/package.js ./ + +# run tests and delete the temporary package.js even if Ctrl+C is pressed +int_trap() { + echo + echo "Tests interrupted." +} + +trap int_trap INT + +meteor test-packages ./ + +PACKAGE_NAME=$(grep -i name package.js | head -1 | cut -d "'" -f 2) +rm -rf ".build.$PACKAGE_NAME" +rm -rf ".build.local-test:$PACKAGE_NAME" +rm versions.json + +rm package.js diff --git a/meteor/test.js b/meteor/test.js new file mode 100644 index 0000000..f7c00a9 --- /dev/null +++ b/meteor/test.js @@ -0,0 +1,9 @@ +'use strict'; + +Tinytest.add('Sortable.is', function (test) { + var items = document.createElement('ul'); + items.innerHTML = '
  • item 1
  • item 2
  • item 3
  • '; + var sortable = new Sortable(items); + test.instanceOf(sortable, Sortable, 'Instantiation OK'); + test.length(sortable.toArray(), 3, 'Three elements'); +}); diff --git a/package.json b/package.json index 7136e65..7d862bf 100644 --- a/package.json +++ b/package.json @@ -7,7 +7,7 @@ "grunt-version": "*", "grunt-contrib-uglify": "*" }, - "description": "Sortable is a minimalist JavaScript library for modern browsers and touch devices. No jQuery.", + "description": "Minimalist library for reorderable drag-and-drop lists on modern browsers and touch devices. No jQuery.", "main": "Sortable.js", "scripts": { "test": "grunt" diff --git a/st/face-01.jpg b/st/face-01.jpg new file mode 100644 index 0000000..06f9640 Binary files /dev/null and b/st/face-01.jpg differ diff --git a/st/face-02.jpg b/st/face-02.jpg new file mode 100644 index 0000000..9063724 Binary files /dev/null and b/st/face-02.jpg differ diff --git a/st/face-03.jpg b/st/face-03.jpg new file mode 100644 index 0000000..3e64a48 Binary files /dev/null and b/st/face-03.jpg differ diff --git a/st/face-04.jpg b/st/face-04.jpg new file mode 100644 index 0000000..0e5c73b Binary files /dev/null and b/st/face-04.jpg differ diff --git a/st/face-05.jpg b/st/face-05.jpg new file mode 100644 index 0000000..a811122 Binary files /dev/null and b/st/face-05.jpg differ diff --git a/st/face-06.jpg b/st/face-06.jpg new file mode 100644 index 0000000..063be72 Binary files /dev/null and b/st/face-06.jpg differ diff --git a/st/face-07.jpg b/st/face-07.jpg new file mode 100644 index 0000000..aebd011 Binary files /dev/null and b/st/face-07.jpg differ diff --git a/st/face-08.jpg b/st/face-08.jpg new file mode 100644 index 0000000..b4e27f1 Binary files /dev/null and b/st/face-08.jpg differ diff --git a/st/face-09.jpg b/st/face-09.jpg new file mode 100644 index 0000000..8ecdef6 Binary files /dev/null and b/st/face-09.jpg differ