notherbase-fs 3.4.4 → 3.4.6
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/package.json +1 -1
- package/public/js/base.js +23 -10
- package/views/head.ejs +7 -7
package/package.json
CHANGED
package/public/js/base.js
CHANGED
|
@@ -18,6 +18,9 @@ class Base {
|
|
|
18
18
|
username: null,
|
|
19
19
|
email: null
|
|
20
20
|
};
|
|
21
|
+
|
|
22
|
+
this.$viewToggle = null;
|
|
23
|
+
this.viewState = "compact";
|
|
21
24
|
}
|
|
22
25
|
|
|
23
26
|
/**
|
|
@@ -142,14 +145,14 @@ class Base {
|
|
|
142
145
|
* Creates the toggle view button.
|
|
143
146
|
*/
|
|
144
147
|
createToggleViewButton = async () => {
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
this
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
$("footer").append(this.$viewToggle);
|
|
148
|
+
// add a button to the footer for toggling between compact and full view
|
|
149
|
+
this.$viewToggle = $("<button>").addClass("view-toggle").text(">");
|
|
150
|
+
this.$viewToggle.on("click", () => {
|
|
151
|
+
this.toggleView();
|
|
152
|
+
});
|
|
153
|
+
$("footer").append(this.$viewToggle);
|
|
152
154
|
|
|
155
|
+
Base.commune("getView").then((res) => {
|
|
153
156
|
if (res.data === "full") this.toggleView(false);
|
|
154
157
|
});
|
|
155
158
|
}
|
|
@@ -159,15 +162,25 @@ class Base {
|
|
|
159
162
|
* @param {Boolean} save Whether or not to save the view state.
|
|
160
163
|
*/
|
|
161
164
|
toggleView = async (save = true) => {
|
|
162
|
-
if (this
|
|
165
|
+
if (this.viewState === "compact") {
|
|
166
|
+
this.viewState = "full";
|
|
163
167
|
this.$viewToggle.text("<");
|
|
164
168
|
$("main").addClass("full-view");
|
|
165
|
-
if (save) Base.commune("setView", { view: "full" });
|
|
166
169
|
}
|
|
167
170
|
else {
|
|
171
|
+
this.viewState = "compact";
|
|
168
172
|
this.$viewToggle.text(">");
|
|
169
173
|
$("main").removeClass("full-view");
|
|
170
|
-
if (save) Base.commune("setView", { view: "compact" });
|
|
171
174
|
}
|
|
175
|
+
|
|
176
|
+
if (save) Base.commune("setView", { view: this.viewState });
|
|
177
|
+
}
|
|
178
|
+
|
|
179
|
+
/**
|
|
180
|
+
* Appends html to the head.
|
|
181
|
+
* @param {String} html The html to append.
|
|
182
|
+
*/
|
|
183
|
+
appendToHead = (html) => {
|
|
184
|
+
$("head").append($(html));
|
|
172
185
|
}
|
|
173
186
|
}
|
package/views/head.ejs
CHANGED
|
@@ -4,15 +4,15 @@
|
|
|
4
4
|
<meta charset="UTF-8">
|
|
5
5
|
<title><%= siteTitle %></title>
|
|
6
6
|
<meta name="viewport" content="width=device-width,initial-scale=1.0">
|
|
7
|
-
<
|
|
8
|
-
<link rel="preconnect" href="https://fonts.
|
|
9
|
-
<link rel="preconnect" href="https://fonts.gstatic.com" crossorigin>
|
|
7
|
+
<link async rel="preconnect" href="https://fonts.googleapis.com">
|
|
8
|
+
<link async rel="preconnect" href="https://fonts.gstatic.com" crossorigin>
|
|
10
9
|
<!-- font-family: 'Roboto' or 'Roboto Condensed', sans-serif; -->
|
|
11
|
-
<link href="https://fonts.googleapis.com/css2?family=Roboto&family=Roboto+Condensed:wght@700&display=swap" rel="stylesheet">
|
|
10
|
+
<link async href="https://fonts.googleapis.com/css2?family=Roboto&family=Roboto+Condensed:wght@700&display=swap" rel="stylesheet">
|
|
12
11
|
<!-- 'Redacted Script', cursive; -->
|
|
13
|
-
<link href="https://fonts.googleapis.com/css2?family=Redacted+Script:wght@300&display=swap" rel="stylesheet">
|
|
14
|
-
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/5.15.4/css/all.min.css">
|
|
15
|
-
<link rel="stylesheet" href="/styles/main.css">
|
|
12
|
+
<link async href="https://fonts.googleapis.com/css2?family=Redacted+Script:wght@300&display=swap" rel="stylesheet">
|
|
13
|
+
<link async rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/5.15.4/css/all.min.css">
|
|
14
|
+
<link async rel="stylesheet" href="/styles/main.css">
|
|
16
15
|
</head>
|
|
17
16
|
|
|
18
17
|
<body>
|
|
18
|
+
<script src="https://code.jquery.com/jquery-3.6.0.min.js" integrity="sha256-/xUj+3OJU5yExlq6GSYGSHk7tPXikynS7ogEvDej/m4=" crossorigin="anonymous"></script>
|