From ea2a79a903b0f39304e0020ac0b7c5d8cd2e2f5c Mon Sep 17 00:00:00 2001 From: Damien Churchill Date: Wed, 27 May 2009 15:51:24 +0000 Subject: [PATCH] improve some of the docs in Deluge.UI --- deluge/ui/web/docs/files.html | 4 +- deluge/ui/web/docs/index.html | 10 +- deluge/ui/web/docs/symbols/Deluge.Events.html | 4 +- .../web/docs/symbols/Deluge.Formatters.html | 4 +- deluge/ui/web/docs/symbols/Deluge.Keys.html | 4 +- .../docs/symbols/Deluge.OptionsManager.html | 4 +- .../docs/symbols/Ext.deluge.TorrentGrid.html | 4 +- .../docs/symbols/Ext.ux.FullProgressBar.html | 4 +- deluge/ui/web/docs/symbols/_global_.html | 4 +- .../ui/web/docs/symbols/src/Deluge.UI.js.html | 264 +++++++++--------- deluge/ui/web/js/Deluge.UI.js | 66 +++-- 11 files changed, 210 insertions(+), 162 deletions(-) diff --git a/deluge/ui/web/docs/files.html b/deluge/ui/web/docs/files.html index 421f953e8..3c901ef07 100644 --- a/deluge/ui/web/docs/files.html +++ b/deluge/ui/web/docs/files.html @@ -194,6 +194,8 @@ ul.inheritsList
  • Deluge.OptionsManager
  • +
  • Deluge.UI
  • +
  • Ext.deluge.TorrentGrid
  • Ext.ux.FullProgressBar
  • @@ -642,7 +644,7 @@ ul.inheritsList
    - Documentation generated by JsDoc Toolkit 2.1.0 on Wed May 27 2009 16:15:35 GMT+0100 (BST) + Documentation generated by JsDoc Toolkit 2.1.0 on Wed May 27 2009 16:48:57 GMT+0100 (BST)
    \ No newline at end of file diff --git a/deluge/ui/web/docs/index.html b/deluge/ui/web/docs/index.html index c1694093a..155c4b2c7 100644 --- a/deluge/ui/web/docs/index.html +++ b/deluge/ui/web/docs/index.html @@ -194,6 +194,8 @@ ul.inheritsList
  • Deluge.OptionsManager
  • +
  • Deluge.UI
  • +
  • Ext.deluge.TorrentGrid
  • Ext.ux.FullProgressBar
  • @@ -236,6 +238,12 @@ ul.inheritsList
    +
    +

    Deluge.UI

    + Deluge +
    +
    +

    Ext.deluge.TorrentGrid

    Ext.deluge.TorrentGrid @@ -252,7 +260,7 @@ ul.inheritsList
    - Documentation generated by JsDoc Toolkit 2.1.0 on Wed May 27 2009 16:15:35 GMT+0100 (BST) + Documentation generated by JsDoc Toolkit 2.1.0 on Wed May 27 2009 16:48:57 GMT+0100 (BST)
    \ No newline at end of file diff --git a/deluge/ui/web/docs/symbols/Deluge.Events.html b/deluge/ui/web/docs/symbols/Deluge.Events.html index 26f7eeb7e..e66256f64 100644 --- a/deluge/ui/web/docs/symbols/Deluge.Events.html +++ b/deluge/ui/web/docs/symbols/Deluge.Events.html @@ -199,6 +199,8 @@ ul.inheritsList
  • Deluge.OptionsManager
  • +
  • Deluge.UI
  • +
  • Ext.deluge.TorrentGrid
  • Ext.ux.FullProgressBar
  • @@ -304,7 +306,7 @@ ul.inheritsList
    - Documentation generated by JsDoc Toolkit 2.1.0 on Wed May 27 2009 16:15:35 GMT+0100 (BST) + Documentation generated by JsDoc Toolkit 2.1.0 on Wed May 27 2009 16:48:57 GMT+0100 (BST)
    diff --git a/deluge/ui/web/docs/symbols/Deluge.Formatters.html b/deluge/ui/web/docs/symbols/Deluge.Formatters.html index 50e18f7a0..c908c68a2 100644 --- a/deluge/ui/web/docs/symbols/Deluge.Formatters.html +++ b/deluge/ui/web/docs/symbols/Deluge.Formatters.html @@ -199,6 +199,8 @@ ul.inheritsList
  • Deluge.OptionsManager
  • +
  • Deluge.UI
  • +
  • Ext.deluge.TorrentGrid
  • Ext.ux.FullProgressBar
  • @@ -590,7 +592,7 @@ if seconds < 0
    - Documentation generated by JsDoc Toolkit 2.1.0 on Wed May 27 2009 16:15:35 GMT+0100 (BST) + Documentation generated by JsDoc Toolkit 2.1.0 on Wed May 27 2009 16:48:57 GMT+0100 (BST)
    diff --git a/deluge/ui/web/docs/symbols/Deluge.Keys.html b/deluge/ui/web/docs/symbols/Deluge.Keys.html index db8dccf93..3b153d03c 100644 --- a/deluge/ui/web/docs/symbols/Deluge.Keys.html +++ b/deluge/ui/web/docs/symbols/Deluge.Keys.html @@ -199,6 +199,8 @@ ul.inheritsList
  • Deluge.OptionsManager
  • +
  • Deluge.UI
  • +
  • Ext.deluge.TorrentGrid
  • Ext.ux.FullProgressBar
  • @@ -526,7 +528,7 @@ by Deluge.Keys.Grid.
    - Documentation generated by JsDoc Toolkit 2.1.0 on Wed May 27 2009 16:15:35 GMT+0100 (BST) + Documentation generated by JsDoc Toolkit 2.1.0 on Wed May 27 2009 16:48:57 GMT+0100 (BST)
    diff --git a/deluge/ui/web/docs/symbols/Deluge.OptionsManager.html b/deluge/ui/web/docs/symbols/Deluge.OptionsManager.html index d4d2b6593..a7e36421d 100644 --- a/deluge/ui/web/docs/symbols/Deluge.OptionsManager.html +++ b/deluge/ui/web/docs/symbols/Deluge.OptionsManager.html @@ -199,6 +199,8 @@ ul.inheritsList
  • Deluge.OptionsManager
  • +
  • Deluge.UI
  • +
  • Ext.deluge.TorrentGrid
  • Ext.ux.FullProgressBar
  • @@ -304,7 +306,7 @@ ul.inheritsList
    - Documentation generated by JsDoc Toolkit 2.1.0 on Wed May 27 2009 16:15:35 GMT+0100 (BST) + Documentation generated by JsDoc Toolkit 2.1.0 on Wed May 27 2009 16:48:57 GMT+0100 (BST)
    diff --git a/deluge/ui/web/docs/symbols/Ext.deluge.TorrentGrid.html b/deluge/ui/web/docs/symbols/Ext.deluge.TorrentGrid.html index 15c6821b1..097b3efee 100644 --- a/deluge/ui/web/docs/symbols/Ext.deluge.TorrentGrid.html +++ b/deluge/ui/web/docs/symbols/Ext.deluge.TorrentGrid.html @@ -199,6 +199,8 @@ ul.inheritsList
  • Deluge.OptionsManager
  • +
  • Deluge.UI
  • +
  • Ext.deluge.TorrentGrid
  • Ext.ux.FullProgressBar
  • @@ -317,7 +319,7 @@ ul.inheritsList
    - Documentation generated by JsDoc Toolkit 2.1.0 on Wed May 27 2009 16:15:35 GMT+0100 (BST) + Documentation generated by JsDoc Toolkit 2.1.0 on Wed May 27 2009 16:48:57 GMT+0100 (BST)
    diff --git a/deluge/ui/web/docs/symbols/Ext.ux.FullProgressBar.html b/deluge/ui/web/docs/symbols/Ext.ux.FullProgressBar.html index a4ba3bbf4..6362bbb87 100644 --- a/deluge/ui/web/docs/symbols/Ext.ux.FullProgressBar.html +++ b/deluge/ui/web/docs/symbols/Ext.ux.FullProgressBar.html @@ -199,6 +199,8 @@ ul.inheritsList
  • Deluge.OptionsManager
  • +
  • Deluge.UI
  • +
  • Ext.deluge.TorrentGrid
  • Ext.ux.FullProgressBar
  • @@ -317,7 +319,7 @@ ul.inheritsList
    - Documentation generated by JsDoc Toolkit 2.1.0 on Wed May 27 2009 16:15:35 GMT+0100 (BST) + Documentation generated by JsDoc Toolkit 2.1.0 on Wed May 27 2009 16:48:57 GMT+0100 (BST)
    diff --git a/deluge/ui/web/docs/symbols/_global_.html b/deluge/ui/web/docs/symbols/_global_.html index 6ce9b3d92..87c8e55ee 100644 --- a/deluge/ui/web/docs/symbols/_global_.html +++ b/deluge/ui/web/docs/symbols/_global_.html @@ -199,6 +199,8 @@ ul.inheritsList
  • Deluge.OptionsManager
  • +
  • Deluge.UI
  • +
  • Ext.deluge.TorrentGrid
  • Ext.ux.FullProgressBar
  • @@ -845,7 +847,7 @@ ul.inheritsList
    - Documentation generated by JsDoc Toolkit 2.1.0 on Wed May 27 2009 16:15:34 GMT+0100 (BST) + Documentation generated by JsDoc Toolkit 2.1.0 on Wed May 27 2009 16:48:56 GMT+0100 (BST)
    diff --git a/deluge/ui/web/docs/symbols/src/Deluge.UI.js.html b/deluge/ui/web/docs/symbols/src/Deluge.UI.js.html index 05a7c6205..6c02f7b11 100644 --- a/deluge/ui/web/docs/symbols/src/Deluge.UI.js.html +++ b/deluge/ui/web/docs/symbols/src/Deluge.UI.js.html @@ -27,132 +27,144 @@ 20 The Free Software Foundation, Inc., 21 51 Franklin Street, Fifth Floor 22 Boston, MA 02110-1301, USA. - 23 # - 24 # In addition, as a special exception, the copyright holders give - 25 # permission to link the code of portions of this program with the OpenSSL - 26 # library. - 27 # You must obey the GNU General Public License in all respects for all of - 28 # the code used other than OpenSSL. If you modify file(s) with this - 29 # exception, you may extend this exception to your version of the file(s), - 30 # but you are not obligated to do so. If you do not wish to do so, delete - 31 # this exception statement from your version. If you delete this exception - 32 # statement from all source files in the program, then also delete it here. - 33 # - 34 */ - 35 - 36 Deluge.UI = { - 37 - 38 cookies: new Ext.state.CookieProvider(), - 39 - 40 errorCount: 0, - 41 - 42 initialize: function() { - 43 Ext.state.Manager.setProvider(this.cookies); - 44 this.MainPanel = new Ext.Panel({ - 45 id: 'mainPanel', - 46 iconCls: 'x-deluge-main-panel', - 47 title: 'Deluge', - 48 layout: 'border', - 49 tbar: Deluge.Toolbar, - 50 items: [ - 51 Deluge.Sidebar, - 52 Deluge.Details, - 53 Deluge.Torrents - 54 ], - 55 bbar: Deluge.Statusbar - 56 }); - 57 - 58 this.Viewport = new Ext.Viewport({ - 59 layout: 'fit', - 60 items: [this.MainPanel] - 61 }); - 62 - 63 Deluge.Events.on("connect", this.onConnect, this); - 64 Deluge.Events.on("disconnect", this.onDisconnect, this); - 65 Deluge.Client = new Ext.ux.util.RpcClient({ - 66 url: '/json' - 67 }); - 68 Deluge.Client.on('connected', function(e) { - 69 Deluge.Login.show(); - 70 }); - 71 this.update = this.update.bind(this); - 72 }, - 73 - 74 update: function() { - 75 var filters = Deluge.Sidebar.getFilters(); - 76 Deluge.Client.web.update_ui(Deluge.Keys.Grid, filters, { - 77 success: this.onUpdate, - 78 failure: this.onUpdateError, - 79 scope: this + 23 + 24 In addition, as a special exception, the copyright holders give + 25 permission to link the code of portions of this program with the OpenSSL + 26 library. + 27 You must obey the GNU General Public License in all respects for all of + 28 the code used other than OpenSSL. If you modify file(s) with this + 29 exception, you may extend this exception to your version of the file(s), + 30 but you are not obligated to do so. If you do not wish to do so, delete + 31 this exception statement from your version. If you delete this exception + 32 statement from all source files in the program, then also delete it here. + 33 */ + 34 + 35 /** + 36 * @namespace Deluge + 37 * @static + 38 * @class Deluge.UI + 39 * The controller for the whole interface, that ties all the components + 40 * together and handles the 2 second poll. + 41 */ + 42 Deluge.UI = { + 43 + 44 cookies: new Ext.state.CookieProvider(), + 45 + 46 errorCount: 0, + 47 + 48 /** + 49 * @description Create all the interface components, the json-rpc client + 50 * and set up various events that the UI will utilise. + 51 */ + 52 initialize: function() { + 53 Ext.state.Manager.setProvider(this.cookies); + 54 this.MainPanel = new Ext.Panel({ + 55 id: 'mainPanel', + 56 iconCls: 'x-deluge-main-panel', + 57 title: 'Deluge', + 58 layout: 'border', + 59 tbar: Deluge.Toolbar, + 60 items: [ + 61 Deluge.Sidebar, + 62 Deluge.Details, + 63 Deluge.Torrents + 64 ], + 65 bbar: Deluge.Statusbar + 66 }); + 67 + 68 this.Viewport = new Ext.Viewport({ + 69 layout: 'fit', + 70 items: [this.MainPanel] + 71 }); + 72 + 73 Deluge.Events.on("connect", this.onConnect, this); + 74 Deluge.Events.on("disconnect", this.onDisconnect, this); + 75 Deluge.Client = new Ext.ux.util.RpcClient({ + 76 url: '/json' + 77 }); + 78 Deluge.Client.on('connected', function(e) { + 79 Deluge.Login.show(); 80 }); - 81 Deluge.Details.update(); - 82 Deluge.Client.web.connected({ - 83 success: this.onConnectedCheck, - 84 scope: this - 85 }); - 86 }, - 87 - 88 onConnectedCheck: function(connected) { - 89 if (!connected) { - 90 Deluge.Events.fire('disconnect'); - 91 } - 92 }, - 93 - 94 onUpdateError: function(error) { - 95 if (this.errorCount == 2) { - 96 Ext.MessageBox.show({ - 97 title: 'Lost Connection', - 98 msg: 'The connection to the webserver has been lost!', - 99 buttons: Ext.MessageBox.OK, -100 icon: Ext.MessageBox.ERROR -101 }); -102 } -103 this.errorCount++; -104 }, -105 -106 onUpdate: function(data) { -107 Deluge.Torrents.update(data['torrents']); -108 Deluge.Statusbar.update(data['stats']); -109 Deluge.Sidebar.update(data['filters']); -110 this.errorCount = 0; -111 }, -112 -113 /* -114 Property: run -115 Start the Deluge UI polling the server to get the updated torrent -116 information. -117 -118 Example: -119 Deluge.UI.onConnect(); -120 */ -121 onConnect: function() { -122 if (!this.running) { -123 this.running = setInterval(this.update, 2000); -124 this.update(); -125 } + 81 this.update = this.update.bind(this); + 82 }, + 83 + 84 update: function() { + 85 var filters = Deluge.Sidebar.getFilters(); + 86 Deluge.Client.web.update_ui(Deluge.Keys.Grid, filters, { + 87 success: this.onUpdate, + 88 failure: this.onUpdateError, + 89 scope: this + 90 }); + 91 Deluge.Details.update(); + 92 Deluge.Client.web.connected({ + 93 success: this.onConnectedCheck, + 94 scope: this + 95 }); + 96 }, + 97 + 98 onConnectedCheck: function(connected) { + 99 if (!connected) { +100 Deluge.Events.fire('disconnect'); +101 } +102 }, +103 +104 onUpdateError: function(error) { +105 if (this.errorCount == 2) { +106 Ext.MessageBox.show({ +107 title: 'Lost Connection', +108 msg: 'The connection to the webserver has been lost!', +109 buttons: Ext.MessageBox.OK, +110 icon: Ext.MessageBox.ERROR +111 }); +112 } +113 this.errorCount++; +114 }, +115 +116 /** +117 * @static +118 * @private +119 * Updates the various components in the interface. +120 */ +121 onUpdate: function(data) { +122 Deluge.Torrents.update(data['torrents']); +123 Deluge.Statusbar.update(data['stats']); +124 Deluge.Sidebar.update(data['filters']); +125 this.errorCount = 0; 126 }, 127 -128 onDisconnect: function() { -129 this.stop(); -130 }, -131 -132 /* -133 Property: stop -134 Stop the Deluge UI polling the server to get the updated torrent -135 information. -136 -137 Example: -138 Deluge.UI.stop(); -139 */ -140 stop: function() { -141 if (this.running) { -142 clearInterval(this.running); -143 this.running = false; -144 Deluge.Torrents.getStore().loadData([]); -145 } -146 } -147 } -148 -149 Ext.onReady(function(e) { -150 Deluge.UI.initialize(); -151 }); \ No newline at end of file +128 /** +129 * @static +130 * @private +131 * Start the Deluge UI polling the server and update the interface. +132 */ +133 onConnect: function() { +134 if (!this.running) { +135 this.running = setInterval(this.update, 2000); +136 this.update(); +137 } +138 }, +139 +140 /** +141 * @static +142 * @private +143 */ +144 onDisconnect: function() { +145 this.stop(); +146 }, +147 +148 /** +149 * @static +150 * Stop the Deluge UI polling the server and clear the interface. +151 */ +152 stop: function() { +153 if (this.running) { +154 clearInterval(this.running); +155 this.running = false; +156 Deluge.Torrents.getStore().loadData([]); +157 } +158 } +159 } +160 +161 Ext.onReady(function(e) { +162 Deluge.UI.initialize(); +163 }); \ No newline at end of file diff --git a/deluge/ui/web/js/Deluge.UI.js b/deluge/ui/web/js/Deluge.UI.js index 4dae71577..ca6080eed 100644 --- a/deluge/ui/web/js/Deluge.UI.js +++ b/deluge/ui/web/js/Deluge.UI.js @@ -20,25 +20,35 @@ Copyright: The Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor Boston, MA 02110-1301, USA. -# -# In addition, as a special exception, the copyright holders give -# permission to link the code of portions of this program with the OpenSSL -# library. -# You must obey the GNU General Public License in all respects for all of -# the code used other than OpenSSL. If you modify file(s) with this -# exception, you may extend this exception to your version of the file(s), -# but you are not obligated to do so. If you do not wish to do so, delete -# this exception statement from your version. If you delete this exception -# statement from all source files in the program, then also delete it here. -# + + In addition, as a special exception, the copyright holders give + permission to link the code of portions of this program with the OpenSSL + library. + You must obey the GNU General Public License in all respects for all of + the code used other than OpenSSL. If you modify file(s) with this + exception, you may extend this exception to your version of the file(s), + but you are not obligated to do so. If you do not wish to do so, delete + this exception statement from your version. If you delete this exception + statement from all source files in the program, then also delete it here. */ +/** + * @namespace Deluge + * @static + * @class Deluge.UI + * The controller for the whole interface, that ties all the components + * together and handles the 2 second poll. + */ Deluge.UI = { cookies: new Ext.state.CookieProvider(), errorCount: 0, + /** + * @description Create all the interface components, the json-rpc client + * and set up various events that the UI will utilise. + */ initialize: function() { Ext.state.Manager.setProvider(this.cookies); this.MainPanel = new Ext.Panel({ @@ -103,6 +113,11 @@ Deluge.UI = { this.errorCount++; }, + /** + * @static + * @private + * Updates the various components in the interface. + */ onUpdate: function(data) { Deluge.Torrents.update(data['torrents']); Deluge.Statusbar.update(data['stats']); @@ -110,14 +125,11 @@ Deluge.UI = { this.errorCount = 0; }, - /* - Property: run - Start the Deluge UI polling the server to get the updated torrent - information. - - Example: - Deluge.UI.onConnect(); - */ + /** + * @static + * @private + * Start the Deluge UI polling the server and update the interface. + */ onConnect: function() { if (!this.running) { this.running = setInterval(this.update, 2000); @@ -125,18 +137,18 @@ Deluge.UI = { } }, + /** + * @static + * @private + */ onDisconnect: function() { this.stop(); }, - /* - Property: stop - Stop the Deluge UI polling the server to get the updated torrent - information. - - Example: - Deluge.UI.stop(); - */ + /** + * @static + * Stop the Deluge UI polling the server and clear the interface. + */ stop: function() { if (this.running) { clearInterval(this.running);