diff options
author | brantje <brantje@gmail.com> | 2016-10-12 21:12:28 +0300 |
---|---|---|
committer | brantje <brantje@gmail.com> | 2016-10-12 21:16:37 +0300 |
commit | 1a74def8dc02475ee0df2b9cd25d77ae7cb3007e (patch) | |
tree | 7d92b46d6a454d34c860ae27c586f3c78dbe18c8 /js/app/directives | |
parent | b658e2a4ca16e7cbec4e49186911be871f555885 (diff) |
Remove unused code
Diffstat (limited to 'js/app/directives')
-rw-r--r-- | js/app/directives/autoscroll.js | 2 | ||||
-rw-r--r-- | js/app/directives/clickselect.js | 2 | ||||
-rw-r--r-- | js/app/directives/colorfromstring.js | 4 | ||||
-rw-r--r-- | js/app/directives/credentialfield.js | 2 | ||||
-rw-r--r-- | js/app/directives/fileselect.js | 3 | ||||
-rw-r--r-- | js/app/directives/otp.js | 4 | ||||
-rw-r--r-- | js/app/directives/passwordgen.js | 4 | ||||
-rw-r--r-- | js/app/directives/progressbar.js | 4 | ||||
-rw-r--r-- | js/app/directives/qrreader.js | 7 | ||||
-rw-r--r-- | js/app/directives/tooltip.js | 6 | ||||
-rw-r--r-- | js/app/directives/use-theme.js | 4 |
11 files changed, 20 insertions, 22 deletions
diff --git a/js/app/directives/autoscroll.js b/js/app/directives/autoscroll.js index b30fd2ef..6f03b701 100644 --- a/js/app/directives/autoscroll.js +++ b/js/app/directives/autoscroll.js @@ -13,7 +13,7 @@ scope: { autoScroll: '=' }, - link: function postLink (scope, element, attrs) { + link: function postLink (scope) { scope.$watch('autoScroll', function () { $('#import_log').scrollTop($('#import_log')[0].scrollHeight); }, true); diff --git a/js/app/directives/clickselect.js b/js/app/directives/clickselect.js index 86220e00..dbd014e8 100644 --- a/js/app/directives/clickselect.js +++ b/js/app/directives/clickselect.js @@ -10,7 +10,7 @@ .directive('selectOnClick', ['$window', function ($window) { return { restrict: 'A', - link: function (scope, element, attrs) { + link: function (scope, element) { element.on('click', function () { if (!$window.getSelection().toString()) { // Required for mobile Safari diff --git a/js/app/directives/colorfromstring.js b/js/app/directives/colorfromstring.js index 62127749..ec9314f1 100644 --- a/js/app/directives/colorfromstring.js +++ b/js/app/directives/colorfromstring.js @@ -7,13 +7,13 @@ * # passwordGen */ angular.module('passmanApp') - .directive('colorFromString', ['$window', function ($window) { + .directive('colorFromString', [function () { return { restrict: 'A', scope:{ string: '=colorFromString' }, - link: function (scope, el, attr, ctrl) { + link: function (scope, el) { function genColor(str) { // java String#hashCode var hash = 0; for (var i = 0; i < str.length; i++) { diff --git a/js/app/directives/credentialfield.js b/js/app/directives/credentialfield.js index 0d040aa7..4725beae 100644 --- a/js/app/directives/credentialfield.js +++ b/js/app/directives/credentialfield.js @@ -27,7 +27,7 @@ '<div class="cell" ng-if="isLink"><a ng-href="{{value}}" target="_blank"><i tooltip="\'Open in new window\'" class="link fa fa-external-link"></i></a></div>' + '<div class="cell" ngclipboard-success="onSuccess(e);" ngclipboard-error="onError(e);" ngclipboard data-clipboard-text="{{value}}"><i tooltip="copy_msg" class="fa fa-clipboard"></i></div>' + '</div></span>', - link: function (scope, elem, attrs, modelCtrl) { + link: function (scope) { var expression = /(https?:\/\/(?:www\.|(?!www))[^\s\.]+\.[^\s]{2,}|www\.[^\s]+\.[^\s]{2,})/gi; var regex = new RegExp(expression); diff --git a/js/app/directives/fileselect.js b/js/app/directives/fileselect.js index 60b3e25a..8f258042 100644 --- a/js/app/directives/fileselect.js +++ b/js/app/directives/fileselect.js @@ -17,7 +17,7 @@ progress: '&progress' }, - link: function (scope, el, attr, ctrl) { + link: function (scope, el) { scope.success = scope.success(); scope.error = scope.error(); scope.progress = scope.progress(); @@ -44,7 +44,6 @@ el.bind('change', function (e) { var _queueTotalFileSize = 0; - var _queueProgressBytes = 0; var i; //Calcutate total size for (i = 0; i < e.target.files.length; i++) { diff --git a/js/app/directives/otp.js b/js/app/directives/otp.js index b03610d0..2765c3b6 100644 --- a/js/app/directives/otp.js +++ b/js/app/directives/otp.js @@ -54,7 +54,7 @@ secret: '=' }, replace: true, - link: function (scope, element) { + link: function (scope) { scope.otp = null; scope.timeleft = null; scope.timer = null; @@ -93,7 +93,7 @@ }, true); scope.$on( "$destroy", - function (event) { + function () { $timeout.cancel(scope.timer); } ); diff --git a/js/app/directives/passwordgen.js b/js/app/directives/passwordgen.js index 42511aea..56367368 100644 --- a/js/app/directives/passwordgen.js +++ b/js/app/directives/passwordgen.js @@ -9,7 +9,7 @@ */ angular.module('passmanApp') - .directive('passwordGen', function ($timeout, $window) { + .directive('passwordGen', function ($timeout) { /* jshint ignore:start */ function Arcfour () { this.j = this.i = 0, this.S = [] @@ -136,7 +136,7 @@ "</button>" + "</div>" + "</div>", - link: function (scope, elem, attrs, modelCtrl) { + link: function (scope) { scope.callback = scope.callback(); scope.$watch("model", function () { scope.password = scope.model; diff --git a/js/app/directives/progressbar.js b/js/app/directives/progressbar.js index 0b4d9e11..fd966763 100644 --- a/js/app/directives/progressbar.js +++ b/js/app/directives/progressbar.js @@ -7,7 +7,7 @@ * # passwordGen */ angular.module('passmanApp') - .directive('progressBar', ['$window', function ($window) { + .directive('progressBar', [function () { return { restrict: 'A', template: '' + @@ -24,7 +24,7 @@ total: '=total' }, - link: function (scope, el, attr, ctrl) { + link: function () { } }; diff --git a/js/app/directives/qrreader.js b/js/app/directives/qrreader.js index 824e99a6..8e735880 100644 --- a/js/app/directives/qrreader.js +++ b/js/app/directives/qrreader.js @@ -7,12 +7,11 @@ * @description * # passwordGen */ - angular.module('passmanApp').directive("qrread", ['$parse', '$compile', - function ($parse, $compile) { + angular.module('passmanApp').directive("qrread", ['$parse', + function ($parse) { return { scope: true, link: function (scope, element, attributes) { - var gCtx = null, gCanvas = null, c = 0, stype = 0, gUM = false, webkit = false, moz = false; var invoker = $parse(attributes.onRead); scope.imageData = null; @@ -29,7 +28,7 @@ element.bind("change", function (changeEvent) { var reader = new FileReader(), file = changeEvent.target.files[0]; reader.readAsDataURL(file); - reader.onload = (function (theFile) { + reader.onload = (function () { return function (e) { //gCtx.clearRect(0, 0, gCanvas.width, gCanvas.height); scope.imageData = e.target.result; diff --git a/js/app/directives/tooltip.js b/js/app/directives/tooltip.js index 78c3257f..9aae59dd 100644 --- a/js/app/directives/tooltip.js +++ b/js/app/directives/tooltip.js @@ -7,15 +7,15 @@ * # passwordGen */ angular.module('passmanApp') - .directive('tooltip', ['$window', function ($window) { + .directive('tooltip', [function () { return { restrict: 'A', scope: { tooltip: '=tooltip' }, - link: function (scope, el, attr, ctrl) { - scope.$watch('tooltip', function (newVal, old) { + link: function (scope, el) { + scope.$watch('tooltip', function () { if (scope.tooltip) { jQuery(el).attr('title', scope.tooltip); jQuery(el).tooltip(); diff --git a/js/app/directives/use-theme.js b/js/app/directives/use-theme.js index d981d158..62b0f0d0 100644 --- a/js/app/directives/use-theme.js +++ b/js/app/directives/use-theme.js @@ -7,7 +7,7 @@ * # passwordGen */ angular.module('passmanApp') - .directive('useTheme', ['$window', function ($window) { + .directive('useTheme', [function () { function invertColor (hexTripletColor) { var color = hexTripletColor; @@ -27,7 +27,7 @@ color: '=', negative: '=' }, - link: function (scope, el, attr, ctrl) { + link: function (scope, el) { var _color = jQuery('#header').css('background-color'); var _bg = _color; if (scope.negative) { |