Added Per download specific settings along with more UI tweaks
This commit is contained in:
parent
3589434d97
commit
23591212b0
90
index.html
90
index.html
|
@ -29,7 +29,7 @@
|
|||
|
||||
<!-- external javascript dependencies -->
|
||||
<script src="js/libs/jquery-2.1.0.js"></script>
|
||||
<script src="js/libs/underscore.js"></script>
|
||||
<script src="js/libs/lodash.js"></script>
|
||||
|
||||
<script src="js/libs/angular.js"></script>
|
||||
|
||||
|
@ -70,9 +70,9 @@
|
|||
<script src="js/services/rpc/helpers.js"></script>
|
||||
|
||||
|
||||
<script src="js/ctrls/main.js"></script>
|
||||
<script src="js/ctrls/modal.js"></script>
|
||||
<script src="js/ctrls/nav.js"></script>
|
||||
<script src="js/ctrls/download.js"></script>
|
||||
<script src="js/ctrls/alert.js"></script>
|
||||
<script src="js/ctrls/props.js"></script>
|
||||
|
||||
|
@ -80,10 +80,10 @@
|
|||
</head>
|
||||
<!-- }}} -->
|
||||
|
||||
<body>
|
||||
<body ng-controller="MainCtrl">
|
||||
|
||||
<!-- {{{ header -->
|
||||
<div class="navbar navbar-inverse navbar-fixed-top" ng-controller="NavCtrl">
|
||||
<div class="navbar navbar-inverse navbar-fixed-top">
|
||||
<div class="navbar-inner">
|
||||
<div class="container">
|
||||
<!-- using a span for collapse rather than a to fix the angular majic on anchors -->
|
||||
|
@ -97,7 +97,12 @@
|
|||
|
||||
<a class="brand"><span class="icon-circle-arrow-down"></span> {{ name }}</a>
|
||||
|
||||
<div class="nav-collapse" collapse="collapsed">
|
||||
<form class="navbar-form pull-right control-group">
|
||||
<input class="span3 input-large" type="text" placeholder="Search" ng-model="downloadFilter" autocomplete="off" ng-change="onDownloadFilter()"></input>
|
||||
</form>
|
||||
<div class="nav-collapse" collapse="collapsed" ng-controller="NavCtrl">
|
||||
|
||||
<!-- {{{ Nav menu -->
|
||||
<ul class="nav">
|
||||
<li class="dropdown">
|
||||
<a class="dropdown-toggle" href="#">
|
||||
|
@ -202,6 +207,8 @@
|
|||
</ul>
|
||||
</li>
|
||||
</ul>
|
||||
<!-- }}} -->
|
||||
|
||||
</div><!--/.nav-collapse -->
|
||||
</div>
|
||||
</div>
|
||||
|
@ -209,7 +216,7 @@
|
|||
<!-- }}} -->
|
||||
|
||||
<!-- {{{ body -->
|
||||
<div role="main" class="container" ng-controller="DownloadCtrl">
|
||||
<div role="main" class="container">
|
||||
|
||||
<!-- {{{ alerts -->
|
||||
<div ng-controller="AlertCtrl" class="row alerts">
|
||||
|
@ -239,11 +246,6 @@
|
|||
<!-- {{{ download template -->
|
||||
<form id="filters" class="clearfix">
|
||||
<fieldset>
|
||||
<p>
|
||||
<label for="download-filter" id="download-filter-label">Search
|
||||
<input id="download-filter" type="text" ng-model="downloadFilter" autocomplete="off" ng-change="onDownloadFilter()" class="input-large"/></label>
|
||||
<button ng-click="clearFilter()" class="btn btn-default btn-mini">Clear</button>
|
||||
</p>
|
||||
<p>
|
||||
<label for="filter-speed">
|
||||
<input type="checkbox" ng-model="filterSpeed" ng-change="persistFilters()" id="filter-speed">
|
||||
|
@ -619,11 +621,27 @@ http://ex1.com/f2.mp4 http://ex2.com/f2.mp4
|
|||
</pre>
|
||||
</p>
|
||||
<textarea rows="6" style="width: 100%" ng-model="getUris.uris"></textarea>
|
||||
|
||||
<div class="control-group">
|
||||
<div ng-repeat="(name, set) in getUris.settings">
|
||||
<label class="control-label">{{name}}</label>
|
||||
|
||||
<div class="controls">
|
||||
<select ng-show="set.options.length" ng-options="opt for opt in set.options" ng-model="set.val">
|
||||
</select>
|
||||
<input ng-show="!set.options.length" typ="text" class="input-xlarge" ng-model="set.val"/>
|
||||
</div>
|
||||
<br><br>
|
||||
</div>
|
||||
</div>
|
||||
</fieldset>
|
||||
|
||||
<button class="btn" ng-click="getUris.advance_opts()">Add Download Specific Options</button>
|
||||
|
||||
</form>
|
||||
<div class="modal-footer">
|
||||
<button class="btn btn-warning" ng-click="$dismiss()">Cancel</button>
|
||||
<button class="btn btn-success" ng-click="$close()">Start</button>
|
||||
<button class="btn" ng-click="$dismiss()">Cancel</button>
|
||||
<button class="btn btn-primary" ng-click="$close()">Start</button>
|
||||
</div>
|
||||
</script>
|
||||
<!-- }}} -->
|
||||
|
@ -643,11 +661,25 @@ http://ex1.com/f2.mp4 http://ex2.com/f2.mp4
|
|||
- To add a magnet torrent url, use the add url option and add it there.
|
||||
</p>
|
||||
<input type="file" class="input-xlarge" fselect="getTorrents.files" multiple/>
|
||||
<div class="control-group">
|
||||
<div ng-repeat="(name, set) in getTorrents.settings">
|
||||
<label class="control-label">{{name}}</label>
|
||||
|
||||
<div class="controls">
|
||||
<select ng-show="set.options.length" ng-options="opt for opt in set.options" ng-model="set.val">
|
||||
</select>
|
||||
<input ng-show="!set.options.length" typ="text" class="input-xlarge" ng-model="set.val"/>
|
||||
</div>
|
||||
<br><br>
|
||||
</div>
|
||||
</div>
|
||||
</fieldset>
|
||||
|
||||
<button class="btn" ng-click="getTorrents.advance_opts()">Add Download Specific Options</button>
|
||||
</form>
|
||||
<div class="modal-footer">
|
||||
<button class="btn btn-warning" ng-click="$dismiss()">Cancel</button>
|
||||
<button class="btn btn-success" ng-click="$close()">Start</button>
|
||||
<button class="btn" ng-click="$dismiss()">Cancel</button>
|
||||
<button class="btn btn-primary" ng-click="$close()">Start</button>
|
||||
</div>
|
||||
</script>
|
||||
<!-- }}} -->
|
||||
|
@ -666,11 +698,25 @@ http://ex1.com/f2.mp4 http://ex2.com/f2.mp4
|
|||
- You can select multiple metalinks to start multiple downloads
|
||||
</p>
|
||||
<input type="file" class="input-xlarge" fselect="getMetalinks.files" multiple/>
|
||||
<div class="control-group">
|
||||
<div ng-repeat="(name, set) in getMetalinks.settings">
|
||||
<label class="control-label">{{name}}</label>
|
||||
|
||||
<div class="controls">
|
||||
<select ng-show="set.options.length" ng-options="opt for opt in set.options" ng-model="set.val">
|
||||
</select>
|
||||
<input ng-show="!set.options.length" typ="text" class="input-xlarge" ng-model="set.val"/>
|
||||
</div>
|
||||
<br><br>
|
||||
</div>
|
||||
</div>
|
||||
</fieldset>
|
||||
|
||||
<button class="btn" ng-click="getMetalinks.advance_opts()">Add Download Specific Options</button>
|
||||
</form>
|
||||
<div class="modal-footer">
|
||||
<button class="btn btn-warning" ng-click="$dismiss()">Cancel</button>
|
||||
<button class="btn btn-success" ng-click="$close()">Start</button>
|
||||
<button class="btn" ng-click="$dismiss()">Cancel</button>
|
||||
<button class="btn btn-primary" ng-click="$close()">Start</button>
|
||||
</div>
|
||||
</script>
|
||||
<!-- }}} -->
|
||||
|
@ -692,7 +738,7 @@ http://ex1.com/f2.mp4 http://ex2.com/f2.mp4
|
|||
<select ng-show="set.options.length" ng-options="opt for opt in set.options" ng-model="set.val">
|
||||
</select>
|
||||
<input ng-show="!set.options.length" typ="text" class="input-xlarge" ng-model="set.val"/>
|
||||
<label class="checkbox">
|
||||
<label class="checkbox" ng-show="set.starred != undefined">
|
||||
<input type="checkbox" ng-model="set.starred"/> Quick Access (shown on the main page)
|
||||
</label>
|
||||
<p class="help-block">{{set.desc}}</p>
|
||||
|
@ -704,8 +750,8 @@ http://ex1.com/f2.mp4 http://ex2.com/f2.mp4
|
|||
</form>
|
||||
|
||||
<div class="modal-footer">
|
||||
<button class="btn btn-warning" ng-click="$dismiss()">Cancel</button>
|
||||
<button class="btn btn-success" ng-click="$close()">Save</button>
|
||||
<button class="btn" ng-click="$dismiss()">Cancel</button>
|
||||
<button class="btn btn-primary" ng-click="$close()">{{settings.actionText}}</button>
|
||||
</div>
|
||||
</script>
|
||||
<!-- }}} -->
|
||||
|
@ -786,8 +832,8 @@ http://ex1.com/f2.mp4 http://ex2.com/f2.mp4
|
|||
</form>
|
||||
</div>
|
||||
<div class="modal-footer">
|
||||
<button href="#" class="btn btn-warning" ng-click="$dismiss()">Cancel</button>
|
||||
<button href="#" class="btn btn-success" ng-click="$close()">
|
||||
<button href="#" class="btn" ng-click="$dismiss()">Cancel</button>
|
||||
<button href="#" class="btn btn-primary" ng-click="$close()">
|
||||
Save Connection configuration
|
||||
</button>
|
||||
</div>
|
||||
|
|
|
@ -4,16 +4,18 @@ angular
|
|||
'webui.services.utils', 'webui.services.rpc', 'webui.services.alerts',
|
||||
'webui.services.settings', 'webui.services.modals'
|
||||
])
|
||||
.controller('DownloadCtrl', [
|
||||
'$scope', '$rpc', '$utils', '$alerts', '$modals',
|
||||
.controller('MainCtrl', [
|
||||
'$scope', '$name', '$rpc', '$utils', '$alerts', '$modals',
|
||||
'$fileSettings', '$activeInclude', '$waitingExclude',
|
||||
// for document title
|
||||
'$window',
|
||||
function(
|
||||
scope, rpc, utils, alerts, modals,
|
||||
scope, name, rpc, utils, alerts, modals,
|
||||
fsettings, activeInclude, waitingExclude, window
|
||||
) {
|
||||
|
||||
scope.name = name;
|
||||
|
||||
var re_slashes = /\\/g;
|
||||
var slash = "/";
|
||||
var allStopped = [];
|
|
@ -29,13 +29,14 @@ angular
|
|||
"ui.bootstrap", 'webui.services.deps', 'webui.services.modals', 'webui.services.rpc'
|
||||
])
|
||||
.controller('ModalCtrl', [
|
||||
'$_', '$scope', '$modal', "$modals", '$rpc',
|
||||
function(_, scope, $modal, modals, rpc) {
|
||||
'$_', '$scope', '$modal', "$modals", '$rpc','$fileSettings',
|
||||
function(_, scope, $modal, modals, rpc, fsettings) {
|
||||
|
||||
scope.getUris = {
|
||||
open: function(cb) {
|
||||
var self = this;
|
||||
this.uris = "";
|
||||
this.settings = {};
|
||||
this.cb = cb;
|
||||
this.inst = $modal.open({
|
||||
templateUrl: "getUris.html",
|
||||
|
@ -44,13 +45,33 @@ angular
|
|||
this.inst.result.then(function() {
|
||||
delete self.inst;
|
||||
if (self.cb) {
|
||||
self.cb(self.parse());
|
||||
var settings = {};
|
||||
for (var i in self.settings) {
|
||||
settings[i] = self.settings[i].val;
|
||||
}
|
||||
|
||||
console.log('sending settings:', settings);
|
||||
self.cb(self.parse(), settings);
|
||||
}
|
||||
},
|
||||
function() {
|
||||
delete self.inst;
|
||||
});
|
||||
},
|
||||
advance_opts: function() {
|
||||
var self = this;
|
||||
modals.invoke(
|
||||
'settings', _.cloneDeep(fsettings),
|
||||
'Advance Download Options', 'Add', function(settings) {
|
||||
|
||||
for (var i in settings) {
|
||||
if (fsettings[i].val != settings[i].val)
|
||||
self.settings[i] = settings[i]
|
||||
};
|
||||
|
||||
console.log('got back new settings:', self.settings);
|
||||
});
|
||||
},
|
||||
parse: function() {
|
||||
return _
|
||||
.chain(this.uris.trim().split(/\n\r?/g))
|
||||
|
@ -61,10 +82,11 @@ angular
|
|||
};
|
||||
|
||||
scope.settings = {
|
||||
open: function(settings, title, cb) {
|
||||
open: function(settings, title, actionText, cb) {
|
||||
var self = this;
|
||||
this.settings = settings;
|
||||
this.title = title;
|
||||
this.actionText = actionText;
|
||||
this.inst = $modal.open({
|
||||
templateUrl: "settings.html",
|
||||
scope: scope
|
||||
|
@ -108,6 +130,7 @@ angular
|
|||
open: function(cb) {
|
||||
var self = this;
|
||||
this.files = [];
|
||||
this.settings = {};
|
||||
this.inst = $modal.open({
|
||||
templateUrl: name + ".html",
|
||||
scope: scope
|
||||
|
@ -116,13 +139,33 @@ angular
|
|||
delete self.inst;
|
||||
if (cb) {
|
||||
parseFiles(self.files, function(txts) {
|
||||
cb(txts);
|
||||
var settings = {};
|
||||
for (var i in self.settings) {
|
||||
settings[i] = self.settings[i].val;
|
||||
}
|
||||
|
||||
console.log('sending settings:', settings);
|
||||
cb(txts, settings);
|
||||
});
|
||||
}
|
||||
},
|
||||
function() {
|
||||
delete self.inst;
|
||||
});
|
||||
},
|
||||
advance_opts: function() {
|
||||
var self = this;
|
||||
modals.invoke(
|
||||
'settings', _.cloneDeep(fsettings),
|
||||
'Advance Download Options', 'Add', function(settings) {
|
||||
|
||||
for (var i in settings) {
|
||||
if (fsettings[i].val != settings[i].val)
|
||||
self.settings[i] = settings[i]
|
||||
};
|
||||
|
||||
console.log('got back new settings:', self.settings);
|
||||
});
|
||||
}
|
||||
};
|
||||
});
|
||||
|
|
|
@ -5,20 +5,17 @@ angular
|
|||
'webui.services.settings', 'webui.services.utils'
|
||||
])
|
||||
.controller('NavCtrl', [
|
||||
'$scope', '$name', '$modals',
|
||||
'$scope', '$modals',
|
||||
'$rpc', '$rpchelpers', '$fileSettings',
|
||||
'$globalSettings', '$globalExclude',
|
||||
'$utils',
|
||||
function(
|
||||
scope, name, modals,
|
||||
scope, modals,
|
||||
rpc, rhelpers, fsettings,
|
||||
gsettings, gexclude,
|
||||
utils
|
||||
) {
|
||||
|
||||
// app name
|
||||
scope.name = name;
|
||||
|
||||
scope.isFeatureEnabled = function(f) { return rhelpers.isFeatureEnabled(f) };
|
||||
|
||||
// initially collapsed in mobile resolution
|
||||
|
@ -82,7 +79,7 @@ angular
|
|||
for (var i in sets) {
|
||||
if (gexclude.indexOf(i) != -1) continue;
|
||||
|
||||
settings[i] = sets[i];
|
||||
settings[i] = _.cloneDeep(sets[i]);
|
||||
settings[i].starred = starred.indexOf(i) != -1;
|
||||
}
|
||||
});
|
||||
|
@ -101,7 +98,7 @@ angular
|
|||
|
||||
modals.invoke(
|
||||
'settings', settings,
|
||||
'Global Settings', function(settings) {
|
||||
'Global Settings', 'Save', function(settings) {
|
||||
|
||||
var sets = {};
|
||||
var starred = [];
|
||||
|
@ -130,5 +127,5 @@ angular
|
|||
'about'
|
||||
);
|
||||
}
|
||||
|
||||
|
||||
}]);
|
||||
|
|
6785
js/libs/lodash.js
Normal file
6785
js/libs/lodash.js
Normal file
File diff suppressed because it is too large
Load Diff
|
@ -1,33 +0,0 @@
|
|||
/*!
|
||||
Lo-Dash 1.0.0-rc.3 (Custom Build) lodash.com/license
|
||||
Build: `lodash underscore -m -o ./lodash.underscore.min.js`
|
||||
Underscore.js 1.4.3 underscorejs.org/LICENSE
|
||||
*/
|
||||
;(function(e,t){function n(e){if(e&&typeof e=="object"&&e.__wrapped__)return e;if(!(this instanceof n))return new n(e);this.__wrapped__=e}function r(e,t){var n=e.b,r=t.b,e=e.a,t=t.a;if(e!==t){if(e>t||typeof e=="undefined")return 1;if(e<t||typeof t=="undefined")return-1}return n<r?-1:1}function i(e,t,n){function r(){var i=arguments,s=t;return n.length&&(i=i.length?n.concat(f(i)):n),this instanceof r?(a.prototype=e.prototype,s=new a,a.prototype=null,i=e.apply(s,i),y(i)?i:s):e.apply(s,i)}return r}function s
|
||||
(e,t,n){return e?typeof e!="function"?function(t){return t[e]}:typeof t!="undefined"?n?function(n,r,i,s){return e.call(t,n,r,i,s)}:function(n,r,i){return e.call(t,n,r,i)}:e:q}function o(e){return"\\"+Tt[e]}function u(e){return Lt[e]}function a(){}function f(e,t,n){t||(t=0),typeof n=="undefined"&&(n=e?e.length:0);for(var r=-1,n=n-t||0,i=Array(0>n?0:n);++r<n;)i[r]=e[t+r];return i}function l(e){return At[e]}function c(e){if(!e)return e;for(var t=1,n=arguments.length;t<n;t++){var r=arguments[t];if(r)
|
||||
for(var i in r)e[i]=r[i]}return e}function h(e){var t=[];return kt(e,function(e,n){t.push(n)}),t}function p(e){if(!e)return e;for(var t=1,n=arguments.length;t<n;t++){var r=arguments[t];if(r)for(var i in r)null==e[i]&&(e[i]=r[i])}return e}function d(e){var t=[];return Ct(e,function(e,n){g(e)&&t.push(n)}),t.sort()}function v(e){var t={};return kt(e,function(e,n){t[e]=n}),t}function m(e,t,n,r){if(e===t)return 0!==e||1/e==1/t;if(null==e||null==t)return e===t;var i=it.call(e),s=it.call(t);if(i!=s)return!1
|
||||
;switch(i){case dt:case vt:return+e==+t;case mt:return e!=+e?t!=+t:0==e?1/e==1/t:e==+t;case yt:case bt:return e==t+""}s=i==pt;if(!s){if(e.__wrapped__||t.__wrapped__)return m(e.__wrapped__||e,t.__wrapped__||t);if(i!=gt)return!1;var i=e.constructor,o=t.constructor;if(i!=o&&(!g(i)||!(i instanceof i&&g(o)&&o instanceof o)))return!1}n||(n=[]),r||(r=[]);for(i=n.length;i--;)if(n[i]==e)return r[i]==t;var u=!0,a=0;n.push(e),r.push(t);if(s){a=e.length;if(u=a==t.length)for(;a--&&(u=m(e[a],t[a],n,r)););return u
|
||||
}return Ct(e,function(e,i,s){if(nt.call(s,i))return a++,!(u=nt.call(t,i)&&m(e,t[i],n,r))&&V}),u&&Ct(t,function(e,t,n){if(nt.call(n,t))return!(u=-1<--a)&&V}),u}function g(e){return typeof e=="function"}function y(e){return e?xt[typeof e]:!1}function b(e){return typeof e=="number"||it.call(e)==mt}function w(e){return typeof e=="string"||it.call(e)==bt}function E(e){var t=[];return kt(e,function(e){t.push(e)}),t}function S(e,t){var n=!1;return typeof (e?e.length:0)=="number"?n=-1<H(e,t):Nt(e,function(
|
||||
e){return(n=e===t)&&V}),n}function x(e,t,n){var r=!0,t=s(t,n);if(Ot(e))for(var n=-1,i=e.length;++n<i&&(r=!!t(e[n],n,e)););else Nt(e,function(e,n,i){return!(r=!!t(e,n,i))&&V});return r}function T(e,t,n){var r=[],t=s(t,n);if(Ot(e))for(var n=-1,i=e.length;++n<i;){var o=e[n];t(o,n,e)&&r.push(o)}else Nt(e,function(e,n,i){t(e,n,i)&&r.push(e)});return r}function N(e,t,n){var r,t=s(t,n);return C(e,function(e,n,i){if(t(e,n,i))return r=e,V}),r}function C(e,t,n){if(t&&typeof n=="undefined"&&Ot(e))for(var n=-1
|
||||
,r=e.length;++n<r&&t(e[n],n,e)!==V;);else Nt(e,t,n)}function k(e,t,n){var r=-1,i=e?e.length:0,o=Array(typeof i=="number"?i:0),t=s(t,n);if(Ot(e))for(;++r<i;)o[r]=t(e[r],r,e);else Nt(e,function(e,n,i){o[++r]=t(e,n,i)});return o}function L(e,t,n){var r=-Infinity,i=-1,o=e?e.length:0,u=r;if(t||!Ot(e))t=s(t,n),Nt(e,function(e,n,i){n=t(e,n,i),n>r&&(r=n,u=e)});else for(;++i<o;)e[i]>u&&(u=e[i]);return u}function A(e,t){return k(e,t+"")}function O(e,t,n,r){var i=3>arguments.length,t=s(t,r,V);if(Ot(e)){var o=-1
|
||||
,u=e.length;for(i&&(n=e[++o]);++o<u;)n=t(n,e[o],o,e)}else Nt(e,function(e,r,s){n=i?(i=!1,e):t(n,e,r,s)});return n}function M(e,t,n,r){var i=e?e.length:0,o=3>arguments.length;if(typeof i!="number")var u=Mt(e),i=u.length;return t=s(t,r,V),C(e,function(r,s,a){s=u?u[--i]:--i,n=o?(o=!1,e[s]):t(n,e[s],s,a)}),n}function _(e,t,n){var r,t=s(t,n);if(Ot(e))for(var n=-1,i=e.length;++n<i&&!(r=t(e[n],n,e)););else Nt(e,function(e,n,i){return(r=t(e,n,i))&&V});return!!r}function D(e,t,n){if(e){var r=e.length;return null==
|
||||
t||n?e[0]:f(e,0,ct(lt(0,t),r))}}function P(e,t){for(var n=-1,r=e?e.length:0,i=[];++n<r;){var s=e[n];Ot(s)?rt.apply(i,t?s:P(s)):i.push(s)}return i}function H(e,t,n){var r=-1,i=e?e.length:0;if(typeof n=="number")r=(0>n?lt(0,i+n):n||0)-1;else if(n)return r=j(e,t),e[r]===t?r:-1;for(;++r<i;)if(e[r]===t)return r;return-1}function B(e,t,n){return f(e,null==t||n?1:lt(0,t))}function j(e,t,n,r){for(var i=0,o=e?e.length:i,n=n?s(n,r):q,t=n(t);i<o;)r=i+o>>>1,n(e[r])<t?i=r+1:o=r;return i}function F(e,t,n,r){var i=-1
|
||||
,o=e?e.length:0,u=[],a=u;typeof t=="function"&&(r=n,n=t,t=!1),n&&(a=[],n=s(n,r));for(;++i<o;){var r=e[i],f=n?n(r,i,e):r;if(t?!i||a[a.length-1]!==f:0>H(a,f))n&&a.push(f),u.push(r)}return u}function I(e,t){return wt||st&&2<arguments.length?st.call.apply(st,arguments):i(e,t,f(arguments,2))}function q(e){return e}function R(e){C(d(e),function(t){var r=n[t]=e[t];n.prototype[t]=function(){var e=[this.__wrapped__];return rt.apply(e,arguments),e=r.apply(n,e),this.__chain__&&(e=new n(e),e.__chain__=!0),e}
|
||||
})}var U=typeof exports=="object"&&exports,z=typeof global=="object"&&global;z.global===z&&(e=z);var W=[],z=new function(){},X=0,V=z,$=e._,J=/&(?:amp|lt|gt|quot|#x27);/g,K=RegExp("^"+(z.valueOf+"").replace(/[.*+?^=!:${}()|[\]\/\\]/g,"\\$&").replace(/valueOf|for [^\]]+/g,".+?")+"$"),Q=/($^)/,G=/[&<>"']/g,Y=/['\n\r\t\u2028\u2029\\]/g,Z=Math.ceil,et=W.concat,tt=Math.floor,nt=z.hasOwnProperty,rt=W.push,it=z.toString,st=K.test(st=f.bind)&&st,ot=K.test(ot=Array.isArray)&&ot,ut=e.isFinite,at=e.isNaN,ft=
|
||||
K.test(ft=Object.keys)&&ft,lt=Math.max,ct=Math.min,ht=Math.random,pt="[object Array]",dt="[object Boolean]",vt="[object Date]",mt="[object Number]",gt="[object Object]",yt="[object RegExp]",bt="[object String]",z=!!e.attachEvent,z=st&&!/\n|true/.test(st+z),wt=st&&!z,Et=(Et={0:1,length:1},W.splice.call(Et,0,1),Et[0]),St=arguments.constructor==Object,xt={"boolean":!1,"function":!0,object:!0,number:!1,string:!1,"undefined":!1},Tt={"\\":"\\","'":"'","\n":"n","\r":"r"," ":"t","\u2028":"u2028","\u2029"
|
||||
:"u2029"};n.templateSettings={escape:/<%-([\s\S]+?)%>/g,evaluate:/<%([\s\S]+?)%>/g,interpolate:/<%=([\s\S]+?)%>/g,variable:""};var Nt=function(e,t,n){if(!e)return e;var t=t&&typeof n=="undefined"?t:s(t,n),r=e.length,n=-1;if(typeof r=="number"){for(;++n<r;)if(t(e[n],n,e)===V)return e}else for(n in e)if(nt.call(e,n)&&t(e[n],n,e)===V)return e};n.isArguments=function(e){return"[object Arguments]"==it.call(e)},n.isArguments(arguments)||(n.isArguments=function(e){return e?nt.call(e,"callee"):!1});var Ct=
|
||||
function(e,t){var n;if(!e)return e;t||(t=q);for(n in e)if(t(e[n],n,e)===V)break;return e},kt=function(e,t){var n;if(!e)return e;t||(t=q);for(n in e)if(nt.call(e,n)&&t(e[n],n,e)===V)break;return e},Lt={"&":"&","<":"<",">":">",'"':""","'":"'"},At=v(Lt),Ot=ot||function(e){return St&&e instanceof Array||it.call(e)==pt};g(/x/)&&(g=function(e){return e instanceof Function||"[object Function]"==it.call(e)});var Mt=ft?function(e){return y(e)?ft(e):[]}:h;n.after=function(e,t){return 1>
|
||||
e?t():function(){if(1>--e)return t.apply(this,arguments)}},n.bind=I,n.bindAll=function(e){for(var t=arguments,n=1<t.length?0:(t=d(e),-1),r=t.length;++n<r;){var i=t[n];e[i]=I(e[i],e)}return e},n.compact=function(e){for(var t=-1,n=e?e.length:0,r=[];++t<n;){var i=e[t];i&&r.push(i)}return r},n.compose=function(){var e=arguments;return function(){for(var t=arguments,n=e.length;n--;)t=[e[n].apply(this,t)];return t[0]}},n.countBy=function(e,t,n){var r={},t=s(t,n);return C(e,function(e,n,i){n=t(e,n,i),nt
|
||||
.call(r,n)?r[n]++:r[n]=1}),r},n.debounce=function(e,t,n){function r(){u=null,n||(s=e.apply(o,i))}var i,s,o,u;return function(){var a=n&&!u;return i=arguments,o=this,clearTimeout(u),u=setTimeout(r,t),a&&(s=e.apply(o,i)),s}},n.defaults=p,n.defer=function(e){var n=f(arguments,1);return setTimeout(function(){e.apply(t,n)},1)},n.delay=function(e,n){var r=f(arguments,2);return setTimeout(function(){e.apply(t,r)},n)},n.difference=function(e){for(var t=-1,n=e.length,r=et.apply(W,arguments),i=[];++t<n;){var s=
|
||||
e[t];0>H(r,s,n)&&i.push(s)}return i},n.filter=T,n.flatten=P,n.forEach=C,n.functions=d,n.groupBy=function(e,t,n){var r={},t=s(t,n);return C(e,function(e,n,i){n=t(e,n,i),(nt.call(r,n)?r[n]:r[n]=[]).push(e)}),r},n.initial=function(e,t,n){if(!e)return[];var r=e.length;return f(e,0,ct(lt(0,r-(null==t||n?1:t||0)),r))},n.intersection=function(e){var t=arguments,n=t.length,r=-1,i=e?e.length:0,s=[];e:for(;++r<i;){var o=e[r];if(0>H(s,o)){for(var u=n;--u;)if(0>H(t[u],o))continue e;s.push(o)}}return s},n.invert=
|
||||
v,n.invoke=function(e,t){var n=f(arguments,2),r=typeof t=="function",i=[];return C(e,function(e){i.push((r?t:e[t]).apply(e,n))}),i},n.keys=Mt,n.map=k,n.max=L,n.memoize=function(e,t){var n={};return function(){var r=t?t.apply(this,arguments):arguments[0];return nt.call(n,r)?n[r]:n[r]=e.apply(this,arguments)}},n.min=function(e,t,n){var r=Infinity,i=-1,o=e?e.length:0,u=r;if(t||!Ot(e))t=s(t,n),Nt(e,function(e,n,i){n=t(e,n,i),n<r&&(r=n,u=e)});else for(;++i<o;)e[i]<u&&(u=e[i]);return u},n.object=function(
|
||||
e,t){for(var n=-1,r=e?e.length:0,i={};++n<r;){var s=e[n];t?i[s]=t[n]:i[s[0]]=s[1]}return i},n.omit=function(e){var t=et.apply(W,arguments),n={};return Ct(e,function(e,r){0>H(t,r,1)&&(n[r]=e)}),n},n.once=function(e){var t,n=!1;return function(){return n?t:(n=!0,t=e.apply(this,arguments),e=null,t)}},n.pairs=function(e){var t=[];return kt(e,function(e,n){t.push([n,e])}),t},n.pick=function(e){for(var t=0,n=et.apply(W,arguments),r=n.length,i={};++t<r;){var s=n[t];s in e&&(i[s]=e[s])}return i},n.pluck=
|
||||
A,n.range=function(e,t,n){e=+e||0,n=+n||1,null==t&&(t=e,e=0);for(var r=-1,t=lt(0,Z((t-e)/n)),i=Array(t);++r<t;)i[r]=e,e+=n;return i},n.reject=function(e,t,n){return t=s(t,n),T(e,function(e,n,r){return!t(e,n,r)})},n.rest=B,n.shuffle=function(e){var t=-1,n=Array(e?e.length:0);return C(e,function(e){var r=tt(ht()*(++t+1));n[t]=n[r],n[r]=e}),n},n.sortBy=function(e,t,n){var i=[],t=s(t,n);C(e,function(e,n,r){i.push({a:t(e,n,r),b:n,c:e})}),e=i.length;for(i.sort(r);e--;)i[e]=i[e].c;return i},n.tap=function(
|
||||
e,t){return t(e),e},n.throttle=function(e,t){function n(){u=new Date,o=null,i=e.apply(s,r)}var r,i,s,o,u=0;return function(){var a=new Date,f=t-(a-u);return r=arguments,s=this,0>=f?(clearTimeout(o),o=null,u=a,i=e.apply(s,r)):o||(o=setTimeout(n,f)),i}},n.times=function(e,t,n){for(var e=+e||0,r=-1,i=Array(e);++r<e;)i[r]=t.call(n,r);return i},n.toArray=function(e){return typeof (e?e.length:0)=="number"?f(e):E(e)},n.union=function(){return F(et.apply(W,arguments))},n.uniq=F,n.values=E,n.where=function(
|
||||
e,t){var n=Mt(t);return T(e,function(e){for(var r=n.length;r--;){var i=e[n[r]]===t[n[r]];if(!i)break}return!!i})},n.without=function(e){for(var t=-1,n=e.length,r=[];++t<n;){var i=e[t];0>H(arguments,i,1)&&r.push(i)}return r},n.wrap=function(e,t){return function(){var n=[e];return rt.apply(n,arguments),t.apply(this,n)}},n.zip=function(e){for(var t=-1,n=e?L(A(arguments,"length")):0,r=Array(n);++t<n;)r[t]=A(arguments,t);return r},n.collect=k,n.drop=B,n.each=C,n.extend=c,n.methods=d,n.select=T,n.tail=
|
||||
B,n.unique=F,n.clone=function(e){return e&&xt[typeof e]?Ot(e)?f(e):c({},e):e},n.contains=S,n.escape=function(e){return null==e?"":(e+"").replace(G,u)},n.every=x,n.find=N,n.has=function(e,t){return e?nt.call(e,t):!1},n.identity=q,n.indexOf=H,n.isArray=Ot,n.isBoolean=function(e){return!0===e||!1===e||it.call(e)==dt},n.isDate=function(e){return e instanceof Date||it.call(e)==vt},n.isElement=function(e){return e?1===e.nodeType:!1},n.isEmpty=function(e){if(!e)return!0;if(Ot(e)||w(e))return!e.length;for(
|
||||
var t in e)if(nt.call(e,t))return!1;return!0},n.isEqual=m,n.isFinite=function(e){return ut(e)&&!at(parseFloat(e))},n.isFunction=g,n.isNaN=function(e){return b(e)&&e!=+e},n.isNull=function(e){return null===e},n.isNumber=b,n.isObject=y,n.isRegExp=function(e){return e instanceof RegExp||it.call(e)==yt},n.isString=w,n.isUndefined=function(e){return typeof e=="undefined"},n.lastIndexOf=function(e,t,n){var r=e?e.length:0;for(typeof n=="number"&&(r=(0>n?lt(0,r+n):ct(n,r-1))+1);r--;)if(e[r]===t)return r;
|
||||
return-1},n.mixin=R,n.noConflict=function(){return e._=$,this},n.random=function(e,t){return null==e&&null==t&&(t=1),e=+e||0,null==t&&(t=e,e=0),e+tt(ht()*((+t||0)-e+1))},n.reduce=O,n.reduceRight=M,n.result=function(e,t){var n=e?e[t]:null;return g(n)?e[t]():n},n.size=function(e){var t=e?e.length:0;return typeof t=="number"?t:Mt(e).length},n.some=_,n.sortedIndex=j,n.template=function(e,t,r){e||(e="");var r=p({},r,n.templateSettings),i=0,s="__p+='",u=r.variable;e.replace(RegExp((r.escape||Q).source+"|"+
|
||||
(r.interpolate||Q).source+"|"+(r.evaluate||Q).source+"|$","g"),function(t,n,r,u,a){s+=e.slice(i,a).replace(Y,o),s+=n?"'+_['escape']("+n+")+'":u?"';"+u+";__p+='":r?"'+((__t=("+r+"))==null?'':__t)+'":"",i=a+t.length}),s+="';\n",u||(u="obj",s="with("+u+"||{}){"+s+"}"),s="function("+u+"){var __t,__p='',__j=Array.prototype.join;function print(){__p+=__j.call(arguments,'')}"+s+"return __p}";try{var a=Function("_","return "+s)(n)}catch(f){throw f.source=s,f}return t?a(t):(a.source=s,a)},n.unescape=function(
|
||||
e){return null==e?"":(e+"").replace(J,l)},n.uniqueId=function(e){var t=++X+"";return e?e+t:t},n.all=x,n.any=_,n.detect=N,n.foldl=O,n.foldr=M,n.include=S,n.inject=O,n.first=D,n.last=function(e,t,n){if(e){var r=e.length;return null==t||n?e[r-1]:f(e,lt(0,r-t))}},n.take=D,n.head=D,n.chain=function(e){return e=new n(e),e.__chain__=!0,e},n.VERSION="1.0.0-rc.3",R(n),n.prototype.chain=function(){return this.__chain__=!0,this},n.prototype.value=function(){return this.__wrapped__},Nt("pop push reverse shift sort splice unshift"
|
||||
.split(" "),function(e){var t=W[e];n.prototype[e]=function(){var e=this.__wrapped__;return t.apply(e,arguments),Et&&e.length===0&&delete e[0],this}}),Nt(["concat","join","slice"],function(e){var t=W[e];n.prototype[e]=function(){var e=t.apply(this.__wrapped__,arguments);return this.__chain__&&(e=new n(e),e.__chain__=!0),e}}),U?typeof module=="object"&&module&&module.exports==U?(module.exports=n)._=n:U._=n:e._=n})(this);
|
|
@ -11,10 +11,10 @@ angular.module('webui.services.rpc.helpers', [
|
|||
getAria2Version: function() {
|
||||
return miscellaneous.version;
|
||||
},
|
||||
addUris: function(uris) {
|
||||
addUris: function(uris, settings) {
|
||||
_.each(uris, function(uri) {
|
||||
// passing true to batch all the addUri calls
|
||||
rpc.once('addUri', [uri], angular.noop, true);
|
||||
rpc.once('addUri', [uri, settings], angular.noop, true);
|
||||
});
|
||||
|
||||
// now dispatch all addUri syscalls
|
||||
|
|
Loading…
Reference in New Issue
Block a user