From 84bc2e78bc3f1ff0ee9b766db4aa083b8bdbbfb1 Mon Sep 17 00:00:00 2001 From: sedulous Date: Sat, 24 Nov 2012 12:34:20 +0000 Subject: [PATCH] Fix #2103 : WebUI: Sorting by name is case-sensitive --- deluge/ui/web/js/deluge-all/TorrentGrid.js | 2 +- deluge/ui/web/js/deluge-all/data/SortTypes.js | 8 ++++++-- deluge/ui/web/js/deluge-all/data/TorrentRecord.js | 5 +++-- 3 files changed, 10 insertions(+), 5 deletions(-) diff --git a/deluge/ui/web/js/deluge-all/TorrentGrid.js b/deluge/ui/web/js/deluge-all/TorrentGrid.js index 4c41b06bc..50be33b03 100644 --- a/deluge/ui/web/js/deluge-all/TorrentGrid.js +++ b/deluge/ui/web/js/deluge-all/TorrentGrid.js @@ -265,7 +265,7 @@ idProperty: 'id', fields: [ {name: 'queue', sortType: Deluge.data.SortTypes.asQueuePosition}, - {name: 'name'}, + {name: 'name', sortType: Deluge.data.SortTypes.asName}, {name: 'total_size', type: 'int'}, {name: 'state'}, {name: 'progress', type: 'float'}, diff --git a/deluge/ui/web/js/deluge-all/data/SortTypes.js b/deluge/ui/web/js/deluge-all/data/SortTypes.js index e404ba348..3a6de182f 100644 --- a/deluge/ui/web/js/deluge-all/data/SortTypes.js +++ b/deluge/ui/web/js/deluge-all/data/SortTypes.js @@ -1,6 +1,6 @@ /*! * Deluge.data.SortTypes.js - * + * * Copyright (c) Damien Churchill 2009-2010 * * This program is free software; you can redistribute it and/or modify @@ -39,7 +39,7 @@ Ext.namespace('Deluge.data'); * * @class Deluge.data.SortTypes * @singleton - */ + */ Deluge.data.SortTypes = { asIPAddress: function(value) { var d = value.match(/(\d{1,3})\.(\d{1,3})\.(\d{1,3})\.(\d{1,3})\:(\d+)/); @@ -48,5 +48,9 @@ Deluge.data.SortTypes = { asQueuePosition: function(value) { return (value > -1) ? value : Number.MAX_VALUE; + }, + + asName: function(value) { + return String(value).toLowerCase(); } } diff --git a/deluge/ui/web/js/deluge-all/data/TorrentRecord.js b/deluge/ui/web/js/deluge-all/data/TorrentRecord.js index d13806c14..f92cfc641 100644 --- a/deluge/ui/web/js/deluge-all/data/TorrentRecord.js +++ b/deluge/ui/web/js/deluge-all/data/TorrentRecord.js @@ -1,6 +1,6 @@ /*! * Deluge.data.TorrentRecord.js - * + * * Copyright (c) Damien Churchill 2009-2010 * * This program is free software; you can redistribute it and/or modify @@ -47,7 +47,8 @@ Deluge.data.Torrent = Ext.data.Record.create([{ type: 'int' }, { name: 'name', - type: 'string' + type: 'string', + sortType: Deluge.data.SortTypes.asName }, { name: 'total_size', type: 'int'