Skip to content
This repository was archived by the owner on Sep 8, 2020. It is now read-only.

Commit 3ff67a5

Browse files
committed
feat(grunt): use Angular UI Publisher
Merge branch 'douglasduteil-feat-publisher' Closes #88
2 parents d3d9d63 + b630f40 commit 3ff67a5

15 files changed

+461
-213
lines changed

.bowerrc

-3
This file was deleted.

.gitignore

+2
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
11
bower_components/
22
node_modules/
33
coverage/
4+
dist/
5+
out/

.jshintrc

+23
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
{
2+
"boss": true,
3+
"browser": true,
4+
"eqnull": true,
5+
"expr": true,
6+
"globalstrict": true,
7+
"immed": true,
8+
"laxbreak": true,
9+
"loopfunc": true,
10+
"newcap": true,
11+
"noarg": true,
12+
"noempty": true,
13+
"nonew": true,
14+
"quotmark": true,
15+
"smarttabs": true,
16+
"sub": true,
17+
"trailing": true,
18+
"undef": true,
19+
"unused": true,
20+
"globals": {
21+
"angular": false
22+
}
23+
}

.travis.yml

+36-9
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,39 @@
11
language: node_js
22
node_js:
3-
- "0.8"
4-
3+
- '0.10'
54
before_install:
6-
- export DISPLAY=:99.0
7-
- sh -e /etc/init.d/xvfb start
8-
- npm install -g bower grunt-cli
9-
- npm install
10-
- bower install
11-
12-
script: "grunt"
5+
- export DISPLAY=:99.0
6+
- sh -e /etc/init.d/xvfb start
7+
- npm install -qg bower grunt-cli
8+
- npm install -q
9+
- bower install
10+
after_success:
11+
- ./node_modules/angular-ui-publisher/travis/authentication.sh || exit 0
12+
- grunt dist build:gh-pages publish:gh-pages build:bower publish:bower
13+
script: grunt
14+
env:
15+
global:
16+
- REPO="[email protected]:angular-ui/ui-sortable.git"
17+
- secure: lv6/NYEdeaQi/ITVGbmWLdj2LoHjrMaF511YoDOOEWjdtCZPUmIciMYDvDidaLzr5NKgtaQCzGouHIgbdM2r+blJndTB+fydXYw3nq9qvRsXRGbWH0TY2KtdB++73N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0SCLsMJOJvGSyg8A9d811//KpDZkSvNTLRER9kW+ONVGWkaqDzZk9JNAiZQ21E=
24+
- secure: moG6EmijG8fnkSEKWT5939qubV7bupNHiR1f61HAaC4dFN2fnQuqzamBlRTmdISOuhFKkMAZRt9ZpRjeOTwcGzE+PV2WkbLzZggn19uPV/4J6cm3MBDhnbJfrTnNCD+XoxfgJezwWL+yA+OTKOjKoli/c2j3gA18lHxL8RGGfWA=
25+
- secure: ey2lvN+BsXGwYm8uMuVl22fv6ABqdqr+wEGsXVq0IwMfoyifXu7Zjbqq3dbxwOADlm2BpuBM1EMOh4b3J5Xae5KbkZ1olh8wbTT07XN6GdRyKoxRgkxORyjQe35uPpxNXPG/4MDPGvOer4tP205GSSET7GzXgTjeoUP/Wn04l3U=
26+
- secure: BkaTcpkvyph2ktmqHmWV2sM+3U2X/Np7LH6CjV/up1tyUqLUVOg7KcxVnDhrfrzxeQQqDv8CX4bkE9OIe0PrIU5FzRDAlxmEA1n8iR/ZFQdLmdLXIT5Aq58oEggyB3GvmojOLSB2MT2jPucz+RpftaglaUtxwa20nxryigEDOdU=
27+
- secure: TQqMgKNva40V429OmdCpFHiAXc86wIhnSN4MYSKpWKb4vmG7pL75ycjYCxADpKJjOjGb4JYk/UZOk/3PIWi2g0j/thNEIK48jak7dtA7I9RZ/pKA6JN4LxaSlcsrOUhFfWAzfchrqpbHCwvzKlbFJmulRXKAeFbqXmzf6IaUVZg=
28+
- secure: CbGh34phZ9Fbzow1JmtDcbbfu5si7piJLUFFAxGlXlu7lYVp5XpgCJ40uIpbzArZ8ZYaD9ZtoCqBgW5dDKRMUdbyobIqbeIcnljAXrHR+M6FonLuao+TLOe9s2k1fThU4Pdxm9aGedz63UwaTdibCY+mFK7jNptxkfO4RAsnsuw=
29+
- secure: i41+wqwnBiQ+OICjPcOFFTkkznqS6E3sVay9plI7RSQJjN4hj9Nvmarr6l9dqIUUSuIrkZVfynvpOezPT6mrOJZulpGOamJMBfueJ03Vk2pT8vtRRMh1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32W0Sf+5z1ajcwWBsZu4nyxRpPo2QZduS7lU2M0+YdFs8qG7gEhploFDu7hZOI2RaCkTo=
36+
- secure: DZhkAksHSU8MGN0dISwGWA2uuMEvxpeSmqJu2fpPTei//n5l/n+RqlfYH8hUKdMf87RBpXRY1VpHiFYpkNYsmf903gw3kdRWhW07hG3Yt9hXc+YIR0OK6KZ5sb/XZi/ZkWrPEInAL2Yol00e6+U13134SZlPE84P6ktXiKKtlMc=
37+
- secure: Cy34UQZ7/9toUKV6905XYeXIaFdDRhLb+ibEbLnjoo3ifeApNaecc1l4aBN88HN6nKnX1TKSZyiETwCpCWCee2d7KTi4IhSFTAa+SVUTV6BmikhdUs6MwemyreyWFlxZD32huZKyWU9ZEAwwQ0Oq9gPqECWWZkdT4LInF6SLWLY=
38+
- secure: E9gahGC9Swvy83Kos9LhFsxZp/zBI6Ll9lqQd6HxT7YSXj2YeoxSMCsF629bODPdtuMirhmFqReKZKL1lDpJBswr1sFtnmVavSwVBW4v/CIAQu0ENC85Knv1wgoAcl7cRisWaueSHJ0DyNstZZWGNWryIINg9zjFdrOSztDvoN8=
39+
- secure: UxCvWwq2GcUdL3BtJyRMEFPHPRGIdPPLthThmWrmUE7dnblpDUdWVXKc62f7Y42qtHlhYh1EjxX0GJFcS1F0Lfge0e0cxDNWBATBoLKpC67kTyz/cUgqFEv6tsbkziBtbOrBuy6/LMZly1BqG/3fIDEJezkKOIqHF+pdApvAC/8=

README.md

+31-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
# ui-sortable directive [![Build Status](https://travis-ci.org/angular-ui/ui-sortable.png)](https://travis-ci.org/angular-ui/ui-sortable)
1+
# UI.Sortable directive [![Build Status](https://travis-ci.org/angular-ui/ui-sortable.png)](https://travis-ci.org/angular-ui/ui-sortable)
22

33
This directive allows you to sort array with drag & drop.
44

@@ -80,3 +80,33 @@ Feel free to edit any of them for your needs (don't forget to also update the li
8080

8181
- [Simple Demo](http://codepen.io/thgreasi/pen/BlFLp)
8282
- [Connected Lists](http://codepen.io/thgreasi/pen/apwsb)
83+
84+
85+
## Testing
86+
87+
We use Karma and jshint to ensure the quality of the code. The easiest way to run these checks is to use grunt:
88+
89+
```sh
90+
npm install -g grunt-cli
91+
npm install && bower install
92+
grunt
93+
```
94+
95+
The karma task will try to open Firefox and Chrome as browser in which to run the tests. Make sure this is available or change the configuration in `test\karma.conf.js`
96+
97+
98+
### Grunt Serve
99+
100+
We have one task to serve them all !
101+
102+
```sh
103+
grunt serve
104+
```
105+
106+
It's equal to run separately:
107+
108+
* `grunt connect:server` : giving you a development server at [http://127.0.0.1:8000/](http://127.0.0.1:8000/).
109+
110+
* `grunt karma:server` : giving you a Karma server to run tests (at [http://localhost:9876/](http://localhost:9876/) by default). You can force a test on this server with `grunt karma:unit:run`.
111+
112+
* `grunt watch` : will automatically test your code and build your demo. You can demo generation with `grunt build:gh-pages`.

demo/demo.css

+2-11
Original file line numberDiff line numberDiff line change
@@ -20,10 +20,6 @@
2020

2121
/*** Extra ***/
2222

23-
body {
24-
font-family: Verdana, 'Trebuchet ms', Tahoma;
25-
}
26-
2723
.logList {
2824
margin-top: 20px;
2925
width: 250px;
@@ -41,11 +37,6 @@ body {
4137
background-color: #FFF;
4238
}
4339

44-
.container {
45-
width:300px;
46-
margin: auto;
40+
ul[ui-sortable] {
41+
float: right;
4742
}
48-
49-
h2 {
50-
text-align: center;
51-
}

demo/demo.html

+13-60
Original file line numberDiff line numberDiff line change
@@ -1,61 +1,14 @@
1-
<!DOCTYPE html>
2-
<!--[if lt IE 7]> <html class="no-js lt-ie9 lt-ie8 lt-ie7"> <![endif]-->
3-
<!--[if IE 7]> <html class="no-js lt-ie9 lt-ie8"> <![endif]-->
4-
<!--[if IE 8]> <html class="no-js lt-ie9"> <![endif]-->
5-
<!--[if gt IE 8]><!--> <html class="no-js"> <!--<![endif]-->
6-
<head>
7-
<meta charset="utf-8">
8-
<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
9-
<title>AngularUI - Sortable Demo</title>
10-
<base href=".."></base>
11-
<link rel="stylesheet" href="bower_components/jquery-ui/themes/smoothness/jquery-ui.css">
12-
<link rel="stylesheet" href="demo/demo.css">
13-
<script type="text/javascript" src="bower_components/jquery/jquery.js"></script>
14-
<script type="text/javascript" src="bower_components/jquery-ui/ui/jquery-ui.js"></script>
15-
<script type="text/javascript" src="bower_components/angular/angular.js"></script>
16-
<script type="text/javascript" src="src/sortable.js"></script>
17-
<script type="text/javascript">
18-
var myapp = angular.module('sortableApp', ['ui.sortable']);
19-
20-
myapp.controller('sortableController', function ($scope) {
21-
var tmpList = [];
22-
23-
for (var i = 1; i <= 6; i++){
24-
tmpList.push({
25-
text: 'Item ' + i,
26-
value: i
27-
});
28-
}
29-
30-
$scope.list = tmpList;
31-
32-
33-
$scope.sortingLog = [];
34-
35-
$scope.sortableOptions = {
36-
// called after a node is dropped
37-
stop: function(e, ui) {
38-
var logEntry = {
39-
ID: $scope.sortingLog.length + 1,
40-
Text: 'Moved element: ' + ui.item.scope().item.text
41-
};
42-
$scope.sortingLog.push(logEntry);
43-
}
44-
};
45-
});
46-
</script>
47-
</head>
48-
<body ng-app="sortableApp" ng-controller="sortableController">
49-
<div class="container">
50-
<h2>ui.sortable demo</h2>
51-
52-
<ul ui-sortable="sortableOptions" ng-model="list" class="list">
53-
<li ng-repeat="item in list" class="item">{{item.text}}</li>
54-
</ul>
55-
56-
<ul class="list logList">
57-
<li ng-repeat="entry in sortingLog" class="logItem">{{entry.Text}}</li>
58-
</ul>
1+
<section ng-app="sortableApp" ng-controller="sortableController">
2+
<div class="row">
3+
<div class="span6">
4+
<ul ui-sortable="sortableOptions" ng-model="list" class="list">
5+
<li ng-repeat="item in list" class="item">{{item.text}}</li>
6+
</ul>
7+
</div>
8+
<div class="span6">
9+
<ul class="list logList">
10+
<li ng-repeat="entry in sortingLog" class="logItem">{{entry.Text}}</li>
11+
</ul>
12+
</div>
5913
</div>
60-
</body>
61-
</html>
14+
</section>

demo/demo.js

+30
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
'use strict';
2+
3+
var myapp = angular.module('sortableApp', ['ui.sortable']);
4+
5+
myapp.controller('sortableController', function ($scope) {
6+
var tmpList = [];
7+
8+
for (var i = 1; i <= 6; i++){
9+
tmpList.push({
10+
text: 'Item ' + i,
11+
value: i
12+
});
13+
}
14+
15+
$scope.list = tmpList;
16+
17+
18+
$scope.sortingLog = [];
19+
20+
$scope.sortableOptions = {
21+
// called after a node is dropped
22+
stop: function(e, ui) {
23+
var logEntry = {
24+
ID: $scope.sortingLog.length + 1,
25+
Text: 'Moved element: ' + ui.item.scope().item.text
26+
};
27+
$scope.sortingLog.push(logEntry);
28+
}
29+
};
30+
});

0 commit comments

Comments
 (0)