Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
1 change: 1 addition & 0 deletions Changelog.md
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,7 @@
- Updated `pdfjs-dist` to v5.6.205 (#7942)
- Switched SCSS files to use `@use` instead of `@import` to reduce bundle size (#7943)
- Fixed flaky git-hooks tests (#7950)
- Replaced custom `HTMLElement` class methods with native versions and removed `application.js` (#7951)

## [v2.9.6]

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -67,9 +67,9 @@ class ImageAnnotationManager extends AnnotationManager {
if (holder === null) {
holder = document.createElement("div");
holder.id = "annotation_holder_" + annotation_id;
holder.addClass("annotation_holder");
holder.classList.add("annotation_holder");
if (this.annotations[annotation_id].is_remark) {
holder.addClass("remark");
holder.classList.add("remark");
}
holder.onmousemove = this.check_for_annotations.bind(this);
if (this.enable_annotations) {
Expand Down
6 changes: 3 additions & 3 deletions app/assets/javascripts/Annotations/pdf_annotation_manager.js
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@

let $control = document.createElement("div");
$control.id = "sel_box";
$control.addClass("annotation-holder-active");
$control.classList.add("annotation-holder-active");
$control.style.display = "none";

// append $control before the first annotation_holder but after the annotationLayer
Expand Down Expand Up @@ -219,9 +219,9 @@

let $control = document.createElement("div");
$control.id = "annotation_holder_" + annotation_id;
$control.addClass("annotation_holder");
$control.classList.add("annotation_holder");
if (this.annotations[annotation_id].is_remark) {
$control.addClass("remark");
$control.classList.add("remark");
}
$control.style.top = (newCoords.y1 / COORDINATE_MULTIPLIER) * 100 + "%";
$control.style.left = (newCoords.x1 / COORDINATE_MULTIPLIER) * 100 + "%";
Expand Down
12 changes: 6 additions & 6 deletions app/assets/javascripts/Annotations/source_code_line.js
Original file line number Diff line number Diff line change
Expand Up @@ -87,9 +87,9 @@ class SourceCodeLine {
newGlowDepth = (parseInt(glowDepth, 10) + 1).toString();
}
parent.setAttribute("data-annotationDepth", newGlowDepth);
parent.addClass("source-code-glowing-" + newGlowDepth);
parent.classList.add("source-code-glowing-" + newGlowDepth);
if (is_remark) {
parent.addClass("remark");
parent.classList.add("remark");
}
parent.addEventListener("mouseover", hoverOnFunction);
parent.addEventListener("mouseout", hoverOffFunction);
Expand Down Expand Up @@ -131,7 +131,7 @@ class SourceCodeLine {
startNode.textContent = startNode.textContent.substr(startNodeOffset);

// Maintain events
if (startSpanPlain.hasClass("source-code-glowing-1")) {
if (startSpanPlain.classList.contains("source-code-glowing-1")) {
startSpanPlain.addEventListener("mouseover", hoverOnFunction);
startSpanPlain.addEventListener("mouseout", hoverOffFunction);
}
Expand Down Expand Up @@ -196,9 +196,9 @@ class SourceCodeLine {
}
spanGlow.setAttribute("data-annotationDepth", newGlowDepth);
spanGlow.setAttribute("data-annotationID" + annotationId, annotationId);
spanGlow.addClass("source-code-glowing-" + newGlowDepth);
spanGlow.classList.add("source-code-glowing-" + newGlowDepth);
if (is_remark) {
spanGlow.addClass("remark");
spanGlow.classList.add("remark");
}
spanGlow.addEventListener("mouseover", hoverOnFunction);
spanGlow.addEventListener("mouseout", hoverOffFunction);
Expand Down Expand Up @@ -233,7 +233,7 @@ class SourceCodeLine {
let glowDepth = parseInt(parent.getAttribute("data-annotationDepth"), 10);
parent.setAttribute("data-annotationDepth", (glowDepth - 1).toString());

parent.removeClass("source-code-glowing-" + glowDepth);
parent.classList.remove("source-code-glowing-" + glowDepth);

// Remove mouse listeners if no longer glowing
if (glowDepth === 1) {
Expand Down
35 changes: 0 additions & 35 deletions app/assets/javascripts/application.js

This file was deleted.

6 changes: 3 additions & 3 deletions app/javascript/Components/Result/image_viewer.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -188,10 +188,10 @@ export class ImageViewer extends React.PureComponent {
let picture = document.getElementById("image_preview");

if (this.state.rotation > 0) {
picture.addClass("rotate" + this.state.rotation.toString());
picture.removeClass("rotate" + (this.state.rotation - 90).toString());
picture.classList.add("rotate" + this.state.rotation.toString());
picture.classList.remove("rotate" + (this.state.rotation - 90).toString());
} else {
picture.removeClass("rotate270");
picture.classList.remove("rotate270");
}
};

Expand Down
2 changes: 1 addition & 1 deletion app/javascript/common/theme_colors.js
Original file line number Diff line number Diff line change
Expand Up @@ -65,5 +65,5 @@ export function set_theme(theme) {
document.documentElement.style.setProperty("--" + color, themes.light[color]);
});
}
document.body.addClass("color-" + theme);
document.body.classList.add("color-" + theme);
}
1 change: 0 additions & 1 deletion app/views/layouts/assignment_content.html.erb
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@
<%= render partial: 'layouts/head' %>
<title><%= t(:markus) + ' - ' + (content_for?(:html_title) ? yield(:html_title) : controller.action_name.titleize) %></title>
<%= javascript_include_tag 'application_webpack', nonce: true %>
<%= javascript_include_tag 'application', nonce: true %>
<% unless session[:auth_type] == 'remote' %>
<%= javascript_include_tag 'check_timeout', nonce: true %>
<% end %>
Expand Down
1 change: 0 additions & 1 deletion app/views/layouts/content.html.erb
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@
<%= render partial: 'layouts/head' %>
<title><%= t(:markus) %> - <%= controller.action_name.titleize %></title>
<%= javascript_include_tag 'application_webpack', nonce: true %>
<%= javascript_include_tag 'application', nonce: true %>
<% unless session[:auth_type] == 'remote' %>
<%= javascript_include_tag 'check_timeout', nonce: true %>
<% end %>
Expand Down
1 change: 0 additions & 1 deletion app/views/layouts/no_menu_header.html.erb
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@
<%= render partial: 'layouts/head' %>
<title><%= t(:markus) %> - <%= controller.action_name %></title>
<%= javascript_include_tag 'application_webpack', nonce: true %>
<%= javascript_include_tag 'application', nonce: true %>
<%= javascript_include_tag 'menu', nonce: true %>
<% unless session[:auth_type] == 'remote' %>
<%= javascript_include_tag 'check_timeout', nonce: true %>
Expand Down
1 change: 0 additions & 1 deletion app/views/layouts/result_content.erb
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@
<%= render partial: 'layouts/head' %>
<title><%= t(:markus) %> - <%= controller.action_name.titleize %></title>
<%= javascript_include_tag 'application_webpack', nonce: true %>
<%= javascript_include_tag 'application', nonce: true %>
<% unless session[:auth_type] == 'remote' %>
<%= javascript_include_tag 'check_timeout', nonce: true %>
<% end %>
Expand Down
Loading