Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Decaffeinate smallest .coffee files & init TODO list #732

Merged
merged 30 commits into from
Jan 3, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
30 commits
Select commit Hold shift + click to select a range
c404d06
Init coffee TODO list (for conversion)
Splines Dec 28, 2024
3fd9831
Show number of lines in coffee TODO list
Splines Dec 28, 2024
ec87249
Sort list according to number of lines in coffee files
Splines Dec 28, 2024
2a97f71
Remove import_manuscript.coffee
Splines Dec 28, 2024
a71bae2
Replace deprecated location.reload(true) with cache busting
Splines Dec 28, 2024
e97141f
Delete error.coffee
Splines Dec 28, 2024
c2e34fd
Replace subscription swatch coffee by JS
Splines Dec 28, 2024
608705e
Replace location.reload() in identify.coffee
Splines Dec 28, 2024
fd23b3c
Decaffeinate update for answers (in lecture edit mode)
Splines Dec 28, 2024
01fe1ca
Decaffeinate delete_edge
Splines Dec 28, 2024
7edc893
Delete new.coffee
Splines Dec 28, 2024
6529135
Decaffeinate default target update in quiz
Splines Dec 28, 2024
ec34e63
Decaffeinate cancel edit tags (erdbeere)
Splines Dec 28, 2024
5f212b1
Decaffeinate display_info (for erdbeere)
Splines Dec 28, 2024
01ffbff
Decaffeinate edit tags
Splines Dec 28, 2024
73d4483
Decaffeinate delete_account modal rendering
Splines Dec 28, 2024
8603089
Decaffeinate cancel_edit tutorials
Splines Dec 28, 2024
8ede799
Add watch out for section
Splines Dec 28, 2024
ece3972
Decaffeinate validate certificate (tutorials)
Splines Dec 28, 2024
c25c10b
Decaffeinate cancel edit assignment
Splines Dec 28, 2024
13e500c
Decaffeinate cancel_import_media (Reset button)
Splines Dec 28, 2024
ca503ed
Decaffeinate cancel_action as tutor (e.g. move to another tut)
Splines Dec 28, 2024
6c16b6b
Decaffeinate cancel_edit_correction (as tutor)
Splines Dec 28, 2024
92eda64
Decaffeinate validate quiz certificates (as tutor)
Splines Dec 28, 2024
c4ab2a1
Decaffeinate new vertex (in quiz)
Splines Dec 28, 2024
0fe745e
Delete render_sidebar
Splines Dec 28, 2024
d5baa12
Decaffeinate late submission accept
Splines Dec 28, 2024
c46e9da
Decaffeinate reject submission (as tutor)
Splines Dec 28, 2024
f9e6f80
Decaffeinate refresh_token (for submissions as tutor)
Splines Dec 28, 2024
e480f08
Add 😭 emoji
Splines Dec 28, 2024
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 3 additions & 1 deletion .config/eslint.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,8 @@
// [4] https://eslint.org/docs/rules/
import js from "@eslint/js";
import stylistic from "@stylistic/eslint-plugin";
import erb from "eslint-plugin-erb";
import pluginCypress from "eslint-plugin-cypress/flat";
import erb from "eslint-plugin-erb";
import globals from "globals";

const ignoreFilesWithSprocketRequireSyntax = [
Expand Down Expand Up @@ -101,6 +101,8 @@ const customGlobals = {
renderMathInElement: "readable",

openAnnotationIfSpecifiedInUrl: "readable",

reloadUrl: "readable",
};

export default [
Expand Down
5 changes: 4 additions & 1 deletion .vscode/settings.json
Original file line number Diff line number Diff line change
Expand Up @@ -111,19 +111,22 @@
"cSpell.words": [
"activerecord",
"ajax",
"clipboardpopup",
"commontator",
"cospeaker",
"cospeakers",
"datetime",
"erdbeere",
"factorybot",
"helpdesk",
"javascripts",
"katex",
"preselection",
"selectize",
"Timecop",
"turbolinks",
"Unsets",
"uncached",
"Unsets",
"whitespaces"
],
"cSpell.enableFiletypes": [
Expand Down
1 change: 1 addition & 0 deletions app/assets/javascripts/application.js
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,7 @@
//= require vertices
//= require watchlists
//= require turbolinks
//= require reload

//= require search_tags

Expand Down
15 changes: 15 additions & 0 deletions app/assets/javascripts/reload.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
/**
* Reloads the current page without using the browser cache by using a query
* parameter that changes on every call (cache busting).
*
* Note that images and other assets may still be cached.
* From https://stackoverflow.com/a/74091027/
*/
// eslint-disable-next-line no-unused-vars
function reloadUrl() {
console.log("in reloadUrl");
const queryParams = new URLSearchParams(window.location.search);
queryParams.set("lr", new Date().getTime());
const query = queryParams.toString();
window.location.search = query; // navigates
}
1 change: 0 additions & 1 deletion app/views/answers/update.coffee

This file was deleted.

1 change: 1 addition & 0 deletions app/views/answers/update.js.erb
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
$("#collapse-answer-<%= @answer.id %>").collapse("hide");
3 changes: 0 additions & 3 deletions app/views/assignments/cancel_edit.coffee

This file was deleted.

3 changes: 3 additions & 0 deletions app/views/assignments/cancel_edit.js.erb
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
$('.assignmentRow[data-id="<%= @assignment.id %>"')
.replaceWith("<%= j render partial: 'assignments/row',
locals: { assignment: @assignment } %>");
2 changes: 0 additions & 2 deletions app/views/erdbeere/cancel_edit_tags.coffee

This file was deleted.

2 changes: 2 additions & 0 deletions app/views/erdbeere/cancel_edit_tags.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
$("#edit-erdbeere-tags-form").hide();
$("#erdbeereTagsList").show();
Original file line number Diff line number Diff line change
@@ -1,2 +1,3 @@
$('.erdbeere-realization[data-sort="<%= @sort %>"][data-id="<%= @id %>"]').empty()
.append('<%= @info %>')
$('.erdbeere-realization[data-sort="<%= @sort %>"][data-id="<%= @id %>"]')
.empty()
.append("<%= @info %>");
2 changes: 0 additions & 2 deletions app/views/erdbeere/edit_tags.coffee

This file was deleted.

2 changes: 2 additions & 0 deletions app/views/erdbeere/edit_tags.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
$("#edit-erdbeere-tags-form").show();
$("#erdbeereTagsList").hide();
4 changes: 0 additions & 4 deletions app/views/lectures/render_sidebar.coffee

This file was deleted.

3 changes: 0 additions & 3 deletions app/views/media/cancel_import_media.coffee

This file was deleted.

5 changes: 5 additions & 0 deletions app/views/media/cancel_import_media.js.erb
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
$("#importMediaForm")
.empty()
.append("<%= j render partial: 'shared/no_selection' %>");

$("#selectionCounter").empty().append("(0)");
1 change: 0 additions & 1 deletion app/views/media/import_manuscript.coffee

This file was deleted.

1 change: 1 addition & 0 deletions app/views/notifications/destroy_all.js
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
reloadUrl();
1 change: 0 additions & 1 deletion app/views/profile/toggle_thread_subscription.coffee

This file was deleted.

1 change: 1 addition & 0 deletions app/views/profile/toggle_thread_subscription.js.erb
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
$("subscriptionSwitch-<%= @thread.id %>").attr("checked", <%= @result %>);
3 changes: 0 additions & 3 deletions app/views/quiz_certificates/validate.coffee

This file was deleted.

4 changes: 4 additions & 0 deletions app/views/quiz_certificates/validate.js.erb
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
$("#validationResult")
.empty()
.append("<%= j render partial: 'quiz_certificates/validation_result',
locals: { certificate: @certificate } %>");
3 changes: 0 additions & 3 deletions app/views/quizzes/delete_edge.coffee

This file was deleted.

4 changes: 4 additions & 0 deletions app/views/quizzes/delete_edge.js.erb
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
$("#quiz-error-messages")
.empty()
.append("<%= j render partial: "quizzes/errors_in_editing",
locals: { quiz: @quiz } %>");
2 changes: 0 additions & 2 deletions app/views/quizzes/new.coffee

This file was deleted.

3 changes: 0 additions & 3 deletions app/views/quizzes/update_default_target.coffee

This file was deleted.

4 changes: 4 additions & 0 deletions app/views/quizzes/update_default_target.js.erb
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
$("#quiz-error-messages")
.empty()
.append("<%= j render partial: "quizzes/errors_in_editing",
locals: { quiz: @quiz } %>");
4 changes: 0 additions & 4 deletions app/views/submissions/accept.coffee

This file was deleted.

5 changes: 5 additions & 0 deletions app/views/submissions/accept.js.erb
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
$('.submission-row[data-id="<%= @submission.id %>"]')
.removeClass("bg-submission-orange")
.empty()
.append("<%= j render partial: 'tutorials/submission_row',
locals: { submission: @submission } %>");
3 changes: 0 additions & 3 deletions app/views/submissions/cancel_action.coffee

This file was deleted.

4 changes: 4 additions & 0 deletions app/views/submissions/cancel_action.js.erb
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
$('.submission-actions[data-id="<%= @submission.id %>"]')
.empty()
.append("<%= j render partial: 'submissions/other_actions',
locals: { submission: @submission } %>");
3 changes: 0 additions & 3 deletions app/views/submissions/cancel_edit_correction.coffee

This file was deleted.

5 changes: 5 additions & 0 deletions app/views/submissions/cancel_edit_correction.js.erb
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
console.log("cancel_edit_correction.js.erb");
$('.correction-column[data-id="<%= @submission.id %>"]')
.empty()
.append("<%= j render partial: 'submissions/correction_column',
locals: { submission: @submission } %>");
1 change: 0 additions & 1 deletion app/views/submissions/error.coffee

This file was deleted.

4 changes: 0 additions & 4 deletions app/views/submissions/refresh_token.coffee

This file was deleted.

4 changes: 4 additions & 0 deletions app/views/submissions/refresh_token.js.erb
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
$('.submissionToken[data-id="<%= @submission.id %>"]')
.text("<%= @submission.token %>");
$(".clipboardpopup").attr("data-clipboard-text", "<%= @submission.token %>");
$("#refreshTokenButton").blur();
4 changes: 0 additions & 4 deletions app/views/submissions/reject.coffee

This file was deleted.

5 changes: 5 additions & 0 deletions app/views/submissions/reject.js.erb
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
$('.submission-row[data-id="<%= @submission.id %>"]')
.removeClass("bg-submission-orange")
.empty()
.append("<%= j render partial: 'tutorials/submission_row',
locals: { submission: @submission } %>");
2 changes: 1 addition & 1 deletion app/views/tags/identify.coffee
Original file line number Diff line number Diff line change
@@ -1 +1 @@
location.reload(true)
reloadUrl();
3 changes: 0 additions & 3 deletions app/views/tutorials/cancel_edit.coffee

This file was deleted.

3 changes: 3 additions & 0 deletions app/views/tutorials/cancel_edit.js.erb
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
$('.tutorialRow[data-id="<%= @tutorial.id %>"')
.replaceWith("<%= j render partial: 'tutorials/row',
locals: { tutorial: @tutorial } %>");
4 changes: 0 additions & 4 deletions app/views/tutorials/validate_certificate.coffee

This file was deleted.

6 changes: 6 additions & 0 deletions app/views/tutorials/validate_certificate.js.erb
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
$("#validateCertificate-modal-content")
.empty()
.append("<%= j render partial: 'quiz_certificates/form' %>");

initBootstrapPopovers();
$("#validateCertificateModal").modal("show");
3 changes: 0 additions & 3 deletions app/views/users/delete_account.coffee

This file was deleted.

4 changes: 4 additions & 0 deletions app/views/users/delete_account.js.erb
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
$("#deleteAccount-modal-content")
.empty()
.append("<%= j render partial: 'users/delete_account' %>");
$("#deleteAccountModal").modal("show");
3 changes: 0 additions & 3 deletions app/views/vertices/new.coffee

This file was deleted.

3 changes: 3 additions & 0 deletions app/views/vertices/new.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
$("#quiz_buttons").hide();
$("#new_vertex").show();
$("html, body").animate({ scrollTop: $("#new_vertex").offset().top - 20 });
Loading
Loading