diff options
Diffstat (limited to 'pyload/web/app/scripts/views/linkGrabberModal.js')
-rw-r--r-- | pyload/web/app/scripts/views/linkGrabberModal.js | 49 |
1 files changed, 0 insertions, 49 deletions
diff --git a/pyload/web/app/scripts/views/linkGrabberModal.js b/pyload/web/app/scripts/views/linkGrabberModal.js deleted file mode 100644 index e6f59c134..000000000 --- a/pyload/web/app/scripts/views/linkGrabberModal.js +++ /dev/null @@ -1,49 +0,0 @@ -define(['jquery', 'underscore', 'app', 'views/abstract/modalView', 'hbs!tpl/dialogs/linkgrabber'], - function($, _, App, modalView, template) { - 'use strict'; - // Modal dialog for package adding - triggers package:added when package was added - return modalView.extend({ - - events: { - 'click .btn-success': 'addPackage', - 'keypress #inputPackageName': 'addOnEnter' - }, - - template: 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 |