diff --git a/.github/ISSUE_TEMPLATE/bug_report.md b/.github/ISSUE_TEMPLATE/bug_report.md index fd9eaf1b2..de939409b 100644 --- a/.github/ISSUE_TEMPLATE/bug_report.md +++ b/.github/ISSUE_TEMPLATE/bug_report.md @@ -6,47 +6,47 @@ labels: bug assignees: "" --- - + - +**Describe the bug** + + + +Sometimes things work in incognito mode, which allows me to further track down the issue. -**To Reproduce** +--> - +**To Reproduce** 1. Go to '...' 2. Click on '....' 3. Scroll down to '....' 4. See error -**Expected behavior** +**Expected behavior** - -**Screenshots** +**Screenshots** - -**Desktop:** +**Desktop:** - OS: [] - Browser [] - Version [] -**Smartphone:** +**Smartphone:** - Device: [] - OS: [] - Browser [] - Version [] -**Additional context** - - +**Additional context** diff --git a/code_r.json b/code_r.json new file mode 100644 index 000000000..07d7151fb --- /dev/null +++ b/code_r.json @@ -0,0 +1,27 @@ +{ + "name": "code_r", + "leftToRight": true, + "words": [ + "if", + "for", + "FALSE", + "NA_integer_", + "return", + "else", + "in", + "NULL", + "NA_real_", + "repeat", + "next", + "Inf", + "NA_complex_", + "while", + "break", + "NaN", + "NA_character_", + "function", + "TRUE", + "NA", + "..." + ] +} diff --git a/src/js/popups/word-filter-popup.js b/src/js/popups/word-filter-popup.js index 79cb583d6..cc1bc9f6c 100644 --- a/src/js/popups/word-filter-popup.js +++ b/src/js/popups/word-filter-popup.js @@ -65,15 +65,15 @@ async function filter(language) { return filteredWords; } -async function apply() { +async function apply(set) { let language = $("#wordFilterPopup .languageInput").val(); let filteredWords = await filter(language); - let customText = ""; - filteredWords.forEach((word) => { - customText += word + " "; - }); + let customText = filteredWords.join(" "); + + $("#customTextPopup textarea").val( + (index, val) => (set ? "" : val + " ") + customText + ); hide(); - $("#customTextPopup textarea").val(customText); } $("#wordFilterPopupWrapper").mousedown((e) => { @@ -90,8 +90,9 @@ $("#wordFilterPopupWrapper .button").mousedown((e) => { $("#wordFilterPopupWrapper .loadingIndicator").removeClass("hidden"); $("#wordFilterPopupWrapper .button").addClass("hidden"); setTimeout(() => { - apply(); - $("#wordFilterPopupWrapper .loadingIndicator").addClass("hidden"); - $("#wordFilterPopupWrapper .button").removeClass("hidden"); + apply($(e.target).is("#set")).then(() => { + $("#wordFilterPopupWrapper .loadingIndicator").addClass("hidden"); + $("#wordFilterPopupWrapper .button").removeClass("hidden"); + }); }, 1); }); diff --git a/static/index.html b/static/index.html index 8963b0626..e4266ebca 100644 --- a/static/index.html +++ b/static/index.html @@ -202,10 +202,15 @@ Use the above filters to include and exclude words or characters (separated by spaces) +
+ "Set" replaces the current custom word list with the filter result, "Add" + appends the filter result to the current custom word list +
-
ok
+
set
+
add