diff options
Diffstat (limited to 'module/web/static/js/views/linkGrabberModal.js')
-rw-r--r-- | module/web/static/js/views/linkGrabberModal.js | 48 |
1 files changed, 0 insertions, 48 deletions
diff --git a/module/web/static/js/views/linkGrabberModal.js b/module/web/static/js/views/linkGrabberModal.js deleted file mode 100644 index e2b6e985d..000000000 --- a/module/web/static/js/views/linkGrabberModal.js +++ /dev/null @@ -1,48 +0,0 @@ -define(['jquery', 'underscore', 'app', 'views/abstract/modalView', 'text!tpl/default/linkgrabber.html'], - function($, _, App, modalView, template) { - // Modal dialog for package adding - triggers package:added when package was added - return modalView.extend({ - - events: { - 'click .btn-success': 'addPackage', - 'keypress #inputPackageName': 'addOnEnter' - }, - - template: _.compile(template), - - initialize: function() { - // Inherit parent events - this.events = _.extend({}, modalView.prototype.events, this.events); - }, - - addOnEnter: function(e) { - if (e.keyCode != 13) return; - this.addPackage(e); - }, - - addPackage: function(e) { - var self = this; - var options = App.apiRequest('addPackage', - { - name: $('#inputPackageName').val(), - // TODO: better parsing / tokenization - links: $('#inputLinks').val().split("\n") - }, - { - success: function() { - App.vent.trigger('package:added'); - self.hide(); - } - }); - - $.ajax(options); - $('#inputPackageName').val(''); - $('#inputLinks').val(''); - }, - - onShow: function() { - this.$('#inputPackageName').focus(); - } - - }); - });
\ No newline at end of file |