diff --git a/web/index.html b/web/index.html index cff2bc4d2..873af9f42 100755 --- a/web/index.html +++ b/web/index.html @@ -419,6 +419,7 @@
  • Name
  • Progress
  • Queue Order
  • +
  • Size
  • State
  • Reverse Sort Order
  • diff --git a/web/javascript/common.js b/web/javascript/common.js index 0f0f88f25..f1c234858 100644 --- a/web/javascript/common.js +++ b/web/javascript/common.js @@ -181,7 +181,6 @@ function tellUser( primaryText, secondaryText ) $("#dialog_body").html("

    " + primaryText + "

    " + secondaryText + "

    " ); $("#dialog" ).dialog( { title: primaryText, - show: 'blind', hide: 'blind', buttons: { 'Close': function() { $(this).dialog('close'); } } }); @@ -205,7 +204,6 @@ function askUser(dialog_heading, dialog_message, confirm_button_label, }; $("#dialog" ).dialog( { title: dialog_heading, - show: 'blind', hide: 'blind', buttons: myButtons }); @@ -242,6 +240,7 @@ Prefs._SortByActivity = 'activity'; Prefs._SortByQueue = 'queue_order'; Prefs._SortByName = 'name'; Prefs._SortByProgress = 'percent_completed'; +Prefs._SortBySize = 'size'; Prefs._SortByState = 'state'; Prefs._SortByTracker = 'tracker'; diff --git a/web/javascript/torrent.js b/web/javascript/torrent.js index 6b56b9308..eec1a90f4 100644 --- a/web/javascript/torrent.js +++ b/web/javascript/torrent.js @@ -781,6 +781,11 @@ Torrent.compareByActivity = function( a, b ) { return a.activity() - b.activity(); }; +/** Helper function for sortTorrents(). */ +Torrent.compareBySize = function( a, b ) { + return a.size() - b.size(); +} + /** Helper function for sortTorrents(). */ Torrent.compareByProgress = function( a, b ) { if( a.getPercentDone() !== b.getPercentDone() ) @@ -817,6 +822,9 @@ Torrent.sortTorrents = function( torrents, sortMethod, sortDirection ) case Prefs._SortByName: torrents.sort( this.compareByName ); break; + case Prefs._SortBySize: + torrents.sort( this.compareBySize ); + break; default: console.warn( "unknown sort method: " + sortMethod ); break; diff --git a/web/javascript/transmission.js b/web/javascript/transmission.js index ac93103a7..8e70fb71f 100644 --- a/web/javascript/transmission.js +++ b/web/javascript/transmission.js @@ -909,7 +909,6 @@ Transmission.prototype = resizable: !fullscreen, draggable: !fullscreen, title: 'Preferences', - show: 'blind', hide: 'blind', buttons: { } }; @@ -1069,7 +1068,6 @@ Transmission.prototype = tr.togglePeriodicStatsRefresh(true); $("#stats_dialog" ).dialog( { title: 'Statistics', - show: 'blind', hide: 'blind', width: 200, buttons: {