refactor(js): streamline frontend SCSS import
Migrated the SCSS import for the frontend directly into editor.js and userarea.js from frontend.js, removing redundancy by consolidating style imports. This adjustment enables more coherent management of SCSS files and removes the need for a separate frontend bundle. Consequently, frontend.js and its references in HTML templates were removed to clean up the codebase and simplify the asset pipeline. These changes should make future maintenance of CSS easier and improve load times by reducing unnecessary scripting and network requests.
This commit is contained in:
parent
0888e6132a
commit
bcca11aab9
6 changed files with 9 additions and 9 deletions
|
@ -1,6 +1,7 @@
|
|||
import { getScene, getSceneElement, getCategory } from "./api";
|
||||
import { populateDestinationDropdown } from "./editor/teleport";
|
||||
|
||||
import "../scss/frontend.scss";
|
||||
import "../css/editor.css";
|
||||
|
||||
let clickTimestamp = 0;
|
||||
|
@ -94,6 +95,9 @@ function startModifyElement(event) {
|
|||
<hr/>
|
||||
|
||||
<form id="modifyElementForm">
|
||||
<input type="hidden" id="csrfmiddlewaretoken" value="${getCookie(
|
||||
"csrftoken"
|
||||
)}">
|
||||
<input type="hidden" id="id" value="${event.target.getAttribute("id")}">
|
||||
<div class="dropdown mb-2">
|
||||
<label for="destinationDropdownSearch" class="form-label">Teleport Destination</label>
|
||||
|
@ -149,7 +153,10 @@ function startModifyElement(event) {
|
|||
reader.onload = function (e) {
|
||||
// Set the image to the file contents
|
||||
if (event.target.getAttribute("data-original-src") == undefined) {
|
||||
event.target.setAttribute("data-original-src", event.target.getAttribute("src"));
|
||||
event.target.setAttribute(
|
||||
"data-original-src",
|
||||
event.target.getAttribute("src")
|
||||
);
|
||||
}
|
||||
event.target.setAttribute("src", e.target.result);
|
||||
};
|
||||
|
|
|
@ -1 +0,0 @@
|
|||
import '../scss/frontend.scss';
|
|
@ -1,3 +1,4 @@
|
|||
import '../scss/frontend.scss';
|
||||
import '../css/userarea.css';
|
||||
|
||||
import { Tab } from 'bootstrap';
|
||||
|
|
|
@ -3,11 +3,6 @@
|
|||
<html>
|
||||
<head>
|
||||
<title>{{ scene.title }} – Quackscape</title>
|
||||
<script
|
||||
type="text/javascript"
|
||||
type="module"
|
||||
src="{% static 'js/frontend.bundle.js' %}"
|
||||
></script>
|
||||
<script
|
||||
type="text/javascript"
|
||||
type="module"
|
||||
|
|
|
@ -29,7 +29,6 @@
|
|||
</div>
|
||||
</div>
|
||||
|
||||
<script src="{% static 'js/frontend.bundle.js' %}"></script>
|
||||
<script src="{% static 'js/userarea.bundle.js' %}"></script>
|
||||
</body>
|
||||
</html>
|
||||
|
|
|
@ -9,7 +9,6 @@ module.exports = {
|
|||
scene: "./assets/js/scene.js",
|
||||
editor: "./assets/js/editor.js",
|
||||
userarea: "./assets/js/userarea.js",
|
||||
frontend: "./assets/js/frontend.js",
|
||||
},
|
||||
output: {
|
||||
path: path.resolve(__dirname, "static/js"),
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue