Changeset 400

Show
Ignore:
Timestamp:
07/01/08 23:06:07 (2 months ago)
Author:
charles
Message:

fix some minor things suggested by lint. remove console.log messages, and some dead code.

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • branches/rpc/web/javascript/common.js

    r395 r400  
    106106Array.prototype.clone = function () { 
    107107        return this.concat(); 
    108 } 
     108}; 
    109109 
    110110/** 
     
    117117        if( e.innerHTML != html ) 
    118118                e.innerHTML = html; 
    119 } 
     119}; 
    120120 
    121121/* 
     
    169169 
    170170    return size + unit; 
    171 } 
     171}; 
    172172 
    173173 
     
    202202 
    203203        return result; 
    204 } 
     204}; 
    205205 
    206206 
     
    214214        var myDate = new Date(seconds*1000); 
    215215        return myDate.toGMTString(); 
    216 } 
     216}; 
    217217 
    218218/* 
     
    226226Math.roundWithPrecision = function(floatnum, precision) { 
    227227    return Math.round ( floatnum * Math.pow ( 10, precision ) ) / Math.pow ( 10, precision ); 
    228 } 
     228}; 
    229229 
    230230 
     
    245245 
    246246        return result; 
    247 } 
     247}; 
    248248 
    249249/* 
     
    254254} 
    255255 
    256  
    257  
    258256/*** 
    259257****  Preferences 
     
    261259 
    262260function Prefs() { } 
    263 Prefs.prototype = { } 
     261Prefs.prototype = { }; 
    264262 
    265263Prefs._AutoStart          = 'auto-start-torrents'; 
     
    314312        date.setTime(date.getTime()+(days*24*60*60*1000)); 
    315313        document.cookie = key+"="+val+"; expires="+date.toGMTString()+"; path=/"; 
    316 } 
     314}; 
    317315 
    318316/** 
     
    342340        else if( val == 'false' ) val = false; 
    343341        return val; 
    344 } 
     342}; 
    345343 
    346344/** 
     
    351349Prefs.getClutchPrefs = function( o ) 
    352350{ 
    353         if( o == null
    354                 o = new Object( )
     351        if( !o
     352                o = { }
    355353        for( var key in Prefs._Defaults ) 
    356354                o[key] = Prefs.getValue( key, Prefs._Defaults[key] ); 
    357355        return o; 
    358 } 
     356}; 
  • branches/rpc/web/javascript/torrent.js

    r399 r400  
    436436                return pass; 
    437437        } 
    438 } 
     438}; 
    439439 
    440440/** Helper function for Torrent.sortTorrents(). */ 
    441441Torrent.compareById = function( a, b ) { 
    442442        return a.id() - b.id(); 
    443 } 
     443}; 
    444444 
    445445/** Helper function for sortTorrents(). */ 
    446446Torrent.compareByAge = function( a, b ) { 
    447447        return a.dateAdded() - b.dateAdded(); 
    448 } 
     448}; 
    449449 
    450450/** Helper function for sortTorrents(). */ 
     
    454454        if( a.name() > b.name() ) return 1; 
    455455        return 0; 
    456 } 
     456}; 
    457457 
    458458/** Helper function for sortTorrents(). */ 
    459459Torrent.compareByActivity = function( a, b ) { 
    460460        return a.activity() - b.activity(); 
    461 }, 
     461}; 
    462462 
    463463 
     
    498498         
    499499        return torrents; 
    500 } 
     500}; 
    501501 
    502502/** 
     
    521521                return -1; // not found 
    522522        } 
    523 } 
     523}; 
    524524 
    525525/** 
     
    532532        var pos = Torrent.indexOf( torrents, id ); 
    533533        return pos >= 0 ? torrents[pos] : null; 
    534 } 
     534}; 
  • branches/rpc/web/javascript/transmission.js

    r398 r400  
    3333                // Initialize the implementation fields 
    3434                this._current_search         = ''; 
    35                 this._torrents               = new Array()
    36                 this._rows                   = new Array()
     35                this._torrents               = [ ]
     36                this._rows                   = [ ]
    3737         
    3838                // Initialize the clutch preferences 
     
    513513                 
    514514                // pass the new prefs upstream to the RPC server 
    515                 var o = new Object( )
     515                var o = { }
    516516                o[RPC._UpSpeedLimit]     = parseInt( $('#prefs_form #upload_rate')[0].value ); 
    517517                o[RPC._DownSpeedLimit]   = parseInt( $('#prefs_form #download_rate')[0].value ); 
     
    715715                        // Limit the download rate 
    716716                        case 'footer_download_rate_menu': 
    717                                 var args = new Object( )
     717                                var args = { }
    718718                                var rate = (this.innerHTML).replace(/[^0-9]/ig, ''); 
    719719                                if ($(this).is('#unlimited_download_rate')) { 
     
    733733                        // Limit the upload rate 
    734734                        case 'footer_upload_rate_menu': 
    735                                 var args = new Object( )
     735                                var args = { }
    736736                                var rate = (this.innerHTML).replace(/[^0-9]/ig, ''); 
    737737                                if ($(this).is('#unlimited_upload_rate')) { 
     
    11021102                                tr.togglePeriodicRefresh( true ); 
    11031103                        }; 
    1104                         console.log( $.toJSON(args) ); 
    11051104                        this.togglePeriodicRefresh( false ); 
    11061105                        $('#torrent_upload_form').ajaxSubmit( args ); 
     
    12321231        updateButtonStates: function() 
    12331232        { 
    1234                 var showing_dialog = RegExp("(prefs_showing|dialog_showing|open_showing)").test(document.body.className); 
     1233                var showing_dialog = new RegExp("(prefs_showing|dialog_showing|open_showing)").test(document.body.className); 
    12351234                if (showing_dialog) 
    12361235                { 
     
    12671266                } 
    12681267        } 
    1269 } 
     1268}; 
  • branches/rpc/web/javascript/transmission.remote.js

    r395 r400  
    8888                o.method = 'torrent-get' 
    8989                o.arguments = { }; 
    90                 o.arguments.fields = 6197
     90                o.arguments.fields = 1+2+4+16+32+64+128+1024+2048+4096
    9191                $.post( RPC._Root, $.toJSON(o), function(data) { 
    9292                        tr.updateTorrents( data.arguments.torrents ); 
     
    125125        }, 
    126126 
    127 /* 
    128                 var form = $('#prefs_form #download_location'); 
    129 console.log( "form is " form ); 
    130 //download_location 
    131  
    132                 // Clear any errors 
    133                 $('div#prefs_container div#pref_error').hide(); 
    134                 $('div#prefs_container h2.dialog_heading').show(); 
    135                                          
    136                 // Set the form action with the appropriate params 
    137                 $('#prefs_form')[0].action = 'remote/index.php?action=savePrefs&param=[]'; 
    138                 $('#prefs_form').ajaxSubmit({dataType: 'script', type: 'POST'}); 
    139                 $('body.prefs_showing').removeClass('prefs_showing'); 
    140                 if (iPhone) { 
    141                         transmission.hideiPhoneAddressbar(); 
    142                         $('#prefs_container').hide(); 
    143                 } else if (Safari3)  { 
    144                         $('div#prefs_container div.dialog_window').css('top', '-425px'); 
    145                         setTimeout("$('#prefs_container').hide();",500); 
    146                 } 
    147 */ 
    148  
    149127        /* 
    150128         * Upload Torrent by URL 
     
    154132                $('#torrent_upload_form').ajaxSubmit({dataType: 'script', type: 'POST'}); 
    155133        }, 
    156 } 
     134};