From b1da2b0a84e6403f85e8a363c53817829780b502 Mon Sep 17 00:00:00 2001 From: Florent Viard Date: Mon, 17 Feb 2014 01:13:25 +0100 Subject: [PATCH] Moved miscallenous info out of the main page. Added "server info" and "about" modals as settings sub-menus. --- index.html | 78 +++++++++++++++++++++++++++++++++++------------ js/ctrls/modal.js | 19 +++++++++++- js/ctrls/nav.js | 13 ++++++++ 3 files changed, 89 insertions(+), 21 deletions(-) diff --git a/index.html b/index.html index 6cd3c05..40912b3 100755 --- a/index.html +++ b/index.html @@ -170,6 +170,18 @@ ng-click="changeGSettings()" href="#"> Global Settings + +
  • + Server info +
  • + +
  • + About and contribute +
  • @@ -554,26 +566,6 @@ - -

    Miscellaneous

    - Aria2 Version {{miscellaneous.version}} -

    - Features Enabled - -
    -

    - To download the latest version of the project, add issues or to contribute back head on to - http://github.com/ziahamza/webui-aria2 -
    - Or you can open the latest version in browser through http://ziahamza.github.io/webui-aria2 -

    - - @@ -779,6 +771,52 @@ http://ex1.com/f2.mp4 http://ex2.com/f2.mp4 + + + + + + + diff --git a/js/ctrls/modal.js b/js/ctrls/modal.js index 41349c7..dff3b1a 100644 --- a/js/ctrls/modal.js +++ b/js/ctrls/modal.js @@ -143,9 +143,26 @@ angular }; }); + _.each(['server_info', 'about'], function(name) { + scope[name] = { + shown: false, + init: function(cb) { + this.shown = this.open = true; + }, + + close: function() { + this.shown = this.open = false; + } + }; + }); + + rpc.once('getVersion', [], function(data) { + scope.miscellaneous = data[0]; + }); + _.each([ 'getUris', 'getTorrents', 'getMetalinks', - 'settings', 'connection' + 'settings', 'connection', 'server_info', 'about' ], function(name) { modals.register(name, function(cb) { if (scope[name].open) { diff --git a/js/ctrls/nav.js b/js/ctrls/nav.js index bfd52a0..551b8ae 100644 --- a/js/ctrls/nav.js +++ b/js/ctrls/nav.js @@ -118,4 +118,17 @@ angular }); }); }; + + scope.showServerInfo = function() { + modals.invoke( + 'server_info' + ); + }; + + scope.showAbout = function() { + modals.invoke( + 'about' + ); + } + }]);