Changeset 12865


Ignore:
Timestamp:
Sep 14, 2011, 5:10:51 AM (12 years ago)
Author:
jordan
Message:

(trunk web) refactor the preferences dialog into its own class. Make the prefs dialog invokable on iPhones/Androids (#1131) and add stop ratio functionality (#2006).

Location:
trunk/web
Files:
2 added
1 deleted
15 edited

Legend:

Unmodified
Added
Removed
  • trunk/web/images/graphics/Makefile.am

    r12840 r12865  
    22
    33dist_data_DATA = \
     4  blue-turtle.png \
    45  chrome.png \
    56  filter_bar.png \
  • trunk/web/index.html

    r12862 r12865  
    1212                <script type="text/javascript" src="https://ajax.googleapis.com/ajax/libs/jqueryui/1.8.16/jquery-ui.min.js"></script>
    1313                <link rel="stylesheet" href="http://ajax.googleapis.com/ajax/libs/jqueryui/1.8.16/themes/base/jquery-ui.css" type="text/css" media="all" />
     14
    1415<!--
    1516                <link media="screen" href="./stylesheets/mobile.css" type= "text/css" rel="stylesheet" />
     
    2425                <script type="text/javascript" src="./javascript/jquery/jquery.transmenu.min.js"></script>
    2526                <script type="text/javascript" src="./javascript/jquery/jquery.contextmenu.min.js"></script>
    26                 <script type="text/javascript" src="./javascript/menu.js"></script>
    2727                <script type="text/javascript" src="./javascript/jquery/jquery.form.min.js"></script>
    2828                <script type="text/javascript" src="./javascript/jquery/json2.min.js"></script>
    2929                <script type="text/javascript" src="./javascript/common.js"></script>
    3030                <script type="text/javascript" src="./javascript/inspector.js"></script>
     31                <script type="text/javascript" src="./javascript/prefs-dialog.js"></script>
    3132                <script type="text/javascript" src="./javascript/remote.js"></script>
    3233                <script type="text/javascript" src="./javascript/transmission.js"></script>
     
    7071                </div>
    7172
     73                <div id="prefs-dialog" style="display:none;">
     74                        <ul>
     75                                <li id="prefs-tab-general"><a href="#prefs-page-torrents">Torrents</a></li>
     76                                <li id="prefs-tab-speed"><a href="#prefs-page-speed">Speed</a></li>
     77                                <li id="prefs-tab-privacy"><a href="#prefs-page-privacy">Privacy</a></li>
     78                                <li id="prefs-tab-network"><a href="#prefs-page-network">Network</a></li>
     79                                <li class="ui-tab-dialog-close"></li>
     80                        </ul>
     81                        <div>
     82                                <div id="prefs-page-torrents">
     83                                        <div class="prefs-section">
     84                                                <div class="title">Downloading</div>
     85                                                <div class="row"><div class="key">Download to:</div><div class="value"><input type="text" id="download-dir"/></div></div>
     86                                                <div class="checkbox-row"><input type="checkbox" id="start-added-torrents"/><label for="start-added-torrents">Start when added</label></div>
     87                                                <div class="checkbox-row"><input type="checkbox" id="rename-partial-files"/><label for="rename-partial-files">Append &quot;.part&quot; to incomplete files' names</label></div>
     88                                        </div>
     89                                        <div class="prefs-section">
     90                                                <div class="title">Seeding</div>
     91                                                <div class="row"><div class="key"><input type="checkbox" id="seedRatioLimited"/><label for="seedRatioLimited">Stop seeding at ratio:</label></div>
     92                                                                 <div class="value"><input type="text" class="numberinput" id="seedRatioLimit"/></div></div>
     93                                                <div class="row"><div class="key"><input type="checkbox" id="idle-seeding-limit-enabled"/><label for="idle-seeding-limit-enabled">Stop seeding if idle for N minutes:</label></div>
     94                                                                 <div class="value"><input type="text" class="numberinput" id="idle-seeding-limit"/></div></div>
     95                                        </div>
     96                                </div>
     97                                <div id="prefs-page-speed">
     98                                        <div class="prefs-section">
     99                                                <div class="title">Speed Limits</div>
     100                                                <div class="row"><div class="key"><input type="checkbox" id="speed-limit-up-enabled"/><label for="speed-limit-up-enabled">Upload (kB/s):</label></div>
     101                                                                 <div class="value"><input type="text" class="numberinput" id="speed-limit-up"/></div></div>
     102                                                <div class="row"><div class="key"><input type="checkbox" id="speed-limit-down-enabled"/><label for="speed-limit-down-enabled">Download (kB/s):</label></div>
     103                                                                 <div class="value"><input type="text" class="numberinput" id="speed-limit-down"/></div></div>
     104                                        </div>
     105                                        <div class="prefs-section">
     106                                                <div class="title"><img src="images/graphics/blue-turtle.png" width="16" height="9" style="padding-right: 10px;"/>Alternative Speed Limits</div>
     107                                                <div class="row" style="font-size: smaller; padding-bottom: 4px;">Override normal speed limits manually or at scheduled times</div>
     108                                                <div class="row"><div class="key">Upload (kB/s):</div>
     109                                                                 <div class="value"><input type="text" class="numberinput" id="alt-speed-up"/></div></div>
     110                                                <div class="row"><div class="key">Download (kB/s):</div>
     111                                                                 <div class="value"><input type="text" class="numberinput" id="alt-speed-down"/></div></div>
     112                                                <div class="checkbox-row"><input type="checkbox" id="alt-speed-time-enabled"/><label for="alt-speed-time-enabled">Scheduled Times</label></div>
     113                                                <div class="row"><div class="key">From:</div>
     114                                                                 <div class="value"><select id="alt-speed-time-begin"></select></div></div>
     115                                                <div class="row"><div class="key">To:</div>
     116                                                                 <div class="value"><select id="alt-speed-time-end"></select></div></div>
     117                                                <div class="row"><div class="key"><label for="alt-speed-time-day">On days:</label></div>
     118                                                                 <div class="value"><select id="alt-speed-time-day">
     119                                                                                <option value="127">Everyday</option>
     120                                                                                <option value="62">Weekdays</option>
     121                                                                                <option value="65">Weekends</option>
     122                                                                                <option value="1">Sunday</option>
     123                                                                                <option value="2">Monday</option>
     124                                                                                <option value="4">Tuesday</option>
     125                                                                                <option value="8">Wednesday</option>
     126                                                                                <option value="16">Thursday</option>
     127                                                                                <option value="32">Friday</option>
     128                                                                                <option value="64">Saturday</option></select></div></div>
     129                                        </div>
     130                                </div>
     131                                <div id="prefs-page-privacy">
     132                                        <div class="prefs-section">
     133                                                <div class="title">Blocklist</div>
     134                                                <div class="row"><div class="key"><input type="checkbox" id="blocklist-enabled"/><label for="blocklist-enabled">Enable blocklist:</label></div>
     135                                                                 <div class="value"><input type="text" id="blocklist-url"/></div></div>
     136                                                <div class="row"><div class="key" style="margin-top: 3px; font-size: smaller;">Blocklist has <span id="blocklist-size">?</span> rules</div>
     137                                                                 <div class="value"><input type="button" id="blocklist-update-button" value="Update"/></div></div>
     138                                        </div>
     139                                        <div class="prefs-section">
     140                                                <div class="title">Privacy</div>
     141                                                <div class="row"><div class="key">Encryption mode:</div>
     142                                                                 <div class="value"><select id="encryption">
     143                                                                        <option value="tolerated">Allow encryption</option>
     144                                                                        <option value="preferred">Prefer encryption</option>
     145                                                                        <option value="required">Require encryption</option></select></div></div>
     146                                                <div class="checkbox-row"><input type="checkbox" id="pex-enabled" title="PEX is a tool for exchanging peer lists with the peers you're connected to."/>
     147                                                                          <label for="pex-enabled" title="PEX is a tool for exchanging peer lists with the peers you're connected to.">Use PEX to find more peers</label></div>
     148                                                <div class="checkbox-row"><input type="checkbox" id="dht-enabled" title="DHT is a tool for finding peers without a tracker."/>
     149                                                                          <label for="dht-enabled" title="DHT is a tool for finding peers without a tracker.">Use DHT to find more peers</label></div>
     150                                                <div class="checkbox-row"><input type="checkbox" id="lpd-enabled" title="LPD is a tool for finding peers on your local network."/>
     151                                                                          <label for="lpd-enabled" title="LPD is a tool for finding peers on your local network.">Use LPD to find more peers</label></div>
     152                                        </div>
     153                                </div>
     154                                <div id="prefs-page-network">
     155                                        <div class="prefs-section">
     156                                                <div class="title">Listening Port</div>
     157                                                <div class="row"><div class="key"><label for="peer-port">Peer listening port:</div>
     158                                                                 <div class="value"><input type="text" class="numberinput" id="peer-port"/></div></div>
     159                                                <div class="row"><div class="key">&nbsp;</div>
     160                                                                 <div class="value"><span id="port-label">Status: Unknown</span></div></div>
     161                                                <div class="checkbox-row"><input type="checkbox" id="peer-port-random-on-start"/><label for="peer-port-random-on-start">Randomize port on launch</label></div>
     162                                                <div class="checkbox-row"><input type="checkbox" id="port-forwarding-enabled"/><label for="port-forwarding-enabled">Use port forwarding from my router</label></div>
     163                                        </div>
     164                                        <div class="prefs-section">
     165                                                <div class="title">Connections</div>
     166                                                <div class="row"><div class="key"><label for="peer-limit-per-torrent">Max peers per torrent:</label></div>
     167                                                                 <div class="value"><input type="text" class="numberinput" id="peer-limit-per-torrent"/></div></div>
     168                                                <div class="row"><div class="key"><label for="peer-limit-global">Max peers overall:</label></div>
     169                                                                 <div class="value"><input type="text" class="numberinput" id="peer-limit-global"/></div></div>
     170                                        </div>
     171                                        <div class="prefs-section">
     172                                                <div class="title">Options</div>
     173                                                <div class="checkbox-row"><input type="checkbox" id="utp-enabled" title="uTP is a tool for reducing network congestion."/>
     174                                                                          <label for="utp-enabled" title="uTP is a tool for reducing network congestion.">Enable uTP for peer communication</label></div>
     175                                        </div>
     176                                </div>
     177                        </div>
     178                </div>
     179
    72180                <div id="torrent_inspector" style="display:none;">
    73181
     
    221329                                <a href="#confirm" id="dialog_confirm_button">Confirm</a>
    222330                                <a href="#cancel" id="dialog_cancel_button">Cancel</a>
    223                         </div>
    224                 </div>
    225 
    226                 <div class="dialog_container" id="prefs_container" style="display:none;">
    227                         <div class="dialog_top_bar"></div>
    228                         <div class="dialog_window">
    229                                 <h2 class="dialog_heading">Preferences</h2>
    230                                 <div id="pref_error"></div>
    231                                 <form action="" id="prefs_form">
    232                                         <div id="prefs_tabs">
    233                                                 <ul>
    234                                                         <li id="prefs-tab-general" class="prefs-tab selected">General</li>
    235                                                         <li id="prefs-tab-speed" class="prefs-tab">Speed</li>
    236                                                         <li id="prefs-tab-peers" class="prefs-tab">Peers</li>
    237                                                         <li id="prefs-tab-network" class="prefs-tab">Network</li>
    238                                                 </ul>
    239                                                 <div id="prefs-page-general" class="prefs-page">
    240                                                         <div class="preference download_location">
    241                                                                 <label class="category">Add transfers:</label>
    242                                                                 <div class="formdiv">
    243                                                                         <label for="download_location" class="item">Download to:</label>
    244                                                                         <input type="text" name="download_location" id="download_location"/>
    245                                                                 </div>
    246                                                                 <div class="formdiv checkbox auto_start">
    247                                                                         <input type="checkbox" name="auto_start" id="auto_start"/>
    248                                                                         <label for="auto_start" class="item">Start transfers when added</label>
    249                                                                 </div>
    250                                                         </div>
    251                                                         <div class="preference encryption">
    252                                                                 <label class="category">Encryption:</label>
    253                                                                 <div class="formdiv checkbox">
    254                                                                         <input type="checkbox" name="encryption" id="encryption"/>
    255                                                                         <label for="encryption" class="item">Ignore unencrypted peers</label>
    256                                                                 </div>
    257                                                         </div>
    258                                                         <div class="preference web_gui">
    259                                                                 <label class="category">Web Client:</label>
    260                                                                 <div class="formdiv">
    261                                                                         <label for="refresh_rate" class="item">Refresh Rate:</label>
    262                                                                         <input type="text" name="refresh_rate" id="refresh_rate" class="numberinput"/>
    263                                                                         <label class="suffix">seconds</label>
    264                                                                 </div>
    265                                                         </div>
    266                                                         <div style="clear: both; visibility: hidden;"></div>
    267                                                 </div>
    268                                                 <div id="prefs-page-speed" class="prefs-page" style="display: none;">
    269                                                         <div class="preference limit_total">
    270                                                                 <label class="category">Speed Limits:</label>
    271                                                                 <div class="formdiv checkbox">
    272                                                                         <input type="checkbox" name="limit_download" id="limit_download"/>
    273                                                                         <label for="limit_download" class="item">Download Rate:</label>
    274                                                                         <input type="text" name="download_rate" id="download_rate" class="numberinput"/>
    275                                                                         <label class="suffix">kB/s</label>
    276                                                                 </div>
    277                                                                 <div class="formdiv checkbox">
    278                                                                         <input type="checkbox" name="limit_upload" id="limit_upload"/>
    279                                                                         <label for="limit_upload" class="item">Upload Rate:</label>
    280                                                                         <input type="text" name="upload_rate" id="upload_rate" class="numberinput"/>
    281                                                                         <label class="suffix">kB/s</label>
    282                                                                 </div>
    283                                                         </div>
    284                                                         <div class="preference limit_turtle">
    285                                                                 <label class="category">Temporary Speed Limits: (Turtle)</label>
    286                                                                 <label>Override normal speed limits manually or at scheduled times</label>
    287                                                                 <div class="formdiv">
    288                                                                         <label for="turtle_download_rate" class="item">Download Rate:</label>
    289                                                                         <input type="text" name="turtle_download_rate" id="turtle_download_rate" class="numberinput"/>
    290                                                                         <label class="suffix">kB/s</label>
    291                                                                 </div>
    292                                                                 <div class="formdiv">
    293                                                                         <label for="turtle_upload_rate" class="item">Upload Rate:</label>
    294                                                                         <input type="text" name="turtle_upload_rate" id="turtle_upload_rate" class="numberinput"/>
    295                                                                         <label class="suffix">kB/s</label>
    296                                                                 </div>
    297                                                                 <div class="formdiv checkbox">
    298                                                                         <input type="checkbox" name="turtle_schedule" id="turtle_schedule"/>
    299                                                                         <label for="turtle_schedule" class="item">Scheduled times:</label>
    300                                                                         <select name="turtle_start_time" id="turtle_start_time" size="1">
    301                                                                         </select>
    302                                                                         <select name="turtle_end_time" id="turtle_end_time" size="1">
    303                                                                         </select>
    304                                                                 </div>
    305                                                                 <div class="formdiv">
    306                                                                         <label for="turtle_days" class="item">On days:</label>
    307                                                                         <select name="turtle_days" id="turtle_days" size="1">
    308                                                                                 <option value="127">Everyday</option>
    309                                                                                 <option value="62">Weekdays</option>
    310                                                                                 <option value="65">Weekends</option>
    311                                                                                 <option value="1">Sunday</option>
    312                                                                                 <option value="2">Monday</option>
    313                                                                                 <option value="4">Tuesday</option>
    314                                                                                 <option value="8">Wednesday</option>
    315                                                                                 <option value="16">Thursday</option>
    316                                                                                 <option value="32">Friday</option>
    317                                                                                 <option value="64">Saturday</option>
    318                                                                         </select>
    319                                                                 </div>
    320                                                         </div>
    321                                                         <div style="clear: both; visibility: hidden;"></div>
    322                                                 </div>
    323                                                 <div id="prefs-page-peers" class="prefs-page" style="display: none;">
    324                                                         <div class="preference peers_conn">
    325                                                                 <label class="category">Connections:</label>
    326                                                                 <div class="formdiv">
    327                                                                         <label for="conn_global" class="item">Global maximum connections:</label>
    328                                                                         <input type="text" name="conn_global" id="conn_global" class="numberinput"/>
    329                                                                         <label class="suffix">peers</label>
    330                                                                 </div>
    331                                                                 <div class="formdiv">
    332                                                                         <label for="conn_torrent" class="item">Maximum connections for new transfers:</label>
    333                                                                         <input type="text" name="conn_torrent" id="conn_torrent" class="numberinput"/>
    334                                                                         <label class="suffix">peers</label>
    335                                                                 </div>
    336                                                                 <div class="formdiv checkbox">
    337                                                                         <input type="checkbox" name="conn_pex" id="conn_pex"/>
    338                                                                         <label for="conn_pex" class="item">Use peer exchange (PEX) for public torrents</label>
    339                                                                 </div>
    340                                                                 <div class="formdiv checkbox">
    341                                                                         <input type="checkbox" name="conn_dht" id="conn_dht"/>
    342                                                                         <label for="conn_dht" class="item">Use distributed hash table (DHT) for public torrents</label>
    343                                                                 </div>
    344                                                                 <div class="formdiv checkbox">
    345                                                                         <input type="checkbox" name="conn_lpd" id="conn_lpd"/>
    346                                                                         <label for="conn_lpd" class="item">Use local peer discovery for public torrents</label>
    347                                                                 </div>
    348                                                         </div>
    349                                                         <div class="preference block_conn">
    350                                                                 <label class="category">Blocklist:</label>
    351                                                                 <div class="formdiv checkbox">
    352                                                                         <input type="checkbox" name="block_enable" id="block_enable"/>
    353                                                                         <label for="block_enable" class="item">Prevent peers in blocklist from connecting</label>
    354                                                                 </div>
    355                                                                 <div class="formdiv block_url">
    356                                                                         <label for="block_url" class="item">URL:</label>
    357                                                                         <input type="text" name="block_url" id="block_url"/>
    358                                                                 </div>
    359                                                                 <div class="formdiv">
    360                                                                         <input type="button" name="block_update_button" id="block_update_button" value="Update"/>
    361                                                                         <label class="suffix" id="block_size">IP rules in the list</label>
    362                                                                 </div>
    363                                                         </div>
    364                                                         <div style="clear: both; visibility: hidden;"></div>
    365                                                 </div>
    366                                                 <div id="prefs-page-network" class="prefs-page" style="display: none;">
    367                                                         <div class="preference utp">
    368                                                                 <label class="category">Peer communication:</label>
    369                                                                 <div class="formdiv checkbox">
    370                                                                         <input type="checkbox" name="network_utp" id="network_utp"/>
    371                                                                         <label for="network_utp" class="item">Enable Micro Transport Protocol (µTP)</label>
    372                                                                 </div>
    373                                                         </div>
    374                                                         <div class="preference port">
    375                                                                 <label class="category">Peer listening port:</label>
    376                                                                 <div class="formdiv">
    377                                                                         <label for="port" class="item">Incoming TCP Port:</label>
    378                                                                         <input type="text" id="port" name="port" class="numberinput"/>
    379                                                                         <label class="suffix" id="port_test"></label>
    380                                                                 </div>
    381                                                                 <div class="formdiv checkbox">
    382                                                                         <input type="checkbox" name="port_rand" id="port_rand"/>
    383                                                                         <label for="port_rand" class="item">Randomize port on launch</label>
    384                                                                 </div>
    385                                                                 <div class="formdiv checkbox">
    386                                                                         <input type="checkbox" name="port_forward" id="port_forward"/>
    387                                                                         <label for="port_forward" class="item">Automatically map port</label>
    388                                                                 </div>
    389                                                         </div>
    390                                                         <div style="clear: both; visibility: hidden;"></div>
    391                                                 </div>
    392                                         </div>
    393                                         <span id="transmission_version"></span>
    394                                         <a href="#save" id="prefs_save_button">Save</a>
    395                                         <a href="#cancel" id="prefs_cancel_button">Cancel</a>
    396                                 </form>
    397331                        </div>
    398332                </div>
     
    487421                                                                <li id="limited_download_rate">Limit (10 kB/s)</li>
    488422                                                                <li class="separator"></li>
    489                                                                 <li>5 kB/s</li>
    490                                                                 <li>10 kB/s</li>
    491                                                                 <li>20 kB/s</li>
    492                                                                 <li>30 kB/s</li>
    493                                                                 <li>40 kB/s</li>
    494                                                                 <li>50 kB/s</li>
    495                                                                 <li>75 kB/s</li>
    496                                                                 <li>100 kB/s</li>
    497                                                                 <li>150 kB/s</li>
    498                                                                 <li>200 kB/s</li>
    499                                                                 <li>250 kB/s</li>
    500                                                                 <li>500 kB/s</li>
    501                                                                 <li>750 kB/s</li>
     423                                                                <li class='download-speed'>5 kB/s</li>
     424                                                                <li class='download-speed'>10 kB/s</li>
     425                                                                <li class='download-speed'>20 kB/s</li>
     426                                                                <li class='download-speed'>30 kB/s</li>
     427                                                                <li class='download-speed'>40 kB/s</li>
     428                                                                <li class='download-speed'>50 kB/s</li>
     429                                                                <li class='download-speed'>75 kB/s</li>
     430                                                                <li class='download-speed'>100 kB/s</li>
     431                                                                <li class='download-speed'>150 kB/s</li>
     432                                                                <li class='download-speed'>200 kB/s</li>
     433                                                                <li class='download-speed'>250 kB/s</li>
     434                                                                <li class='download-speed'>500 kB/s</li>
     435                                                                <li class='download-speed'>750 kB/s</li>
    502436                                                        </ul>
    503437                                                </li>
     
    507441                                                                <li id="limited_upload_rate">Limit (10 kB/s)</li>
    508442                                                                <li class="separator"></li>
    509                                                                 <li>5 kB/s</li>
    510                                                                 <li>10 kB/s</li>
    511                                                                 <li>20 kB/s</li>
    512                                                                 <li>30 kB/s</li>
    513                                                                 <li>40 kB/s</li>
    514                                                                 <li>50 kB/s</li>
    515                                                                 <li>75 kB/s</li>
    516                                                                 <li>100 kB/s</li>
    517                                                                 <li>150 kB/s</li>
    518                                                                 <li>200 kB/s</li>
    519                                                                 <li>250 kB/s</li>
    520                                                                 <li>500 kB/s</li>
    521                                                                 <li>750 kB/s</li>
     443                                                                <li class='upload-speed'>5 kB/s</li>
     444                                                                <li class='upload-speed'>10 kB/s</li>
     445                                                                <li class='upload-speed'>20 kB/s</li>
     446                                                                <li class='upload-speed'>30 kB/s</li>
     447                                                                <li class='upload-speed'>40 kB/s</li>
     448                                                                <li class='upload-speed'>50 kB/s</li>
     449                                                                <li class='upload-speed'>75 kB/s</li>
     450                                                                <li class='upload-speed'>100 kB/s</li>
     451                                                                <li class='upload-speed'>150 kB/s</li>
     452                                                                <li class='upload-speed'>200 kB/s</li>
     453                                                                <li class='upload-speed'>250 kB/s</li>
     454                                                                <li class='upload-speed'>500 kB/s</li>
     455                                                                <li class='upload-speed'>750 kB/s</li>
    522456                                                        </ul>
    523457                                                </li>
     
    525459                                                <li>Sort Transfers By
    526460                                                        <ul id="footer_sort_menu">
    527                                                                 <li id="sort_by_activity">Activity</li>
    528                                                                 <li id="sort_by_age">Age</li>
    529                                                                 <li id="sort_by_name">Name</li>
    530                                                                 <li id="sort_by_percent_completed">Progress</li>
    531                                                                 <li id="sort_by_ratio">Ratio</li>
    532                                                                 <li id="sort_by_queue_order">Queue Order</li>
    533                                                                 <li id="sort_by_state">State</li>
     461                                                                <li class='sort-mode' id="sort_by_activity">Activity</li>
     462                                                                <li class='sort-mode' id="sort_by_age">Age</li>
     463                                                                <li class='sort-mode' id="sort_by_name">Name</li>
     464                                                                <li class='sort-mode' id="sort_by_percent_completed">Progress</li>
     465                                                                <li class='sort-mode' id="sort_by_ratio">Ratio</li>
     466                                                                <li class='sort-mode' id="sort_by_queue_order">Queue Order</li>
     467                                                                <li class='sort-mode' id="sort_by_state">State</li>
    534468                                                                <li class="separator"></li>
    535469                                                                <li id="reverse_sort_order">Reverse Sort Order</li>
     
    539473                                </li>
    540474                        </ul>
     475                        <div id="prefs-button">&nbsp;</div>
    541476                        <div id="turtle-button">&nbsp;</div>
    542477                        <div id="compact-button">&nbsp;</div>
  • trunk/web/javascript/Makefile.am

    r12829 r12865  
    77  formatter.js \
    88  inspector.js \
    9   menu.js \
     9  prefs-dialog.js \
    1010  remote.js \
    1111  torrent.js \
  • trunk/web/javascript/common.js

    r12842 r12865  
    1 /*
    2  *      Copyright © Dave Perrett and Malcolm Jarvis
    3  *      This code is licensed under the GPL version 2.
    4  *      For more details, see http://www.gnu.org/licenses/old-licenses/gpl-2.0.html
    5  *
    6  * Common javascript
     1/**
     2 * Copyright © Dave Perrett and Malcolm Jarvis
     3 *
     4 * This file is licensed under the GPLv2.
     5 * http://www.gnu.org/licenses/old-licenses/gpl-2.0.html
    76 */
    87
     
    2019                return -1;
    2120        }
     21}
     22
     23// http://forum.jquery.com/topic/combining-ui-dialog-and-tabs
     24$.fn.tabbedDialog = function (dialog_opts) {
     25        this.tabs({selected: 0});
     26        this.dialog(dialog_opts);
     27        this.find('.ui-tab-dialog-close').append(this.parent().find('.ui-dialog-titlebar-close'));
     28        this.find('.ui-tab-dialog-close').css({'position':'absolute','right':'0', 'top':'16px'});
     29        this.find('.ui-tab-dialog-close > a').css({'float':'none','padding':'0'});
     30        var tabul = this.find('ul:first');
     31        this.parent().addClass('ui-tabs').prepend(tabul).draggable('option','handle',tabul);
     32        this.siblings('.ui-dialog-titlebar').remove();
     33        tabul.addClass('ui-dialog-titlebar');
    2234}
    2335
     
    5971});
    6072
    61 /*
    62  *   Return a copy of the array
    63  *
    64  *   @returns array
    65  */
    66 Array.prototype.clone = function () {
    67         return this.concat();
    68 };
    69 
    7073/**
    7174 * "innerHTML = html" is pretty slow in FF.  Happily a lot of our innerHTML
     
    101104};
    102105
    103 /*
    104  *   Truncate a float to a specified number of decimal
    105  *   places, stripping trailing zeroes
    106  *
    107  *   @param float floatnum
    108  *   @param integer precision
    109  *   @returns float
    110  */
    111 Math.truncateWithPrecision = function(floatnum, precision) {
    112         return Math.floor(floatnum * Math.pow (10, precision)) / Math.pow(10, precision);
    113 };
    114 
    115 /*
    116  *   Round a string of a number to a specified number of decimal
    117  *   places
     106/**
     107 * Round a string of a number to a specified number of decimal places
    118108 */
    119109Number.prototype.toTruncFixed = function(place) {
    120         var ret = Math.truncateWithPrecision(this, place);
     110        var ret = Math.floor(this * Math.pow (10, place)) / Math.pow(10, place);
    121111        return ret.toFixed(place);
    122112}
     113
     114Number.prototype.toStringWithCommas = function() {
     115    return this.toString().replace(/\B(?=(?:\d{3})+(?!\d))/g, ",");
     116}
     117
    123118
    124119/*
     
    137132
    138133Prefs._RefreshRate        = 'refresh_rate';
    139 Prefs._SessionRefreshRate = 'session_refresh_rate';
    140134
    141135Prefs._FilterMode         = 'filter';
     
    160154Prefs._SortByState        = 'state';
    161155
    162 Prefs._TurtleState        = 'turtle-state';
    163156Prefs._CompactDisplayState= 'compact_display_state';
    164157
  • trunk/web/javascript/dialog.js

    r12842 r12865  
    1 /*
    2  *      Copyright © Dave Perrett and Malcolm Jarvis
    3  *      This code is licensed under the GPL version 2.
    4  *      For more details, see http://www.gnu.org/licenses/old-licenses/gpl-2.0.html
     1/**
     2 * Copyright © Dave Perrett and Malcolm Jarvis
    53 *
    6  * Class Dialog
     4 * This file is licensed under the GPLv2.
     5 * http://www.gnu.org/licenses/old-licenses/gpl-2.0.html
    76 */
    87
  • trunk/web/javascript/file-row.js

    r12832 r12865  
    1 /*
    2  *   Copyright © Jordan Lee
    3  *   This code is licensed under the GPL version 2.
    4  *   <http://www.gnu.org/licenses/old-licenses/gpl-2.0.html>
     1/**
     2 * Copyright © Mnemosyne LLC
     3 *
     4 * This file is licensed under the GPLv2.
     5 * http://www.gnu.org/licenses/old-licenses/gpl-2.0.html
    56 */
    67
  • trunk/web/javascript/formatter.js

    r12842 r12865  
    11/**
    2 ***  This file Copyright (C) Mnemosyne LLC
    3 ***
    4 ***  This code is licensed under the GPL version 2.
    5 ***  For more details, see http://www.gnu.org/licenses/old-licenses/gpl-2.0.html
    6 **/
     2 * Copyright © Mnemosyne LLC
     3 *
     4 * This file is licensed under the GPLv2.
     5 * http://www.gnu.org/licenses/old-licenses/gpl-2.0.html
     6 */
    77
    88Transmission.fmt = (function()
  • trunk/web/javascript/inspector.js

    r12842 r12865  
    1 /*
     1/**
    22 * Copyright © Jordan Lee, Dave Perrett, Malcolm Jarvis and Bruno Bierbaumer
    3  * This code is licensed under the GPL version 2.
    4  * For details, see http://www.gnu.org/licenses/old-licenses/gpl-2.0.html
     3 *
     4 * This file is licensed under the GPLv2.
     5 * http://www.gnu.org/licenses/old-licenses/gpl-2.0.html
    56 */
    67
  • trunk/web/javascript/remote.js

    r12842 r12865  
    1 /*
    2  * Copyright © Dave Perrett, Malcolm Jarvis and Bruno Bierbaumer
    3  * This code is licensed under the GPL version 2.
    4  * For details, see http://www.gnu.org/licenses/old-licenses/gpl-2.0.html
     1/**
     2 * Copyright © Jordan Lee, Dave Perrett, Malcolm Jarvis and Bruno Bierbaumer
    53 *
    6  * Class TransmissionRemote
     4 * This file is licensed under the GPLv2.
     5 * http://www.gnu.org/licenses/old-licenses/gpl-2.0.html
    76 */
    87
    98var RPC = {
    10         _Root                   : '../rpc',
    119        _DaemonVersion          : 'version',
    12         _Encryption             : 'encryption',
    13         _EncryptionPreferred    : 'preferred',
    14         _EncryptionRequired     : 'required',
    15         _UpSpeedLimit           : 'speed-limit-up',
    1610        _DownSpeedLimit         : 'speed-limit-down',
    17         _DownloadDir            : 'download-dir',
    18         _PeerPort               : 'peer-port',
    19         _UpSpeedLimited         : 'speed-limit-up-enabled',
    2011        _DownSpeedLimited       : 'speed-limit-down-enabled',
    21         _TurtleState            : 'alt-speed-enabled',
    22         _TurtleUpSpeedLimit     : 'alt-speed-up',
    23         _TurtleDownSpeedLimit   : 'alt-speed-down',
    24         _TurtleTimeEnabled      : 'alt-speed-time-enabled',
    25         _TurtleTimeBegin        : 'alt-speed-time-begin',
    26         _TurtleTimeEnd          : 'alt-speed-time-end',
    27         _TurtleTimeDay          : 'alt-speed-time-day',
    28         _PeerLimitGlobal        : 'peer-limit-global',
    29         _PeerLimitPerTorrent    : 'peer-limit-per-torrent',
    30         _PexEnabled             : 'pex-enabled',
    31         _DhtEnabled             : 'dht-enabled',
    32         _LpdEnabled             : 'lpd-enabled',
    33         _BlocklistEnabled       : 'blocklist-enabled',
    34         _BlocklistURL           : 'blocklist-url',
    35         _BlocklistSize          : 'blocklist-size',
    36         _UtpEnabled             : 'utp-enabled',
    37         _PeerPortRandom         : 'peer-port-random-on-start',
    38         _PortForwardingEnabled  : 'port-forwarding-enabled',
    39         _StartAddedTorrent      : 'start-added-torrents',
    4012        _QueueMoveTop           : 'queue-move-top',
    4113        _QueueMoveBottom        : 'queue-move-bottom',
    4214        _QueueMoveUp            : 'queue-move-up',
    43         _QueueMoveDown          : 'queue-move-down'
     15        _QueueMoveDown          : 'queue-move-down',
     16        _Root                   : '../rpc',
     17        _TurtleDownSpeedLimit   : 'alt-speed-down',
     18        _TurtleState            : 'alt-speed-enabled',
     19        _TurtleUpSpeedLimit     : 'alt-speed-up',
     20        _UpSpeedLimit           : 'speed-limit-up',
     21        _UpSpeedLimited         : 'speed-limit-up-enabled'
    4422};
    4523
  • trunk/web/javascript/torrent-row.js

    r12842 r12865  
    1 /*
    2  *   Copyright © Jordan Lee
    3  *   This code is licensed under the GPL version 2.
    4  *   <http://www.gnu.org/licenses/old-licenses/gpl-2.0.html>
     1/**
     2 * Copyright © Mnemosyne LLC
     3 *
     4 * This file is licensed under the GPLv2.
     5 * http://www.gnu.org/licenses/old-licenses/gpl-2.0.html
    56 */
    6 
    7 /****
    8 *****
    9 *****
    10 ****/
    117
    128function TorrentRendererHelper()
  • trunk/web/javascript/torrent.js

    r12804 r12865  
    1 /*
    2  *      Copyright © Jordan Lee, Dave Perrett and Malcolm Jarvis
    3  *      This code is licensed under the GPL version 2.
    4  *      For details, see http://www.gnu.org/licenses/old-licenses/gpl-2.0.html
     1/**
     2 * Copyright © Mnemosyne LLC
    53 *
    6  *      Class Torrent
     4 * This file is licensed under the GPLv2.
     5 * http://www.gnu.org/licenses/old-licenses/gpl-2.0.html
    76 */
    8 
    97
    108function Torrent(data)
  • trunk/web/javascript/transmission.js

    r12842 r12865  
    1 /*
    2  *      Copyright © Dave Perrett, Malcolm Jarvis and Bruno Bierbaumer
    3  *      This code is licensed under the GPL version 2.
    4  *      For details, see http://www.gnu.org/licenses/old-licenses/gpl-2.0.html
     1/**
     2 * Copyright © Jordan Lee, Dave Perrett, Malcolm Jarvis and Bruno Bierbaumer
    53 *
    6  * Class Transmission
     4 * This file is licensed under the GPLv2.
     5 * http://www.gnu.org/licenses/old-licenses/gpl-2.0.html
    76 */
    87
     
    2221        initialize: function()
    2322        {
     23                var e;
     24
    2425                // Initialize the helper classes
    2526                this.remote = new TransmissionRemote(this);
    2627                this.inspector = new Inspector(this, this.remote);
     28                this.prefsDialog = new PrefsDialog(this.remote);
     29                this.isMenuEnabled = !isMobileDevice;
    2730
    2831                // Initialize the implementation fields
     
    3841
    3942                // Set up user events
    40                 var tr = this;
    4143                $(".numberinput").forceNumeric();
    42                 $('#pause_all_link').click(function(e) { tr.stopAllClicked(e); });
    43                 $('#resume_all_link').click(function(e) { tr.startAllClicked(e); });
    44                 $('#pause_selected_link').click(function(e) { tr.stopSelectedClicked(e); });
    45                 $('#resume_selected_link').click(function(e) { tr.startSelectedClicked(e); });
    46                 $('#remove_link').click(function(e) { tr.removeClicked(e); });
    47                 $('#prefs_save_button').click(function(e) { tr.savePrefsClicked(e); return false;});
    48                 $('#prefs_cancel_button').click(function() { tr.hidePrefsDialog(); return false; });
    49                 $('#block_update_button').click(function() { tr.remote.updateBlocklist(); return false; });
    50                 $('#stats_close_button').click(function() { tr.hideStatsDialog(); return false; });
    51                 $('#open_link').click(function(e) { tr.openTorrentClicked(e); });
    52                 $('#upload_confirm_button').click(function(e) { tr.confirmUploadClicked(e); return false;});
    53                 $('#upload_cancel_button').click(function() { tr.hideUploadDialog(); return false; });
    54                 $('#turtle-button').click(function() { tr.toggleTurtleClicked(); });
    55                 $('#compact-button').click(function() { tr.toggleCompactClicked(); });
    56                 $('#prefs-tab-general').click(function() { tr.selectPrefsTab('general'); });
    57                 $('#prefs-tab-speed').click(function() { tr.selectPrefsTab('speed'); });
    58                 $('#prefs-tab-peers').click(function() { tr.selectPrefsTab('peers'); });
    59                 $('#prefs-tab-network').click(function() { tr.selectPrefsTab('network'); });
    60                 $('#torrent_upload_form').submit(function() { $('#upload_confirm_button').click(); return false; });
    61                 $('#torrent_container').bind('dragover', function(e) { return tr.dragenter(e); });
    62                 $('#torrent_container').bind('dragenter', function(e) { return tr.dragenter(e); });
    63                 $('#torrent_container').bind('drop', function(e) { return tr.drop(e); });
     44                $('#pause_all_link').click($.proxy(this.stopAllClicked,this));
     45                $('#resume_all_link').click($.proxy(this.startAllClicked,this));
     46                $('#pause_selected_link').click($.proxy(this.stopSelectedClicked,this));
     47                $('#resume_selected_link').click($.proxy(this.startSelectedClicked,this));
     48                $('#remove_link').click($.proxy(this.removeClicked,this));
     49                $('#stats_close_button').click($.proxy(this.hideStatsDialog,this));
     50                $('#open_link').click($.proxy(this.openTorrentClicked,this));
     51
     52                $('#prefs-button').click($.proxy(this.showPrefsDialog,this));
     53
     54                $('#upload_confirm_button').click($.proxy(this.confirmUploadClicked,this));
     55                $('#upload_cancel_button').click($.proxy(this.hideUploadDialog,this));
     56                $('#turtle-button').click($.proxy(this.toggleTurtleClicked,this));
     57                $('#compact-button').click($.proxy(this.toggleCompactClicked,this));
     58                $('#torrent_container').bind('dragover', $.proxy(this.dragenter,this));
     59                $('#torrent_container').bind('dragenter', $.proxy(this.dragenter,this));
     60                $('#torrent_container').bind('drop', $.proxy(this.drop,this));
     61
    6462                // tell jQuery to copy the dataTransfer property from events over if it exists
    6563                jQuery.event.props.push("dataTransfer");
     
    6866
    6967                if (isMobileDevice) {
    70                         $('#inspector_close').bind('click', function() { tr.setInspectorVisible(false); });
    71                         $('#preferences_link').bind('click', function(e) { tr.releaseClutchPreferencesButton(e); });
     68                        $('#inspector_close').click($.proxy(this.toggleInspector,this));
    7269                } else {
    73                         $(document).bind('keydown', function(e) { return tr.keyDown(e); });
    74                         $(document).bind('keyup', function(e) { tr.keyUp(e); });
    75                         $(document).delegate('#torrent_container', 'click', function() { tr.deselectAll(); });
    76                         $('#inspector_link').click(function(e) { tr.toggleInspector(); });
     70                        $(document).bind('keydown', $.proxy(this.keyDown,this) );
     71                        $(document).bind('keyup', $.proxy(this.keyUp, this) );
     72                        $('#torrent_container').click( $.proxy(this.deselectAll,this) );
     73                        $('#inspector_link').click( $.proxy(this.toggleInspector,this) );
    7774
    7875                        this.setupSearchBox();
    7976                        this.createContextMenu();
     77                }
     78
     79                if (this.isMenuEnabled)
    8080                        this.createSettingsMenu();
    81                 }
    82                 this.initTurtleDropDowns();
    83 
    84                 this._torrent_list             = $('#torrent_list')[0];
    85                 this._toolbar_buttons          = $('#toolbar ul li');
    86                 this._toolbar_pause_button     = $('#toolbar #pause_selected')[0];
    87                 this._toolbar_pause_all_button = $('#toolbar #pause_all')[0];
    88                 this._toolbar_start_button     = $('#toolbar #resume_selected')[0];
    89                 this._toolbar_start_all_button = $('#toolbar #resume_all')[0];
    90                 this._toolbar_remove_button    = $('#toolbar #remove')[0];
    91                 this._context_pause_button     = $('li#context_pause_selected')[0];
    92                 this._context_start_button     = $('li#context_resume_selected')[0];
    93                 this._context_start_now_button = $('li#context_resume_now_selected')[0];
    94                 this._context_move_top         = $('li#context_move_top')[0];
    95                 this._context_move_up          = $('li#context_move_up')[0];
    96                 this._context_move_down        = $('li#context_move_down')[0];
    97                 this._context_move_bottom      = $('li#context_move_bottom')[0];
    98 
    99                 // Setup the prefs gui
     81 
     82                e = {};
     83                e.torrent_list              = $('#torrent_list')[0];
     84                e.toolbar_buttons           = $('#toolbar ul li');
     85                e.toolbar_pause_button      = $('#toolbar #pause_selected')[0];
     86                e.toolbar_pause_all_button  = $('#toolbar #pause_all')[0];
     87                e.toolbar_start_button      = $('#toolbar #resume_selected')[0];
     88                e.toolbar_start_all_button  = $('#toolbar #resume_all')[0];
     89                e.toolbar_remove_button     = $('#toolbar #remove')[0];
     90                e.context_pause_button      = $('li#context_pause_selected')[0];
     91                e.context_start_button      = $('li#context_resume_selected')[0];
     92                e.context_start_now_button  = $('li#context_resume_now_selected')[0];
     93                e.context_move_top          = $('li#context_move_top')[0];
     94                e.context_move_up           = $('li#context_move_up')[0];
     95                e.context_move_down         = $('li#context_move_down')[0];
     96                e.context_move_bottom       = $('li#context_move_bottom')[0];
     97                this.elements = e;
     98
     99                // Apply the prefs settings to the gui
    100100                this.initializeSettings();
    101101
     
    111111        },
    112112
    113         selectPrefsTab: function(name) {
    114                 $('#prefs-tab-'+name).addClass('selected').siblings('.prefs-tab').removeClass('selected');
    115                 $('#prefs-page-'+name).show().siblings('.prefs-page').hide();
    116         },
    117 
    118113        loadDaemonPrefs: function(async) {
    119114                this.remote.loadDaemonPrefs(function(data) {
    120115                        var o = data['arguments'];
    121116                        Prefs.getClutchPrefs(o);
    122                         this.updatePrefs(o);
     117                        this.updateGuiFromSession(o);
    123118                }, this, async);
    124119        },
     
    127122                this.remote.loadDaemonStats(function(data) {
    128123                        this.updateStats(data['arguments']);
    129                 }, this, async);
    130         },
    131         checkPort: function(async) {
    132                 $('#port_test').text('checking ...');
    133                 this.remote.checkPort(function(data) {
    134                         this.updatePortStatus(data['arguments']);
    135124                }, this, async);
    136125        },
     
    176165                Prefs.getClutchPrefs(this);
    177166
    178                 // iPhone conditions in the section allow us to not
    179                 // include transmenu js to save some bandwidth; if we
    180                 // start using prefs on mobile devices we need to weed
    181                 // transmenu refs out of that too.
    182                 if (!isMobileDevice)
     167                if (this.isMenuEnabled)
    183168                {
    184169                        $('#sort_by_' + this[Prefs._SortMethod]).selectMenuItem();
     
    220205        },
    221206
    222         /*
     207        /**
    223208         * Create the torrent right-click menu
    224209         */
     
    242227                };
    243228
    244                 // Setup the context menu
     229                // Set up the context menu
    245230                $('ul#torrent_list').contextMenu('torrent_context_menu', {
    246231                        bindings:          bindings,
    247                         menuStyle:         Menu.context.menu_style,
    248                         itemStyle:         Menu.context.item_style,
    249                         itemHoverStyle:    Menu.context.item_hover_style,
    250                         itemDisabledStyle: Menu.context.item_disabled_style,
     232                        menuStyle:         { width: '310px', backgroundColor: '#fff', border: 'none', padding: '5px 0', textAlign: 'left' },
     233                        itemStyle:         { backgroundColor: 'transparent', margin: '0', padding: '3px 10px 3px 20px', color: '#000', cursor: 'default', border: 'none'},
     234                        itemHoverStyle:    { backgroundColor: '#24e', color: '#fff', border: 'none'},
     235                        itemDisabledStyle: { backgroundColor: 'transparent', margin: '0', padding: '3px 10px 3px 20px', color: '#aaa', cursor: 'default', border: 'none'},
    251236                        shadow:            false,
    252237                        boundingElement:   $('div#torrent_container'),
     
    270255                        selected_char: '&#x2714;',
    271256                        direction: 'up',
    272                         onClick: $.proxy(this.processSettingsMenuEvent,this)
     257                        onClick: $.proxy(this.onMenuClicked,this)
    273258                });
    274259
     
    277262        },
    278263
    279 
    280         initTurtleDropDowns: function() {
    281                 var i, hour, mins, start, end, value, content;
    282                 // Build the list of times
    283                 start = $('#turtle_start_time')[0];
    284                 end = $('#turtle_end_time')[0];
    285                 for (i = 0; i < 24 * 4; i++) {
    286                         hour = parseInt(i / 4, 10);
    287                         mins = ((i % 4) * 15);
    288 
    289                         value = (i * 15);
    290                         content = hour + ":" + (mins || '00');
    291                         start.options[i] = new Option(content, value);
    292                         end.options[i]  = new Option(content, value);
    293                 }
    294         },
    295264
    296265        /****
     
    361330
    362331        setSelectedRow: function(row) {
    363                 $(this._torrent_list).children('.selected').removeClass('selected');
     332                $(this.elements.torrent_list).children('.selected').removeClass('selected');
    364333                this.selectRow(row);
    365334        },
     
    376345
    377346        selectAll: function() {
    378                 $(this._torrent_list).children().addClass('selected');
     347                $(this.elements.torrent_list).children().addClass('selected');
    379348                this.callSelectionChangedSoon();
    380349        },
    381350        deselectAll: function() {
    382                 $(this._torrent_list).children('.selected').removeClass('selected');
     351                $(this.elements.torrent_list).children('.selected').removeClass('selected');
    383352                this.callSelectionChangedSoon();
    384353                delete this._last_torrent_clicked;
     
    579548                        }
    580549                }
    581                 var paused = $('#prefs_form #auto_start')[0].checked;
     550                var paused = this.shouldAddedTorrentsStart();
    582551                for (i = 0; i < uris.length; ++i) {
    583552                        var uri = uris[i];
     
    605574        },
    606575
    607         savePrefsClicked: function()
    608         {
    609                 // handle the clutch prefs locally
    610                 var rate = parseInt ($('#prefs_form #refresh_rate')[0].value, 10);
    611                 if (rate != this[Prefs._RefreshRate])
    612                         this.setPref (Prefs._RefreshRate, rate);
    613 
    614                 var up_bytes        = parseInt($('#prefs_form #upload_rate').val(), 10),
    615                     dn_bytes        = parseInt($('#prefs_form #download_rate').val(), 10),
    616                     turtle_up_bytes = parseInt($('#prefs_form #turtle_upload_rate').val(), 10),
    617                     turtle_dn_bytes = parseInt($('#prefs_form #turtle_download_rate').val(), 10);
    618 
    619                 // pass the new prefs upstream to the RPC server
    620                 var o = { };
    621                 o[RPC._StartAddedTorrent]    = $('#prefs_form #auto_start')[0].checked;
    622                 o[RPC._PeerPort]             = parseInt($('#prefs_form #port').val(), 10);
    623                 o[RPC._UpSpeedLimit]         = up_bytes;
    624                 o[RPC._DownSpeedLimit]       = dn_bytes;
    625                 o[RPC._DownloadDir]          = $('#prefs_form #download_location').val();
    626                 o[RPC._UpSpeedLimited]       = $('#prefs_form #limit_upload').prop('checked');
    627                 o[RPC._DownSpeedLimited]     = $('#prefs_form #limit_download').prop('checked');
    628                 o[RPC._Encryption]           = $('#prefs_form #encryption').prop('checked')
    629                                                    ? RPC._EncryptionRequired
    630                                                    : RPC._EncryptionPreferred;
    631                 o[RPC._TurtleDownSpeedLimit] = turtle_dn_bytes;
    632                 o[RPC._TurtleUpSpeedLimit]   = turtle_up_bytes;
    633                 o[RPC._TurtleTimeEnabled]    = $('#prefs_form #turtle_schedule').prop('checked');
    634                 o[RPC._TurtleTimeBegin]      = parseInt($('#prefs_form #turtle_start_time').val(), 10);
    635                 o[RPC._TurtleTimeEnd]        = parseInt($('#prefs_form #turtle_end_time').val(), 10);
    636                 o[RPC._TurtleTimeDay]        = parseInt($('#prefs_form #turtle_days').val(), 10);
    637 
    638 
    639                 o[RPC._PeerLimitGlobal]      = parseInt($('#prefs_form #conn_global').val(), 10);
    640                 o[RPC._PeerLimitPerTorrent]  = parseInt($('#prefs_form #conn_torrent').val(), 10);
    641                 o[RPC._PexEnabled]           = $('#prefs_form #conn_pex').prop('checked');
    642                 o[RPC._DhtEnabled]           = $('#prefs_form #conn_dht').prop('checked');
    643                 o[RPC._LpdEnabled]           = $('#prefs_form #conn_lpd').prop('checked');
    644                 o[RPC._BlocklistEnabled]     = $('#prefs_form #block_enable').prop('checked');
    645                 o[RPC._BlocklistURL]         = $('#prefs_form #block_url').val();
    646                 o[RPC._UtpEnabled]           = $('#prefs_form #network_utp').prop('checked');
    647                 o[RPC._PeerPortRandom]       = $('#prefs_form #port_rand').prop('checked');
    648                 o[RPC._PortForwardingEnabled]= $('#prefs_form #port_forward').prop('checked');
    649 
    650                 this.remote.savePrefs(o);
    651 
    652                 this.hidePrefsDialog();
    653         },
    654 
    655576        removeClicked: function(ev) {
    656577                if (this.isButtonEnabled(ev)) {
     
    660581        },
    661582
    662         /*
    663          * 'Clutch Preferences' was clicked (isMobileDevice only)
    664          */
    665         releaseClutchPreferencesButton: function() {
    666                 $('div#prefs_container div#pref_error').hide();
    667                 $('div#prefs_container h2.dialog_heading').show();
    668                 this.showPrefsDialog();
    669         },
    670 
    671         getIntervalMsec: function(key, min)
    672         {
    673                 var interval = this[key];
    674                 if (!interval || (interval < min))
    675                         interval = min;
    676                 return interval * 1000;
    677         },
    678 
    679         /* Turn the periodic ajax session refresh on & off */
    680583        togglePeriodicSessionRefresh: function(enabled) {
     584                /* Turn the periodic ajax session refresh on & off */
    681585                clearInterval(this.sessionInterval);
    682586                delete this.sessionInterval;
    683587                if (enabled) {
    684                         var msec = this.getIntervalMsec(Prefs._SessionRefreshRate, 5);
    685                         this.sessionInterval = setInterval($.proxy(this.loadDaemonPrefs,this), msec);
     588                        var callback = $.proxy(this.loadDaemonPrefs,this),
     589                            msec = 8000;
     590                        this.sessionInterval = setInterval(callback, msec);
    686591                }
    687592        },
     
    692597                delete this.statsInterval;
    693598                if (enabled) {
    694                         var msec = this.getIntervalMsec(Prefs._SessionRefreshRate, 5);
    695                         this.statsInterval = setInterval($.proxy(this.loadDaemonStats,this), msec);
     599                        var callback = $.proxy(this.loadDaemonStats,this),
     600                            msec = 5000;
     601                        this.statsInterval = setInterval(callback, msec);
    696602                }
    697603        },
     
    699605        toggleTurtleClicked: function()
    700606        {
    701                 // toggle it
    702                 var p = Prefs._TurtleState;
    703                 this[p] = !this[p];
    704 
    705                 // send it to the session
    706                 var args = { };
    707                 args[RPC._TurtleState] = this[p];
    708                 this.remote.savePrefs(args);
    709         },
    710 
    711         updateTurtleButton: function() {
    712                 var enabled = this[Prefs._TurtleState],
    713                     w = $('#turtle-button'),
    714                     t = [ 'Click to ', (enabled?'disable':'enable'), ' Temporary Speed Limits',
    715                           '(', Transmission.fmt.speed(this._prefs[RPC._TurtleUpSpeedLimit]), 'up,',
    716                                Transmission.fmt.speed(this._prefs[RPC._TurtleDownSpeedLimit]), 'down)' ];
    717                 w.toggleClass('enabled',enabled);
    718                 w.attr('title', t.join(' '));
     607                var o = {};
     608                o[RPC._TurtleState] = !$('#turtle-button').hasClass('enabled');
     609                this.remote.savePrefs(o);
    719610        },
    720611
     
    725616         *--------------------------------------------*/
    726617
    727         showPrefsDialog: function() {
    728                 this.checkPort(true);
    729                 $('body').addClass('prefs_showing');
    730                 $('#prefs_container').fadeIn();
    731                 this.hideMobileAddressbar();
    732                 this.updateButtonStates();
    733                 this.togglePeriodicSessionRefresh(false);
    734         },
    735 
    736         hidePrefsDialog: function()
    737         {
    738                 $('body.prefs_showing').removeClass('prefs_showing');
    739                 if (isMobileDevice)
    740                         this.hideMobileAddressbar();
    741                 $('#prefs_container').fadeOut();
    742                 this.updateButtonStates();
    743                 this.togglePeriodicSessionRefresh(true);
    744         },
    745 
    746         /*
    747          * Process got some new session data from the server
    748          */
    749         updatePrefs: function(p)
    750         {
    751                 // remember them for later
    752                 this._prefs = p;
    753 
    754                 var up_limited        = p[RPC._UpSpeedLimited];
    755                 var dn_limited        = p[RPC._DownSpeedLimited];
    756                 var up_limit_k        = p[RPC._UpSpeedLimit];
    757                 var dn_limit_k        = p[RPC._DownSpeedLimit];
    758                 var turtle_up_limit_k = p[RPC._TurtleUpSpeedLimit];
    759                 var turtle_dn_limit_k = p[RPC._TurtleDownSpeedLimit];
    760 
    761                 if (p.units)
    762                         Transmission.fmt.updateUnits(p.units);
    763 
    764                 $('div.download_location input').val(      p[RPC._DownloadDir]);
    765                 $('div.port input').val(                   p[RPC._PeerPort]);
    766                 $('div.auto_start input').prop('checked',  p[RPC._StartAddedTorrent]);
    767                 $('input#limit_download').prop('checked',  dn_limited);
    768                 $('input#download_rate').val(              dn_limit_k);
    769                 $('input#limit_upload').prop('checked',    up_limited);
    770                 $('input#upload_rate').val(                up_limit_k);
    771                 $('input#refresh_rate').val(               p[Prefs._RefreshRate]);
    772                 $('div.encryption input').val(             p[RPC._Encryption] === RPC._EncryptionRequired);
    773                 $('input#turtle_download_rate').val(       turtle_dn_limit_k);
    774                 $('input#turtle_upload_rate').val(         turtle_up_limit_k);
    775                 $('input#turtle_schedule').prop('checked', p[RPC._TurtleTimeEnabled]);
    776                 $('select#turtle_start_time').val(         p[RPC._TurtleTimeBegin]);
    777                 $('select#turtle_end_time').val(           p[RPC._TurtleTimeEnd]);
    778                 $('select#turtle_days').val(               p[RPC._TurtleTimeDay]);
    779                 $('#transmission_version').text(           p[RPC._DaemonVersion]);
    780                 $('#conn_global').val(                     p[RPC._PeerLimitGlobal]);
    781                 $('#conn_torrent').val(                    p[RPC._PeerLimitPerTorrent]);
    782                 $('#conn_pex').prop('checked',             p[RPC._PexEnabled]);
    783                 $('#conn_dht').prop('checked',             p[RPC._DhtEnabled]);
    784                 $('#conn_lpd').prop('checked',             p[RPC._LpdEnabled]);
    785                 $('#block_enable').prop('checked',         p[RPC._BlocklistEnabled]);
    786                 $('#block_url').val(                       p[RPC._BlocklistURL]);
    787                 $('#block_size').text(                     p[RPC._BlocklistSize]+' IP rules in the list');
    788                 $('#network_utp').prop('checked',          p[RPC._UtpEnabled]);
    789                 $('#port_rand').prop('checked',            p[RPC._PeerPortRandom]);
    790                 $('#port_forward').prop('checked',         p[RPC._PortForwardingEnabled]);
    791 
    792                 if (!isMobileDevice)
    793                 {
    794                         setInnerHTML($('#limited_download_rate')[0], [ 'Limit (', Transmission.fmt.speed(dn_limit_k), ')' ].join(''));
    795                         var key = dn_limited ? '#limited_download_rate'
    796                                                : '#unlimited_download_rate';
    797                         $(key).deselectMenuSiblings().selectMenuItem();
    798 
    799                         setInnerHTML($('#limited_upload_rate')[0], [ 'Limit (', Transmission.fmt.speed(up_limit_k), ')' ].join(''));
    800                         key = up_limited ? '#limited_upload_rate'
    801                                          : '#unlimited_upload_rate';
    802                         $(key).deselectMenuSiblings().selectMenuItem();
    803                 }
    804 
    805                 this[Prefs._TurtleState] = p[RPC._TurtleState];
    806                 this.updateTurtleButton();
    807                 this.setCompactMode(p[Prefs._CompactDisplayState]);
    808         },
    809 
    810         updatePortStatus: function(status) {
    811                 if (status['port-is-open'])
    812                         $('#port_test').text('Port is open');
    813                 else
    814                         $('#port_test').text('Port is closed');
     618        showPrefsDialog: function()
     619        {
     620                this.prefsDialog.show();
    815621        },
    816622
    817623        showStatsDialog: function() {
    818624                this.loadDaemonStats();
    819                 $('body').addClass('stats_showing');
    820625                $('#stats_container').fadeIn();
    821626                this.hideMobileAddressbar();
     
    825630
    826631        hideStatsDialog: function() {
    827                 $('body.stats_showing').removeClass('stats_showing');
    828                 if (isMobileDevice)
    829                         this.hideMobileAddressbar();
    830632                $('#stats_container').fadeOut();
     633                this.hideMobileAddressbar();
    831634                this.updateButtonStates();
    832635                this.togglePeriodicStatsRefresh(false);
     
    869672        },
    870673
    871         /*
    872          * Process an event in the footer-menu
    873          */
    874         processSettingsMenuEvent: function(ev) {
    875                 var tr = this;
    876                 var $element = $(ev.target);
    877 
    878                 // Figure out which menu has been clicked
    879                 switch ($element.parent()[0].id) {
    880 
    881                                 // Display the preferences dialog
    882                         case 'footer_super_menu':
    883                                 if ($element[0].id === 'preferences') {
    884                                         $('div#prefs_container div#pref_error').hide();
    885                                         $('div#prefs_container h2.dialog_heading').show();
    886                                         tr.showPrefsDialog();
     674        updateGuiFromSession: function(o)
     675        {
     676                var limit, limited, e, b, text,
     677                    fmt = Transmission.fmt,
     678                    menu = $('#settings_menu');
     679
     680                this.prefsDialog.set(o);
     681
     682                if (RPC._TurtleState in o)
     683                {
     684                        b = o[RPC._TurtleState];
     685                        e = $('#turtle-button');
     686                        text = [ 'Click to ', (b?'disable':'enable'), ' Temporary Speed Limits (',
     687                                 fmt.speed(o[RPC._TurtleUpSpeedLimit]), ' up,',
     688                                 fmt.speed(o[RPC._TurtleDownSpeedLimit]), ' down)' ].join('');
     689                        e.toggleClass('enabled', b);
     690                        e.attr('title', text);
     691                }
     692
     693                if (this.isMenuEnabled && (RPC._DownSpeedLimited in o)
     694                                       && (RPC._DownSpeedLimit in o))
     695                {
     696                        limit = o[RPC._DownSpeedLimit];
     697                        limited = o[RPC._DownSpeedLimited];
     698
     699                        e = menu.find('#limited_download_rate');
     700                        e.html('Limit (' + fmt.speed(limit) + ')');
     701
     702                        if (!limited)
     703                                e = menu.find('#unlimited_download_rate');
     704                        e.deselectMenuSiblings().selectMenuItem();
     705                }
     706
     707                if (this.isMenuEnabled && (RPC._UpSpeedLimited in o)
     708                                       && (RPC._UpSpeedLimit in o))
     709                {
     710                        limit = o[RPC._UpSpeedLimit];
     711                        limited = o[RPC._UpSpeedLimited];
     712
     713                        e = menu.find('#limited_upload_rate');
     714                        e.html('Limit (' + fmt.speed(limit) + ')');
     715
     716                        if (!limited)
     717                                e = menu.find('#unlimited_upload_rate');
     718                        e.deselectMenuSiblings().selectMenuItem();
     719                }
     720        },
     721
     722        onMenuClicked: function(ev)
     723        {
     724                var o, dir,
     725                    id = ev.target.id,
     726                    remote = this.remote,
     727                    element = $(ev.target);
     728
     729                if (element.hasClass('sort-mode'))
     730                {
     731                        element.parent().find('.sort-mode').each(function() {
     732                                element.parent().deselectMenuItem();
     733                        });
     734                        element.selectMenuItem();
     735                        this.setSortMethod(id.replace(/sort_by_/, ''));
     736                }
     737                else if (element.hasClass('upload-speed'))
     738                {
     739                        o = {};
     740                        o[RPC._UpSpeedLimit] = parseInt(ev.target.innerHTML);
     741                        o[RPC._UpSpeedLimited] = true;
     742                        remote.savePrefs(o);
     743                }
     744                else if (element.hasClass('download-speed'))
     745                {
     746                        o = {};
     747                        o[RPC._DownSpeedLimit] = parseInt(ev.target.innerHTML);
     748                        o[RPC._DownSpeedLimited] = true;
     749                        remote.savePrefs(o);
     750                }
     751                else switch (id)
     752                {
     753                        case 'preferences':
     754                                this.showPrefsDialog();
     755                                break;
     756
     757                        case 'statistics':
     758                                $('div#stats_container div#stats_error').hide();
     759                                $('div#stats_container h2.dialog_heading').show();
     760                                this.showStatsDialog();
     761                                break;
     762
     763                        case 'homepage':
     764                                window.open('http://www.transmissionbt.com/');
     765                                break;
     766
     767                        case 'tipjar':
     768                                window.open('http://www.transmissionbt.com/donate.php');
     769                                break; 
     770
     771                        case 'unlimited_download_rate':
     772                                o = { };
     773                                o[RPC._DownSpeedLimited] = false;
     774                                remote.savePrefs(o);
     775                                break;
     776
     777                        case 'limited_download_rate':
     778                                o = { };
     779                                o[RPC._DownSpeedLimited] = true;
     780                                remote.savePrefs(o);
     781                                break;
     782
     783                        case 'unlimited_upload_rate':
     784                                o = {};
     785                                o[RPC._UpSpeedLimited] = false;
     786                                remote.savePrefs(o);
     787                                break;
     788
     789                        case 'limited_upload_rate':
     790                                o = {};
     791                                o[RPC._UpSpeedLimited] = true;
     792                                remote.savePrefs(o);
     793                                break;
     794
     795                        case 'reverse_sort_order':
     796                                if (element.menuItemIsSelected()) {
     797                                        dir = Prefs._SortAscending;
     798                                        element.deselectMenuItem();
     799                                } else {
     800                                        dir = Prefs._SortDescending;
     801                                        element.selectMenuItem();
    887802                                }
    888                                 else if ($element[0].id === 'statistics') {
    889                                         $('div#stats_container div#stats_error').hide();
    890                                         $('div#stats_container h2.dialog_heading').show();
    891                                         tr.showStatsDialog();
    892                                 }
    893                                 else if ($element[0].id === 'homepage') {
    894                                         window.open('http://www.transmissionbt.com/');
    895                                 }
    896                                 else if ($element[0].id === 'tipjar') {
    897                                         window.open('http://www.transmissionbt.com/donate.php');
    898                                 }
     803                                this.setSortDirection(dir);
    899804                                break;
    900805
    901                         // Limit the download rate
    902                         case 'footer_download_rate_menu':
    903                                 var args = { };
    904                                 if ($element.is('#unlimited_download_rate')) {
    905                                         $element.deselectMenuSiblings().selectMenuItem();
    906                                         args[RPC._DownSpeedLimited] = false;
    907                                 } else {
    908                                         var rate_str = $element[0].innerHTML;
    909                                         var rate_val = parseInt(rate_str, 10);
    910                                         setInnerHTML($('#limited_download_rate')[0], [ 'Limit (', Transmission.fmt.speed(rate_val), ')' ].join(''));
    911                                         $('#limited_download_rate').deselectMenuSiblings().selectMenuItem();
    912                                         $('div.preference input#download_rate')[0].value = rate_str;
    913                                         args[RPC._DownSpeedLimit] = rate_val;
    914                                         args[RPC._DownSpeedLimited] = true;
    915                                 }
    916                                 $('div.preference input#limit_download')[0].checked = args[RPC._DownSpeedLimited];
    917                                 tr.remote.savePrefs(args);
     806                        default:
     807                                console.log('unhandled: ' + id);
    918808                                break;
    919809
    920                         // Limit the upload rate
    921                         case 'footer_upload_rate_menu':
    922                                 var args = { };
    923                                 if ($element.is('#unlimited_upload_rate')) {
    924                                         $element.deselectMenuSiblings().selectMenuItem();
    925                                         args[RPC._UpSpeedLimited] = false;
    926                                 } else {
    927                                         var rate_str = $element[0].innerHTML;
    928                                         var rate_val = parseInt(rate_str, 10);
    929                                         setInnerHTML($('#limited_upload_rate')[0], [ 'Limit (', Transmission.fmt.speed(rate_val), ')' ].join(''));
    930                                         $('#limited_upload_rate').deselectMenuSiblings().selectMenuItem();
    931                                         $('div.preference input#upload_rate')[0].value = rate_str;
    932                                         args[RPC._UpSpeedLimit] = rate_val;
    933                                         args[RPC._UpSpeedLimited] = true;
    934                                 }
    935                                 $('div.preference input#limit_upload')[0].checked = args[RPC._UpSpeedLimited];
    936                                 tr.remote.savePrefs(args);
    937                                 break;
    938 
    939                         // Sort the torrent list
    940                         case 'footer_sort_menu':
    941 
    942                                 // The 'reverse sort' option state can be toggled independently of the other options
    943                                 if ($element.is('#reverse_sort_order')) {
    944                                         if (!$element.is('#reverse_sort_order.active')) break;
    945                                         var dir;
    946                                         if ($element.menuItemIsSelected()) {
    947                                                 $element.deselectMenuItem();
    948                                                 dir = Prefs._SortAscending;
    949                                         } else {
    950                                                 $element.selectMenuItem();
    951                                                 dir = Prefs._SortDescending;
    952                                         }
    953                                         tr.setSortDirection(dir);
    954 
    955                                 // Otherwise, deselect all other options (except reverse-sort) and select this one
    956                                 } else {
    957                                         $element.parent().find('span.selected').each(function() {
    958                                                 if (! $element.parent().is('#reverse_sort_order')) {
    959                                                         $element.parent().deselectMenuItem();
    960                                                 }
    961                                         });
    962                                         $element.selectMenuItem();
    963                                         var method = $element[0].id.replace(/sort_by_/, '');
    964                                         tr.setSortMethod(method);
    965                                 }
    966                                 break;
    967810                }
    968811                $('#settings_menu').trigger('closemenu');
    969                 return false; // to prevent the event from bubbling up
     812                ev.stopImmediatePropagation();
    970813        },
    971814
     
    999842                                this.dirtyTorrents[id] = true;
    1000843                                $(t).bind('dataChanged',$.proxy(this.onTorrentChanged,this));
    1001                                 if(!('name' in t.fields) || !('status' in t.fields)) // missing some fields...
     844                                // if we need them, ask for fields from the server...
     845                                if(!('name' in t.fields) || !('status' in t.fields))
    1002846                                        needinfo.push(id);
    1003847                        }
     
    1023867        refreshTorrents: function()
    1024868        {
     869                var callback = $.proxy(this.refreshTorrents,this),
     870                    msec = this[Prefs._RefreshRate] * 1000,
     871                    fields = ['id'].concat(Torrent.Fields.Stats);
     872
    1025873                // send a request right now
    1026                 this.updateTorrents('recently-active', ['id'].concat(Torrent.Fields.Stats));
     874                this.updateTorrents('recently-active', fields);
    1027875
    1028876                // schedule the next request
    1029877                clearTimeout(this.refreshTorrentsTimeout);
    1030                 this.refreshTorrentsTimeout = setTimeout($.proxy(this.refreshTorrents,this), this[Prefs._RefreshRate]*1000);
     878                this.refreshTorrentsTimeout = setTimeout(callback,msec);
    1031879        },
    1032880
    1033881        initializeTorrents: function()
    1034882        {
    1035                 this.updateTorrents(null, ['id'].concat(Torrent.Fields.Metadata, Torrent.Fields.Stats));
     883                var fields = ['id'].concat(Torrent.Fields.Metadata,
     884                                           Torrent.Fields.Stats);
     885                this.updateTorrents(null, fields);
    1036886        },
    1037887
     
    1109959        updateStatusbar: function()
    1110960        {
    1111                 var i, row,
     961                var i, row, text,
    1112962                    u=0, d=0,
    1113963                    fmt = Transmission.fmt,
     
    1122972                }
    1123973
    1124                 setInnerHTML($('#statusbar #speed-up-label')[0], u ? '&uarr; ' + fmt.speedBps(u) : '');
    1125                 setInnerHTML($('#statusbar #speed-dn-label')[0], d ? '&darr; ' + fmt.speedBps(d) : '');
     974                text = u ? '&uarr; ' + fmt.speedBps(u) : '';
     975                setInnerHTML($('#statusbar #speed-up-label')[0], text);
     976
     977                text = d ? '&darr; ' + fmt.speedBps(d) : '';
     978                setInnerHTML($('#statusbar #speed-dn-label')[0], text);
     979        },
     980
     981        shouldAddedTorrentsStart: function()
     982        {
     983                return this.prefsDialog.shouldAddedTorrentsStart();
    1126984        },
    1127985
     
    1136994                        $('input#torrent_upload_file').attr('value', '');
    1137995                        $('input#torrent_upload_url').attr('value', '');
    1138                         $('input#torrent_auto_start').attr('checked', $('#prefs_form #auto_start')[0].checked);
     996                        $('input#torrent_auto_start').attr('checked', this.shouldAddedTorrentsStart());
    1139997                        $('#upload_container').show();
    1140998                        $('#torrent_upload_url').focus();
     
    11741032                if (torrents.length === 1)
    11751033                {
    1176                         var torrent = torrents[0];
    1177                         var header = 'Remove ' + torrent.getName() + '?';
    1178                         var message = 'Once removed, continuing the transfer will require the torrent file. Are you sure you want to remove it?';
     1034                        var torrent = torrents[0],
     1035                            header = 'Remove ' + torrent.getName() + '?',
     1036                            message = 'Once removed, continuing the transfer will require the torrent file. Are you sure you want to remove it?';
    11791037                        dialog.confirm(header, message, 'Remove', 'transmission.removeTorrents', torrents);
    11801038                }
    11811039                else
    11821040                {
    1183                         var header = 'Remove ' + torrents.length + ' transfers?';
    1184                         var message = 'Once removed, continuing the transfers will require the torrent files. Are you sure you want to remove them?';
     1041                        var header = 'Remove ' + torrents.length + ' transfers?',
     1042                            message = 'Once removed, continuing the transfers will require the torrent files. Are you sure you want to remove them?';
    11851043                        dialog.confirm(header, message, 'Remove', 'transmission.removeTorrents', torrents);
    11861044                }
     
    11921050                {
    11931051                        var torrent = torrents[0],
    1194                                 header = 'Remove ' + torrent.getName() + ' and delete data?',
    1195                                 message = 'All data downloaded for this torrent will be deleted. Are you sure you want to remove it?';
     1052                            header = 'Remove ' + torrent.getName() + ' and delete data?',
     1053                            message = 'All data downloaded for this torrent will be deleted. Are you sure you want to remove it?';
    11961054                        dialog.confirm(header, message, 'Remove', 'transmission.removeTorrentsAndData', torrents);
    11971055                }
     
    11991057                {
    12001058                        var header = 'Remove ' + torrents.length + ' transfers and delete data?',
    1201                                 message = 'All data downloaded for these torrents will be deleted. Are you sure you want to remove them?';
     1059                            message = 'All data downloaded for these torrents will be deleted. Are you sure you want to remove them?';
    12021060                        dialog.confirm(header, message, 'Remove', 'transmission.removeTorrentsAndData', torrents);
    12031061                }
     
    12051063
    12061064        removeTorrents: function(torrents) {
    1207                 var ids = $.map(torrents, function(t) { return t.getId(); });
     1065                var ids = this.getTorrentIds(torrents);
    12081066                this.remote.removeTorrents(ids, this.refreshTorrents, this);
    12091067        },
     
    12301088                this.startTorrents([ torrent ], false);
    12311089        },
     1090
     1091        getTorrentIds: function(torrents) {
     1092                return $.map(torrents.slice(0), function(t) {return t.getId();});
     1093        },
    12321094        startTorrents: function(torrents, force) {
    1233                 this.remote.startTorrents($.map(torrents, function(t) {return t.getId();}),
    1234                                           force, this.refreshTorrents, this);
     1095                this.remote.startTorrents(this.getTorrentIds(torrents), force,
     1096                                          this.refreshTorrents, this);
    12351097        },
    12361098        verifyTorrent: function(torrent) {
     
    12381100        },
    12391101        verifyTorrents: function(torrents) {
    1240                 this.remote.verifyTorrents($.map(torrents, function(t) {return t.getId();}),
     1102                this.remote.verifyTorrents(this.getTorrentIds(torrents),
    12411103                                           this.refreshTorrents, this);
    12421104        },
     
    12461108        },
    12471109        reannounceTorrents: function(torrents) {
    1248                 this.remote.reannounceTorrents($.map(torrents, function(t) {return t.getId();}),
     1110                this.remote.reannounceTorrents(this.getTorrentIds(torrents),
    12491111                                               this.refreshTorrents, this);
    12501112        },
     
    12601122        },
    12611123        stopTorrents: function(torrents) {
    1262                 this.remote.stopTorrents($.map(torrents.slice(0), function(t) {return t.getId();}),
     1124                this.remote.stopTorrents(this.getTorrentIds(torrents),
    12631125                                         this.refreshTorrents, this);
    12641126        },
     
    12691131        hideMobileAddressbar: function(delaySecs) {
    12701132                if (isMobileDevice && !scroll_timeout) {
    1271                         var delayMsec = delaySecs*1000 || 150;
    1272                         scroll_timeout = setTimeout($.proxy(this.doToolbarHide,this), delayMsec);
     1133                        var callback = $.proxy(this.doToolbarHide,this),
     1134                            msec = delaySecs*1000 || 150;
     1135                        scroll_timeout = setTimeout(callback,msec);
    12731136                }
    12741137        },
     
    13081171        {
    13091172                if (!this.buttonRefreshTimer)
    1310                         this.buttonRefreshTimer = setTimeout($.proxy(this.updateButtonStates,this), 100);
     1173                {
     1174                        var callback = $.proxy(this.updateButtonStates,this),
     1175                            msec = 100;
     1176                        this.buttonRefreshTimer = setTimeout(callback, msec);
     1177                }
    13111178        },
    13121179
    13131180        updateButtonStates: function()
    13141181        {
     1182                var e = this.elements,
     1183                    haveActive = false,
     1184                    havePaused = false,
     1185                    haveSelection = false,
     1186                    haveActiveSelection = false,
     1187                    havePausedSelection = false;
     1188
    13151189                clearTimeout(this.buttonRefreshTimer);
    13161190                delete this.buttonRefreshTimer;
    13171191
    1318                 var showing_dialog = new RegExp("(prefs_showing|dialog_showing|open_showing)").test(document.body.className);
    1319                 this._toolbar_buttons.toggleClass('disabled', showing_dialog);
    1320 
    1321                 if (!showing_dialog)
    1322                 {
    1323                         var haveSelection = false,
    1324                             haveActive = false,
    1325                             haveActiveSelection = false,
    1326                             havePaused = false,
    1327                             havePausedSelection = false;
    1328 
    1329                         for (var i=0, row; row=this._rows[i]; ++i) {
    1330                                 var isStopped = row.getTorrent().isStopped();
    1331                                 var isSelected = row.isSelected();
    1332                                 if (!isStopped) haveActive = true;
    1333                                 if (isStopped) havePaused = true;
    1334                                 if (isSelected) haveSelection = true;
    1335                                 if (isSelected && !isStopped) haveActiveSelection = true;
    1336                                 if (isSelected && isStopped) havePausedSelection = true;
    1337                         }
    1338 
    1339                         this.setEnabled(this._toolbar_pause_button,       haveActiveSelection);
    1340                         this.setEnabled(this._context_pause_button,       haveActiveSelection);
    1341                         this.setEnabled(this._toolbar_start_button,       havePausedSelection);
    1342                         this.setEnabled(this._context_start_button,       havePausedSelection);
    1343                         this.setEnabled(this._context_move_top_button,    haveSelection);
    1344                         this.setEnabled(this._context_move_up_button,     haveSelection);
    1345                         this.setEnabled(this._context_move_down_button,   haveSelection);
    1346                         this.setEnabled(this._context_move_bottom_button, haveSelection);
    1347                         this.setEnabled(this._context_start_now_button,   havePausedSelection);
    1348                         this.setEnabled(this._toolbar_remove_button,      haveSelection);
    1349                         this.setEnabled(this._toolbar_pause_all_button,   haveActive);
    1350                         this.setEnabled(this._toolbar_start_all_button,   havePaused);
    1351                 }
     1192                for (var i=0, row; row=this._rows[i]; ++i) {
     1193                        var isStopped = row.getTorrent().isStopped();
     1194                        var isSelected = row.isSelected();
     1195                        if (!isStopped) haveActive = true;
     1196                        if (isStopped) havePaused = true;
     1197                        if (isSelected) haveSelection = true;
     1198                        if (isSelected && !isStopped) haveActiveSelection = true;
     1199                        if (isSelected && isStopped) havePausedSelection = true;
     1200                }
     1201
     1202                this.setEnabled(e.toolbar_pause_button,       haveActiveSelection);
     1203                this.setEnabled(e.context_pause_button,       haveActiveSelection);
     1204                this.setEnabled(e.toolbar_start_button,       havePausedSelection);
     1205                this.setEnabled(e.context_start_button,       havePausedSelection);
     1206                this.setEnabled(e.context_move_top_button,    haveSelection);
     1207                this.setEnabled(e.context_move_up_button,     haveSelection);
     1208                this.setEnabled(e.context_move_down_button,   haveSelection);
     1209                this.setEnabled(e.context_move_bottom_button, haveSelection);
     1210                this.setEnabled(e.context_start_now_button,   havePausedSelection);
     1211                this.setEnabled(e.toolbar_remove_button,      haveSelection);
     1212                this.setEnabled(e.toolbar_pause_all_button,   haveActive);
     1213                this.setEnabled(e.toolbar_start_all_button,   havePaused);
    13521214        },
    13531215
     
    13681230        setInspectorVisible: function(visible)
    13691231        {
     1232                if (visible)
     1233                        this.inspector.setTorrents(this.getSelectedTorrents());
     1234
    13701235                // update the ui widgetry
    13711236                $('#torrent_inspector').toggle(visible);
     
    13791244                }
    13801245                setInnerHTML($('ul li#context_toggle_inspector')[0], (visible?'Hide':'Show')+' Inspector');
    1381 
    1382                 if (visible)
    1383                         this.inspector.setTorrents(this.getSelectedTorrents());
    13841246        },
    13851247
     
    13951257                popup.dialog({
    13961258                        autoOpen: false,
    1397                         position: isMobileDevice ? [0,0] : [40,80],
     1259                        position: isMobileDevice ? 'center' : [40,80],
    13981260                        show: 'blind',
    13991261                        hide: 'blind',
     
    14251287
    14261288                // count the total number of torrents
    1427                 // torrent_count = Object.keys(this._torrents).length; // IE8 doesn't support Object.keys(
    14281289                torrent_count = 0;
    14291290                o = this._torrents;
     
    14531314        {
    14541315                if (!this.refilterTimer) {
    1455                         var tr = this;
    1456                         this.refilterTimer = setTimeout(function(){tr.refilter(false);}, 100);
     1316                        var tr = this,
     1317                            callback = function(){tr.refilter(false);},
     1318                            msec = 100;
     1319                        this.refilterTimer = setTimeout(callback, msec);
    14571320                }
    14581321        },
     
    14861349                    filter_tracker = this.filterTracker,
    14871350                    renderer = this.torrentRenderer,
    1488                     list = this._torrent_list,
     1351                    list = this.elements.torrent_list,
    14891352                    old_sel_count = $(list).children('.selected').length;
    14901353
     
    16531516                ***/
    16541517
    1655                 var trackers = this.getTrackers();
    1656                 //var names = Object.keys(trackers).sort(); (IE8 doesn't have Object.keys)
    1657                 var name, name=[];
    1658                 var names = [];
    1659                 for  (name in trackers)
     1518                var trackers = this.getTrackers(),
     1519                    name, name=[],
     1520                    names = [];
     1521                for (name in trackers)
    16601522                        names.push (name);
    16611523                names.sort();
  • trunk/web/stylesheets/common.css

    r12857 r12865  
    5151        height: 75px;
    5252        margin: 0;
    53         border: 1px outset #AEBBCB;
     53        border: 1px outset #AEBBCB;
    5454        overflow: hidden;
    5555        -moz-user-select: none;
    5656        -webkit-user-select: none;
    57 }
    58 
    59 #toolbar h1 {
    60         height: inherit;
    61         width: 205px;
    62         text-indent: -9000px !important;
    63         padding: 0;
    64         margin: 0 0 0 5px;
    6557}
    6658
     
    215207}
    216208#filter-popup .row {
    217         font-size: 1.2em;
    218209        text-align: left;
    219210        cursor: pointer;
     
    483474li.torrent a:active div.torrent_resume {
    484475        background-position: center bottom;
     476}
     477
     478/***
     479****
     480****  PREFERENCES
     481****
     482***/
     483
     484#prefs-dialog.ui-tabs .ui-tabs-panel {
     485        padding: 0px;
     486        -moz-user-select: none;
     487        -webkit-user-select: none;
     488}
     489.prefs-section {
     490        margin: 10px;
     491        text-align: left;
     492}
     493.prefs-section > * {
     494        padding-top: 8px;
     495        padding-left: 8px;
     496}
     497.prefs-section .title {
     498        font-weight: bold;
     499        padding-left: 0px;
     500}
     501.prefs-section .row .key {
     502        float: left;
     503        padding-top: 3px;
     504}
     505.prefs-section .row .key > * {
     506        margin-left: 0px;
     507}
     508.prefs-section .row .value {
     509        margin-left: 150px;
     510}
     511.prefs-section .row .value > * {
     512        width: 100%;
     513}
     514.prefs-section .checkbox-row > input {
     515        margin: 0px;
     516}
     517.prefs-section .checkbox-row > label {
     518        margin-left: 5px;
    485519}
    486520
     
    867901}
    868902
    869 /*--------------------------------------
    870  *
    871  * T O R R E N T   F O O T E R
    872  *
    873  *--------------------------------------*/
     903
     904/****
     905*****
     906*****  MAIN WINDOW FOOTER
     907*****
     908****/
    874909
    875910div.torrent_footer {
     
    901936        position: relative;
    902937}
    903 div.torrent_footer ul#settings_menu li#button:active,
    904 div.torrent_footer ul#settings_menu li#button:hover {
     938div.torrent_footer ul#settings_menu li#button:hover,
     939div.torrent_footer ul#settings_menu li#button:active {
    905940        background-position: -32px top;
    906941}
     
    909944        background: transparent url('../images/graphics/chrome.png') left -18px no-repeat;
    910945}
    911 #turtle-button:active,
    912 #turtle-button:hover {
     946#turtle-button:hover,
     947#turtle-button:active {
    913948        background-position: -32px -18px;
    914949}
     
    916951        background-position: left -36px;
    917952}
    918 #turtle-button.enabled:active,
    919 #turtle-button.enabled:hover {
     953#turtle-button.enabled:hover,
     954#turtle-button.enabled:active {
    920955        background-position: -32px -36px;
    921956}
    922957
    923958#compact-button {
    924         background: transparent url('../images/graphics/chrome.png') left -54px no-repeat;
    925 }
    926 #compact-button:active,
    927 #compact-button:hover {
     959        background: transparent url('../images/graphics/chrome.png') left -54px no-repeat;
     960}
     961#compact-button:hover,
     962#compact-button:active {
    928963        background-position: -32px -54px;
    929964}
     
    931966        background-position: left -72px;
    932967}
    933 #compact-button.enabled:active,
    934 #compact-button.enabled:hover {
     968#compact-button.enabled:hover,
     969#compact-button.enabled:active {
    935970        background-position: -32px -72px;
    936971}
    937972
    938 
    939 
    940 /*--------------------------------------
    941  *
    942  * D I A L O G S
    943  *
    944  *--------------------------------------*/
     973#prefs-button {
     974        display: none;
     975}
     976
     977
     978/****
     979*****
     980*****  DIALOGS
     981*****
     982****/
    945983
    946984div.dialog_container {
     
    10741112}
    10751113
    1076 div#prefs_container label {
    1077         display: block;
    1078         margin: 0 0 0 2px;
    1079 }
    1080 
    1081 div#prefs_container label.category {
    1082         clear: both;
    1083         font-size: 1.2em;
    1084 }
    1085 
    1086 div#prefs_container label.item {
    1087         font-size: 11px !important;
    1088         margin: 0 5px 0 20px;
    1089         float: left;
    1090 }
    1091 
    1092 div#prefs_container label.suffix {
    1093         margin: 0 5px 0 10px;
    1094         float: left;
    1095 }
    1096 
    1097 div#prefs_container div.formdiv.checkbox label.item {
    1098         margin: 0 5px 0 2px;
    1099 }
    1100 
    1101 div#prefs_container div.limit_total label.item {
    1102         width: 102px;
    1103 }
    1104 
    1105 div#prefs_container div.limit_turtle label.item {
    1106         width: 120px;
    1107 }
    1108 
    1109 div#prefs_container div.preference input[type=checkbox] {
    1110         float: left;
    1111         margin-left: 20px;
    1112         margin-top: 9px;
    1113 }
    1114 @-moz-document url-prefix() {
    1115         div#prefs_container div.preference input[type=checkbox] {
    1116                 margin-top: 8px;
    1117         }
    1118 }
    1119 
    1120 div#prefs_container div.preference input[type=text] {
    1121         width: 50px;
    1122         padding: 0px !important;
    1123         height: 18px;
    1124         margin-top: 2px;
    1125 }
    1126 
    1127 div#prefs_container div.preference input {
    1128         float: left;
    1129 }
    1130 
    1131 div#prefs_container div.block_url input {
    1132         width: 256px !important;
    1133 }
    1134 
    1135 div#prefs_container div.download_location input {
    1136         width: 256px !important;
    1137 }
    1138 div#prefs_container div.download_location .checkbox input {
    1139         width: auto !important;
    1140 }
    1141 
    1142 div#prefs_container div.formdiv {
    1143         clear: both;
    1144         line-height: 30px;
    1145 }
    1146 
    1147 div#prefs_container a {
    1148         clear: left;
    1149         margin: 10px 5px 10px 7px;
    1150 }
    1151 
    1152 div#prefs_container h2.dialog_heading {
    1153         display: none;
    1154 }
    1155 
    1156 div#prefs_container div#prefs_tabs {
    1157         clear: both;
    1158 }
    1159 div#prefs_container div#prefs_tabs ul {
    1160         margin: 0;
    1161         padding: 0 0 0 10px;
    1162 }
    1163 .prefs-tab {
    1164         cursor: pointer;
    1165         display: block;
    1166         float: left;
    1167         font-size: 1.2em;
    1168         color: #323232;
    1169         text-align: center;
    1170         padding: 2px 20px;
    1171         border: 1px solid #787878;
    1172         margin-bottom: -1px;
    1173         background: #C0C8D6 url('../images/graphics/filter_bar.png') bottom repeat-x;
    1174 }
    1175 .prefs-tab.selected {
    1176         background: none;
    1177         border-bottom: 1px solid #efefef;
    1178 }
    1179 .prefs-page {
    1180         border-top: 1px solid #787878;
    1181         clear: both;
    1182         padding: 7px;
    1183 }
    11841114div#stats_container h2.dialog_heading {
    11851115        display: none;
     
    12361166}
    12371167
    1238 div#prefs_container div#pref_error {
    1239         display: none;
    1240         width: 395px;
    1241         margin: 6px auto 6px auto;
    1242         padding: 3px 0 3px 0;
    1243         border: 2px solid #cc3333;
    1244         color: #cc3333;
    1245         font-size: 1.2em;
    1246         vertical-align: middle;
    1247         text-align: center;
    1248         height: 20px;
    1249         line-height: 20px;
    1250         background-color: #FFEFEF;
    1251 }
    1252 
    1253 #transmission_version{
    1254         position: absolute;
    1255         bottom: 10px;
    1256         left:   10px;
    1257         color:  #999;
    1258 }
    1259 
    1260 /*--------------------------------------
    1261  *
    1262  * T R A N S   M E N U
    1263  *
    1264  *--------------------------------------*/
     1168/****
     1169*****
     1170*****  POPUP MENU
     1171*****
     1172****/
    12651173
    12661174.trans_menu {
     
    12981206.trans_menu > * li {
    12991207        margin: 0;
    1300         padding: 0 10px 2px 20px !important;
     1208        padding: 3px 10px 3px 20px !important;
    13011209        color: #000;
    1302         font-size: 14px;
    13031210        cursor: default;
    13041211        text-indent: auto !important;
     
    13231230.trans_menu li span.arrow {
    13241231        float: right;
    1325         margin: 3px 0 0;
    1326         font-size: 11px;
    1327         color: #333;
    1328         text-shadow: none;
    13291232}
    13301233
     
    13351238.trans_menu span.selected {
    13361239        margin: 0 3px 0 -15px;
    1337         font-size: 14px;
    13381240        color: #666;
    13391241        float: left;
  • trunk/web/stylesheets/mobile.css

    r12794 r12865  
    1313body {
    1414        font: 11px Helvetica, Arial, sans-serif;
    15         color: #323232 !important;
    16         background: #fff;
     15        background: #FFF;
    1716        text-align: center;
    1817        margin: 0;
     
    6665        background: #6685a1 url('../images/graphics/iphone_chrome.png') top left repeat-x;
    6766        border: 1px outset #AEBBCB;
    68         position: relative;
    69         text-shadow: 0 -1px 0 #446;
    7067}
    7168
     
    7370        margin: 0;
    7471        padding: 0 3px;
    75         text-align: left;
     72        text-align: center;
    7673}
    7774
     
    7976        list-style-type: none;
    8077        list-style-image: none;
    81         padding: 0;
    8278        margin: 4px 0 0 0;
     79        padding: 0 2px;
     80        cursor: pointer;
    8381        display: inline-block;
    8482}
    8583
    86 #toolbar li#remove, li#open {
     84#toolbar li#remove, li#open, li#resume_selected, li#pause_selected {
    8785        float: left;
    8886}
     
    104102}
    105103
    106 #toolbar ul li.disabled {
    107         opacity: 0.25;
    108 }
    109 
    110 #toolbar ul li div div.toolbar_image {
     104#toolbar ul li div.toolbar_image {
    111105        width: 32px;
    112106        height: 32px;
     
    133127li#inspector       div:active div.toolbar_image { background-position: right -224px; }
    134128
     129#toolbar ul li.disabled > div {
     130        text-shadow: 0 1px 0 #fff;
     131        opacity: 0.25;
     132        cursor: default;
     133}
     134
    135135#toolbar ul li#filter,
    136136#toolbar ul li#inspector,
     
    208208}
    209209#filter-popup .row {
    210         font-size: 1.2em;
    211210        text-align: left;
    212211        cursor: pointer;
     
    214213        position: relative;
    215214        height: 18px;
     215        -moz-user-select: none;
     216        -webkit-user-select: none;
    216217}
    217218div#filter-popup .row .filter-img {
     
    257258
    258259ul.torrent_list {
    259         width: 100%;
    260260        margin: 0;
    261261        padding: 0;
     
    298298
    299299ul.torrent_list li.torrent.selected {
    300         background-color: #3875D7;
     300        background-color: #3879D7;
    301301        color: #FFF;
    302302}
    303303
    304304ul.torrent_list li.torrent div.torrent_name {
    305         font-size: 13px;
     305        font-size: 1.3em;
    306306        font-weight: bold;
    307307        overflow: hidden;
     
    326326}
    327327
    328 div.torrent_peer_details {
    329         font-size: 10px;
    330 }
     328ul.torrent_list div.torrent_progress_details,
     329ul.torrent_list div.torrent_peer_details {
     330        clear: left;
     331        font-size: 1em;
     332        overflow: hidden;
     333        text-overflow: ellipsis;
     334        white-space: nowrap;
     335}
     336
     337ul.torrent_list li.torrent div.torrent_progress_details.error {
     338        color: #FF0000;
     339}
     340ul.torrent_list li.torrent.selected div.torrent_progress_details.error {
     341        color: #FFF;
     342}
     343ul.torrent_list li.torrent div.torrent_peer_details.error {
     344        color: #FF0000;
     345}
     346ul.torrent_list li.torrent.selected div.torrent_peer_details.error {
     347        color: #FFF;
     348}
     349
    331350
    332351/**
     
    403422}
    404423ul.torrent_list div.torrent_progress_bar.complete.leeching.queued {
    405         background-position: left -70px;
    406         border-color: #889CA5;
     424        background-position: left -70px;
     425        border-color: #889CA5;
    407426}
    408427ul.torrent_list div.torrent_progress_bar.incomplete.leeching {
     
    411430}
    412431ul.torrent_list div.torrent_progress_bar.incomplete.leeching.queued {
    413         background-position: left -80px;
    414         border-color: #C4C4C4;
     432        background-position: left -80px;
     433        border-color: #C4C4C4;
    415434}
    416435ul.torrent_list div.torrent_progress_bar.complete.seeding {
     
    419438}
    420439ul.torrent_list div.torrent_progress_bar.complete.seeding.queued {
    421         background-position: left -60px;
    422         border-color: #8A998D;
     440        background-position: left -60px;
     441        border-color: #8A998D;
    423442}
    424443ul.torrent_list div.torrent_progress_bar.incomplete.seeding {
     
    475494}
    476495
    477 div.dialog_container a#dialog_cancel_button, div.dialog_container a#prefs_cancel_button {
    478         left: 55px;
    479 }
    480 
    481 div.dialog_container a#dialog_confirm_button, div.dialog_container a#prefs_save_button {
    482         right: 55px;
    483         color: black;
    484         text-shadow: none;
    485         background: #fff;
    486 }
    487 
    488496#dialog_container div.dialog_window img {
    489497        margin: 5px auto 12px;
     
    515523}
    516524
    517 /*--------------------------------------
    518  *
    519  * P R E F S   C O N T A I N E R
    520  *
    521  *--------------------------------------*/
    522 
    523 div#prefs_container {
    524         text-align: left;
    525 }
    526 
    527 div#prefs_container label.item {
    528         margin: 0 5px 0 15px;
     525/***
     526****
     527****  PREFERENCES
     528****
     529***/
     530
     531#prefs-dialog.ui-tabs .ui-tabs-panel {
     532        padding: 0px;
     533        -moz-user-select: none;
     534        -webkit-user-select: none;
     535}
     536.prefs-section {
     537        margin: 10px;
     538        text-align: left;
     539}
     540.prefs-section > * {
     541        padding-top: 8px;
     542        padding-left: 8px;
     543}
     544.prefs-section .title {
     545        font-weight: bold;
     546        padding-left: 0px;
     547}
     548.prefs-section .row .key {
    529549        float: left;
    530 }
    531 
    532 form#prefs_form {
    533         height: 365px;
    534         padding: 0 5px;
    535 }
    536 
    537 div#prefs_container label.suffix {
    538         margin: 0 5px 0 10px;
    539         float: left;
    540 }
    541 
    542 div#prefs_container input {
    543         float: left;
    544 }
    545 
    546 div#prefs_container div.preference input[type=checkbox] {
    547         margin: 3px 7px 0 16px;
    548         width: 18px;
    549         height: 18px;
    550         clear: left;
    551 }
    552 
    553 div#prefs_container label {
    554         line-height: 25px;
    555         display: block;
    556 }
    557 
    558 div#prefs_container div.download_location label.item,
    559 div#prefs_container div.port label.item,
    560 div#prefs_container div.web_gui label.item {
    561         width: 127px;
    562         clear: left;
    563 }
    564 
    565 div#prefs_container div.auto_start label.item,
    566 div#prefs_container div.encryption label.item,
    567 div#prefs_container div.limit_total label.item {
    568         margin: 0 5px 0 0;
    569 }
    570 
    571 div#prefs_container div.limit_total label.item {
    572         width: 101px;
    573 }
    574 
    575 div#prefs_container div.preference input[type=text] {
    576         padding: 2px 2px 1px;
    577         text-shadow: none !important;
    578         font-size: 13px;
    579         width: 50px;
    580 }
    581 
    582 div#prefs_container div.download_location input {
    583         position: absolute;
    584         right: 20px;
    585         left: 160px;
    586         width: auto !important;
    587 }
    588 
    589 div#prefs_container label.category {
    590         clear: both;
    591         font-weight: bold;
    592 }
    593 
    594 div#prefs_container a {
    595         margin-top: 42px !important;
    596 }
    597 
    598 .landscape div.dialog_container a#prefs_cancel_button {
    599         left: 135px;
    600 }
    601 
    602 .landscape div.dialog_container a#prefs_save_button {
    603         right: 135px;
     550        padding-top: 3px;
     551}
     552.prefs-section .row .key > * {
     553        margin-left: 0px;
     554}
     555.prefs-section .row .value {
     556        margin-left: 150px;
     557}
     558.prefs-section .row .value > * {
     559        width: 100%;
     560}
     561.prefs-section .checkbox-row > input {
     562        margin: 0px;
     563}
     564.prefs-section .checkbox-row > label {
     565        margin-left: 5px;
    604566}
    605567
     
    631593        margin: 0;
    632594        overflow: hidden;
    633         word-wrap: break-word;
    634595}
    635596div#torrent_inspector #torrent_inspector_size {
    636597        font-size: 1.2em;
    637         margin: 3;
     598        margin: 3px;
    638599        display: block;
    639600        padding-top: 2px;
     
    790751li.inspector_torrent_file_list_entry.skip>.inspector_torrent_file_list_entry_name {
    791752        color: #666;
    792 }
    793 li.inspector_torrent_file_list_entry.even {
    794         background-color: #EEEEEE;
    795753}
    796754div.inspector_torrent_file_list_entry_progress {
     
    837795}
    838796div.file_priority_control.normal {
     797        background-position: left top;
     798}
     799div.file_priority_control.normal:hover {
    839800        background-position: right top;
    840801}
    841802div.file_priority_control.high {
     803        background-position: left -19px;
     804}
     805div.file_priority_control.high:hover {
    842806        background-position: right -19px;
    843807}
    844808div.file_priority_control.low {
     809        background-position: left -38px;
     810}
     811div.file_priority_control.low:hover {
    845812        background-position: right -38px;
    846813}
     
    851818
    852819
     820/****
     821*****
     822*****  MAIN WINDOW FOOTER
     823*****
     824****/
     825
     826div.torrent_footer {
     827        height: 20px;
     828        padding: 1px;
     829        border-top: 1px solid #555;
     830        position: relative;
     831        width: 100%;
     832        z-index: 3;
     833        background-color: #6b83a1;
     834}
     835
     836div.torrent_footer > * {
     837        position: relative;
     838        float: left;
     839        margin-right: 30px;
     840}
     841div.torrent_footer > * {
     842        height: 18px;
     843        width: 32px;
     844        cursor: pointer;
     845        -moz-user-select: none;
     846        -webkit-user-select: none;
     847}
     848
     849div.torrent_footer ul#settings_menu {
     850        display: none;
     851}
     852
     853#turtle-button {
     854        background: transparent url('../images/graphics/chrome.png') left -18px no-repeat;
     855}
     856#turtle-button:active {
     857        background-position: -32px -18px;
     858}
     859#turtle-button.enabled {
     860        background-position: left -36px;
     861}
     862#turtle-button.enabled:active {
     863        background-position: -32px -36px;
     864}
     865
     866#compact-button {
     867        background: transparent url('../images/graphics/chrome.png') left -54px no-repeat;
     868}
     869#compact-button:active {
     870        background-position: -32px -54px;
     871}
     872#compact-button.enabled {
     873        background-position: left -72px;
     874}
     875#compact-button.enabled:active {
     876        background-position: -32px -72px;
     877}
     878
     879#prefs-button {
     880        background: transparent url('../images/graphics/chrome.png') left -90px no-repeat;
     881}
     882#prefs-button:active {
     883        background-position: -32px -90px;
     884}
     885
     886/****
     887*****
     888*****  POPUP MENU
     889*****
     890****/
     891
     892.trans_menu,
     893.trans_menu * {
     894        display: none;
     895}
     896
     897
    853898/*--------------------------------------
    854899 *
    855  * T O R R E N T   F O O T E R
     900 * Hide remnants of stuff we don't need, like
     901 * transmenu and contextmenu.
    856902 *
    857903 *--------------------------------------*/
    858904
    859 div.torrent_footer {
    860         margin: 0px;
    861         height: 20px;
    862         border-top: 1px solid #777;
    863         position: relative;
    864         width: 100%;
    865         z-index: 2;
    866         text-align: center;
    867         color: #222;
    868         text-shadow: 0 1px 1px #fff;
    869         overflow: hidden;
    870 
    871         background-color: #B9B9B9; /* fallback color if gradients are not supported */
    872         background-image: -webkit-gradient(linear, left top, left bottom, from(#C9C9C9), to(#A7A7A7));
    873         background-image: -webkit-linear-gradient(top, #C9C9C9, #A7A7A7);
    874         background-image:    -moz-linear-gradient(top, #C9C9C9, #A7A7A7);
    875         background-image:     -ms-linear-gradient(top, #C9C9C9, #A7A7A7);
    876         background-image:      -o-linear-gradient(top, #C9C9C9, #A7A7A7);
    877         background-image:         linear-gradient(top, #C9C9C9, #A7A7A7); /* standard, but currently unimplemented */
    878 }
    879 
    880 div.torrent_footer div#disk_space_container, div.torrent_footer a#preferences_link {
    881         float: right;
    882         font-size: 12px;
    883         vertical-align: middle;
    884         margin: 1px 6px 0 0;
    885         padding: 2px 0 2px;
    886         max-width: 55%;
    887         overflow: hidden;
    888         white-space: nowrap;
    889         text-overflow: ellipsis;
    890 }
    891 
    892 div.torrent_footer a#preferences_link {
    893         float: left;
    894         font-weight: bold;
    895         margin: 1px 0 0 6px;
    896 }
    897 
    898 body.prefs_showing div.torrent_footer a#preferences_link, body.dialog_showing div.torrent_footer a#preferences_link {
     905div#torrent_context_menu {
    899906        display: none;
    900907}
     
    911918        margin: 0;
    912919}
    913 
    914 div.torrent_footer #compact-button,
    915 div.torrent_footer #turtle-button {
    916         position: absolute;
    917         height: 18px;
    918         width: 32px !important;
    919         top: 0px;
    920         margin: 2px;
    921 }
    922 
    923 #compact-button {
    924         right: 0px;
    925         background: transparent url('../images/graphics/chrome.png') left -54px no-repeat;
    926 }
    927 #compact-button:active {
    928         background-position: -32px -54px;
    929 }
    930 #compact-button.enabled {
    931         background-position: left -72px;
    932 }
    933 #compact-button.enabled:active {
    934         background-position: -32px -72px;
    935 }
    936 
    937 #turtle-button {
    938         left: 0px;
    939         background: transparent url('../images/graphics/chrome.png') left -18px no-repeat;
    940 }
    941 #turtle-button:active {
    942         background-position: -32px -18px;
    943 }
    944 #turtle-button.enabled {
    945         background-position: left -36px;
    946 }
    947 #turtle-button.enabled:active {
    948         background-position: -32px -36px;
    949 }
    950 
    951 /*--------------------------------------
    952  *
    953  * Hide remnants of stuff we don't need, like
    954  * transmenu and contextmenu.
    955  *
    956  *--------------------------------------*/
    957 
    958 .torrent_footer div.main_container, .torrent_footer ul#settings_menu, div.torrent_footer ul#settings_menu li#button, div#torrent_context_menu {
    959         display: none;
    960 }
Note: See TracChangeset for help on using the changeset viewer.