Initial commit
This commit is contained in:
20
api-wiaas/client/js/bower_components/ngclipboard/src/.jshintrc
vendored
Normal file
20
api-wiaas/client/js/bower_components/ngclipboard/src/.jshintrc
vendored
Normal file
@@ -0,0 +1,20 @@
|
||||
{
|
||||
"curly": true,
|
||||
"eqeqeq": true,
|
||||
"immed": true,
|
||||
"latedef": true,
|
||||
"newcap": true,
|
||||
"noarg": true,
|
||||
"sub": true,
|
||||
"undef": true,
|
||||
"unused": true,
|
||||
"boss": true,
|
||||
"eqnull": true,
|
||||
"browser": true,
|
||||
"predef": [
|
||||
"angular",
|
||||
"Clipboard",
|
||||
"require",
|
||||
"module"
|
||||
]
|
||||
}
|
||||
50
api-wiaas/client/js/bower_components/ngclipboard/src/ngclipboard.js
vendored
Normal file
50
api-wiaas/client/js/bower_components/ngclipboard/src/ngclipboard.js
vendored
Normal file
@@ -0,0 +1,50 @@
|
||||
(function() {
|
||||
'use strict';
|
||||
var MODULE_NAME = 'ngclipboard';
|
||||
var angular, ClipboardJS;
|
||||
|
||||
// Check for CommonJS support
|
||||
if (typeof module === 'object' && module.exports) {
|
||||
angular = require('angular');
|
||||
ClipboardJS = require('clipboard');
|
||||
module.exports = MODULE_NAME;
|
||||
} else {
|
||||
angular = window.angular;
|
||||
ClipboardJS = window.ClipboardJS;
|
||||
}
|
||||
|
||||
angular.module(MODULE_NAME, []).directive('ngclipboard', function() {
|
||||
return {
|
||||
restrict: 'A',
|
||||
scope: {
|
||||
ngclipboardSuccess: '&',
|
||||
ngclipboardError: '&'
|
||||
},
|
||||
link: function(scope, element) {
|
||||
//constructor for clipboardjs changed to ClipboardJS
|
||||
var clipboard = new ClipboardJS(element[0]);
|
||||
|
||||
clipboard.on('success', function(e) {
|
||||
scope.$apply(function () {
|
||||
scope.ngclipboardSuccess({
|
||||
e: e
|
||||
});
|
||||
});
|
||||
});
|
||||
|
||||
clipboard.on('error', function(e) {
|
||||
scope.$apply(function () {
|
||||
scope.ngclipboardError({
|
||||
e: e
|
||||
});
|
||||
});
|
||||
});
|
||||
|
||||
element.on('$destroy', function() {
|
||||
clipboard.destroy();
|
||||
});
|
||||
|
||||
}
|
||||
};
|
||||
});
|
||||
})();
|
||||
Reference in New Issue
Block a user