diff --git a/css/client.css b/css/client.css index 30d3cea..91cf979 100644 --- a/css/client.css +++ b/css/client.css @@ -327,7 +327,7 @@ body{ font-size: 16px; } .singleHeadBack{ - width: 220px; + width: 300px; cursor: pointer; left: 10px; } @@ -771,7 +771,6 @@ img[src=""],img:not([src]){opacity:0;} padding: 5px; width: calc(100% - 10px); height: calc(100% - 10px); - overflow-y: scroll; } .submissionDisplayer > div:first-child{ padding: 5px 10px; diff --git a/js/client.js b/js/client.js index b3a3e6a..3c63fb2 100644 --- a/js/client.js +++ b/js/client.js @@ -580,20 +580,21 @@ function getSingleRatingChanges(currSingleLastTimeUpdate, un, ci){ if(singleAnnouncementLength == -1) singleAnnouncementLength = q.length; if(singleAnnouncementLength != q.length && q.length != 0){ - singleAnnouncementLength = q.length; - q = q.eq(0); - var alt = ""; - q.contents().each(function(){ - if($(this).prop("outerHTML") == "
") - alt += '\n'; - else - alt += $(this).text(); - }); - q = $('
' + alt + '
').text(); - problemNewWinJQ.append(``); - if(settings.openNotification){ - new Notification(`Notification of CF #${ci}`, {body: q, icon: '../favicon.png'}); + for(var dis = q.length - singleAnnouncementLength - 1; dis >= 0; dis --){ + var t = q.eq(dis); + var alt = ""; + t.contents().each(function(){ + if($(this).prop("outerHTML") == "
") + alt += '\n'; + else + alt += $(this).text(); + }); + t = $('
' + alt + '
').text(); + problemNewWinJQ.append(``); + if(settings.openNotification) + new Notification(`Notification of CF #${ci}`, {body: t, icon: '../favicon.png'}); } + singleAnnouncementLength = q.length; } } }) diff --git a/js/locale.js b/js/locale.js index 9a96935..462a626 100644 --- a/js/locale.js +++ b/js/locale.js @@ -14,7 +14,7 @@ var lang_en = { singleContestantButton: "Fetch Information", singleVirtualButton: "Fetch Information", singleCheckExist: "Checking Existance...", - singleHeadBack: "Back to select page", + singleHeadBack: "Go back (Long press)", singleSmallWindow: "Open small window", singleSmallWindowClose: "Close small window", alertLoadSuccess: "Load Success!", @@ -291,7 +291,7 @@ var lang_zh = { singleContestantButton: "获取信息", singleVirtualButton: "获取信息", singleCheckExist: "检查合法性...", - singleHeadBack: "返回选择界面", + singleHeadBack: "返回选择界面(长按)", singleSmallWindow: "打开小窗口", singleSmallWindowClose: "关闭小窗口", alertLoadSuccess: "加载成功!", diff --git a/js/problem.js b/js/problem.js index b1fb585..2704486 100644 --- a/js/problem.js +++ b/js/problem.js @@ -168,10 +168,11 @@ function loadProblem(x, info){ }) if(info != undefined){ problemCurrentPageList[p][2] = 0; + problemCurrentPageList[p][4].contestName = $(info).find(".caption").html(); initProblemPageInfo(problemNewWinJQ.find(`.innerContent > [problem-id=${x}]`), $(info).find(`.problemindexholder[problemindex=${getProblemIndexes(x)[1]}] .problem-statement`), p); return; } - problemCurrentPageList[p][1] =$.ajax({ + problemCurrentPageList[p][1] = $.ajax({ url: settings.mainURL + `/${getProblemIndexes(x)[0] >= 100000 ? "gym" : "contest"}/` + getProblemIndexes(x)[0] + '/problem/' + getProblemIndexes(x)[1] + '?locale=en', success: function(data){ if(data.indexOf(`data-entityId="${getProblemIndexes(x)[0]}"`) == -1){ @@ -354,7 +355,8 @@ function loadContestProblemset(cid, S, E){ cid = Number(cid); $.ajax({ url: settings.mainURL + `/${cid >= 100000 ? "gym" : "contest"}/` + cid + '/problems', - success: function(data){ + success: function(data, status, xhr){ + console.log(status, xhr); if(data.indexOf(`class="problem-statement"`) == -1){ E(); return; } @@ -363,7 +365,7 @@ function loadContestProblemset(cid, S, E){ q.find(".problemindexholder").each(function(){ ret.push(String(cid) + $.trim($(this).attr("problemindex"))); }) - S(ret, q); + S(ret, data); }, error: function(){ E(); @@ -603,16 +605,16 @@ function initProblemNewWin(){ for(var i=0; i= 100000 ? "gym" : "contest"}/${getProblemIndexes(problemCurrentPageList[i][0])[0]}/problem/${getProblemIndexes(problemCurrentPageList[i][0])[1]}`, - "interactive": false, - "memoryLimit": problemCurrentPageList[i][4].memoryLimit, - "timeLimit": problemCurrentPageList[i][4].timelimit, - "tests": sampleWrapper(problemCurrentPageList[i][3][0], problemCurrentPageList[i][3][1]), - "input": problemCurrentPageList[i][4].input, - "output": problemCurrentPageList[i][4].output, - }); + "name": problemCurrentPageList[i][4].title, + "group": problemCurrentPageList[i][4].contestName, + "url": `https://codeforces.com/${getProblemIndexes(problemCurrentPageList[i][0])[0] >= 100000 ? "gym" : "contest"}/${getProblemIndexes(problemCurrentPageList[i][0])[0]}/problem/${getProblemIndexes(problemCurrentPageList[i][0])[1]}`, + "interactive": false, + "memoryLimit": problemCurrentPageList[i][4].memoryLimit, + "timeLimit": problemCurrentPageList[i][4].timelimit, + "tests": sampleWrapper(problemCurrentPageList[i][3][0], problemCurrentPageList[i][3][1]), + "input": problemCurrentPageList[i][4].input, + "output": problemCurrentPageList[i][4].output, + }); for(var pr in CompetitiveCompanionPort) sender(info, pr, curr * 1000); ++curr;