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

Feat publisher #88

Closed
wants to merge 12 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 0 additions & 3 deletions .bowerrc

This file was deleted.

2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
bower_components/
node_modules/
coverage/
dist/
out/
23 changes: 23 additions & 0 deletions .jshintrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
{
"boss": true,
"browser": true,
"eqnull": true,
"expr": true,
"globalstrict": true,
"immed": true,
"laxbreak": true,
"loopfunc": true,
"newcap": true,
"noarg": true,
"noempty": true,
"nonew": true,
"quotmark": true,
"smarttabs": true,
"sub": true,
"trailing": true,
"undef": true,
"unused": true,
"globals": {
"angular": false
}
}
45 changes: 36 additions & 9 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -1,12 +1,39 @@
language: node_js
node_js:
- "0.8"

- '0.10'
before_install:
- export DISPLAY=:99.0
- sh -e /etc/init.d/xvfb start
- npm install -g bower grunt-cli
- npm install
- bower install

script: "grunt"
- export DISPLAY=:99.0
- sh -e /etc/init.d/xvfb start
- npm install -qg bower grunt-cli
- npm install -q
- bower install
after_success:
- ./node_modules/angular-ui-publisher/travis/authentication.sh || exit 0
- grunt dist build:gh-pages publish:gh-pages build:bower publish:bower
script: grunt
env:
global:
- REPO="[email protected]:angular-ui/ui-sortable.git"
- secure: lv6/NYEdeaQi/ITVGbmWLdj2LoHjrMaF511YoDOOEWjdtCZPUmIciMYDvDidaLzr5NKgtaQCzGouHIgbdM2r+blJndTB+fydXYw3nq9qvRsXRGbWH0TY2KtdB++73NhomHN2kOYAx7IOW7XN+StWG6kdBFJ6lDOZl9vOZTHnHvE=
- secure: A6zLTHw99hvJ37FNKPnW4y6Eu/G+1M7NEw4vgWDlyH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pkNYsmf903gw3kdRWhW07hG3Yt9hXc+YIR0OK6KZ5sb/XZi/ZkWrPEInAL2Yol00e6+U13134SZlPE84P6ktXiKKtlMc=
- secure: Cy34UQZ7/9toUKV6905XYeXIaFdDRhLb+ibEbLnjoo3ifeApNaecc1l4aBN88HN6nKnX1TKSZyiETwCpCWCee2d7KTi4IhSFTAa+SVUTV6BmikhdUs6MwemyreyWFlxZD32huZKyWU9ZEAwwQ0Oq9gPqECWWZkdT4LInF6SLWLY=
- secure: E9gahGC9Swvy83Kos9LhFsxZp/zBI6Ll9lqQd6HxT7YSXj2YeoxSMCsF629bODPdtuMirhmFqReKZKL1lDpJBswr1sFtnmVavSwVBW4v/CIAQu0ENC85Knv1wgoAcl7cRisWaueSHJ0DyNstZZWGNWryIINg9zjFdrOSztDvoN8=
- secure: UxCvWwq2GcUdL3BtJyRMEFPHPRGIdPPLthThmWrmUE7dnblpDUdWVXKc62f7Y42qtHlhYh1EjxX0GJFcS1F0Lfge0e0cxDNWBATBoLKpC67kTyz/cUgqFEv6tsbkziBtbOrBuy6/LMZly1BqG/3fIDEJezkKOIqHF+pdApvAC/8=
32 changes: 31 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# ui-sortable directive [![Build Status](https://travis-ci.org/angular-ui/ui-sortable.png)](https://travis-ci.org/angular-ui/ui-sortable)
# UI.Sortable directive [![Build Status](https://travis-ci.org/angular-ui/ui-sortable.png)](https://travis-ci.org/angular-ui/ui-sortable)

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

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

- [Simple Demo](http://codepen.io/thgreasi/pen/BlFLp)
- [Connected Lists](http://codepen.io/thgreasi/pen/apwsb)


## Testing

We use Karma and jshint to ensure the quality of the code. The easiest way to run these checks is to use grunt:

```sh
npm install -g grunt-cli
npm install && bower install
grunt
```

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`


### Grunt Serve

We have one task to serve them all !

```sh
grunt serve
```

It's equal to run separately:

* `grunt connect:server` : giving you a development server at [http://127.0.0.1:8000/](http://127.0.0.1:8000/).

* `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`.

* `grunt watch` : will automatically test your code and build your demo. You can demo generation with `grunt build:gh-pages`.
13 changes: 2 additions & 11 deletions demo/demo.css
Original file line number Diff line number Diff line change
Expand Up @@ -20,10 +20,6 @@

/*** Extra ***/

body {
font-family: Verdana, 'Trebuchet ms', Tahoma;
}

.logList {
margin-top: 20px;
width: 250px;
Expand All @@ -41,11 +37,6 @@ body {
background-color: #FFF;
}

.container {
width:300px;
margin: auto;
ul[ui-sortable] {
float: right;
}

h2 {
text-align: center;
}
73 changes: 13 additions & 60 deletions demo/demo.html
Original file line number Diff line number Diff line change
@@ -1,61 +1,14 @@
<!DOCTYPE html>
<!--[if lt IE 7]> <html class="no-js lt-ie9 lt-ie8 lt-ie7"> <![endif]-->
<!--[if IE 7]> <html class="no-js lt-ie9 lt-ie8"> <![endif]-->
<!--[if IE 8]> <html class="no-js lt-ie9"> <![endif]-->
<!--[if gt IE 8]><!--> <html class="no-js"> <!--<![endif]-->
<head>
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
<title>AngularUI - Sortable Demo</title>
<base href=".."></base>
<link rel="stylesheet" href="bower_components/jquery-ui/themes/smoothness/jquery-ui.css">
<link rel="stylesheet" href="demo/demo.css">
<script type="text/javascript" src="bower_components/jquery/jquery.js"></script>
<script type="text/javascript" src="bower_components/jquery-ui/ui/jquery-ui.js"></script>
<script type="text/javascript" src="bower_components/angular/angular.js"></script>
<script type="text/javascript" src="src/sortable.js"></script>
<script type="text/javascript">
var myapp = angular.module('sortableApp', ['ui.sortable']);

myapp.controller('sortableController', function ($scope) {
var tmpList = [];

for (var i = 1; i <= 6; i++){
tmpList.push({
text: 'Item ' + i,
value: i
});
}

$scope.list = tmpList;


$scope.sortingLog = [];

$scope.sortableOptions = {
// called after a node is dropped
stop: function(e, ui) {
var logEntry = {
ID: $scope.sortingLog.length + 1,
Text: 'Moved element: ' + ui.item.scope().item.text
};
$scope.sortingLog.push(logEntry);
}
};
});
</script>
</head>
<body ng-app="sortableApp" ng-controller="sortableController">
<div class="container">
<h2>ui.sortable demo</h2>

<ul ui-sortable="sortableOptions" ng-model="list" class="list">
<li ng-repeat="item in list" class="item">{{item.text}}</li>
</ul>

<ul class="list logList">
<li ng-repeat="entry in sortingLog" class="logItem">{{entry.Text}}</li>
</ul>
<section ng-app="sortableApp" ng-controller="sortableController">
<div class="row">
<div class="span6">
<ul ui-sortable="sortableOptions" ng-model="list" class="list">
<li ng-repeat="item in list" class="item">{{item.text}}</li>
</ul>
</div>
<div class="span6">
<ul class="list logList">
<li ng-repeat="entry in sortingLog" class="logItem">{{entry.Text}}</li>
</ul>
</div>
</div>
</body>
</html>
</section>
30 changes: 30 additions & 0 deletions demo/demo.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
'use strict';

var myapp = angular.module('sortableApp', ['ui.sortable']);

myapp.controller('sortableController', function ($scope) {
var tmpList = [];

for (var i = 1; i <= 6; i++){
tmpList.push({
text: 'Item ' + i,
value: i
});
}

$scope.list = tmpList;


$scope.sortingLog = [];

$scope.sortableOptions = {
// called after a node is dropped
stop: function(e, ui) {
var logEntry = {
ID: $scope.sortingLog.length + 1,
Text: 'Moved element: ' + ui.item.scope().item.text
};
$scope.sortingLog.push(logEntry);
}
};
});
Loading