mirror of
https://git.deluge-torrent.org/deluge
synced 2025-04-21 03:54:50 +00:00
move extended ext classes into their own file
This commit is contained in:
parent
c05def0cf9
commit
5cf1fa9d00
3 changed files with 54 additions and 31 deletions
|
@ -15,6 +15,7 @@
|
|||
<script type="text/javascript" src="/js/rpc.js"></script>
|
||||
<script type="text/javascript" src="/gettext.js"></script>
|
||||
<script type="text/javascript" src="/js/deluge.js"></script>
|
||||
<script type="text/javascript" src="/js/deluge-ext.js"></script>
|
||||
<script type="text/javascript" src="/js/deluge-login.js"></script>
|
||||
<script type="text/javascript" src="/js/deluge-menus.js"></script>
|
||||
<script type="text/javascript" src="/js/deluge-bars.js"></script>
|
||||
|
|
|
@ -22,37 +22,6 @@ Copyright:
|
|||
Boston, MA 02110-1301, USA.
|
||||
*/
|
||||
|
||||
Deluge.FilesTreeLoader = Ext.extend(Ext.tree.TreeLoader, {
|
||||
initComponent: function() {
|
||||
Deluge.FilesTreeLoader.superclass.initComponent.call(this);
|
||||
},
|
||||
});
|
||||
|
||||
Deluge.ProgressBar = Ext.extend(Ext.ProgressBar, {
|
||||
initComponent: function() {
|
||||
Deluge.ProgressBar.superclass.initComponent.call(this);
|
||||
},
|
||||
|
||||
updateProgress: function(value, text, animate) {
|
||||
this.value = value || 0;
|
||||
if (text) {
|
||||
this.updateText(text);
|
||||
}
|
||||
|
||||
if (this.rendered) {
|
||||
var w = Math.floor(value*this.el.dom.firstChild.offsetWidth / 100.0);
|
||||
this.progressBar.setWidth(w, animate === true || (animate !== false && this.animate));
|
||||
if (this.textTopEl) {
|
||||
//textTopEl should be the same width as the bar so overflow will clip as the bar moves
|
||||
this.textTopEl.removeClass('x-hidden').setWidth(w);
|
||||
}
|
||||
}
|
||||
this.fireEvent('update', this, value, text);
|
||||
return this;
|
||||
}
|
||||
});
|
||||
Ext.reg('deluge-progress', Deluge.ProgressBar);
|
||||
|
||||
Deluge.Details = {
|
||||
clear: function() {
|
||||
this.Panel.items.each(function(item) {
|
||||
|
|
53
deluge/ui/web/js/deluge-ext.js
Normal file
53
deluge/ui/web/js/deluge-ext.js
Normal file
|
@ -0,0 +1,53 @@
|
|||
/*
|
||||
Script: deluge-ext.js
|
||||
Container for all classes that extend Exts native classes.
|
||||
|
||||
Copyright:
|
||||
(C) Damien Churchill 2009 <damoxc@gmail.com>
|
||||
This program is free software; you can redistribute it and/or modify
|
||||
it under the terms of the GNU General Public License as published by
|
||||
the Free Software Foundation; either version 3, or (at your option)
|
||||
any later version.
|
||||
|
||||
This program is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
GNU General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU General Public License
|
||||
along with this program. If not, write to:
|
||||
The Free Software Foundation, Inc.,
|
||||
51 Franklin Street, Fifth Floor
|
||||
Boston, MA 02110-1301, USA.
|
||||
*/
|
||||
|
||||
Deluge.FilesTreeLoader = Ext.extend(Ext.tree.TreeLoader, {
|
||||
initComponent: function() {
|
||||
Deluge.FilesTreeLoader.superclass.initComponent.call(this);
|
||||
},
|
||||
});
|
||||
|
||||
Deluge.ProgressBar = Ext.extend(Ext.ProgressBar, {
|
||||
initComponent: function() {
|
||||
Deluge.ProgressBar.superclass.initComponent.call(this);
|
||||
},
|
||||
|
||||
updateProgress: function(value, text, animate) {
|
||||
this.value = value || 0;
|
||||
if (text) {
|
||||
this.updateText(text);
|
||||
}
|
||||
|
||||
if (this.rendered) {
|
||||
var w = Math.floor(value*this.el.dom.firstChild.offsetWidth / 100.0);
|
||||
this.progressBar.setWidth(w, animate === true || (animate !== false && this.animate));
|
||||
if (this.textTopEl) {
|
||||
//textTopEl should be the same width as the bar so overflow will clip as the bar moves
|
||||
this.textTopEl.removeClass('x-hidden').setWidth(w);
|
||||
}
|
||||
}
|
||||
this.fireEvent('update', this, value, text);
|
||||
return this;
|
||||
}
|
||||
});
|
||||
Ext.reg('deluge-progress', Deluge.ProgressBar);
|
Loading…
Add table
Reference in a new issue