From 9b860c9b3cf9b5e1d8b0ce84ff58455ab91e5c82 Mon Sep 17 00:00:00 2001 From: Damien Churchill Date: Wed, 27 May 2009 15:24:37 +0000 Subject: [PATCH] add a build_docs method to build.sh and rebuild the docs --- deluge/ui/web/docs/files.html | 30 +- deluge/ui/web/docs/index.html | 18 +- deluge/ui/web/docs/symbols/Deluge.Events.html | 6 +- .../web/docs/symbols/Deluge.Formatters.html | 6 +- deluge/ui/web/docs/symbols/Deluge.Keys.html | 6 +- .../docs/symbols/Deluge.OptionsManager.html | 310 +++++++ .../docs/symbols/Ext.deluge.TorrentGrid.html | 6 +- .../docs/symbols/Ext.ux.FullProgressBar.html | 323 ++++++++ deluge/ui/web/docs/symbols/_global_.html | 520 +++++++++++- .../symbols/src/Deluge.Details.Files.js.html | 128 ++- .../src/Deluge.Details.Options.js.html | 629 ++++++++------- .../docs/symbols/src/Deluge.Details.js.html | 146 ++-- .../symbols/src/Deluge.OptionsManager.js.html | 92 +++ .../symbols/src/ext-extensions-debug.js.html | 755 ++++++++++++++++++ deluge/ui/web/js/build.sh | 18 +- 15 files changed, 2532 insertions(+), 461 deletions(-) create mode 100644 deluge/ui/web/docs/symbols/Deluge.OptionsManager.html create mode 100644 deluge/ui/web/docs/symbols/Ext.ux.FullProgressBar.html create mode 100644 deluge/ui/web/docs/symbols/src/Deluge.OptionsManager.js.html create mode 100644 deluge/ui/web/docs/symbols/src/ext-extensions-debug.js.html diff --git a/deluge/ui/web/docs/files.html b/deluge/ui/web/docs/files.html index e2d1ffff5..421f953e8 100644 --- a/deluge/ui/web/docs/files.html +++ b/deluge/ui/web/docs/files.html @@ -192,8 +192,12 @@ ul.inheritsList
  • Deluge.Keys
  • +
  • Deluge.OptionsManager
  • +
  • Ext.deluge.TorrentGrid
  • +
  • Ext.ux.FullProgressBar
  • +
    @@ -414,6 +418,18 @@ ul.inheritsList + + +
    + +
    +

    Deluge.OptionsManager.js

    + +
    + + + +

    @@ -606,6 +622,18 @@ ul.inheritsList + + +
    + +
    +

    ext-extensions-debug.js

    + +
    + + + +

    @@ -614,7 +642,7 @@ ul.inheritsList
    - Documentation generated by JsDoc Toolkit 2.1.0 on Tue May 19 2009 23:27:57 GMT+0100 (BST) + Documentation generated by JsDoc Toolkit 2.1.0 on Wed May 27 2009 16:15:35 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 cb29a53bf..c1694093a 100644 --- a/deluge/ui/web/docs/index.html +++ b/deluge/ui/web/docs/index.html @@ -192,8 +192,12 @@ ul.inheritsList
  • Deluge.Keys
  • +
  • Deluge.OptionsManager
  • +
  • Ext.deluge.TorrentGrid
  • +
  • Ext.ux.FullProgressBar
  • +
    @@ -226,17 +230,29 @@ ul.inheritsList
    +
    +

    Deluge.OptionsManager

    + Deluge +
    +
    +

    Ext.deluge.TorrentGrid

    Ext.deluge.TorrentGrid

    +
    +

    Ext.ux.FullProgressBar

    + Ext.deluge.ProgressBar +
    +
    +
    - Documentation generated by JsDoc Toolkit 2.1.0 on Tue May 19 2009 23:27:57 GMT+0100 (BST) + Documentation generated by JsDoc Toolkit 2.1.0 on Wed May 27 2009 16:15:35 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 9c796613f..26f7eeb7e 100644 --- a/deluge/ui/web/docs/symbols/Deluge.Events.html +++ b/deluge/ui/web/docs/symbols/Deluge.Events.html @@ -197,8 +197,12 @@ ul.inheritsList
  • Deluge.Keys
  • +
  • Deluge.OptionsManager
  • +
  • Ext.deluge.TorrentGrid
  • +
  • Ext.ux.FullProgressBar
  • +
    @@ -300,7 +304,7 @@ ul.inheritsList
    - Documentation generated by JsDoc Toolkit 2.1.0 on Tue May 19 2009 23:27:56 GMT+0100 (BST) + Documentation generated by JsDoc Toolkit 2.1.0 on Wed May 27 2009 16:15:35 GMT+0100 (BST)
    diff --git a/deluge/ui/web/docs/symbols/Deluge.Formatters.html b/deluge/ui/web/docs/symbols/Deluge.Formatters.html index bd37290ce..50e18f7a0 100644 --- a/deluge/ui/web/docs/symbols/Deluge.Formatters.html +++ b/deluge/ui/web/docs/symbols/Deluge.Formatters.html @@ -197,8 +197,12 @@ ul.inheritsList
  • Deluge.Keys
  • +
  • Deluge.OptionsManager
  • +
  • Ext.deluge.TorrentGrid
  • +
  • Ext.ux.FullProgressBar
  • +
    @@ -586,7 +590,7 @@ if seconds < 0
    - Documentation generated by JsDoc Toolkit 2.1.0 on Tue May 19 2009 23:27:57 GMT+0100 (BST) + Documentation generated by JsDoc Toolkit 2.1.0 on Wed May 27 2009 16:15:35 GMT+0100 (BST)
    diff --git a/deluge/ui/web/docs/symbols/Deluge.Keys.html b/deluge/ui/web/docs/symbols/Deluge.Keys.html index 01491c84e..db8dccf93 100644 --- a/deluge/ui/web/docs/symbols/Deluge.Keys.html +++ b/deluge/ui/web/docs/symbols/Deluge.Keys.html @@ -197,8 +197,12 @@ ul.inheritsList
  • Deluge.Keys
  • +
  • Deluge.OptionsManager
  • +
  • Ext.deluge.TorrentGrid
  • +
  • Ext.ux.FullProgressBar
  • +
    @@ -522,7 +526,7 @@ by Deluge.Keys.Grid.
    - Documentation generated by JsDoc Toolkit 2.1.0 on Tue May 19 2009 23:27:57 GMT+0100 (BST) + Documentation generated by JsDoc Toolkit 2.1.0 on Wed May 27 2009 16:15:35 GMT+0100 (BST)
    diff --git a/deluge/ui/web/docs/symbols/Deluge.OptionsManager.html b/deluge/ui/web/docs/symbols/Deluge.OptionsManager.html new file mode 100644 index 000000000..d4d2b6593 --- /dev/null +++ b/deluge/ui/web/docs/symbols/Deluge.OptionsManager.html @@ -0,0 +1,310 @@ + + + + + + + JsDoc Reference - Deluge.OptionsManager + + + + + + + + + + + +
    + +
    Class Index +| File Index
    +
    +

    Classes

    + +
    + +
    + +
    + +

    + + Namespace Deluge.OptionsManager +

    + + +

    + + + Deluge + + +
    Defined in: Deluge.OptionsManager.js. + +

    + + + + + + + + + + + + + + + + + +
    Namespace Summary
    Constructor AttributesConstructor Name and Description
      + +
    A class that can be used to manage options throughout the ui.
    +
    + + + + + + + + + + + + +
    +
    + Namespace Detail +
    + +
    + Deluge.OptionsManager +
    + +
    + A class that can be used to manage options throughout the ui. + +
    + + + + + + + + + + + + +
    + + + + + + + + + + + +
    +
    + + + +
    + + Documentation generated by JsDoc Toolkit 2.1.0 on Wed May 27 2009 16:15:35 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 e70350faa..15c6821b1 100644 --- a/deluge/ui/web/docs/symbols/Ext.deluge.TorrentGrid.html +++ b/deluge/ui/web/docs/symbols/Ext.deluge.TorrentGrid.html @@ -197,8 +197,12 @@ ul.inheritsList
  • Deluge.Keys
  • +
  • Deluge.OptionsManager
  • +
  • Ext.deluge.TorrentGrid
  • +
  • Ext.ux.FullProgressBar
  • +
    @@ -313,7 +317,7 @@ ul.inheritsList
    - Documentation generated by JsDoc Toolkit 2.1.0 on Tue May 19 2009 23:27:57 GMT+0100 (BST) + Documentation generated by JsDoc Toolkit 2.1.0 on Wed May 27 2009 16:15:35 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 new file mode 100644 index 000000000..a4ba3bbf4 --- /dev/null +++ b/deluge/ui/web/docs/symbols/Ext.ux.FullProgressBar.html @@ -0,0 +1,323 @@ + + + + + + + JsDoc Reference - Ext.ux.FullProgressBar + + + + + + + + + + + +
    + +
    Class Index +| File Index
    +
    +

    Classes

    + +
    + +
    + +
    + +

    + + Class Ext.ux.FullProgressBar +

    + + +

    +
    Extends + Ext.ProgressBar.
    + + + Ext.deluge.ProgressBar + + +
    Defined in: ext-extensions-debug.js. + +

    + + + + + + + + + + + + + + + + + +
    Class Summary
    Constructor AttributesConstructor Name and Description
      + +
    Ext.ux.FullProgressBar Class
    +
    + + + + + + + + + + + + +
    +
    + Class Detail +
    + +
    + Ext.ux.FullProgressBar(config) +
    + +
    + Ext.ux.FullProgressBar Class +
    Author: Damien Churchill . +
    + + + + + +
    +
    Parameters:
    + +
    + {Object} config + +
    +
    Configuration options
    + +
    + + + + + + + + +
    + + + + + + + + + + + +
    +
    + + + +
    + + Documentation generated by JsDoc Toolkit 2.1.0 on Wed May 27 2009 16:15:35 GMT+0100 (BST) +
    + + diff --git a/deluge/ui/web/docs/symbols/_global_.html b/deluge/ui/web/docs/symbols/_global_.html index a03887b0e..6ce9b3d92 100644 --- a/deluge/ui/web/docs/symbols/_global_.html +++ b/deluge/ui/web/docs/symbols/_global_.html @@ -197,8 +197,12 @@ ul.inheritsList
  • Deluge.Keys
  • +
  • Deluge.OptionsManager
  • +
  • Ext.deluge.TorrentGrid
  • +
  • Ext.ux.FullProgressBar
  • +
    @@ -225,6 +229,74 @@ ul.inheritsList + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    Field Summary
    Field AttributesField Name and Description
      +
    + autoSize +
    +
    +
      + +
    +
      + +
    +
      + +
    +
      +
    + readOnly +
    +
    +
    + + + + @@ -240,6 +312,51 @@ ul.inheritsList + +   + +
    alignErrorIcon() +
    +
    + + + + +   + +
    getFileInputId() +
    +
    + + + + +   + +
    getPositionEl() +
    +
    + + + + +   + +
    getResizeEl() +
    +
    + + + + +   + +
    initComponent() +
    +
    + + +   @@ -249,6 +366,15 @@ ul.inheritsList + +   + +
    onResize(w, h) +
    +
    + + + @@ -257,12 +383,169 @@ ul.inheritsList + + + + + + + + + + + + + + + + + + +
    Event Summary
    Event AttributesEvent Name and Description
      +
    onRender(this, value) +
    +
    +
    + + + + +
    + Field Detail +
    + + +
    + + + autoSize + +
    +
    + + +
    + Defined in: ext-extensions-debug.js. + + +
    + + + + + + + + +
    + + +
    + + + buttonOffset + +
    +
    + + +
    + Defined in: ext-extensions-debug.js. + + +
    + + + + + + + + +
    + + +
    + + + buttonOnly + +
    +
    + + +
    + Defined in: ext-extensions-debug.js. + + +
    + + + + + + + + +
    + + +
    + + + buttonText + +
    +
    + + +
    + Defined in: ext-extensions-debug.js. + + +
    + + + + + + + + +
    + + +
    + + + readOnly + +
    +
    + + +
    + Defined in: ext-extensions-debug.js. + + +
    + + + + + + + + + + + @@ -270,6 +553,146 @@ ul.inheritsList Method Detail + +
    + + + alignErrorIcon() + +
    +
    + + +
    + Defined in: ext-extensions-debug.js. + + +
    + + + + + + + + + + + +
    + + +
    + + + getFileInputId() + +
    +
    + + +
    + Defined in: ext-extensions-debug.js. + + +
    + + + + + + + + + + + +
    + + +
    + + + getPositionEl() + +
    +
    + + +
    + Defined in: ext-extensions-debug.js. + + +
    + + + + + + + + + + + +
    + + +
    + + + getResizeEl() + +
    +
    + + +
    + Defined in: ext-extensions-debug.js. + + +
    + + + + + + + + + + + +
    + + +
    + + + initComponent() + +
    +
    + + +
    + Defined in: ext-extensions-debug.js. + + +
    + + + + + + + + + + + +
    +
    @@ -313,12 +736,107 @@ ul.inheritsList +
    + + +
    + + + onResize(w, h) + +
    +
    + + +
    + Defined in: ext-extensions-debug.js. + + +
    + + + + +
    +
    Parameters:
    + +
    + w + +
    +
    + +
    + h + +
    +
    + +
    + + + + + + + + +
    + Event Detail +
    + + +
    + + + onRender(this, value) + +
    +
    + + +
    + Defined in: ext-extensions-debug.js. + + +
    + + + + +
    +
    Parameters:
    + +
    + {Ext.form.FileUploadField} this + +
    +
    + +
    + {String} value + +
    +
    The file value returned by the underlying file input field
    + +
    + + + + + + + + + + +
    @@ -327,7 +845,7 @@ ul.inheritsList
    - Documentation generated by JsDoc Toolkit 2.1.0 on Tue May 19 2009 23:27:56 GMT+0100 (BST) + Documentation generated by JsDoc Toolkit 2.1.0 on Wed May 27 2009 16:15:34 GMT+0100 (BST)
    diff --git a/deluge/ui/web/docs/symbols/src/Deluge.Details.Files.js.html b/deluge/ui/web/docs/symbols/src/Deluge.Details.Files.js.html index df6f0a474..e9c4661d1 100644 --- a/deluge/ui/web/docs/symbols/src/Deluge.Details.Files.js.html +++ b/deluge/ui/web/docs/symbols/src/Deluge.Details.Files.js.html @@ -136,78 +136,74 @@ 129 default: 130 var indexes = {}; 131 function walk(node) { -132 if (!node.attributes.fileIndex) return; +132 if (Ext.isEmpty(node.attributes.fileIndex)) return; 133 indexes[node.attributes.fileIndex] = node.attributes.priority; 134 } 135 this.getRootNode().cascade(walk); 136 137 var nodes = this.getSelectionModel().getSelectedNodes(); 138 Ext.each(nodes, function(node) { -139 if (!node.attributes.fileIndex) return; +139 if (Ext.isEmpty(node.attributes.fileIndex)) return; 140 indexes[node.attributes.fileIndex] = baseItem.filePriority; 141 }); 142 -143 alert(Ext.keys(indexes)); -144 -145 priorities = new Array(Ext.keys(indexes).length); -146 for (var index in indexes) { -147 priorities[index] = indexes[index]; -148 } -149 -150 alert(this.torrentId); -151 alert(priorities); -152 Deluge.Client.core.set_torrent_file_priorities(this.torrentId, priorities, { -153 success: function() { -154 Ext.each(nodes, function(node) { -155 node.setColumnValue(3, baseItem.filePriority); -156 }); -157 }, -158 scope: this -159 }); -160 break; -161 } -162 }, -163 -164 onRequestComplete: function(files, options) { -165 function walk(files, parent) { -166 for (var file in files) { -167 var item = files[file]; -168 var child = parent.findChild('id', file); -169 if (Ext.type(item) == 'object') { -170 if (!child) { -171 child = new Ext.tree.TreeNode({ -172 id: file, -173 text: file -174 }); -175 parent.appendChild(child); -176 } -177 walk(item, child); -178 } else { -179 if (!child) { -180 child = new Ext.tree.ColumnTreeNode({ -181 id: file, -182 filename: file, -183 text: file, // this needs to be here for sorting -184 fileIndex: item[0], -185 size: item[1], -186 progress: item[2], -187 priority: item[3], -188 leaf: true, -189 iconCls: 'x-deluge-file', -190 uiProvider: Ext.tree.ColumnNodeUI -191 }); -192 parent.appendChild(child); -193 } -194 child.setColumnValue(1, item[1]); -195 child.setColumnValue(2, item[2]); -196 child.setColumnValue(3, item[3]); -197 } -198 } -199 } -200 var root = this.getRootNode(); -201 walk(files, root); -202 root.firstChild.expand(); -203 } -204 }); -205 Deluge.Details.add(new Ext.deluge.details.FilesTab()); -206 })(); \ No newline at end of file +143 var priorities = new Array(Ext.keys(indexes).length); +144 for (var index in indexes) { +145 priorities[index] = indexes[index]; +146 } +147 +148 Deluge.Client.core.set_torrent_file_priorities(this.torrentId, priorities, { +149 success: function() { +150 Ext.each(nodes, function(node) { +151 node.setColumnValue(3, baseItem.filePriority); +152 }); +153 }, +154 scope: this +155 }); +156 break; +157 } +158 }, +159 +160 onRequestComplete: function(files, options) { +161 function walk(files, parent) { +162 for (var file in files) { +163 var item = files[file]; +164 var child = parent.findChild('id', file); +165 if (Ext.type(item) == 'object') { +166 if (!child) { +167 child = new Ext.tree.TreeNode({ +168 id: file, +169 text: file +170 }); +171 parent.appendChild(child); +172 } +173 walk(item, child); +174 } else { +175 if (!child) { +176 child = new Ext.tree.ColumnTreeNode({ +177 id: file, +178 filename: file, +179 text: file, // this needs to be here for sorting +180 fileIndex: item[0], +181 size: item[1], +182 progress: item[2], +183 priority: item[3], +184 leaf: true, +185 iconCls: 'x-deluge-file', +186 uiProvider: Ext.tree.ColumnNodeUI +187 }); +188 parent.appendChild(child); +189 } +190 child.setColumnValue(1, item[1]); +191 child.setColumnValue(2, item[2]); +192 child.setColumnValue(3, item[3]); +193 } +194 } +195 } +196 var root = this.getRootNode(); +197 walk(files, root); +198 root.firstChild.expand(); +199 } +200 }); +201 Deluge.Details.add(new Ext.deluge.details.FilesTab()); +202 })(); \ No newline at end of file diff --git a/deluge/ui/web/docs/symbols/src/Deluge.Details.Options.js.html b/deluge/ui/web/docs/symbols/src/Deluge.Details.Options.js.html index 85f199307..e236423ec 100644 --- a/deluge/ui/web/docs/symbols/src/Deluge.Details.Options.js.html +++ b/deluge/ui/web/docs/symbols/src/Deluge.Details.Options.js.html @@ -38,318 +38,317 @@ 31 statement from all source files in the program, then also delete it here. 32 */ 33 - 34 Ext.deluge.details.OptionsTab = Ext.extend(Ext.form.FormPanel, { - 35 - 36 constructor: function(config) { - 37 config = Ext.apply({ - 38 autoScroll: true, - 39 bodyStyle: 'padding: 5px;', - 40 border: false, - 41 cls: 'x-deluge-options', - 42 defaults: { - 43 autoHeight: true, - 44 labelWidth: 1, - 45 defaultType: 'checkbox' - 46 }, - 47 deferredRender: false, - 48 layout: 'column', - 49 title: _('Options') - 50 }, config); - 51 Ext.deluge.details.OptionsTab.superclass.constructor.call(this, config); - 52 }, - 53 - 54 initComponent: function() { - 55 Ext.deluge.details.OptionsTab.superclass.initComponent.call(this); - 56 - 57 this.fieldsets = {}, this.fields = {}; - 58 - 59 /* - 60 * Bandwidth Options - 61 */ - 62 this.fieldsets.bandwidth = this.add({ - 63 xtype: 'fieldset', - 64 defaultType: 'uxspinner', - 65 bodyStyle: 'padding: 5px', - 66 - 67 layout: 'table', - 68 layoutConfig: {columns: 3}, - 69 labelWidth: 150, - 70 - 71 style: 'margin-left: 10px; margin-right: 5px; padding: 5px', - 72 title: _('Bandwidth'), - 73 width: 300 - 74 }); - 75 - 76 /* - 77 * Max Download Speed - 78 */ - 79 this.fieldsets.bandwidth.add({ - 80 xtype: 'label', - 81 text: _('Max Download Speed'), - 82 forId: 'max_download_speed', - 83 cls: 'x-deluge-options-label' - 84 }); - 85 this.fields.max_download_speed = this.fieldsets.bandwidth.add({ - 86 id: 'max_download_speed', - 87 name: 'max_download_speed', - 88 width: 100, - 89 value: -1, - 90 stragegy: new Ext.ux.form.Spinner.NumberStrategy({ - 91 minValue: -1, - 92 maxValue: 99999, - 93 incrementValue: 1 - 94 }) - 95 }); - 96 this.fieldsets.bandwidth.add({ - 97 xtype: 'label', - 98 text: _('KiB/s'), - 99 style: 'margin-left: 10px' -100 }); -101 -102 /* -103 * Max Upload Speed -104 */ -105 this.fieldsets.bandwidth.add({ -106 xtype: 'label', -107 text: _('Max Upload Speed'), -108 forId: 'max_upload_speed', -109 cls: 'x-deluge-options-label' -110 }); -111 this.fields.max_upload_speed = this.fieldsets.bandwidth.add({ -112 id: 'max_upload_speed', -113 name: 'max_upload_speed', -114 width: 100, -115 value: -1, -116 stragegy: new Ext.ux.form.Spinner.NumberStrategy({ -117 minValue: -1, -118 maxValue: 99999, -119 incrementValue: 1 -120 }) -121 }); -122 this.fieldsets.bandwidth.add({ -123 xtype: 'label', -124 text: _('KiB/s'), -125 style: 'margin-left: 10px' -126 }); -127 -128 /* -129 * Max Connections -130 */ -131 this.fieldsets.bandwidth.add({ -132 xtype: 'label', -133 text: _('Max Connections'), -134 forId: 'max_connections', -135 cls: 'x-deluge-options-label' -136 }); -137 this.fields.max_connections = this.fieldsets.bandwidth.add({ -138 id: 'max_connections', -139 name: 'max_connections', -140 width: 100, -141 value: -1, -142 stragegy: new Ext.ux.form.Spinner.NumberStrategy({ -143 minValue: -1, -144 maxValue: 99999, -145 incrementValue: 1 -146 }) -147 }); -148 this.fieldsets.bandwidth.add({xtype: 'label'}); -149 -150 /* -151 * Max Upload Slots -152 */ -153 this.fieldsets.bandwidth.add({ -154 xtype: 'label', -155 text: _('Max Upload Slots'), -156 forId: 'max_upload_slots', -157 cls: 'x-deluge-options-label' -158 }); -159 this.fields.max_upload_slots = this.fieldsets.bandwidth.add({ -160 id: 'max_upload_slots', -161 name: 'max_upload_slots', -162 width: 100, -163 value: -1, -164 stragegy: new Ext.ux.form.Spinner.NumberStrategy({ -165 minValue: -1, -166 maxValue: 99999, -167 incrementValue: 1 -168 }) -169 }); -170 -171 /* -172 * Queue Options -173 */ -174 this.fieldsets.queue = this.add({ -175 xtype: 'fieldset', -176 title: _('Queue'), -177 style: 'margin-left: 5px; margin-right: 5px; padding: 5px', -178 width: 200, -179 defaults: { -180 fieldLabel: '', -181 labelSeparator: '' -182 } -183 }); -184 -185 this.fields.is_auto_managed = this.fieldsets.queue.add({ -186 fieldLabel: '', -187 labelSeparator: '', -188 id: 'is_auto_managed', -189 boxLabel: _('Auto Managed') -190 }); -191 -192 this.fields.stop_at_ratio = this.fieldsets.queue.add({ -193 fieldLabel: '', -194 labelSeparator: '', -195 id: 'stop_at_ratio', -196 boxLabel: _('Stop seed at ratio') -197 }); -198 -199 this.fields.remove_at_ratio = this.fieldsets.queue.add({ -200 fieldLabel: '', -201 labelSeparator: '', -202 id: 'remove_at_ratio', -203 style: 'margin-left: 10px', -204 boxLabel: _('Remove at ratio') -205 }); -206 -207 this.fields.move_completed = this.fieldsets.queue.add({ -208 fieldLabel: '', -209 labelSeparator: '', -210 id: 'move_completed', -211 boxLabel: _('Move Completed') -212 }); -213 -214 -215 /* -216 * General Options -217 */ -218 this.rightColumn = this.add({ -219 border: false, -220 autoHeight: true, -221 style: 'margin-left: 5px', -222 width: 200 -223 }); -224 -225 this.fieldsets.general = this.rightColumn.add({ -226 xtype: 'fieldset', -227 autoHeight: true, -228 defaultType: 'checkbox', -229 title: _('General'), -230 layout: 'form' -231 }); -232 -233 this.fields['private'] = this.fieldsets.general.add({ -234 fieldLabel: '', -235 labelSeparator: '', -236 boxLabel: _('Private'), -237 id: 'private' -238 }); -239 -240 this.fields.prioritize_first_last = this.fieldsets.general.add({ -241 fieldLabel: '', -242 labelSeparator: '', -243 boxLabel: _('Prioritize First/Last'), -244 id: 'prioritize_first_last' -245 }); -246 -247 /* -248 * Buttons -249 */ -250 this.buttonPanel = this.rightColumn.add({ -251 layout: 'column', -252 xtype: 'panel', -253 border: false -254 }); -255 -256 // The buttons below are required to be added to a panel -257 // first as simply adding them to the column layout throws an -258 // error c.getSize() does not exist. This could be intentional -259 // or it may possible be a bug in ext-js. Take care when upgrading -260 // to ext-js 3.0. -261 -262 /* -263 * Edit Trackers button -264 */ -265 this.buttonPanel.add({ -266 xtype: 'panel', -267 border: false -268 }).add({ -269 id: 'edit_trackers', -270 xtype: 'button', -271 text: _('Edit Trackers'), -272 cls: 'x-btn-text-icon', -273 iconCls: 'x-deluge-edit-trackers', -274 border: false, -275 width: 100, -276 handler: this.onEditTrackers, -277 scope: this -278 }); -279 -280 /* -281 * Apply button -282 */ -283 this.buttonPanel.add({ -284 xtype: 'panel', -285 border: false -286 }).add({ -287 id: 'apply', -288 xtype: 'button', -289 text: _('Apply'), -290 style: 'margin-left: 10px;', -291 border: false, -292 width: 100, -293 }); -294 -295 this.disable(); -296 }, -297 -298 onRender: function(ct, position) { -299 Ext.deluge.details.OptionsTab.superclass.onRender.call(this, ct, position); -300 -301 // This is another hack I think, so keep an eye out here when upgrading. -302 this.layout = new Ext.layout.ColumnLayout(); -303 this.layout.setContainer(this); -304 this.doLayout(); -305 }, -306 -307 clear: function() { -308 this.fields.max_download_speed.setValue(0); -309 this.fields.max_upload_speed.setValue(0); -310 this.fields.max_connections.setValue(0); -311 this.fields.max_upload_slots.setValue(0); -312 this.fields.is_auto_managed.setValue(false); -313 this.fields.stop_at_ratio.setValue(false); -314 this.fields.remove_at_ratio.setValue(false); -315 this.fields['private'].setValue(false); -316 this.fields.prioritize_first_last.setValue(false); -317 }, -318 -319 reset: function() { -320 if (this.torrentId) { -321 delete this.changed[this.torrentId]; -322 } -323 }, -324 -325 update: function(torrentId) { -326 this.torrentId = torrentId; -327 Deluge.Client.core.get_torrent_status(torrentId, Deluge.Keys.Options, { -328 success: this.onRequestComplete, -329 scope: this -330 }); -331 }, -332 -333 onEditTrackers: function() { -334 Deluge.EditTrackers.show(); -335 }, -336 -337 onRequestComplete: function(torrent, options) { -338 for (var key in torrent) { -339 if (this.fields[key]) { -340 this.fields[key].setValue(torrent[key]) -341 } else { -342 //alert(key); -343 } -344 } -345 } -346 }); -347 Deluge.Details.add(new Ext.deluge.details.OptionsTab()); -348 \ No newline at end of file + 34 + 35 Ext.deluge.details.OptionsTab = Ext.extend(Ext.form.FormPanel, { + 36 + 37 constructor: function(config) { + 38 config = Ext.apply({ + 39 autoScroll: true, + 40 bodyStyle: 'padding: 5px;', + 41 border: false, + 42 cls: 'x-deluge-options', + 43 defaults: { + 44 autoHeight: true, + 45 labelWidth: 1, + 46 defaultType: 'checkbox' + 47 }, + 48 deferredRender: false, + 49 layout: 'column', + 50 title: _('Options') + 51 }, config); + 52 Ext.deluge.details.OptionsTab.superclass.constructor.call(this, config); + 53 }, + 54 + 55 initComponent: function() { + 56 Ext.deluge.details.OptionsTab.superclass.initComponent.call(this); + 57 + 58 this.fieldsets = {}, this.fields = {}; + 59 + 60 /* + 61 * Bandwidth Options + 62 */ + 63 this.fieldsets.bandwidth = this.add({ + 64 xtype: 'fieldset', + 65 defaultType: 'uxspinner', + 66 bodyStyle: 'padding: 5px', + 67 + 68 layout: 'table', + 69 layoutConfig: {columns: 3}, + 70 labelWidth: 150, + 71 + 72 style: 'margin-left: 10px; margin-right: 5px; padding: 5px', + 73 title: _('Bandwidth'), + 74 width: 300 + 75 }); + 76 + 77 /* + 78 * Max Download Speed + 79 */ + 80 this.fieldsets.bandwidth.add({ + 81 xtype: 'label', + 82 text: _('Max Download Speed'), + 83 forId: 'max_download_speed', + 84 cls: 'x-deluge-options-label' + 85 }); + 86 this.fields.max_download_speed = this.fieldsets.bandwidth.add({ + 87 id: 'max_download_speed', + 88 name: 'max_download_speed', + 89 width: 100, + 90 value: -1, + 91 stragegy: new Ext.ux.form.Spinner.NumberStrategy({ + 92 minValue: -1, + 93 maxValue: 99999, + 94 incrementValue: 1 + 95 }) + 96 }); + 97 this.fieldsets.bandwidth.add({ + 98 xtype: 'label', + 99 text: _('KiB/s'), +100 style: 'margin-left: 10px' +101 }); +102 +103 /* +104 * Max Upload Speed +105 */ +106 this.fieldsets.bandwidth.add({ +107 xtype: 'label', +108 text: _('Max Upload Speed'), +109 forId: 'max_upload_speed', +110 cls: 'x-deluge-options-label' +111 }); +112 this.fields.max_upload_speed = this.fieldsets.bandwidth.add({ +113 id: 'max_upload_speed', +114 name: 'max_upload_speed', +115 width: 100, +116 value: -1, +117 stragegy: new Ext.ux.form.Spinner.NumberStrategy({ +118 minValue: -1, +119 maxValue: 99999, +120 incrementValue: 1 +121 }) +122 }); +123 this.fieldsets.bandwidth.add({ +124 xtype: 'label', +125 text: _('KiB/s'), +126 style: 'margin-left: 10px' +127 }); +128 +129 /* +130 * Max Connections +131 */ +132 this.fieldsets.bandwidth.add({ +133 xtype: 'label', +134 text: _('Max Connections'), +135 forId: 'max_connections', +136 cls: 'x-deluge-options-label' +137 }); +138 this.fields.max_connections = this.fieldsets.bandwidth.add({ +139 id: 'max_connections', +140 name: 'max_connections', +141 width: 100, +142 value: -1, +143 stragegy: new Ext.ux.form.Spinner.NumberStrategy({ +144 minValue: -1, +145 maxValue: 99999, +146 incrementValue: 1 +147 }) +148 }); +149 this.fieldsets.bandwidth.add({xtype: 'label'}); +150 +151 /* +152 * Max Upload Slots +153 */ +154 this.fieldsets.bandwidth.add({ +155 xtype: 'label', +156 text: _('Max Upload Slots'), +157 forId: 'max_upload_slots', +158 cls: 'x-deluge-options-label' +159 }); +160 this.fields.max_upload_slots = this.fieldsets.bandwidth.add({ +161 id: 'max_upload_slots', +162 name: 'max_upload_slots', +163 width: 100, +164 value: -1, +165 stragegy: new Ext.ux.form.Spinner.NumberStrategy({ +166 minValue: -1, +167 maxValue: 99999, +168 incrementValue: 1 +169 }) +170 }); +171 +172 /* +173 * Queue Options +174 */ +175 this.fieldsets.queue = this.add({ +176 xtype: 'fieldset', +177 title: _('Queue'), +178 style: 'margin-left: 5px; margin-right: 5px; padding: 5px', +179 width: 200, +180 defaults: { +181 fieldLabel: '', +182 labelSeparator: '' +183 } +184 }); +185 +186 this.fields.is_auto_managed = this.fieldsets.queue.add({ +187 fieldLabel: '', +188 labelSeparator: '', +189 id: 'is_auto_managed', +190 boxLabel: _('Auto Managed') +191 }); +192 +193 this.fields.stop_at_ratio = this.fieldsets.queue.add({ +194 fieldLabel: '', +195 labelSeparator: '', +196 id: 'stop_at_ratio', +197 boxLabel: _('Stop seed at ratio') +198 }); +199 +200 this.fields.remove_at_ratio = this.fieldsets.queue.add({ +201 fieldLabel: '', +202 labelSeparator: '', +203 id: 'remove_at_ratio', +204 style: 'margin-left: 10px', +205 boxLabel: _('Remove at ratio') +206 }); +207 +208 this.fields.move_completed = this.fieldsets.queue.add({ +209 fieldLabel: '', +210 labelSeparator: '', +211 id: 'move_completed', +212 boxLabel: _('Move Completed') +213 }); +214 +215 +216 /* +217 * General Options +218 */ +219 this.rightColumn = this.add({ +220 border: false, +221 autoHeight: true, +222 style: 'margin-left: 5px', +223 width: 200 +224 }); +225 +226 this.fieldsets.general = this.rightColumn.add({ +227 xtype: 'fieldset', +228 autoHeight: true, +229 defaultType: 'checkbox', +230 title: _('General'), +231 layout: 'form' +232 }); +233 +234 this.fields['private'] = this.fieldsets.general.add({ +235 fieldLabel: '', +236 labelSeparator: '', +237 boxLabel: _('Private'), +238 id: 'private' +239 }); +240 +241 this.fields.prioritize_first_last = this.fieldsets.general.add({ +242 fieldLabel: '', +243 labelSeparator: '', +244 boxLabel: _('Prioritize First/Last'), +245 id: 'prioritize_first_last' +246 }); +247 +248 /* +249 * Buttons +250 */ +251 this.buttonPanel = this.rightColumn.add({ +252 layout: 'column', +253 xtype: 'panel', +254 border: false +255 }); +256 +257 // The buttons below are required to be added to a panel +258 // first as simply adding them to the column layout throws an +259 // error c.getSize() does not exist. This could be intentional +260 // or it may possible be a bug in ext-js. Take care when upgrading +261 // to ext-js 3.0. +262 +263 /* +264 * Edit Trackers button +265 */ +266 this.buttonPanel.add({ +267 xtype: 'panel', +268 border: false +269 }).add({ +270 id: 'edit_trackers', +271 xtype: 'button', +272 text: _('Edit Trackers'), +273 cls: 'x-btn-text-icon', +274 iconCls: 'x-deluge-edit-trackers', +275 border: false, +276 width: 100, +277 handler: this.onEditTrackers, +278 scope: this +279 }); +280 +281 /* +282 * Apply button +283 */ +284 this.buttonPanel.add({ +285 xtype: 'panel', +286 border: false +287 }).add({ +288 id: 'apply', +289 xtype: 'button', +290 text: _('Apply'), +291 style: 'margin-left: 10px;', +292 border: false, +293 width: 100, +294 }); +295 }, +296 +297 onRender: function(ct, position) { +298 Ext.deluge.details.OptionsTab.superclass.onRender.call(this, ct, position); +299 +300 // This is another hack I think, so keep an eye out here when upgrading. +301 this.layout = new Ext.layout.ColumnLayout(); +302 this.layout.setContainer(this); +303 this.doLayout(); +304 }, +305 +306 clear: function() { +307 this.fields.max_download_speed.setValue(0); +308 this.fields.max_upload_speed.setValue(0); +309 this.fields.max_connections.setValue(0); +310 this.fields.max_upload_slots.setValue(0); +311 this.fields.is_auto_managed.setValue(false); +312 this.fields.stop_at_ratio.setValue(false); +313 this.fields.remove_at_ratio.setValue(false); +314 this.fields['private'].setValue(false); +315 this.fields.prioritize_first_last.setValue(false); +316 }, +317 +318 reset: function() { +319 if (this.torrentId) { +320 delete this.changed[this.torrentId]; +321 } +322 }, +323 +324 update: function(torrentId) { +325 this.torrentId = torrentId; +326 Deluge.Client.core.get_torrent_status(torrentId, Deluge.Keys.Options, { +327 success: this.onRequestComplete, +328 scope: this +329 }); +330 }, +331 +332 onEditTrackers: function() { +333 Deluge.EditTrackers.show(); +334 }, +335 +336 onRequestComplete: function(torrent, options) { +337 for (var key in torrent) { +338 if (this.fields[key]) { +339 this.fields[key].setValue(torrent[key]) +340 } else { +341 //alert(key); +342 } +343 } +344 } +345 }); +346 Deluge.Details.add(new Ext.deluge.details.OptionsTab()); +347 \ No newline at end of file diff --git a/deluge/ui/web/docs/symbols/src/Deluge.Details.js.html b/deluge/ui/web/docs/symbols/src/Deluge.Details.js.html index d7257ca19..1896bf404 100644 --- a/deluge/ui/web/docs/symbols/src/Deluge.Details.js.html +++ b/deluge/ui/web/docs/symbols/src/Deluge.Details.js.html @@ -6,7 +6,7 @@ .REGX {color: #339;} .line {border-right: 1px dotted #666; color: #666; font-style: normal;}
      1 /*
    -  2 Script: deluge-details.js
    +  2 Script: Deluge.Details.js
       3     Contains all objects and functions related to the lower details panel and
       4 	it's containing tabs.
       5 
    @@ -27,72 +27,82 @@
      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 (function() {
    - 37 	Ext.namespace('Ext.deluge.details');
    - 38 	Ext.deluge.details.TabPanel = Ext.extend(Ext.TabPanel, {
    - 39 		
    - 40 		constructor: function(config) {
    - 41 			config = Ext.apply({
    - 42 				region: 'south',
    - 43 				split: true,
    - 44 				height: 220,
    - 45 				minSize: 100,
    - 46 				collapsible: true,
    - 47 				margins: '0 5 5 5',
    - 48 				activeTab: 0
    - 49 			}, config);
    - 50 			Ext.deluge.details.TabPanel.superclass.constructor.call(this, config);
    - 51 		},
    - 52 		
    - 53 		clear: function() {
    - 54 			this.items.each(function(panel) {
    - 55 				if (panel.clear) panel.clear();
    - 56 			});
    - 57 		},
    - 58 		
    + 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 (function() {
    + 36 	Ext.namespace('Ext.deluge.details');
    + 37 	Ext.deluge.details.TabPanel = Ext.extend(Ext.TabPanel, {
    + 38 		
    + 39 		constructor: function(config) {
    + 40 			config = Ext.apply({
    + 41 				region: 'south',
    + 42 				split: true,
    + 43 				height: 220,
    + 44 				minSize: 100,
    + 45 				collapsible: true,
    + 46 				margins: '0 5 5 5',
    + 47 				activeTab: 0
    + 48 			}, config);
    + 49 			Ext.deluge.details.TabPanel.superclass.constructor.call(this, config);
    + 50 		},
    + 51 		
    + 52 		clear: function() {
    + 53 			this.items.each(function(panel) {
    + 54 				if (panel.clear) panel.clear();
    + 55 			});
    + 56 		},
    + 57 		
    + 58 		
      59 		update: function(tab) {
      60 			var torrent = Deluge.Torrents.getSelected();
    - 61 			if (!torrent) return;
    - 62 			
    - 63 			tab = tab || this.getActiveTab();
    - 64 			if (tab.update) tab.update(torrent.id);
    - 65 		},
    - 66 		
    - 67 		/* Event Handlers */
    - 68 		
    - 69 		// We need to add the events in onRender since Deluge.Torrents hasn't
    - 70 		// been created yet.
    - 71 		onRender: function(ct, position) {
    - 72 			Ext.deluge.details.TabPanel.superclass.onRender.call(this, ct, position);
    - 73 			Deluge.Events.on('disconnect', this.clear, this);
    - 74 			Deluge.Torrents.on('rowclick', this.onTorrentsClick, this);
    - 75 			this.on('tabchange', this.onTabChange, this);
    - 76 			
    - 77 			Deluge.Torrents.getSelectionModel().on('selectionchange', function(selModel) {
    - 78 				if (!selModel.hasSelection()) this.clear();
    - 79 			}, this);
    - 80 		},
    - 81 		
    - 82 		onTabChange: function(panel, tab) {
    - 83 			this.update(tab);
    - 84 		},
    - 85 		
    - 86 		onTorrentsClick: function(grid, rowIndex, e) {
    - 87 			this.update();
    - 88 		}
    - 89 	});
    - 90 	Deluge.Details = new Ext.deluge.details.TabPanel();
    - 91 })();
    \ No newline at end of file + 61 if (!torrent) { + 62 this.items.each(function(tab) { + 63 tab.disable(); + 64 }); + 65 return; + 66 } + 67 + 68 this.items.each(function(tab) { + 69 tab.enable(); + 70 }); + 71 + 72 tab = tab || this.getActiveTab(); + 73 if (tab.update) tab.update(torrent.id); + 74 }, + 75 + 76 /* Event Handlers */ + 77 + 78 // We need to add the events in onRender since Deluge.Torrents hasn't + 79 // been created yet. + 80 onRender: function(ct, position) { + 81 Ext.deluge.details.TabPanel.superclass.onRender.call(this, ct, position); + 82 Deluge.Events.on('disconnect', this.clear, this); + 83 Deluge.Torrents.on('rowclick', this.onTorrentsClick, this); + 84 this.on('tabchange', this.onTabChange, this); + 85 + 86 Deluge.Torrents.getSelectionModel().on('selectionchange', function(selModel) { + 87 if (!selModel.hasSelection()) this.clear(); + 88 }, this); + 89 }, + 90 + 91 onTabChange: function(panel, tab) { + 92 this.update(tab); + 93 }, + 94 + 95 onTorrentsClick: function(grid, rowIndex, e) { + 96 this.update(); + 97 } + 98 }); + 99 Deluge.Details = new Ext.deluge.details.TabPanel(); +100 })(); +101 \ No newline at end of file diff --git a/deluge/ui/web/docs/symbols/src/Deluge.OptionsManager.js.html b/deluge/ui/web/docs/symbols/src/Deluge.OptionsManager.js.html new file mode 100644 index 000000000..1d4893b0c --- /dev/null +++ b/deluge/ui/web/docs/symbols/src/Deluge.OptionsManager.js.html @@ -0,0 +1,92 @@ +
      1 /*
    +  2 Script:
    +  3 	Deluge.OptionsManager.js
    +  4 
    +  5 Copyright:
    +  6 	(C) Damien Churchill 2009 <damoxc@gmail.com>
    +  7 	This program is free software; you can redistribute it and/or modify
    +  8 	it under the terms of the GNU General Public License as published by
    +  9 	the Free Software Foundation; either version 3, or (at your option)
    + 10 	any later version.
    + 11 
    + 12 	This program is distributed in the hope that it will be useful,
    + 13 	but WITHOUT ANY WARRANTY; without even the implied warranty of
    + 14 	MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
    + 15 	GNU General Public License for more details.
    + 16 
    + 17 	You should have received a copy of the GNU General Public License
    + 18 	along with this program.  If not, write to:
    + 19 		The Free Software Foundation, Inc.,
    + 20 		51 Franklin Street, Fifth Floor
    + 21 		Boston, MA  02110-1301, USA.
    + 22 
    + 23     In addition, as a special exception, the copyright holders give
    + 24     permission to link the code of portions of this program with the OpenSSL
    + 25     library.
    + 26     You must obey the GNU General Public License in all respects for all of
    + 27     the code used other than OpenSSL. If you modify file(s) with this
    + 28     exception, you may extend this exception to your version of the file(s),
    + 29     but you are not obligated to do so. If you do not wish to do so, delete
    + 30     this exception statement from your version. If you delete this exception
    + 31     statement from all source files in the program, then also delete it here.
    + 32 */
    + 33 
    + 34 /**
    + 35  * @description A class that can be used to manage options throughout the ui.
    + 36  * @namespace Deluge
    + 37  * @class Deluge.OptionsManager
    + 38  */
    + 39 Deluge.OptionsManager = Ext.extend(Ext.util.Observable, {
    + 40 	
    + 41 	initComponent: function() {
    + 42 		Deluge.OptionsManager.superclass.initComponent.call(this);
    + 43 		this.changed = {};
    + 44 		this.options = {};
    + 45 	},
    + 46 
    + 47 	/**
    + 48 	 * Add a set of options and values for an id to the options manager
    + 49 	 * @param {String} id
    + 50 	 * @param {Object} options The default options for the id.
    + 51 	 */
    + 52 	addOptions: function(id, options) {
    + 53 		this.options[id] = options;
    + 54 	},
    + 55 
    + 56 	/**
    + 57 	 * Reset the options back to the default values for the specified id.
    + 58 	 * @param {String} id
    + 59 	 */
    + 60 	resetOptions: function(id) {
    + 61 		if (!this.changed[id]) return;
    + 62 		delete this.changed[id];
    + 63 	},
    + 64 	
    + 65 	/**
    + 66 	 * Set the specified option for the passed in id.
    + 67 	 * @param {String} id
    + 68 	 * @param {String} option
    + 69 	 * @param {Object...} value The new value for the option
    + 70 	 */
    + 71 	setOption: function(id, option, value) {
    + 72 		if (!this.changed[id]) this.changed[id] = {};
    + 73 		this.changed[id][option] = value;
    + 74 	},
    + 75 	
    + 76 	/**
    + 77 	 * Set the specified options for the passed in id.
    + 78 	 * @param {String} id
    + 79 	 * @param {object} options The option values to change.
    + 80 	 */
    + 81 	setOptions: function(id, options) {
    + 82 		if (!this.changed[id]) this.changed[id] = {};
    + 83 		this.changed[id] = Ext.extend(this.changed[id], options);
    + 84 	}
    + 85 });
    \ No newline at end of file diff --git a/deluge/ui/web/docs/symbols/src/ext-extensions-debug.js.html b/deluge/ui/web/docs/symbols/src/ext-extensions-debug.js.html new file mode 100644 index 000000000..b7e927e31 --- /dev/null +++ b/deluge/ui/web/docs/symbols/src/ext-extensions-debug.js.html @@ -0,0 +1,755 @@ +
      1 /**
    +  2  * Copyright (c) 2008, Steven Chim
    +  3  * All rights reserved.
    +  4  * 
    +  5  * Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:
    +  6  * 
    +  7  *     * Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.
    +  8  *     * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution.
    +  9  *     * The names of its contributors may not be used to endorse or promote products derived from this software without specific prior written permission.
    + 10  * 
    + 11  * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
    + 12  */
    + 13 
    + 14 /**
    + 15   * Ext.ux.form.Spinner Class
    + 16 	*
    + 17 	* @author  Steven Chim
    + 18 	* @version Spinner.js 2008-08-27 v0.35
    + 19   *
    + 20   * @class Ext.ux.form.Spinner
    + 21   * @extends Ext.form.TriggerField
    + 22   */
    + 23 
    + 24 Ext.namespace("Ext.ux.form");
    + 25 
    + 26 Ext.ux.form.Spinner = function(config){
    + 27 	Ext.ux.form.Spinner.superclass.constructor.call(this, config);
    + 28 	this.addEvents({
    + 29 		'spin' : true,
    + 30 		'spinup' : true,
    + 31 		'spindown' : true
    + 32 	});
    + 33 }
    + 34 
    + 35 Ext.extend(Ext.ux.form.Spinner, Ext.form.TriggerField, {
    + 36 	triggerClass : 'x-form-spinner-trigger',
    + 37 	splitterClass : 'x-form-spinner-splitter',
    + 38 
    + 39 	alternateKey : Ext.EventObject.shiftKey,
    + 40 	strategy : undefined,
    + 41 
    + 42 	//private
    + 43 	onRender : function(ct, position){
    + 44 		Ext.ux.form.Spinner.superclass.onRender.call(this, ct, position);
    + 45 
    + 46 		this.splitter = this.wrap.createChild({tag:'div', cls:this.splitterClass, style:'width:13px; height:2px;'});
    + 47 		this.splitter.show().setRight( (Ext.isIE) ? 1 : 2 );
    + 48 		this.splitter.show().setTop(10);
    + 49 
    + 50 		this.proxy = this.trigger.createProxy('', this.splitter, true);
    + 51 		this.proxy.addClass("x-form-spinner-proxy");
    + 52 		this.proxy.setStyle('left','0px');  
    + 53 		this.proxy.setSize(14, 1);
    + 54 		this.proxy.hide();
    + 55 		this.dd = new Ext.dd.DDProxy(this.splitter.dom.id, "SpinnerDrag", {dragElId: this.proxy.id});
    + 56 
    + 57 		this.initSpinner();
    + 58 	},
    + 59 
    + 60 	//private
    + 61 	initTrigger : function(){
    + 62 		this.trigger.addClassOnOver('x-form-trigger-over');
    + 63 		this.trigger.addClassOnClick('x-form-trigger-click');
    + 64 	},
    + 65 
    + 66 	//private
    + 67 	initSpinner : function(){
    + 68 		this.keyNav = new Ext.KeyNav(this.el, {
    + 69 			"up" : function(e){
    + 70 				e.preventDefault();
    + 71 				this.onSpinUp();
    + 72 			},
    + 73 
    + 74 			"down" : function(e){
    + 75 				e.preventDefault();
    + 76 				this.onSpinDown();
    + 77 			},
    + 78 
    + 79 			"pageUp" : function(e){
    + 80 				e.preventDefault();
    + 81 				this.onSpinUpAlternate();
    + 82 			},
    + 83 
    + 84 			"pageDown" : function(e){
    + 85 				e.preventDefault();
    + 86 				this.onSpinDownAlternate();
    + 87 			},
    + 88 
    + 89 			scope : this
    + 90 		});
    + 91 
    + 92 		this.repeater = new Ext.util.ClickRepeater(this.trigger);
    + 93 		this.repeater.on("click", this.onTriggerClick, this, {preventDefault:true});
    + 94 		this.trigger.on("mouseover", this.onMouseOver, this, {preventDefault:true});
    + 95 		this.trigger.on("mouseout",  this.onMouseOut,  this, {preventDefault:true});
    + 96 		this.trigger.on("mousemove", this.onMouseMove, this, {preventDefault:true});
    + 97 		this.trigger.on("mousedown", this.onMouseDown, this, {preventDefault:true});
    + 98 		this.trigger.on("mouseup",   this.onMouseUp,   this, {preventDefault:true});
    + 99 		this.wrap.on("mousewheel",   this.handleMouseWheel, this);
    +100 
    +101 		this.dd.setXConstraint(0, 0, 10)
    +102 		this.dd.setYConstraint(1500, 1500, 10);
    +103 		this.dd.endDrag = this.endDrag.createDelegate(this);
    +104 		this.dd.startDrag = this.startDrag.createDelegate(this);
    +105 		this.dd.onDrag = this.onDrag.createDelegate(this);
    +106 
    +107         /*
    +108         jsakalos suggestion
    +109         http://extjs.com/forum/showthread.php?p=121850#post121850 */
    +110         if('object' == typeof this.strategy && this.strategy.xtype) {
    +111             switch(this.strategy.xtype) {
    +112                 case 'number':
    +113                     this.strategy = new Ext.ux.form.Spinner.NumberStrategy(this.strategy);
    +114 	                break;
    +115 
    +116                 case 'date':
    +117                     this.strategy = new Ext.ux.form.Spinner.DateStrategy(this.strategy);
    +118 	                break;
    +119 
    +120                 case 'time':
    +121                     this.strategy = new Ext.ux.form.Spinner.TimeStrategy(this.strategy);
    +122                 	break;
    +123 
    +124                 default:
    +125                     delete(this.strategy);
    +126                 	break;
    +127             }
    +128             delete(this.strategy.xtype);
    +129         }
    +130 
    +131 		if(this.strategy == undefined){
    +132 			this.strategy = new Ext.ux.form.Spinner.NumberStrategy();
    +133 		}
    +134 	},
    +135 
    +136 	//private
    +137 	onMouseOver : function(){
    +138 		if(this.disabled){
    +139 			return;
    +140 		}
    +141 		var middle = this.getMiddle();
    +142 		this.__tmphcls = (Ext.EventObject.getPageY() < middle) ? 'x-form-spinner-overup' : 'x-form-spinner-overdown';
    +143 		this.trigger.addClass(this.__tmphcls);
    +144 	},
    +145 
    +146 	//private
    +147 	onMouseOut : function(){
    +148 		this.trigger.removeClass(this.__tmphcls);
    +149 	},
    +150 
    +151 	//private
    +152 	onMouseMove : function(){
    +153 		if(this.disabled){
    +154 			return;
    +155 		}
    +156 		var middle = this.getMiddle();
    +157 		if( ((Ext.EventObject.getPageY() > middle) && this.__tmphcls == "x-form-spinner-overup") ||
    +158 			((Ext.EventObject.getPageY() < middle) && this.__tmphcls == "x-form-spinner-overdown")){
    +159 		}
    +160 	},
    +161 
    +162 	//private
    +163 	onMouseDown : function(){
    +164 		if(this.disabled){
    +165 			return;
    +166 		}
    +167 		var middle = this.getMiddle();
    +168 		this.__tmpccls = (Ext.EventObject.getPageY() < middle) ? 'x-form-spinner-clickup' : 'x-form-spinner-clickdown';
    +169 		this.trigger.addClass(this.__tmpccls);
    +170 	},
    +171 
    +172 	//private
    +173 	onMouseUp : function(){
    +174 		this.trigger.removeClass(this.__tmpccls);
    +175 	},
    +176 
    +177 	//private
    +178 	onTriggerClick : function(){
    +179 		if(this.disabled || this.getEl().dom.readOnly){
    +180 			return;
    +181 		}
    +182 		var middle = this.getMiddle();
    +183 		var ud = (Ext.EventObject.getPageY() < middle) ? 'Up' : 'Down';
    +184 		this['onSpin'+ud]();
    +185 	},
    +186 
    +187 	//private
    +188 	getMiddle : function(){
    +189 		var t = this.trigger.getTop();
    +190 		var h = this.trigger.getHeight();
    +191 		var middle = t + (h/2);
    +192 		return middle;
    +193 	},
    +194 	
    +195 	//private
    +196 	//checks if control is allowed to spin
    +197 	isSpinnable : function(){
    +198 		if(this.disabled || this.getEl().dom.readOnly){
    +199 			Ext.EventObject.preventDefault();	//prevent scrolling when disabled/readonly
    +200 			return false;
    +201 		}
    +202 		return true;
    +203 	},
    +204 
    +205 	handleMouseWheel : function(e){
    +206 		//disable scrolling when not focused
    +207 		if(this.wrap.hasClass('x-trigger-wrap-focus') == false){
    +208 			return;
    +209 		}
    +210 
    +211 		var delta = e.getWheelDelta();
    +212 		if(delta > 0){
    +213 			this.onSpinUp();
    +214 			e.stopEvent();
    +215 		} else if(delta < 0){
    +216 			this.onSpinDown();
    +217 			e.stopEvent();
    +218 		}
    +219 	},
    +220 
    +221 	//private
    +222 	startDrag : function(){
    +223 		this.proxy.show();
    +224 		this._previousY = Ext.fly(this.dd.getDragEl()).getTop();
    +225 	},
    +226 
    +227 	//private
    +228 	endDrag : function(){
    +229 		this.proxy.hide();
    +230 	},
    +231 
    +232 	//private
    +233 	onDrag : function(){
    +234 		if(this.disabled){
    +235 			return;
    +236 		}
    +237 		var y = Ext.fly(this.dd.getDragEl()).getTop();
    +238 		var ud = '';
    +239 
    +240 		if(this._previousY > y){ud = 'Up';}         //up
    +241 		if(this._previousY < y){ud = 'Down';}       //down
    +242 
    +243 		if(ud != ''){
    +244 			this['onSpin'+ud]();
    +245 		}
    +246 
    +247 		this._previousY = y;
    +248 	},
    +249 
    +250 	//private
    +251 	onSpinUp : function(){
    +252 		if(this.isSpinnable() == false) {
    +253 			return;
    +254 		}
    +255 		if(Ext.EventObject.shiftKey == true){
    +256 			this.onSpinUpAlternate();
    +257 			return;
    +258 		}else{
    +259 			this.strategy.onSpinUp(this);
    +260 		}
    +261 		this.fireEvent("spin", this);
    +262 		this.fireEvent("spinup", this);
    +263 	},
    +264 
    +265 	//private
    +266 	onSpinDown : function(){
    +267 		if(this.isSpinnable() == false) {
    +268 			return;
    +269 		}
    +270 		if(Ext.EventObject.shiftKey == true){
    +271 			this.onSpinDownAlternate();
    +272 			return;
    +273 		}else{
    +274 			this.strategy.onSpinDown(this);
    +275 		}
    +276 		this.fireEvent("spin", this);
    +277 		this.fireEvent("spindown", this);
    +278 	},
    +279 
    +280 	//private
    +281 	onSpinUpAlternate : function(){
    +282 		if(this.isSpinnable() == false) {
    +283 			return;
    +284 		}
    +285 		this.strategy.onSpinUpAlternate(this);
    +286 		this.fireEvent("spin", this);
    +287 		this.fireEvent("spinup", this);
    +288 	},
    +289 
    +290 	//private
    +291 	onSpinDownAlternate : function(){
    +292 		if(this.isSpinnable() == false) {
    +293 			return;
    +294 		}
    +295 		this.strategy.onSpinDownAlternate(this);
    +296 		this.fireEvent("spin", this);
    +297 		this.fireEvent("spindown", this);
    +298 	}
    +299 
    +300 });
    +301 
    +302 Ext.reg('uxspinner', Ext.ux.form.Spinner);
    +303 
    +304 /**
    +305  * Copyright (c) 2008, Steven Chim
    +306  * All rights reserved.
    +307  * 
    +308  * Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:
    +309  * 
    +310  *     * Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.
    +311  *     * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution.
    +312  *     * The names of its contributors may not be used to endorse or promote products derived from this software without specific prior written permission.
    +313  * 
    +314  * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
    +315  */
    +316 
    +317 /***
    +318  * Abstract Strategy
    +319  */
    +320 Ext.ux.form.Spinner.Strategy = function(config){
    +321 	Ext.apply(this, config);
    +322 };
    +323 
    +324 Ext.extend(Ext.ux.form.Spinner.Strategy, Ext.util.Observable, {
    +325 	defaultValue : 0,
    +326 	minValue : undefined,
    +327 	maxValue : undefined,
    +328 	incrementValue : 1,
    +329 	alternateIncrementValue : 5,
    +330 	validationTask : new Ext.util.DelayedTask(),
    +331 	
    +332 	onSpinUp : function(field){
    +333 		this.spin(field, false, false);
    +334 	},
    +335 
    +336 	onSpinDown : function(field){
    +337 		this.spin(field, true, false);
    +338 	},
    +339 
    +340 	onSpinUpAlternate : function(field){
    +341 		this.spin(field, false, true);
    +342 	},
    +343 
    +344 	onSpinDownAlternate : function(field){
    +345 		this.spin(field, true, true);
    +346 	},
    +347 
    +348 	spin : function(field, down, alternate){
    +349 		this.validationTask.delay(500, function(){field.validate()});
    +350 		//extend
    +351 	},
    +352 
    +353 	fixBoundries : function(value){
    +354 		return value;
    +355 		//overwrite
    +356 	}
    +357 	
    +358 });
    +359 
    +360 /***
    +361  * Concrete Strategy: Numbers
    +362  */
    +363 Ext.ux.form.Spinner.NumberStrategy = function(config){
    +364 	Ext.ux.form.Spinner.NumberStrategy.superclass.constructor.call(this, config);
    +365 };
    +366 
    +367 Ext.extend(Ext.ux.form.Spinner.NumberStrategy, Ext.ux.form.Spinner.Strategy, {
    +368 
    +369     allowDecimals : true,
    +370     decimalPrecision : 2,
    +371     
    +372 	spin : function(field, down, alternate){
    +373 		Ext.ux.form.Spinner.NumberStrategy.superclass.spin.call(this, field, down, alternate);
    +374 
    +375 		var v = parseFloat(field.getValue());
    +376 		var incr = (alternate == true) ? this.alternateIncrementValue : this.incrementValue;
    +377 
    +378 		(down == true) ? v -= incr : v += incr ;
    +379 		v = (isNaN(v)) ? this.defaultValue : v;
    +380 		v = this.fixBoundries(v);
    +381 		field.setRawValue(v);
    +382 	},
    +383 
    +384 	fixBoundries : function(value){
    +385 		var v = value;
    +386 
    +387 		if(this.minValue != undefined && v < this.minValue){
    +388 			v = this.minValue;
    +389 		}
    +390 		if(this.maxValue != undefined && v > this.maxValue){
    +391 			v = this.maxValue;
    +392 		}
    +393 
    +394 		return this.fixPrecision(v);
    +395 	},
    +396 	
    +397     // private
    +398     fixPrecision : function(value){
    +399         var nan = isNaN(value);
    +400         if(!this.allowDecimals || this.decimalPrecision == -1 || nan || !value){
    +401             return nan ? '' : value;
    +402         }
    +403         return parseFloat(parseFloat(value).toFixed(this.decimalPrecision));
    +404     }
    +405 });
    +406 
    +407 
    +408 /***
    +409  * Concrete Strategy: Date
    +410  */
    +411 Ext.ux.form.Spinner.DateStrategy = function(config){
    +412 	Ext.ux.form.Spinner.DateStrategy.superclass.constructor.call(this, config);
    +413 };
    +414 
    +415 Ext.extend(Ext.ux.form.Spinner.DateStrategy, Ext.ux.form.Spinner.Strategy, {
    +416 	defaultValue : new Date(),
    +417 	format : "Y-m-d",
    +418 	incrementValue : 1,
    +419 	incrementConstant : Date.DAY,
    +420 	alternateIncrementValue : 1,
    +421 	alternateIncrementConstant : Date.MONTH,
    +422 
    +423 	spin : function(field, down, alternate){
    +424 		Ext.ux.form.Spinner.DateStrategy.superclass.spin.call(this);
    +425 
    +426 		var v = field.getRawValue();
    +427 		
    +428 		v = Date.parseDate(v, this.format);
    +429 		var dir = (down == true) ? -1 : 1 ;
    +430 		var incr = (alternate == true) ? this.alternateIncrementValue : this.incrementValue;
    +431 		var dtconst = (alternate == true) ? this.alternateIncrementConstant : this.incrementConstant;
    +432 
    +433 		if(typeof this.defaultValue == 'string'){
    +434 			this.defaultValue = Date.parseDate(this.defaultValue, this.format);
    +435 		}
    +436 
    +437 		v = (v) ? v.add(dtconst, dir*incr) : this.defaultValue;
    +438 
    +439 		v = this.fixBoundries(v);
    +440 		field.setRawValue(Ext.util.Format.date(v,this.format));
    +441 	},
    +442 	
    +443 	//private
    +444 	fixBoundries : function(date){
    +445 		var dt = date;
    +446 		var min = (typeof this.minValue == 'string') ? Date.parseDate(this.minValue, this.format) : this.minValue ;
    +447 		var max = (typeof this.maxValue == 'string') ? Date.parseDate(this.maxValue, this.format) : this.maxValue ;
    +448 
    +449 		if(this.minValue != undefined && dt < min){
    +450 			dt = min;
    +451 		}
    +452 		if(this.maxValue != undefined && dt > max){
    +453 			dt = max;
    +454 		}
    +455 
    +456 		return dt;
    +457 	}
    +458 
    +459 });
    +460 
    +461 /***
    +462  * Concrete Strategy: Time
    +463  */
    +464 Ext.ux.form.Spinner.TimeStrategy = function(config){
    +465 	Ext.ux.form.Spinner.TimeStrategy.superclass.constructor.call(this, config);
    +466 };
    +467 
    +468 Ext.extend(Ext.ux.form.Spinner.TimeStrategy, Ext.ux.form.Spinner.DateStrategy, {
    +469 	format : "H:i",
    +470 	incrementValue : 1,
    +471 	incrementConstant : Date.MINUTE,
    +472 	alternateIncrementValue : 1,
    +473 	alternateIncrementConstant : Date.HOUR
    +474 });
    +475 
    +476 Ext.tree.ColumnTree = Ext.extend(Ext.tree.TreePanel, {
    +477     lines:false,
    +478     borderWidth: Ext.isBorderBox ? 0 : 2, // the combined left/right border for each cell
    +479     cls:'x-column-tree',
    +480     
    +481     onRender : function(){
    +482         Ext.tree.ColumnTree.superclass.onRender.apply(this, arguments);
    +483         this.headers = this.body.createChild(
    +484             {cls:'x-tree-headers'},this.innerCt.dom);
    +485 
    +486         var cols = this.columns, c;
    +487         var totalWidth = 0;
    +488 
    +489         for(var i = 0, len = cols.length; i < len; i++){
    +490              c = cols[i];
    +491              totalWidth += c.width;
    +492              this.headers.createChild({
    +493                  cls:'x-tree-hd ' + (c.cls?c.cls+'-hd':''),
    +494                  cn: {
    +495                      cls:'x-tree-hd-text',
    +496                      html: c.header
    +497                  },
    +498                  style:'width:'+(c.width-this.borderWidth)+'px;'
    +499              });
    +500         }
    +501         this.headers.createChild({cls:'x-clear'});
    +502         // prevent floats from wrapping when clipped
    +503         this.headers.setWidth(totalWidth);
    +504         this.innerCt.setWidth(totalWidth);
    +505     }
    +506 });
    +507 
    +508 Ext.tree.ColumnTreeNode = Ext.extend(Ext.tree.TreeNode, {
    +509 	
    +510 	setColumnValue: function(index, value) {
    +511 		var t = this.getOwnerTree();
    +512 		var oldValue = this[t.columns[index].dataIndex];
    +513 		this[t.columns[index].dataIndex] = value;
    +514 		this.attributes[[t.columns[index].dataIndex]] = value;
    +515 		if (this.rendered) {
    +516 			this.ui.onColumnValueChange(this, index, value, oldValue);
    +517 		}
    +518 		this.fireEvent('columnvaluechange', this, index, value, oldValue);
    +519 	}
    +520 });
    +521 
    +522 Ext.tree.ColumnNodeUI = Ext.extend(Ext.tree.TreeNodeUI, {
    +523     focus: Ext.emptyFn, // prevent odd scrolling behavior
    +524 	
    +525 	onColumnValueChange: function(n, colIndex, value, oldValue) {
    +526 		if (this.rendered) {
    +527 			var c = n.getOwnerTree().columns[colIndex];
    +528 			this.columnNodes[colIndex].innerHTML = (c.renderer ? c.renderer(value, n, null) : value);
    +529 		}
    +530 	},
    +531 
    +532     renderElements : function(n, a, targetNode, bulkRender){
    +533         this.indentMarkup = n.parentNode ? n.parentNode.ui.getChildIndent() : '';
    +534 
    +535         var t = n.getOwnerTree();
    +536         var cols = t.columns;
    +537         var bw = t.borderWidth;
    +538         var c = cols[0];
    +539         
    +540         var cb = typeof a.checked == 'boolean';
    +541 		var href = a.href ? a.href : Ext.isGecko ? "" : "#";
    +542 
    +543         var buf = [
    +544              '<li class="x-tree-node"><div ext:tree-node-id="',n.id,'" class="x-tree-node-el x-tree-node-leaf x-unselectable ', a.cls,'" unselectable="on">',
    +545                 '<div class="x-tree-col" style="width:',c.width-bw,'px;">',
    +546                     '<span class="x-tree-node-indent">',this.indentMarkup,"</span>",
    +547                     '<img src="', this.emptyIcon, '" class="x-tree-ec-icon x-tree-elbow">',
    +548                     '<img src="', a.icon || this.emptyIcon, '" class="x-tree-node-icon',(a.icon ? " x-tree-node-inline-icon" : ""),(a.iconCls ? " "+a.iconCls : ""),'" unselectable="on" />',
    +549                     cb ? ('<input class="x-tree-node-cb" type="checkbox" ' + (a.checked ? 'checked="checked" />' : '/>')) : '',
    +550                     '<a hidefocus="on" class="x-tree-node-anchor" href="',href,'" tabIndex="1" ',
    +551                     a.hrefTarget ? ' target="'+a.hrefTarget+'"' : "", '>',
    +552                     '<span unselectable="on">', n.text || (c.renderer ? c.renderer(a[c.dataIndex], n, a) : a[c.dataIndex]),"</span></a>",
    +553                 "</div>"];
    +554          for(var i = 1, len = cols.length; i < len; i++){
    +555              c = cols[i];
    +556 
    +557              buf.push('<div class="x-tree-col ',(c.cls?c.cls:''),'" style="width:',c.width-bw,'px;">',
    +558                         '<div class="x-tree-col-text">',(c.renderer ? c.renderer(a[c.dataIndex], n, a) : a[c.dataIndex]),"</div>",
    +559                       "</div>");
    +560          }
    +561          buf.push(
    +562             '<div class="x-clear"></div></div>',
    +563             '<ul class="x-tree-node-ct" style="display:none;"></ul>',
    +564             "</li>");
    +565 
    +566         if(bulkRender !== true && n.nextSibling && n.nextSibling.ui.getEl()){
    +567             this.wrap = Ext.DomHelper.insertHtml("beforeBegin",
    +568                                 n.nextSibling.ui.getEl(), buf.join(""));
    +569         }else{
    +570             this.wrap = Ext.DomHelper.insertHtml("beforeEnd", targetNode, buf.join(""));
    +571         }
    +572 
    +573         this.elNode = this.wrap.childNodes[0];
    +574         this.ctNode = this.wrap.childNodes[1];
    +575         var cs = this.elNode.firstChild.childNodes;
    +576         this.indentNode = cs[0];
    +577         this.ecNode = cs[1];
    +578         this.iconNode = cs[2];
    +579 		var index = 3;
    +580         if(cb){
    +581             this.checkbox = cs[3];
    +582 			// fix for IE6
    +583 			this.checkbox.defaultChecked = this.checkbox.checked;			
    +584             index++;
    +585         }
    +586         this.anchor = cs[index];
    +587 		this.columnNodes = [cs[index].firstChild];
    +588 		for(var i = 1, len = cols.length; i < len; i++){
    +589 			this.columnNodes[i] = this.elNode.childNodes[i].firstChild;
    +590 		}
    +591     }
    +592 });
    +593 
    +594 Ext.form.FileUploadField = Ext.extend(Ext.form.TextField,  {
    +595     /**
    +596      * @cfg {String} buttonText The button text to display on the upload button (defaults to
    +597      * 'Browse...').  Note that if you supply a value for {@link #buttonCfg}, the buttonCfg.text
    +598      * value will be used instead if available.
    +599      */
    +600     buttonText: 'Browse...',
    +601     /**
    +602      * @cfg {Boolean} buttonOnly True to display the file upload field as a button with no visible
    +603      * text field (defaults to false).  If true, all inherited TextField members will still be available.
    +604      */
    +605     buttonOnly: false,
    +606     /**
    +607      * @cfg {Number} buttonOffset The number of pixels of space reserved between the button and the text field
    +608      * (defaults to 3).  Note that this only applies if {@link #buttonOnly} = false.
    +609      */
    +610     buttonOffset: 3,
    +611     /**
    +612      * @cfg {Object} buttonCfg A standard {@link Ext.Button} config object.
    +613      */
    +614 
    +615     // private
    +616     readOnly: true,
    +617     
    +618     /**
    +619      * @hide 
    +620      * @method autoSize
    +621      */
    +622     autoSize: Ext.emptyFn,
    +623     
    +624     // private
    +625     initComponent: function(){
    +626         Ext.form.FileUploadField.superclass.initComponent.call(this);
    +627         
    +628         this.addEvents(
    +629             /**
    +630              * @event fileselected
    +631              * Fires when the underlying file input field's value has changed from the user
    +632              * selecting a new file from the system file selection dialog.
    +633              * @param {Ext.form.FileUploadField} this
    +634              * @param {String} value The file value returned by the underlying file input field
    +635              */
    +636             'fileselected'
    +637         );
    +638     },
    +639     
    +640     // private
    +641     onRender : function(ct, position){
    +642         Ext.form.FileUploadField.superclass.onRender.call(this, ct, position);
    +643         
    +644         this.wrap = this.el.wrap({cls:'x-form-field-wrap x-form-file-wrap'});
    +645         this.el.addClass('x-form-file-text');
    +646         this.el.dom.removeAttribute('name');
    +647         
    +648         this.fileInput = this.wrap.createChild({
    +649             id: this.getFileInputId(),
    +650             name: this.name||this.getId(),
    +651             cls: 'x-form-file',
    +652             tag: 'input', 
    +653             type: 'file',
    +654             size: 1
    +655         });
    +656         
    +657         var btnCfg = Ext.applyIf(this.buttonCfg || {}, {
    +658             text: this.buttonText
    +659         });
    +660         this.button = new Ext.Button(Ext.apply(btnCfg, {
    +661             renderTo: this.wrap
    +662         }));
    +663         
    +664         if(this.buttonOnly){
    +665             this.el.hide();
    +666             this.wrap.setWidth(this.button.getEl().getWidth());
    +667         }
    +668         
    +669         this.fileInput.on('change', function(){
    +670             var v = this.fileInput.dom.value;
    +671             this.setValue(v);
    +672             this.fireEvent('fileselected', this, v);
    +673         }, this);
    +674     },
    +675     
    +676     // private
    +677     getFileInputId: function(){
    +678         return this.id+'-file';
    +679     },
    +680     
    +681     // private
    +682     onResize : function(w, h){
    +683         Ext.form.FileUploadField.superclass.onResize.call(this, w, h);
    +684         
    +685         this.wrap.setWidth(w);
    +686         
    +687         if(!this.buttonOnly){
    +688             var w = this.wrap.getWidth() - this.button.getEl().getWidth() - this.buttonOffset;
    +689             this.el.setWidth(w);
    +690         }
    +691     },
    +692     
    +693     // private
    +694     preFocus : Ext.emptyFn,
    +695     
    +696     // private
    +697     getResizeEl : function(){
    +698         return this.wrap;
    +699     },
    +700 
    +701     // private
    +702     getPositionEl : function(){
    +703         return this.wrap;
    +704     },
    +705 
    +706     // private
    +707     alignErrorIcon : function(){
    +708         this.errorIcon.alignTo(this.wrap, 'tl-tr', [2, 0]);
    +709     }
    +710     
    +711 });
    +712 Ext.reg('fileuploadfield', Ext.form.FileUploadField);
    +713 
    +714 /**
    +715   * Ext.ux.FullProgressBar Class
    +716   *
    +717   * @author Damien Churchill <damoxc@gmail.com>
    +718   * @version 1.2
    +719   *
    +720   * @class Ext.deluge.ProgressBar
    +721   * @extends Ext.ProgressBar
    +722   * @constructor
    +723   * @param {Object} config Configuration options
    +724   */
    +725 Ext.ux.FullProgressBar = Ext.extend(Ext.ProgressBar, {
    +726 	initComponent: function() {
    +727 		Ext.ux.FullProgressBar.superclass.initComponent.call(this);
    +728 	},
    +729 	
    +730 	updateProgress: function(value, text, animate) {
    +731 		this.value = value || 0;
    +732 		if (text) {
    +733 			this.updateText(text);
    +734 		}
    +735 		
    +736 		if (this.rendered) {
    +737 			var w = Math.floor(value*this.el.dom.firstChild.offsetWidth / 100.0);
    +738 	        this.progressBar.setWidth(w, animate === true || (animate !== false && this.animate));
    +739 	        if (this.textTopEl) {
    +740 	            //textTopEl should be the same width as the bar so overflow will clip as the bar moves
    +741 	            this.textTopEl.removeClass('x-hidden').setWidth(w);
    +742 	        }
    +743 		}
    +744 		this.fireEvent('update', this, value, text);
    +745 		return this;
    +746 	}
    +747 });
    +748 Ext.reg('fullprogressbar', Ext.ux.FullProgressBar);
    \ No newline at end of file diff --git a/deluge/ui/web/js/build.sh b/deluge/ui/web/js/build.sh index 2a892f1eb..c9b0fd84d 100755 --- a/deluge/ui/web/js/build.sh +++ b/deluge/ui/web/js/build.sh @@ -37,6 +37,11 @@ build_deluge() { yuicompressor --type=js -o "deluge-yc.js" "deluge-yc.js.tmp" && rm "deluge-yc.js.tmp" } +build_docs() { + echo "building docs"; + jsdoc-toolkit -d="../docs/" $ALL_FILES +} + build_ext() { check_file "ext-extensions-debug.js" if [ $? == 1 ]; then @@ -45,8 +50,11 @@ build_ext() { fi; } -scan -build_ext -build_deluge - -mv .build_data.tmp .build_data +if [ "$1" = "doc" ]; then + build_docs +else + scan + build_ext + build_deluge + mv .build_data.tmp .build_data +fi; \ No newline at end of file