Changeset 8311


Ignore:
Timestamp:
Apr 29, 2009, 5:48:04 PM (13 years ago)
Author:
charles
Message:

(trunk clutch) only refresh the inspector's innerHTML fields when something's actually changed

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/web/javascript/transmission.js

    r8088 r8311  
    986986
    987987                var ti = '#torrent_inspector_';
    988                 $(ti+'name')[0].innerHTML            = name;
    989                 $(ti+'size')[0].innerHTML            = torrents.length ? Math.formatBytes( total_size ) : 'N/A';
    990                 $(ti+'tracker')[0].innerHTML         = total_tracker;
    991                 $(ti+'hash')[0].innerHTML            = hash;
    992                 $(ti+'state')[0].innerHTML           = total_state;
    993                 $(ti+'download_speed')[0].innerHTML  = torrents.length ? Math.formatBytes( total_download_speed ) + '/s' : 'N/A';
    994                 $(ti+'upload_speed')[0].innerHTML    = torrents.length ? Math.formatBytes( total_upload_speed ) + '/s' : 'N/A';
    995                 $(ti+'uploaded')[0].innerHTML        = torrents.length ? Math.formatBytes( total_upload ) : 'N/A';
    996                 $(ti+'downloaded')[0].innerHTML      = torrents.length ? Math.formatBytes( total_download ) : 'N/A';
    997                 $(ti+'ratio')[0].innerHTML           = torrents.length ? Math.ratio( total_upload, total_download ) : 'N/A';
    998                 $(ti+'total_seeders')[0].innerHTML   = torrents.length ? total_seeders : 'N/A';
    999                 $(ti+'total_leechers')[0].innerHTML  = torrents.length ? total_leechers : 'N/A';
    1000                 $(ti+'swarm_speed')[0].innerHTML     = torrents.length ? Math.formatBytes(total_swarm_speed) + '/s' : 'N/A';
    1001                 $(ti+'have')[0].innerHTML            = torrents.length ? Math.formatBytes(total_completed) + ' (' + Math.formatBytes(total_verified) + ' verified)' : 'N/A';
    1002                 $(ti+'upload_to')[0].innerHTML       = torrents.length ? total_upload_peers : 'N/A';
    1003                 $(ti+'download_from')[0].innerHTML   = torrents.length ? total_download_peers : 'N/A';
    1004                 $(ti+'secure')[0].innerHTML          = private_string;
    1005                 $(ti+'creator_date')[0].innerHTML    = date_created;
    1006                 $(ti+'progress')[0].innerHTML        = torrents.length ? Math.ratio( sizeDone*100, sizeWhenDone ) + '%' : 'N/A';
    1007                 $(ti+'comment')[0].innerHTML         = comment;
    1008                 $(ti+'creator')[0].innerHTML         = creator;
    1009                 $(ti+'error')[0].innerHTML           = error;
     988                setInnerHTML( $(ti+'name')[0], name );
     989                setInnerHTML( $(ti+'size')[0], torrents.length ? Math.formatBytes( total_size ) : 'N/A' );
     990                setInnerHTML( $(ti+'tracker')[0], total_tracker );
     991                setInnerHTML( $(ti+'hash')[0], hash );
     992                setInnerHTML( $(ti+'state')[0], total_state );
     993                setInnerHTML( $(ti+'download_speed')[0], torrents.length ? Math.formatBytes( total_download_speed ) + '/s' : 'N/A' );
     994                setInnerHTML( $(ti+'upload_speed')[0], torrents.length ? Math.formatBytes( total_upload_speed ) + '/s' : 'N/A' );
     995                setInnerHTML( $(ti+'uploaded')[0], torrents.length ? Math.formatBytes( total_upload ) : 'N/A' );
     996                setInnerHTML( $(ti+'downloaded')[0], torrents.length ? Math.formatBytes( total_download ) : 'N/A' );
     997                setInnerHTML( $(ti+'ratio')[0], torrents.length ? Math.ratio( total_upload, total_download ) : 'N/A' );
     998                setInnerHTML( $(ti+'total_seeders')[0], torrents.length ? total_seeders : 'N/A' );
     999                setInnerHTML( $(ti+'total_leechers')[0], torrents.length ? total_leechers : 'N/A' );
     1000                setInnerHTML( $(ti+'swarm_speed')[0], torrents.length ? Math.formatBytes(total_swarm_speed) + '/s' : 'N/A' );
     1001                setInnerHTML( $(ti+'have')[0], torrents.length ? Math.formatBytes(total_completed) + ' (' + Math.formatBytes(total_verified) + ' verified)' : 'N/A' );
     1002                setInnerHTML( $(ti+'upload_to')[0], torrents.length ? total_upload_peers : 'N/A' );
     1003                setInnerHTML( $(ti+'download_from')[0], torrents.length ? total_download_peers : 'N/A' );
     1004                setInnerHTML( $(ti+'secure')[0], private_string );
     1005                setInnerHTML( $(ti+'creator_date')[0], date_created );
     1006                setInnerHTML( $(ti+'progress')[0], torrents.length ? Math.ratio( sizeDone*100, sizeWhenDone ) + '%' : 'N/A' );
     1007                setInnerHTML( $(ti+'comment')[0], comment );
     1008                setInnerHTML( $(ti+'creator')[0], creator );
     1009                setInnerHTML( $(ti+'error')[0], error );
    10101010               
    10111011                $(".inspector_row > div:contains('N/A')").css('color', '#666');
Note: See TracChangeset for help on using the changeset viewer.