Changeset 9507
- Timestamp:
- Nov 10, 2009, 5:42:57 AM (13 years ago)
- Location:
- trunk/web
- Files:
-
- 6 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/web/index.html
r9460 r9507 207 207 <div id="pref_error"></div> 208 208 <form action="" id="prefs_form"> 209 <div class="preference download_location"> 210 <label class="category">Add transfers:</label> 211 <div class="formdiv"> 212 <label for="download_location" class="item">Download to:</label> 213 <input type="text" name="download_location" id="download_location"/> 209 <div id="prefs_tabs"> 210 <ul> 211 <li onclick="changeTab(this, 'prefs_tab_general');" class="prefs_tab_enabled">General</li> 212 <li onclick="changeTab(this, 'prefs_tab_speed');" class="prefs_tab_disabled">Speed</li> 213 </ul> 214 <div id="prefs_tab_general" class="prefs_tab"> 215 <div class="preference download_location"> 216 <label class="category">Add transfers:</label> 217 <div class="formdiv"> 218 <label for="download_location" class="item">Download to:</label> 219 <input type="text" name="download_location" id="download_location"/> 220 </div> 221 <div class="formdiv checkbox auto_start"> 222 <input type="checkbox" name="auto_start" id="auto_start"/> 223 <label for="auto_start" class="item">Start transfers when added</label> 224 </div> 225 </div> 226 <div class="preference port"> 227 <label class="category">Network:</label> 228 <div class="formdiv"> 229 <label for="port" class="item">Incoming TCP Port:</label> 230 <input type="text" id="port" name="port"/> 231 </div> 232 </div> 233 <div class="preference encryption"> 234 <label class="category">Encryption:</label> 235 <div class="formdiv checkbox"> 236 <input type="checkbox" name="encryption" id="encryption"/> 237 <label for="encryption" class="item">Ignore unencrypted peers</label> 238 </div> 239 </div> 240 <div class="preference web_gui"> 241 <label class="category">Web Client:</label> 242 <div class="formdiv"> 243 <label for="refresh_rate" class="item">Refresh Rate:</label> 244 <input type="text" name="refresh_rate" id="refresh_rate"/> 245 <label class="suffix">seconds</label> 246 </div> 247 </div> 248 <div style="clear: both; visibility: hidden;"/></div> 214 249 </div> 215 <div class="formdiv checkbox auto_start"> 216 <input type="checkbox" name="auto_start" id="auto_start"/> 217 <label for="auto_start" class="item">Start transfers when added</label> 218 </div> 219 </div> 220 <div class="preference port"> 221 <label class="category">Network:</label> 222 <div class="formdiv"> 223 <label for="port" class="item">Incoming TCP Port:</label> 224 <input type="text" id="port" name="port"/> 225 </div> 226 </div> 227 <div class="preference encryption"> 228 <label class="category">Encryption:</label> 229 <div class="formdiv checkbox"> 230 <input type="checkbox" name="encryption" id="encryption"/> 231 <label for="encryption" class="item">Ignore unencrypted peers</label> 232 </div> 233 </div> 234 <div class="preference limit_total"> 235 <label class="category">Limit total bandwidth:</label> 236 <div class="formdiv checkbox"> 237 <input type="checkbox" name="limit_download" id="limit_download"/> 238 <label for="limit_download" class="item">Download Rate:</label> 239 <input type="text" name="download_rate" id="download_rate"/> 240 <label class="suffix">KB/s</label> 241 </div> 242 <div class="formdiv checkbox"> 243 <input type="checkbox" name="limit_upload" id="limit_upload"/> 244 <label for="limit_upload" class="item">Upload Rate:</label> 245 <input type="text" name="upload_rate" id="upload_rate"/> 246 <label class="suffix">KB/s</label> 247 </div> 248 </div> 249 <div class="preference web_gui"> 250 <label class="category">Web Client:</label> 251 <div class="formdiv"> 252 <label for="refresh_rate" class="item">Refresh Rate:</label> 253 <input type="text" name="refresh_rate" id="refresh_rate"/> 254 <label class="suffix">seconds</label> 250 <div id="prefs_tab_speed" class="prefs_tab" style="display: none;"> 251 <div class="preference limit_total"> 252 <label class="category">Speed Limits:</label> 253 <div class="formdiv checkbox"> 254 <input type="checkbox" name="limit_download" id="limit_download"/> 255 <label for="limit_download" class="item">Download Rate:</label> 256 <input type="text" name="download_rate" id="download_rate"/> 257 <label class="suffix">KB/s</label> 258 </div> 259 <div class="formdiv checkbox"> 260 <input type="checkbox" name="limit_upload" id="limit_upload"/> 261 <label for="limit_upload" class="item">Upload Rate:</label> 262 <input type="text" name="upload_rate" id="upload_rate"/> 263 <label class="suffix">KB/s</label> 264 </div> 265 </div> 266 <div class="preference limit_turtle"> 267 <label class="category">Temporary Speed Limits: (Turtle)</label> 268 <label>Override normal speed limits manually or at scheduled times</label> 269 <div class="formdiv"> 270 <label for="turtle_download_rate" class="item">Download Rate:</label> 271 <input type="text" name="turtle_download_rate" id="turtle_download_rate"/> 272 <label class="suffix">KB/s</label> 273 </div> 274 <div class="formdiv"> 275 <label for="turtle_upload_rate" class="item">Upload Rate:</label> 276 <input type="text" name="turtle_upload_rate" id="turtle_upload_rate"/> 277 <label class="suffix">KB/s</label> 278 </div> 279 <div class="formdiv checkbox"> 280 <input type="checkbox" name="turtle_schedule" id="turtle_schedule"/> 281 <label for="turtle_schedule" class="item">Scheduled times:</label> 282 <select name="turtle_start_time" id="turtle_start_time" size="1"> 283 </select> 284 <select name="turtle_end_time" id="turtle_end_time" size="1"> 285 </select> 286 </div> 287 <div class="formdiv"> 288 <label for="turtle_days" class="item">On days:</label> 289 <select name="turtle_days" id="turtle_days" size="1"> 290 <option value="127">Everyday</option> 291 <option value="62">Weekdays</option> 292 <option value="65">Weekends</option> 293 <option value="1">Sunday</option> 294 <option value="2">Monday</option> 295 <option value="4">Tuesday</option> 296 <option value="8">Wednesday</option> 297 <option value="16">Thursday</option> 298 <option value="32">Friday</option> 299 <option value="64">Saturday</option> 300 </select> 301 </div> 302 </div> 303 <div style="clear: both; visibility: hidden;"/></div> 255 304 </div> 256 305 </div> … … 342 391 </li> 343 392 </ul> 393 <div id="turtle_button"> </div> 394 <div style="clear: both; visibility: hidden;"></div> 344 395 </div> 345 396 -
trunk/web/javascript/common.js
r8903 r9507 253 253 } 254 254 255 /** 256 * @brief Switch between different dialog tabs 257 */ 258 function changeTab(tab, id) { 259 for ( var x = 0, node; tab.parentNode.childNodes[x]; x++ ) { 260 node = tab.parentNode.childNodes[x]; 261 if (node == tab) { 262 node.className = "prefs_tab_enabled"; 263 } else { 264 node.className = "prefs_tab_disabled"; 265 } 266 } 267 for ( x = 0; tab.parentNode.parentNode.childNodes[x]; x++ ) { 268 node = tab.parentNode.parentNode.childNodes[x]; 269 if (node.tagName == "DIV") { 270 if (node.id == id) { 271 node.style.display = "block"; 272 } else { 273 node.style.display = "none"; 274 } 275 } 276 } 277 } 255 278 256 279 /*** … … 288 311 Prefs._SortByTracker = 'tracker'; 289 312 313 Prefs._TurtleState = 'turtle-state'; 290 314 291 315 Prefs._Defaults = … … 297 321 'show_inspector': false, 298 322 'sort_direction': 'ascending', 299 'sort_method': 'name' 323 'sort_method': 'name', 324 'turtle-state' : false 300 325 }; 301 326 -
trunk/web/javascript/jquery/jquery.transmenu.min.js
r8797 r9507 26 26 $(liElems).hover(mainHoverIn,mainHoverOut).addClass('main').find('>div').addClass('inner');if(transMenuSettings.arrow_char){var arrow_markup=$("<span class='arrow'>"+transMenuSettings.arrow_char+'</span>');if($.browser.mozilla&&+$.browser.version.replace(/\./g,'').slice(0,3)<191){arrow_markup.css('margin-top','-13px');} 27 27 $('div.inner div.outerbox',this).before(arrow_markup);} 28 $(this).wrap('<div class="main_container"></div>').after('<div style="clear: both; visibility: hidden;"></div>');});};$.fn.transMenu.setDefaults=function(o){$.extend(defaults,o);};$.fn.shadowBox=function(){return this.each(function(){var outer=$('<div class="outerbox"></div>').get(0);if($(this).css('position')=='absolute'){$(outer).css({position:'relative',width:this.offsetWidth,height:this.offsetHeight});}else{$(outer).css('position','absolute');}28 });};$.fn.transMenu.setDefaults=function(o){$.extend(defaults,o);};$.fn.shadowBox=function(){return this.each(function(){var outer=$('<div class="outerbox"></div>').get(0);if($(this).css('position')=='absolute'){$(outer).css({position:'relative',width:this.offsetWidth,height:this.offsetHeight});}else{$(outer).css('position','absolute');} 29 29 $(this).addClass('innerBox').wrap(outer).before('<div class="shadowbox1"></div><div class="shadowbox2"></div><div class="shadowbox3"></div>');});};$.fn.selectMenuItem=function(){if(this.find('span.selected').length==0){this.prepend($("<span class='selected'>"+transMenuSettings.selected_char+"</span>"));} 30 30 return this;};$.fn.deselectMenuItem=function(){return this.find('span.selected').remove();};$.fn.menuItemIsSelected=function(){return(this.find('span.selected').length>0);};$.fn.deselectMenuSiblings=function(){this.parent().find('span.selected').remove();this.selectMenuItem();return this;};})(jQuery); -
trunk/web/javascript/transmission.js
r9460 r9507 53 53 $('#upload_confirm_button').bind('click', function(e){ tr.confirmUploadClicked(e); return false;}); 54 54 $('#upload_cancel_button').bind('click', function(e){ tr.cancelUploadClicked(e); return false; }); 55 $('#turtle_button').bind('click', function(e){ tr.toggleTurtleClicked(e); return false; }); 55 56 if (iPhone) { 56 57 $('#inspector_close').bind('click', function(e){ tr.hideInspector(); }); … … 66 67 this.createSettingsMenu(); 67 68 } 69 this.initTurtleDropDowns(); 68 70 69 71 this._torrent_list = $('#torrent_list')[0]; … … 310 312 311 313 314 initTurtleDropDowns: function() { 315 var i, out, hour, mins; 316 // Build the list of times 317 out = ""; 318 for (i = 0; i < 24 * 4; i++) { 319 hour = parseInt(i / 4); 320 mins = ((i % 4) * 15); 321 out += "<option value='" + (i * 15) + "'>" + hour + ":" + (mins == 0 ? "00" : mins) + "</option>"; 322 } 323 setInnerHTML( $('#turtle_start_time')[0], out ); 324 setInnerHTML( $('#turtle_end_time')[0], out ); 325 }, 326 312 327 /*-------------------------------------------- 313 328 * … … 605 620 // pass the new prefs upstream to the RPC server 606 621 var o = { }; 607 o[RPC._PeerPort] = parseInt( $('#prefs_form #port')[0].value ); 608 o[RPC._UpSpeedLimit] = parseInt( $('#prefs_form #upload_rate')[0].value ); 609 o[RPC._DownSpeedLimit] = parseInt( $('#prefs_form #download_rate')[0].value ); 610 o[RPC._DownloadDir] = $('#prefs_form #download_location')[0].value; 611 o[RPC._UpSpeedLimited] = $('#prefs_form #limit_upload')[0].checked; 612 o[RPC._DownSpeedLimited] = $('#prefs_form #limit_download')[0].checked; 613 o[RPC._Encryption] = $('#prefs_form #encryption')[0].checked 614 ? RPC._EncryptionRequired 615 : RPC._EncryptionPreferred; 622 o[RPC._PeerPort] = parseInt( $('#prefs_form #port')[0].value ); 623 o[RPC._UpSpeedLimit] = parseInt( $('#prefs_form #upload_rate')[0].value ); 624 o[RPC._DownSpeedLimit] = parseInt( $('#prefs_form #download_rate')[0].value ); 625 o[RPC._DownloadDir] = $('#prefs_form #download_location')[0].value; 626 o[RPC._UpSpeedLimited] = $('#prefs_form #limit_upload')[0].checked; 627 o[RPC._DownSpeedLimited] = $('#prefs_form #limit_download')[0].checked; 628 o[RPC._Encryption] = $('#prefs_form #encryption')[0].checked 629 ? RPC._EncryptionRequired 630 : RPC._EncryptionPreferred; 631 o[RPC._TurtleDownSpeedLimit] = parseInt( $('#prefs_form #turtle_download_rate')[0].value ); 632 o[RPC._TurtleUpSpeedLimit] = parseInt( $('#prefs_form #turtle_upload_rate')[0].value ); 633 o[RPC._TurtleTimeEnabled] = $('#prefs_form #turtle_schedule')[0].checked; 634 o[RPC._TurtleTimeBegin] = parseInt( $('#prefs_form #turtle_start_time').val() ); 635 o[RPC._TurtleTimeEnd] = parseInt( $('#prefs_form #turtle_end_time').val() ); 636 o[RPC._TurtleTimeDay] = parseInt( $('#prefs_form #turtle_days').val() ); 637 616 638 tr.remote.savePrefs( o ); 617 639 … … 731 753 }, 732 754 755 toggleTurtleClicked: function() { 756 // Toggle the value 757 this[Prefs._TurtleState] = !this[Prefs._TurtleState]; 758 // Store the result 759 var args = { }; 760 args[RPC._TurtleState] = this[Prefs._TurtleState]; 761 this.remote.savePrefs( args ); 762 }, 763 764 updateTurtleButton: function() { 765 if ( this[Prefs._TurtleState] ) { 766 $('#turtle_button').addClass('turtleEnabled'); 767 $('#turtle_button').removeClass('turtleDisabled'); 768 } else { 769 $('#turtle_button').removeClass('turtleEnabled'); 770 $('#turtle_button').addClass('turtleDisabled'); 771 } 772 }, 773 733 774 /*-------------------------------------------- 734 775 * … … 783 824 $('input#refresh_rate')[0].value = prefs[Prefs._RefreshRate]; 784 825 $('div.encryption input')[0].checked = prefs[RPC._Encryption] == RPC._EncryptionRequired; 826 $('input#turtle_download_rate')[0].value = prefs[RPC._TurtleDownSpeedLimit]; 827 $('input#turtle_upload_rate')[0].value = prefs[RPC._TurtleUpSpeedLimit]; 828 $('input#turtle_schedule')[0].checked = prefs[RPC._TurtleTimeEnabled]; 829 $('select#turtle_start_time').val( prefs[RPC._TurtleTimeBegin] ); 830 $('select#turtle_end_time').val( prefs[RPC._TurtleTimeEnd] ); 831 $('select#turtle_days').val( prefs[RPC._TurtleTimeDay] ); 785 832 786 833 if (!iPhone) … … 796 843 $(key).deselectMenuSiblings().selectMenuItem(); 797 844 } 845 846 this[Prefs._TurtleState] = prefs[RPC._TurtleState]; 847 this.updateTurtleButton(); 798 848 }, 799 849 -
trunk/web/javascript/transmission.remote.js
r8903 r9507 21 21 RPC._UpSpeedLimited = 'speed-limit-up-enabled'; 22 22 RPC._DownSpeedLimited = 'speed-limit-down-enabled'; 23 RPC._TurtleState = 'alt-speed-enabled'; 24 RPC._TurtleUpSpeedLimit = 'alt-speed-up'; 25 RPC._TurtleDownSpeedLimit = 'alt-speed-down'; 26 RPC._TurtleTimeEnabled = 'alt-speed-time-enabled'; 27 RPC._TurtleTimeBegin = 'alt-speed-time-begin'; 28 RPC._TurtleTimeEnd = 'alt-speed-time-end'; 29 RPC._TurtleTimeDay = 'alt-speed-time-day'; 23 30 24 31 function TransmissionRemote( controller ) -
trunk/web/stylesheets/common.css
r9216 r9507 738 738 margin: 0 20px 0 0; 739 739 padding: 0px; 740 } 741 742 div.torrent_footer div#turtle_button { 743 height: 22px; 744 width: 32px !important; 745 margin: 0 0 0 38px; 746 padding: 0; 747 -moz-user-select: none; 748 -webkit-user-select: none; 749 } 750 751 .turtleEnabled { 752 background: transparent url('../images/graphics/chrome.png') -32px -119px no-repeat; 753 } 754 .turtleDisabled { 755 background: transparent url('../images/graphics/chrome.png') left -97px no-repeat; 740 756 } 741 757 … … 866 882 div#prefs_container label { 867 883 display: block; 884 margin: 0 0 0 2px; 868 885 } 869 886 … … 871 888 clear: both; 872 889 font-size: 1.2em; 873 margin: 0 0 0 2px;874 890 } 875 891 … … 890 906 891 907 div#prefs_container div.limit_total label.item { 892 width: 91px; 908 width: 102px; 909 } 910 911 div#prefs_container div.limit_turtle label.item { 912 width: 120px; 893 913 } 894 914 … … 934 954 div#prefs_container h2.dialog_heading { 935 955 display: none; 956 } 957 958 div#prefs_container div#prefs_tabs { 959 clear: both; 960 } 961 962 div#prefs_container div#prefs_tabs ul { 963 margin: 0; 964 padding: 0; 965 } 966 div#prefs_container div#prefs_tabs ul li { 967 display: block; 968 float: left; 969 font-size: 1.2em; 970 color: #323232; 971 text-align: center; 972 padding: 2px 20px; 973 border-left: 1px solid #787878; 974 border-right: 1px solid #787878; 975 border-top: 1px solid #787878; 976 } 977 .prefs_tab_disabled { 978 background: #C0C8D6 url('../images/graphics/filter_bar.png') bottom repeat-x; 979 } 980 .prefs_tab_enabled { 981 background: none; 982 } 983 div.dialog_container div#prefs_tabs ul li.prefs_tab_disabled:hover, 984 div.dialog_container div#prefs_tabs ul li.prefs_tab_disabled:active { 985 background: none; 986 } 987 div#prefs_container div#prefs_tabs div.prefs_tab { 988 border: 1px solid #787878; 989 clear: both; 990 padding: 2px 0; 936 991 } 937 992
Note: See TracChangeset
for help on using the changeset viewer.