added manage menu to angular

This commit is contained in:
hamza zia 2013-02-25 14:09:11 +01:00
parent 81a956ad67
commit 0d3b2f03a1
3 changed files with 60 additions and 25 deletions

View File

@ -112,15 +112,32 @@
</ul> </ul>
</li> </li>
<li class="dropdown" ng-show="false"> <li class="dropdown">
<a class="dropdown-toggle" href="#"> <a class="dropdown-toggle" href="#"> Manage <b class="caret"></b></a>
Manage <b class="caret"></b>
</a>
<ul class="dropdown-menu"> <ul class="dropdown-menu">
<li><a href="#"><i class="icon-pause"></i> Pause All</a></li> <li>
<li><a href="#"><i class="icon-play"></i> Resume Paused</a></li> <a
<li><a href="#"><i class="icon-remove"></i> Purge Completed</a></li> href="#"
<li><a href="#"><i class="icon-fire"></i> Remove All</a></li> ng-click="forcePauseAll()"><i class="icon-pause"></i> Pause All</a>
</li>
<li>
<a
href="#"
ng-click="unpauseAll()"><i class="icon-play"></i> Resume Paused</a>
</li>
<li>
<a
href="#"
ng-click="purgeDownloadResult()"><i class="icon-remove"></i> Purge Completed</a>
</li>
<!-- not adding remove all as requires many rpc syscalls to finish
<li>
<a
href="#"
ng-click="removeAll()"><i class="icon-fire"></i> Remove All</a>
</li>
-->
</ul> </ul>
</li> </li>
@ -128,29 +145,36 @@
<ul class="nav"> <ul class="nav">
<li class="dropdown"> <li class="dropdown">
<a href="#" class="dropdown-toggle" > <a
Settings <b class="caret"></b> href="#"
</a> class="dropdown-toggle">Settings <b class="caret"></b></a>
<ul class="dropdown-menu"> <ul class="dropdown-menu">
<li ng-show="false"><a href="#"> <li ng-show="false">
<i class="icon-wrench"></i> Connection Settings</a> <a href="#"><i class="icon-wrench"></i> Connection Settings</a>
</li>
<li>
<a
ng-click="changeGSettings()"
href="#"><i class="icon-wrench"></i> Global Settings</a>
</li> </li>
<li><a href="#" ng-click="changeGSettings()">
<i class="icon-wrench"></i> Global Settings</a></li>
</ul> </ul>
</li> </li>
</ul> </ul>
<ul class="nav pull-right" ng-show="false"> <ul class="nav pull-right" ng-show="false">
<li class="dropdown"> <li class="dropdown">
<a href="#" class="dropdown-toggle" > <a
About <b class="caret"></b> class="dropdown-toggle"
</a> href="#">Miscellaneous <b class="caret"></b></a>
<ul class="dropdown-menu"> <ul class="dropdown-menu">
<li><a href="#"> <li>
<i class="icon-list-alt"></i> Global Statistics</a></li> <a href="#"><i class="icon-list-alt"></i> Global Statistics</a>
<li><a href="#"> </li>
<i class="icon-info-sign"></i> About</a></li> <li>
<a href="#"><i class="icon-info-sign"></i> About</a>
</li>
</ul> </ul>
</li> </li>
</ul> </ul>

View File

@ -157,8 +157,6 @@ function(
rpc.once('getOption', [d.gid], function(data) { rpc.once('getOption', [d.gid], function(data) {
var vals = data[0]; var vals = data[0];
window.fs = fsettings;
window.ai = activeInclude;
for (var i in fsettings) { for (var i in fsettings) {
if (type == 'active' && activeInclude.indexOf(i) == -1) continue; if (type == 'active' && activeInclude.indexOf(i) == -1) continue;
@ -167,7 +165,6 @@ function(
settings[i] = fsettings[i]; settings[i] = fsettings[i];
settings[i].val = vals[i] || settings[i].val; settings[i].val = vals[i] || settings[i].val;
} }
console.log(type);
modals.invoke('settings', settings, scope.getName(d) + ' settings', function(settings) { modals.invoke('settings', settings, scope.getName(d) + ' settings', function(settings) {
var sets = {}; var sets = {};

View File

@ -14,11 +14,25 @@ angular
gsettings, gexclude gsettings, gexclude
) { ) {
// app name
scope.name = name; scope.name = name;
// initially collapsed in mobile resolution // initially collapsed in mobile resolution
scope.collapsed = true; scope.collapsed = true;
// manage download functions
scope.forcePauseAll = function() {
rpc.once('forcePauseAll', []);
}
scope.purgeDownloadResult = function() {
rpc.once('purgeDownloadResult', []);
}
scope.unpauseAll = function() {
rpc.once('unpauseAll', []);
}
scope.addUris = function() { scope.addUris = function() {
modals.invoke( modals.invoke(
'getUris', _.bind(rhelpers.addUris, rhelpers) 'getUris', _.bind(rhelpers.addUris, rhelpers)