Browse Source

- WebUI is now working for IE7

adaptive-webui-19844
Christophe Dumez 16 years ago
parent
commit
e497789ec7
  1. 1
      Changelog
  2. 8
      src/webui/scripts/client.js
  3. 41
      src/webui/scripts/dynamicTable.js

1
Changelog

@ -12,6 +12,7 @@ @@ -12,6 +12,7 @@
- FEATURE: Got rid of libmagick++ dependency
- FEATURE: Updated Web interface to MochaUI v0.9.5
- BUGFIX: Fixed several memory leaks
- BUGFIX: WebUI is now working with IE7
* Unknown - Christophe Dumez <chris@qbittorrent.org> - v1.2.1
- BUGFIX: Fixed possible crash when deleting a torrent permanently

8
src/webui/scripts/client.js

@ -22,6 +22,9 @@ @@ -22,6 +22,9 @@
* THE SOFTWARE.
*/
myTable = new dynamicTable();
myTableUP = new dynamicTable();
window.addEvent('domready', function(){
MochaUI.Desktop = new MochaUI.Desktop();
MochaUI.Desktop.desktop.setStyles({
@ -34,9 +37,8 @@ window.addEvent('domready', function(){ @@ -34,9 +37,8 @@ window.addEvent('domready', function(){
width: '100%',
height: '100%'
});
// Download list
myTable = new dynamicTable('myTable', {overCls: 'over', selectCls: 'selected', altCls: 'alt'});
myTableUP = new dynamicTable('myTableUP', {overCls: 'over', selectCls: 'selected', altCls: 'alt'});
myTable.setup('myTable');
myTableUP.setup('myTableUP');
var r=0;
var waiting=false;
var stateToImg = function(state){

41
src/webui/scripts/dynamicTable.js

@ -32,13 +32,11 @@ @@ -32,13 +32,11 @@
**************************************************************/
var dynamicTable = new Class ({
initialize: function(){
},
initialize: function(table, options){
this.setOptions({
overCls: false,
selectCls: false,
altCls: false
}, options);
setup: function(table){
this.table = $(table);
this.rows = new Object();
this.cur = new Array();
@ -47,16 +45,13 @@ var dynamicTable = new Class ({ @@ -47,16 +45,13 @@ var dynamicTable = new Class ({
altRow: function()
{
var trs = this.table.getElements('tr');
if(this.options.altCls)
{
trs.each(function(el,i){
if(i % 2){
el.addClass(this.options.altCls);
el.addClass('alt');
}else{
el.removeClass(this.options.altCls);
el.removeClass('alt');
}
}.bind(this));
}
},
insertRow: function(id, row){
@ -73,14 +68,12 @@ var dynamicTable = new Class ({ @@ -73,14 +68,12 @@ var dynamicTable = new Class ({
td.injectInside(tr);
};
if(this.options.overCls){
tr.addEvent('mouseover', function(e){
tr.addClass(this.options.overCls);
tr.addClass('over');
}.bind(this));
tr.addEvent('mouseout', function(e){
tr.removeClass(this.options.overCls);
tr.removeClass('over');
}.bind(this));
}
tr.addEvent('click', function(e){
e.stop();
if(e.control) {
@ -91,14 +84,14 @@ var dynamicTable = new Class ({ @@ -91,14 +84,14 @@ var dynamicTable = new Class ({
// Remove selected style
temptr = this.rows[id];
if(temptr){
temptr.removeClass(this.options.selectCls);
temptr.removeClass('selected');
}
} else {
this.cur[this.cur.length] = id;
// Add selected style
temptr = this.rows[id];
if(temptr){
temptr.addClass(this.options.selectCls);
temptr.addClass('selected');
}
}
} else {
@ -119,7 +112,7 @@ var dynamicTable = new Class ({ @@ -119,7 +112,7 @@ var dynamicTable = new Class ({
// Add selected style
temptr = this.rows[curID];
if(temptr){
temptr.addClass(this.options.selectCls);
temptr.addClass('selected');
}
}
} else {
@ -128,14 +121,14 @@ var dynamicTable = new Class ({ @@ -128,14 +121,14 @@ var dynamicTable = new Class ({
for(i=0; i<this.cur.length; i++) {
var temptr = this.rows[this.cur[i]];
if(temptr){
temptr.removeClass(this.options.selectCls);
temptr.removeClass('selected');
}
}
this.cur.empty();
// Add selected style to new one
temptr = this.rows[id];
if(temptr){
temptr.addClass(this.options.selectCls);
temptr.addClass('selected');
}
this.cur[0] = id;
}
@ -153,8 +146,8 @@ var dynamicTable = new Class ({ @@ -153,8 +146,8 @@ var dynamicTable = new Class ({
this.cur[this.cur.length] = id;
temptr = this.rows[id];
if(temptr){
if(!temptr.hasClass(this.options.selectCls)) {
temptr.addClass(this.options.selectCls);
if(!temptr.hasClass('selected')) {
temptr.addClass('selected');
}
}
}
@ -204,7 +197,7 @@ var dynamicTable = new Class ({ @@ -204,7 +197,7 @@ var dynamicTable = new Class ({
return ids;
}
});
dynamicTable.implement(new Options);
dynamicTable.implement(new Events);
//dynamicTable.implement(new Options);
//dynamicTable.implement(new Events);
/*************************************************************/

Loading…
Cancel
Save