Changeset 1021

Show
Ignore:
Timestamp:
07/31/08 10:38:30 (1 month ago)
Author:
MaierMan
Message:

minimized functions and generators

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • trunk/chrome/content/dta/manager.js

    r1020 r1021  
    16901690                Debug.logString("scoreboard\n" + scoreboard); 
    16911691        },       
    1692         toString: function() { 
    1693                 return this.urlManager.usable; 
    1694         }, 
     1692        toString: function() this.urlManager.usable, 
    16951693        toSource: function() { 
    16961694                let e = {}; 
     
    25642562        let g = downloads; 
    25652563        if ('length' in downloads) { 
    2566                 g = function() { 
    2567                          for each (let i in downloads) { 
    2568                                 yield i; 
    2569                          } 
    2570                 }(); 
     2564                g = (i for each (i in downloads)); 
    25712565        } 
    25722566 
  • trunk/chrome/content/dta/manager/tree.js

    r1020 r1021  
    536536                                _state: 0, 
    537537                                resumable: false, 
    538                                 is: function(s) { 
    539                                         return this._state & s;   
    540                                 }, 
     538                                is: function(s) this._state & s,   
    541539                                isOf: QueueItem.prototype.isOf, 
    542540                                count: this.selection.count 
     
    565563                                } 
    566564                        } 
    567                         modifySome($('play', 'toolplay'), function(d) { return !d.isOf(COMPLETE, RUNNING, QUEUED, FINISHING); }); 
    568                         modifySome($('pause', 'toolpause'), function(d) { return (d.state & RUNNING && d.resumable) || (d.state & QUEUED); }); 
    569                         modifySome($('cancel', 'toolcancel'), function(d) { return !d.isOf(FINISHING, CANCELED); }); 
    570                         modifySome($('launch'), function(d) { return d.curFile; }); 
    571                         modifySome($('folder'), function(d) { return d.curFolder; }); 
    572                         modifySome($('delete'), function(d) { return d.is(COMPLETE); }); 
    573                         modifySome($('export'), function(d) { return d.count != 0; }); 
    574                         modifySome($('addchunk', 'removechunk', 'force'), function(d) { return d.isOf(QUEUED, RUNNING, PAUSED); }); 
     565                        modifySome($('play', 'toolplay'), function(d) !d.isOf(COMPLETE, RUNNING, QUEUED, FINISHING)); 
     566                        modifySome($('pause', 'toolpause'), function(d) (d.is(RUNNING) && d.resumable) || d.is(QUEUED)); 
     567                        modifySome($('cancel', 'toolcancel'), function(d) !d.isOf(FINISHING, CANCELED)); 
     568                        modifySome($('launch'), function(d) !!d.curFile); 
     569                        modifySome($('folder'), function(d) !!d.curFolder); 
     570                        modifySome($('delete'), function(d) d.is(COMPLETE)); 
     571                        modifySome($('export'), function(d) !!d.count); 
     572                        modifySome($('addchunk', 'removechunk', 'force'), function(d) d.isOf(QUEUED, RUNNING, PAUSED)); 
    575573                } 
    576574                catch (ex) {