summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorGravatar RaNaN <Mast3rRaNaN@hotmail.de> 2013-12-04 19:45:15 +0100
committerGravatar RaNaN <Mast3rRaNaN@hotmail.de> 2013-12-04 19:45:15 +0100
commitdfbb7dbeb5551b7b60aa05e59855f628c2e001ea (patch)
tree471e297783ce906869e32322d71e4de6d04e1c90
parentfixed changing the dl speed limit (diff)
downloadpyload-dfbb7dbeb5551b7b60aa05e59855f628c2e001ea.tar.xz
password field for linkgrabber
-rw-r--r--pyload/web/app/scripts/models/CollectorPackage.js4
-rw-r--r--pyload/web/app/scripts/views/linkgrabber/packageView.js11
-rw-r--r--pyload/web/app/templates/default/linkgrabber/package.html10
3 files changed, 21 insertions, 4 deletions
diff --git a/pyload/web/app/scripts/models/CollectorPackage.js b/pyload/web/app/scripts/models/CollectorPackage.js
index b608b8e18..9582c6af8 100644
--- a/pyload/web/app/scripts/models/CollectorPackage.js
+++ b/pyload/web/app/scripts/models/CollectorPackage.js
@@ -6,6 +6,7 @@ define(['jquery', 'backbone', 'underscore', 'app', 'utils/apitypes', 'collection
idAttribute: 'name',
defaults: {
name: 'Unnamed package',
+ password: null,
new_name: null,
links: null
},
@@ -41,7 +42,8 @@ define(['jquery', 'backbone', 'underscore', 'app', 'utils/apitypes', 'collection
$.ajax(App.apiRequest('addPackage',
{name: this.getName(),
- links: links},
+ links: links,
+ password: this.get('password')},
{success: function() {
self.destroy();
App.vent.trigger('package:added');
diff --git a/pyload/web/app/scripts/views/linkgrabber/packageView.js b/pyload/web/app/scripts/views/linkgrabber/packageView.js
index 356d39b4b..a9d04ced6 100644
--- a/pyload/web/app/scripts/views/linkgrabber/packageView.js
+++ b/pyload/web/app/scripts/views/linkgrabber/packageView.js
@@ -13,7 +13,8 @@ define(['jquery', 'underscore', 'backbone', 'app', 'hbs!tpl/linkgrabber/package'
ui: {
'name': '.name',
- 'table': 'table'
+ 'table': 'table',
+ 'password': '.password'
},
events: {
@@ -21,6 +22,7 @@ define(['jquery', 'underscore', 'backbone', 'app', 'hbs!tpl/linkgrabber/package'
'click .name': 'renamePackage',
'keyup .name input': 'saveName',
'click .btn-add': 'addPackage',
+ 'click .btn-password': 'togglePassword',
'click .btn-delete': 'deletePackage',
'click .btn-mini': 'deleteLink'
},
@@ -35,6 +37,7 @@ define(['jquery', 'underscore', 'backbone', 'app', 'hbs!tpl/linkgrabber/package'
addPackage: function(e) {
e.stopPropagation();
+ this.model.set('password', this.ui.password.val());
this.model.add();
return false;
},
@@ -80,6 +83,12 @@ define(['jquery', 'underscore', 'backbone', 'app', 'hbs!tpl/linkgrabber/package'
this.expanded ^= true;
this.ui.table.toggle();
return false;
+ },
+
+ togglePassword: function(e) {
+ var el = $(e.target);
+ el.find('i').toggleClass('icon-lock icon-unlock');
+ this.ui.password.toggle();
}
});
diff --git a/pyload/web/app/templates/default/linkgrabber/package.html b/pyload/web/app/templates/default/linkgrabber/package.html
index d5d4c669b..2efdc2b35 100644
--- a/pyload/web/app/templates/default/linkgrabber/package.html
+++ b/pyload/web/app/templates/default/linkgrabber/package.html
@@ -1,8 +1,14 @@
<span class="name">
<strong>{{name }}</strong>
<input type="text" value="{{name}}">
-</span> -
-<button class="btn btn-small btn-blue btn-expand"><i class="icon-arrow-down"></i> </button> <button class="btn btn-small btn-success btn-add"><i class="icon-plus"></i> </button> <button class="btn btn-small btn-danger btn-delete"><i class="icon-trash"></i> </button> <br>
+</span> &nbsp;
+<button class="btn btn-small btn-blue btn-expand"><i class="icon-arrow-down"></i> </button>
+
+<input type="password" value="{{password}}"
+ class="password pull-right input-small" {{#unless password}}style="display: none"{{/unless}}>
+<button class="btn btn-small btn-password pull-right"><i class="icon-unlock"></i> </button>
+<button class="btn btn-small btn-danger btn-delete pull-right"><i class="icon-trash"></i> </button>
+<button class="btn btn-small btn-success btn-add pull-right"><i class="icon-plus"></i> </button>
<table class="table table-condensed" {{#unless expanded}}style="display: none"{{/unless}}>
<tbody>
{{#each links}}