Skip to content

Commit fffa26b

Browse files
committed
tech(lib upgrade): updated jquery to 3.1, fixes grafana#6034
1 parent 25139c7 commit fffa26b

File tree

135 files changed

+12255
-2378
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

135 files changed

+12255
-2378
lines changed

bower.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,11 +13,12 @@
1313
"tests"
1414
],
1515
"dependencies": {
16-
"jquery": "~2.2.4",
16+
"jquery": "~3.1.0",
1717
"angular": "~1.5.9",
1818
"angular-route": "~1.5.9",
1919
"angular-mocks": "~1.5.9",
2020
"angular-sanitize": "~1.5.9",
21+
"angular-native-dragdrop": "~1.2.2",
2122
"angular-bindonce": "~0.3.3"
2223
}
2324
}
Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
1+
{
2+
"name": "angular-native-dragdrop",
3+
"version": "1.2.2",
4+
"homepage": "http://angular-dragdrop.github.io/angular-dragdrop",
5+
"authors": [
6+
"ganarajpr"
7+
],
8+
"description": "Angular HTML5 Drag and Drop directive written in pure with no dependency on JQuery.",
9+
"main": "draganddrop.js",
10+
"keywords": [
11+
"angular",
12+
"drag",
13+
"drop",
14+
"html5"
15+
],
16+
"dependencies": {
17+
"angular": "^1.3"
18+
},
19+
"license": "MIT",
20+
"ignore": [
21+
"**/.*",
22+
"node_modules",
23+
"bower_components",
24+
"test",
25+
"tests"
26+
],
27+
"_release": "1.2.2",
28+
"_resolution": {
29+
"type": "version",
30+
"tag": "1.2.2",
31+
"commit": "e630636fdc39fef815c1c534340aa16caf76a04c"
32+
},
33+
"_source": "https://github.com/angular-dragdrop/angular-dragdrop.git",
34+
"_target": "~1.2.2",
35+
"_originalSource": "angular-native-dragdrop"
36+
}
Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
/* jshint -W097 */
2+
'use strict';
3+
4+
/* global require */
5+
var jshint = require('gulp-jshint');
6+
var stylish = require('jshint-stylish');
7+
var uglify = require('gulp-uglify');
8+
var rename = require('gulp-rename');
9+
var gulp = require('gulp');
10+
11+
gulp.task('lint', function() {
12+
return gulp.src('./draganddrop.js')
13+
.pipe(jshint())
14+
.pipe(jshint.reporter(stylish));
15+
});
16+
gulp.task('compress', function() {
17+
return gulp.src('./draganddrop.js')
18+
.pipe(uglify())
19+
.pipe(rename({
20+
extname: '.min.js'
21+
}))
22+
.pipe(gulp.dest('./'));
23+
});
24+
25+
gulp.task('default', ['lint', 'compress']);
Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
2+
The MIT License
3+
4+
Copyright (c) 2015 Ganaraj P R, [Nebithi](http://www.nebithi.com)
5+
6+
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
7+
8+
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
9+
10+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
{
2+
"name": "angular-native-dragdrop",
3+
"version": "1.2.1",
4+
"homepage": "http://angular-dragdrop.github.io/angular-dragdrop",
5+
"authors": [
6+
"ganarajpr"
7+
],
8+
"description": "Angular HTML5 Drag and Drop directive written in pure with no dependency on JQuery.",
9+
"main": "draganddrop.js",
10+
"keywords": [
11+
"angular",
12+
"drag",
13+
"drop",
14+
"html5"
15+
],
16+
"dependencies": {
17+
"angular": "^1.3"
18+
},
19+
"license": "MIT",
20+
"ignore": [
21+
"**/.*",
22+
"node_modules",
23+
"bower_components",
24+
"test",
25+
"tests"
26+
]
27+
}
Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
body {
2+
background-color: #f8f7f8;
3+
}
4+
5+
.heading {
6+
border-bottom: 1px solid #b7b7b7;
7+
padding-bottom: 10px;
8+
margin-bottom: 10px;
9+
}
10+
11+
.topRow {
12+
margin-bottom: 30px;
13+
}
14+
15+
.on-drag-enter {
16+
background-color : #677ba6;
17+
}
18+
19+
.on-drag-enter-custom {
20+
background-color : #d78cc7;
21+
}
22+
23+
.on-drag-hover {
24+
background-color : #3eb352;
25+
}
26+
27+
.on-drag-hover-custom {
28+
background-color : #d7a931;
29+
}
Lines changed: 178 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,178 @@
1+
<!DOCTYPE html>
2+
<html ng-app="app">
3+
4+
<head>
5+
<meta charset="utf-8" />
6+
<title>Angular DragDrop (Demo)</title>
7+
<script>document.write('<base href="' + document.location + '" />');</script>
8+
<link rel="stylesheet" href="css/styles.css" />
9+
<script data-require="angular.js@1.4.x" src="https://ajax.googleapis.com/ajax/libs/angularjs/1.4.3/angular.js" data-semver="1.4.3"></script>
10+
<script src="http://pc035860.github.io/angular-highlightjs/angular-highlightjs.min.js"></script>
11+
<script src="js/app.js"></script>
12+
<script src="../draganddrop.js"></script>
13+
<link href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.5/css/bootstrap.min.css" rel="stylesheet">
14+
</head>
15+
16+
<body >
17+
<div class="container">
18+
<div class="row topRow">
19+
<h4 class="heading">
20+
Drag and drop between the two lists.
21+
</h4>
22+
</div>
23+
24+
<h3>Beasts</h3>
25+
26+
<p>Left column of beasts is not draggable and accepts both beasts and priests</p>
27+
28+
<hr>
29+
30+
<div class="row" ng-controller="MainCtrl">
31+
<div class="col-xs-6">
32+
<ul ui-on-drop="onDrop($event,$data,men)" drag-enter-class="on-drag-enter-custom"
33+
drop-channel="beasts,priests"
34+
drop-validate="dropValidateHandler($drop, $event, $data)">
35+
<li ui-draggable="false" drag="man" drag-channel="beasts"
36+
on-drop-success="dropSuccessHandler($event,$index,men)"
37+
ng-repeat="man in men track by $index">
38+
{{man}}
39+
</li>
40+
</ul>
41+
</div>
42+
<div class="col-xs-6">
43+
<ul ui-on-drop="onDrop($event,$data,women)"
44+
drop-channel="beasts"
45+
drop-validate="dropValidateHandler($drop, $event, $data)">
46+
<li ui-draggable="true" drag="woman" drag-channel="beasts"
47+
on-drop-success="dropSuccessHandler($event,$index,women)"
48+
on-drop-failure="dropFailureHandler($event,$index,women)"
49+
ng-repeat="woman in women track by $index">
50+
{{woman}}
51+
</li>
52+
</ul>
53+
</div>
54+
</div>
55+
56+
<hr>
57+
58+
<h3>Priests</h3>
59+
60+
<hr>
61+
62+
<div class="row" ng-controller="MainCtrl">
63+
<div class="col-xs-6">
64+
<ul ui-on-drop="onDrop($event,$data,men)"
65+
drop-channel="priests"
66+
drop-validate="dropValidateHandler($drop, $event, $data)">
67+
<li ui-draggable="true" drag="man"
68+
drag-channel="priests"
69+
on-drop-success="dropSuccessHandler($event,$index,men)"
70+
ng-repeat="man in men track by $index">
71+
{{man}}
72+
</li>
73+
</ul>
74+
</div>
75+
<div class="col-xs-6">
76+
<ul ui-on-drop="onDrop($event,$data,women)"
77+
drop-channel="priests"
78+
drop-validate="dropValidateHandler($drop, $event, $data)">
79+
<li ui-draggable="true" drag="woman"
80+
drag-channel="priests"
81+
on-drop-success="dropSuccessHandler($event,$index,women)"
82+
ng-repeat="woman in women track by $index">
83+
{{woman}}
84+
</li>
85+
</ul>
86+
</div>
87+
</div>
88+
89+
<hr>
90+
91+
<h3>Terrorists</h3>
92+
93+
<p>Each terrorist list item accepts a new terrorist. Shows inserting into a particular
94+
position in an array.</p>
95+
96+
<hr>
97+
98+
99+
<div class="row" ng-controller="MainCtrl">
100+
<div class="col-xs-6">
101+
<ul>
102+
<li ui-draggable="true" drag="man"
103+
drag-channel="terrorists2"
104+
drop-validate="dropValidateHandler($drop, $event, $data)"
105+
drag-hover-class="on-drag-hover-custom"
106+
on-drop-success="dropSuccessHandler($event,$index,men)"
107+
ui-on-drop="onDrop($event,$data,men,$index)" drop-channel="terrorists1"
108+
ng-repeat="man in men track by $index">
109+
{{man}}
110+
</li>
111+
</ul>
112+
</div>
113+
<div class="col-xs-6">
114+
<ul>
115+
<li ui-draggable="true" drag="woman"
116+
drag-channel="terrorists1"
117+
drop-validate="dropValidateHandler($drop, $event, $data)"
118+
drag-hover-class="on-drag-hover-custom"
119+
ui-on-drop="onDrop($event,$data,women,$index)" drop-channel="terrorists2"
120+
on-drop-success="dropSuccessHandler($event,$index,women)"
121+
ng-repeat="woman in women track by $index">
122+
{{woman}}
123+
</li>
124+
</ul>
125+
</div>
126+
</div>
127+
128+
<hr>
129+
130+
<h3>Custom Drag Image</h3>
131+
132+
<p>You may specify a drag-image-element-id to use as the drag image. You can use the
133+
<a href="http://www.kryogenix.org/code/browser/custom-drag-image.html" target="_blank">ghost image</a>
134+
technique for the custom drag image.</p>
135+
136+
<hr>
137+
138+
139+
<div class="row" ng-controller="MainCtrl">
140+
<div class="col-xs-6">
141+
<ul>
142+
<li ui-draggable="true" drag="man"
143+
drag-channel="customImage2"
144+
drop-validate="dropValidateHandler($drop, $event, $data)"
145+
drag-hover-class="on-drag-hover-custom"
146+
drag-image-element-id="getCustomDragElementId($index)"
147+
on-drop-success="dropSuccessHandler($event,$index,men)"
148+
ui-on-drop="onDrop($event,$data,men,$index)"
149+
drop-channel="customImage1"
150+
ng-repeat="man in men track by $index">
151+
{{man}}
152+
</li>
153+
</ul>
154+
</div>
155+
<div class="col-xs-6">
156+
<ul>
157+
<li ui-draggable="true" drag="woman"
158+
drag-channel="customImage1"
159+
drop-validate="dropValidateHandler($drop, $event, $data)"
160+
drag-hover-class="on-drag-hover-custom"
161+
drag-image-element-id="getCustomDragElementId($index)"
162+
ui-on-drop="onDrop($event,$data,women,$index)"
163+
drop-channel="customImage2"
164+
on-drop-success="dropSuccessHandler($event,$index,women)"
165+
ng-repeat="woman in women track by $index">
166+
{{woman}}
167+
</li>
168+
</ul>
169+
</div>
170+
</div>
171+
172+
<div id="customDrag0" class="alert alert-info" style="max-width: 200px">Custom drag image #1</div>
173+
<div id="customDrag1" class="alert alert-danger" style="position: absolute; top: 0; right: 0; z-index: -2; max-width: 200px">Custom drag image #2</div>
174+
<div id="coverUp" style="position: absolute; top: 0; right: 0; z-index: -1; background-color: white; width: 200px; height: 60px"></div>
175+
</div>
176+
</body>
177+
178+
</html>
Lines changed: 54 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,54 @@
1+
angular.module('app', [
2+
'hljs',
3+
'ang-drag-drop'
4+
]).controller('MainCtrl', function($scope) {
5+
$scope.men = [
6+
'John',
7+
'Jack',
8+
'Mark',
9+
'Ernie',
10+
'Mike (Locked)'
11+
];
12+
13+
14+
$scope.women = [
15+
'Jane',
16+
'Jill',
17+
'Betty',
18+
'Mary'
19+
];
20+
21+
$scope.addText = '';
22+
23+
$scope.dropValidateHandler = function($drop, $event, $data) {
24+
if ($data === 'Mike (Locked)') {
25+
return false;
26+
}
27+
if ($drop.element[0] === $event.srcElement.parentNode) {
28+
// Don't allow moving to same container
29+
return false;
30+
}
31+
return true;
32+
};
33+
34+
$scope.dropSuccessHandler = function($event, index, array) {
35+
array.splice(index, 1);
36+
};
37+
38+
$scope.dropFailureHandler = function($event, index, array) {
39+
alert(array[index] + ' could be dropped into left list!')
40+
};
41+
42+
$scope.onDrop = function($event, $data, array, index) {
43+
if (index !== undefined) {
44+
array.splice(index, 0, $data);
45+
} else {
46+
array.push($data);
47+
}
48+
};
49+
50+
$scope.getCustomDragElementId = function (index) {
51+
return 'customDrag' + (index % 2);
52+
}
53+
54+
});
Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
#Examples
2+
3+
##Simple Usage
4+
<iframe style="width: 100%; height: 500px" src="http://embed.plnkr.co/5RLvCpDPoRcEk6u77dBM" frameborder="0" allowfullscreen="allowfullscreen"></iframe>
5+
6+
7+
##With drop validation
8+
<iframe style="width: 100%; height: 500px" src="http://embed.plnkr.co/xRmz4TlCvlJKxybGrhQH" frameborder="0" allowfullscreen="allowfullscreen"></iframe>

0 commit comments

Comments
 (0)