Module: deluge
Branch: master
Commit: 0d091cdaccd03b3bb08db2e421e3481630056fd8

Author: Damien Churchill <[email protected]>
Date:   Thu Apr  1 09:52:54 2010 +0100

replace ∞ with its html code &infin;

---

 deluge/ui/web/js/deluge-all/Formatters.js        |    2 +-
 deluge/ui/web/js/deluge-all/Torrents.js          |    2 +-
 deluge/ui/web/js/deluge-all/add/AddWindow.js     |   62 ++++++++++------------
 deluge/ui/web/js/deluge-all/details/StatusTab.js |    2 +-
 4 files changed, 31 insertions(+), 37 deletions(-)

diff --git a/deluge/ui/web/js/deluge-all/Formatters.js 
b/deluge/ui/web/js/deluge-all/Formatters.js
index 1dbec58..04a67a4 100644
--- a/deluge/ui/web/js/deluge-all/Formatters.js
+++ b/deluge/ui/web/js/deluge-all/Formatters.js
@@ -97,7 +97,7 @@ Deluge.Formatters = {
         * @return {String} a formatted time string. will return '' if seconds 
== 0
         */
        timeRemaining: function(time) {
-               if (time == 0) { return '∞' }
+               if (time == 0) { return '&infin;' }
         time = time.toFixed(0);
                if (time < 60) { return time + 's'; }
                else { time = time / 60; }
diff --git a/deluge/ui/web/js/deluge-all/Torrents.js 
b/deluge/ui/web/js/deluge-all/Torrents.js
index af4a64d..70e57d6 100644
--- a/deluge/ui/web/js/deluge-all/Torrents.js
+++ b/deluge/ui/web/js/deluge-all/Torrents.js
@@ -65,7 +65,7 @@
                }
        }
        function availRenderer(value, p, r)     {
-               return (value < 0) ? '∞' : new Number(value).toFixed(3);
+               return (value < 0) ? '&infin;' : new Number(value).toFixed(3);
        }
        function trackerRenderer(value, p, r) {
                return String.format('<div style="background: url(' + 
deluge.config.base + 'tracker/{0}) no-repeat; padding-left: 20px;">{0}</div>', 
value);
diff --git a/deluge/ui/web/js/deluge-all/add/AddWindow.js 
b/deluge/ui/web/js/deluge-all/add/AddWindow.js
index 334953f..36940d8 100644
--- a/deluge/ui/web/js/deluge-all/add/AddWindow.js
+++ b/deluge/ui/web/js/deluge-all/add/AddWindow.js
@@ -34,21 +34,16 @@ Ext.namespace('Deluge.add');
 
 Deluge.add.AddWindow = Ext.extend(Deluge.add.Window, {
 
-       constructor: function(config) {
-               config = Ext.apply({
-                       title: _('Add Torrents'),
-                       layout: 'border',
-                       width: 470,
-                       height: 450,
-                       bodyStyle: 'padding: 10px 5px;',
-                       buttonAlign: 'right',
-                       closeAction: 'hide',
-                       closable: true,
-                       plain: true,
-                       iconCls: 'x-deluge-add-window-icon'
-               }, config);
-               Deluge.add.AddWindow.superclass.constructor.call(this, config);
-       },
+       title: _('Add Torrents'),
+       layout: 'border',
+       width: 470,
+       height: 450,
+       bodyStyle: 'padding: 10px 5px;',
+       buttonAlign: 'right',
+       closeAction: 'hide',
+       closable: true,
+       plain: true,
+       iconCls: 'x-deluge-add-window-icon',
 
        initComponent: function() {
                Deluge.add.AddWindow.superclass.initComponent.call(this);
@@ -63,9 +58,9 @@ Deluge.add.AddWindow = Ext.extend(Deluge.add.Window, {
                                return String.format('<div 
class="x-deluge-add-torrent-name-loading">{0}</div>', value);
                        }
                }
-       
-               this.grid = this.add({
-                       xtype: 'grid',
+
+               this.list = this.add({
+                       xtype: 'listview',
                        region: 'center',
                        store: new Ext.data.SimpleStore({
                                fields: [
@@ -82,15 +77,13 @@ Deluge.add.AddWindow = Ext.extend(Deluge.add.Window, {
                                dataIndex: 'text'
                        }],     
                        stripeRows: true,
-                       selModel: new Ext.grid.RowSelectionModel({
-                               singleSelect: true,
-                               listeners: {
-                                       'rowselect': {
-                                               fn: this.onSelect,
-                                               scope: this
-                                       }
+                       singleSelect: true,
+                       listeners: {
+                               'selectionchanged': {
+                                       fn: this.onSelect,
+                                       scope: this
                                }
-                       }),
+                       },
                        hideHeaders: true,
                        autoExpandColumn: 'torrent',
                        deferredRender: false,
@@ -126,14 +119,14 @@ Deluge.add.AddWindow = Ext.extend(Deluge.add.Window, {
        },
 
        clear: function() {
-               this.grid.getStore().removeAll();
+               this.list.getStore().removeAll();
                this.optionsPanel.clear();
        },
 
        onAddClick: function() {
                var torrents = [];
                if (!this.grid) return;
-               this.grid.getStore().each(function(r) {
+               this.list.getStore().each(function(r) {
                        var id = r.get('info_hash');
                        torrents.push({
                                path: this.optionsPanel.getFilename(id),
@@ -169,13 +162,14 @@ Deluge.add.AddWindow = Ext.extend(Deluge.add.Window, {
                var selection = this.grid.getSelectionModel();
                if (!selection.hasSelection()) return;
                var torrent = selection.getSelected();
-               this.grid.getStore().remove(torrent);
+               this.list.getStore().remove(torrent);
                this.optionsPanel.clear();
                
                if (this.torrents && this.torrents[torrent.id]) delete 
this.torrents[torrent.id];
        },
 
-       onSelect: function(selModel, rowIndex, record) {
+       onSelect: function(list, selections) {
+               
                this.optionsPanel.setTorrent(record.get('info_hash'));
                this.optionsPanel.files.setDisabled(false);
                this.optionsPanel.form.setDisabled(false);
@@ -198,12 +192,12 @@ Deluge.add.AddWindow = Ext.extend(Deluge.add.Window, {
        },
 
        onTorrentBeforeAdd: function(torrentId, text) {
-               var store = this.grid.getStore();
+               var store = this.list.getStore();
                store.loadData([[torrentId, null, text]], true);
        },
 
        onTorrentAdd: function(torrentId, info) {
-               var r = this.grid.getStore().getById(torrentId);
+               var r = this.list.getStore().getById(torrentId);
                if (!info) {
                        Ext.MessageBox.show({
                                title: _('Error'),
@@ -213,11 +207,11 @@ Deluge.add.AddWindow = Ext.extend(Deluge.add.Window, {
                                icon: Ext.MessageBox.ERROR,
                                iconCls: 'x-deluge-icon-error'
                        });
-                       this.grid.getStore().remove(r);
+                       this.list.getStore().remove(r);
                } else {
                        r.set('info_hash', info['info_hash']);
                        r.set('text', info['name']);
-                       this.grid.getStore().commitChanges();
+                       this.list.getStore().commitChanges();
                        this.optionsPanel.addTorrent(info);
                }
        },
diff --git a/deluge/ui/web/js/deluge-all/details/StatusTab.js 
b/deluge/ui/web/js/deluge-all/details/StatusTab.js
index 03f2091..ba99a2a 100644
--- a/deluge/ui/web/js/deluge-all/details/StatusTab.js
+++ b/deluge/ui/web/js/deluge-all/details/StatusTab.js
@@ -96,7 +96,7 @@ Deluge.details.StatusTab = Ext.extend(Ext.Panel, {
                var data = {
                        downloaded: fsize(status.total_done, true),
                        uploaded: fsize(status.total_uploaded, true),
-                       share: (status.ratio == -1) ? '∞' : 
status.ratio.toFixed(3),
+                       share: (status.ratio == -1) ? '&infin;' : 
status.ratio.toFixed(3),
                        announce: ftime(status.next_announce),
                        tracker_status: status.tracker_status,
                        downspeed: (status.download_payload_rate) ? 
fspeed(status.download_payload_rate) : '0.0 KiB/s',

-- 
You received this message because you are subscribed to the Google Groups 
"deluge-commit" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to 
[email protected].
For more options, visit this group at 
http://groups.google.com/group/deluge-commit?hl=en.

Reply via email to