summaryrefslogtreecommitdiffstats
path: root/module/web/static/js/views/linkGrabberModal.js
diff options
context:
space:
mode:
authorGravatar RaNaN <Mast3rRaNaN@hotmail.de> 2013-03-20 21:39:30 +0100
committerGravatar RaNaN <Mast3rRaNaN@hotmail.de> 2013-03-20 21:39:30 +0100
commit63cef4c7d641ffddaeabcd768020674e2681ba05 (patch)
tree10b9ee50b927a7673d93db15b896a15a1012f482 /module/web/static/js/views/linkGrabberModal.js
parentadded ReadWrite lock, render file progress on dashboard (diff)
downloadpyload-63cef4c7d641ffddaeabcd768020674e2681ba05.tar.xz
improved ui, render waiting files
Diffstat (limited to 'module/web/static/js/views/linkGrabberModal.js')
-rw-r--r--module/web/static/js/views/linkGrabberModal.js29
1 files changed, 14 insertions, 15 deletions
diff --git a/module/web/static/js/views/linkGrabberModal.js b/module/web/static/js/views/linkGrabberModal.js
index 71f97f0bf..3d9a886db 100644
--- a/module/web/static/js/views/linkGrabberModal.js
+++ b/module/web/static/js/views/linkGrabberModal.js
@@ -26,23 +26,22 @@ define(['jquery', 'underscore', 'app', 'views/abstract/modalView', 'text!tpl/def
addPackage: function(e) {
var self = this;
- var settings = {
- type: 'POST',
- data: {
- name: JSON.stringify($('#inputPackageName').val()),
- links: JSON.stringify(['http://download.pyload.org/random.bin', 'http://download.pyload.org/random100.bin',
- 'invalid link', 'invalid link 2', 'invalid link 3', 'inavlid link 4',
- 'http://download.pyload.org/random.bin', 'http://download.pyload.org/random.bin', 'http://download.pyload.org/random.bin',
- 'A really really long invalid url that should exceed length of most of the urls by far and split into two lines'])
+ 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('api/addPackage', settings);
+ {
+ success: function() {
+ App.vent.trigger('package:added');
+ self.hide();
+ }
+ });
+
+ $.ajax(options);
$('#inputPackageName').val('');
+ $('#inputLinks').val('');
},
onShow: function() {