diff options
author | brantje <brantje@gmail.com> | 2017-02-18 17:26:08 +0300 |
---|---|---|
committer | brantje <brantje@gmail.com> | 2017-02-22 20:02:55 +0300 |
commit | 9e7f47a715724fc5cf01d5ddcf11a73b723d224c (patch) | |
tree | d5438b886c2481aa8c818a6f12cf032b5a616b1b /js/app/directives | |
parent | 3dd9e84de7c306dd6c543bd4e69432ff3935cbb4 (diff) |
Add a generic CSV importer
Diffstat (limited to 'js/app/directives')
-rw-r--r-- | js/app/directives/autoscroll.js | 4 | ||||
-rw-r--r-- | js/app/directives/credentialtemplate.js | 47 | ||||
-rw-r--r-- | js/app/directives/fileselect.js | 12 |
3 files changed, 56 insertions, 7 deletions
diff --git a/js/app/directives/autoscroll.js b/js/app/directives/autoscroll.js index 714bb225..38cd9a11 100644 --- a/js/app/directives/autoscroll.js +++ b/js/app/directives/autoscroll.js @@ -35,9 +35,9 @@ scope: { autoScroll: '=' }, - link: function postLink (scope) { + link: function postLink (scope, el) { scope.$watch('autoScroll', function () { - $('#import_log').scrollTop($('#import_log')[0].scrollHeight); + $(el).scrollTop($(el)[0].scrollHeight); }, true); } }; diff --git a/js/app/directives/credentialtemplate.js b/js/app/directives/credentialtemplate.js new file mode 100644 index 00000000..66f47271 --- /dev/null +++ b/js/app/directives/credentialtemplate.js @@ -0,0 +1,47 @@ +/** + * Nextcloud - passman + * + * @copyright Copyright (c) 2016, Sander Brand (brantje@gmail.com) + * @copyright Copyright (c) 2016, Marcos Zuriaga Miguel (wolfi@wolfi.es) + * @license GNU AGPL version 3 or any later version + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU Affero General Public License as + * published by the Free Software Foundation, either version 3 of the + * License, or (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Affero General Public License for more details. + * + * You should have received a copy of the GNU Affero General Public License + * along with this program. If not, see <http://www.gnu.org/licenses/>. + * + */ + +(function () { + 'use strict'; + /** + * @ngdoc directive + * @name passmanApp.directive:passwordGen + * @description + * # passwordGen + */ + angular.module('passmanApp') + .directive('credentialTemplate', [function () { + return { + templateUrl: 'views/partials/credential_template.html', + replace: true, + restrict: 'A', + scope: { + credential: '=credentialTemplate' + }, + + link: function (scope, element, attrs) { + console.log(attrs.showLabel) + scope.showLabel = (attrs.hasOwnProperty('showLabel')); + } + }; + }]); +}());
\ No newline at end of file diff --git a/js/app/directives/fileselect.js b/js/app/directives/fileselect.js index c7dfcf1c..20ecc0f1 100644 --- a/js/app/directives/fileselect.js +++ b/js/app/directives/fileselect.js @@ -53,11 +53,13 @@ fileReader.onprogress = function (event) { var percent = (event.loaded / event.total * 100); - scope.$apply(scope.progress({ - file_total: event.total, - file_loaded: event.loaded, - file_percent: percent - })); + if(scope.progress) { + scope.$apply(scope.progress({ + file_total: event.total, + file_loaded: event.loaded, + file_percent: percent + })); + } }; fileReader.onerror = function () { |