Skip to content

Commit

Permalink
Fix languages highlighting
Browse files Browse the repository at this point in the history
  • Loading branch information
hobovsky committed May 2, 2021
1 parent 76d2694 commit cee69b1
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions polyglot.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
// ==UserScript==
// @name CodeWars - Mark solved languages
// @version 1.3.10
// @version 1.3.11
// @downloadURL https://github.com/hobovsky/polyglot/releases/latest/download/polyglot.js
// @include https://www.codewars.com/*
// @grant GM_xmlhttpRequest
Expand Down Expand Up @@ -224,7 +224,7 @@ function toppedUp(resp) {
topUpInProgress = false;
let cwResp = resp.responseText;
let toAppend = jQuery.parseHTML(cwResp);
let kataList = jQuery(toAppend).find("div.list-item.kata");
let kataList = jQuery(toAppend).find("div.list-item-kata");
if (!kataList.length) {
jQuery.notify("No more katas available.", "info");
return;
Expand Down Expand Up @@ -314,7 +314,7 @@ function kataAppeared(elem) {
}

function reHighlight() {
jQuery("div.list-item.kata").each(function() {
jQuery("div.list-item-kata").each(function() {
kataAppeared(this);
});
}
Expand Down Expand Up @@ -342,7 +342,7 @@ function setUpForm(form) {
let langVal = sel.val();
let lang = sel.text();
if (lang && langVal !== "" && langVal !== "my-languages") {
jQuery("div.list-item.kata:first").before('<form id="dummy_form"><select id="cmbHighlight"><option value = "all">Show all</option><option value = "solved">Show katas I\'ve solved in ' + lang + '</option><option value = "not_solved">Show katas I haven\'t solved in ' + lang + "</option></select></form>");
jQuery("div.list-item-kata:first").before('<form id="dummy_form"><select id="cmbHighlight"><option value = "all">Show all</option><option value = "solved">Show katas I\'ve solved in ' + lang + '</option><option value = "not_solved">Show katas I haven\'t solved in ' + lang + "</option></select></form>");
let cmbHc = jQuery("#cmbHighlight");
cmbHc.change(setUpHighlightConfig);
cmbHc.change(reHighlight);
Expand Down Expand Up @@ -447,7 +447,7 @@ function tabidizePastSolutions(liElem) {
* DOM Listeners *
*********************************/

jQuery(document).arrive("div.list-item.kata", { existing: true }, function() {
jQuery(document).arrive("div.list-item-kata", { existing: true }, function() {
kataAppeared(this);
});

Expand Down

0 comments on commit cee69b1

Please sign in to comment.