diff options
Diffstat (limited to 'www/js')
-rw-r--r-- | www/js/musicpools.js | 4 | ||||
-rw-r--r-- | www/js/shows.js | 9 | ||||
-rw-r--r-- | www/js/utils.js | 4 |
3 files changed, 14 insertions, 3 deletions
diff --git a/www/js/musicpools.js b/www/js/musicpools.js index ac5a07e..9d21427 100644 --- a/www/js/musicpools.js +++ b/www/js/musicpools.js @@ -98,7 +98,9 @@ Rdxport.MusicpoolsView.prototype.updateSelector = function() { $musicpoolSelector.off(); $('option', $musicpoolSelector).remove(); - $(this.model.groups).each(function(index, musicpool) { + $(this.model.groups).sort(function(a, b) { + return a.title.toLowerCase() >= b.title.toLowerCase() + }).each(function(index, musicpool) { var name = musicpool.title + ' (' + musicpool.clock + ')'; $musicpoolSelector.append($('<option>').attr('value', musicpool.clock).text(name)); }); diff --git a/www/js/shows.js b/www/js/shows.js index 9104bec..f125991 100644 --- a/www/js/shows.js +++ b/www/js/shows.js @@ -98,8 +98,13 @@ Rdxport.ShowListView.prototype.updateSelector = function() { $showSelector.off(); $('option', $showSelector).remove(); - $(this.model.groups).each(function(index, show) { - var name = show.title + ' (' + show.rhythm + ', ' + weekday[show.dayofweek] + ', ' + show.starttime + ', ' + show.length + ' Min.)'; + $(this.model.groups).sort(function(a, b) { + if(a.title.toLowerCase() == b.title.toLowerCase()) { + return b.rhythm - a.rhythm; + } + return a.title.toLowerCase() >= b.title.toLowerCase() + }).each(function(index, show) { + var name = show.id + ' | ' + show.title + ' (' + show.rhythm + ', ' + weekday[show.dayofweek] + ', ' + show.starttime + ', ' + show.length + ' Min.)'; $showSelector.append($('<option>').attr('value', show.id).text(name)); }); diff --git a/www/js/utils.js b/www/js/utils.js index eaed673..7e7a656 100644 --- a/www/js/utils.js +++ b/www/js/utils.js @@ -141,6 +141,10 @@ jQuery.fn.brightness = function() { } }; +jQuery.fn.sort = function() { + return this.pushStack(jQuery.makeArray([].sort.apply(this, arguments))); +}; + function updateProgressBar($el, upload) { if(upload.uploadprogress.progress < 99) { var bytes_str = Number((upload.uploadprogress.bytesSent/1024)/1024).toFixed(1) + " von " + |