From 7449a2d85c388aae20886b7ced17f169980009c2 Mon Sep 17 00:00:00 2001 From: moparisthebest Date: Fri, 31 Mar 2023 01:10:28 -0400 Subject: [PATCH] Fix some UI display annoyances, mostly sorting --- src/main/webapp/css/rcrdit.css | 1 - src/main/webapp/js/rcrdit.js | 56 +++++++++++++++++++++++++++++----- 2 files changed, 49 insertions(+), 8 deletions(-) diff --git a/src/main/webapp/css/rcrdit.css b/src/main/webapp/css/rcrdit.css index d0f742f..b7fd18b 100644 --- a/src/main/webapp/css/rcrdit.css +++ b/src/main/webapp/css/rcrdit.css @@ -365,7 +365,6 @@ ul#channelGroups li ul li ul li.channel { background-color: white; padding:20px; border-radius: 30px; - height: 400px; } #upcomingRecordingsGoHere{ diff --git a/src/main/webapp/js/rcrdit.js b/src/main/webapp/js/rcrdit.js index b599209..671c0d9 100644 --- a/src/main/webapp/js/rcrdit.js +++ b/src/main/webapp/js/rcrdit.js @@ -32,7 +32,6 @@ $( document ).ready(function() { getUpcomingRecordings(); $("#autoRecsGoHere").hide(); $("#upcomingRecordingsGoHere").show(); - $("#programInfo").dialog("close"); }); getCurrentlyRecording(); @@ -69,7 +68,14 @@ function getUpcomingRecordings(){ var upcomingRecordingsDiv = $("#upcomingRecordingsGoHere"); var upcomingRecordingTable = $(" nameB) { + return 1; + } + + // names must be equal + return 0; +} + +function sortAutoRecs(a, b) { + return sortStringsIgnoreCase(a.title, b.title); +} + function getAutoRecs(){ $("#autoRecsGoHere").html(""); @@ -104,8 +128,15 @@ function getAutoRecs(){ dataType: 'json', success: function (data) { var autoRecDiv = $("#autoRecsGoHere"); - for(var idx in data){ - var autoRec = data[idx]; + // we want this sorted by name + var autoRecs = []; + for(var idx in data) { + autoRecs[autoRecs.length] = data[idx]; + } + autoRecs.sort(sortAutoRecs); + for (var i=0; i").append($("").append(autoRec.title))); } }, @@ -158,6 +189,11 @@ function forceScheduleUpdate(){ } +function sortChannels(a, b) { + //return sortStringsIgnoreCase(a.displayName, b.displayName); + // these are basically decimals, so compare them like so + return a.displayName - b.displayName; +} function getSchedule2(requestObject){ if(isNull(requestObject)){ @@ -170,16 +206,22 @@ function getSchedule2(requestObject){ contentType: "application/json", data: JSON.stringify(requestObject), success: function (data) { - var channelList = data.schedule; var requestObject = data.requestObject; var requestStartTimeEpochSeconds = requestObject.startTime.epochSecond; $("#guideGoesHere").html(""); $("#guideGoesHere").append(getProgramsHeader(requestObject)); var channelUl = $("").addClass("roundedBottom"); var channelGroupsUl = $("").attr("id","channelGroups").append($("
  • ").append(channelUl)); - for(var idx in channelList){ + + var channels = []; + for(var idx in data.schedule) { + channels[channels.length] = data.schedule[idx]; + } + channels.sort(sortChannels); + + for (var i=0; i"); - var channel = channelList[idx]; var currentPercentOver = 0; var channelProgramUl = $("").attr("channelNum",channel.displayName); individualChannelLi.append(channelProgramUl);