notherbase-fs 4.3.4 → 4.3.5
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/controllers/user.js +0 -29
- package/package.json +1 -1
- package/public/js/base.js +0 -38
- package/views/explorer.ejs +2 -6
package/controllers/user.js
CHANGED
|
@@ -262,35 +262,6 @@ export default class User {
|
|
|
262
262
|
}
|
|
263
263
|
}
|
|
264
264
|
|
|
265
|
-
/**
|
|
266
|
-
* Gets a user's saved view state.
|
|
267
|
-
*/
|
|
268
|
-
getView = async (req, res) => {
|
|
269
|
-
if (loginCheck(req, res)) {
|
|
270
|
-
let user = await req.db.Spirit.recallOne("user", null, { username: req.session.currentUser });
|
|
271
|
-
|
|
272
|
-
if (check(res, user, "Account not found!")) {
|
|
273
|
-
success(res, "View found", user.memory.data.view);
|
|
274
|
-
}
|
|
275
|
-
}
|
|
276
|
-
}
|
|
277
|
-
|
|
278
|
-
/**
|
|
279
|
-
* Sets a user's view state.
|
|
280
|
-
*/
|
|
281
|
-
setView = async (req, res) => {
|
|
282
|
-
if (loginCheck(req, res)) {
|
|
283
|
-
let user = await req.db.Spirit.recallOne("user", null, { username: req.session.currentUser });
|
|
284
|
-
|
|
285
|
-
if (check(res, user, "Account not found!")) {
|
|
286
|
-
user.memory.data.view = req.body.view == "compact" ? "compact" : "full";
|
|
287
|
-
await user.commit();
|
|
288
|
-
|
|
289
|
-
success(res, "View set");
|
|
290
|
-
}
|
|
291
|
-
}
|
|
292
|
-
}
|
|
293
|
-
|
|
294
265
|
//download all spirit data belonging to the user
|
|
295
266
|
downloadData = async (req, res) => {
|
|
296
267
|
if (loginCheck(req, res)) {
|
package/package.json
CHANGED
package/public/js/base.js
CHANGED
|
@@ -17,13 +17,6 @@ class Base {
|
|
|
17
17
|
this.playerAccount = {
|
|
18
18
|
username: null
|
|
19
19
|
};
|
|
20
|
-
|
|
21
|
-
this.$viewToggle = null;
|
|
22
|
-
this.viewState = "compact";
|
|
23
|
-
|
|
24
|
-
Base.commune("getView").then((res) => {
|
|
25
|
-
if (res.data === "full") this.toggleView(false);
|
|
26
|
-
});
|
|
27
20
|
}
|
|
28
21
|
|
|
29
22
|
/**
|
|
@@ -135,37 +128,6 @@ class Base {
|
|
|
135
128
|
return response;
|
|
136
129
|
}
|
|
137
130
|
|
|
138
|
-
/**
|
|
139
|
-
* Creates the toggle view button.
|
|
140
|
-
*/
|
|
141
|
-
createToggleViewButton = async () => {
|
|
142
|
-
// add a button to the footer for toggling between compact and full view
|
|
143
|
-
this.$viewToggle = $("<button>").addClass("view-toggle").text(">");
|
|
144
|
-
this.$viewToggle.on("click", () => {
|
|
145
|
-
this.toggleView();
|
|
146
|
-
});
|
|
147
|
-
$("footer").append(this.$viewToggle);
|
|
148
|
-
}
|
|
149
|
-
|
|
150
|
-
/**
|
|
151
|
-
* Toggles the view between compact and full.
|
|
152
|
-
* @param {Boolean} save Whether or not to save the view state.
|
|
153
|
-
*/
|
|
154
|
-
toggleView = async (save = true) => {
|
|
155
|
-
if (this.viewState === "compact") {
|
|
156
|
-
this.viewState = "full";
|
|
157
|
-
if (this.$viewToggle) this.$viewToggle.text("<");
|
|
158
|
-
$("main").addClass("full-view");
|
|
159
|
-
}
|
|
160
|
-
else {
|
|
161
|
-
this.viewState = "compact";
|
|
162
|
-
if (this.$viewToggle) this.$viewToggle.text(">");
|
|
163
|
-
$("main").removeClass("full-view");
|
|
164
|
-
}
|
|
165
|
-
|
|
166
|
-
if (save) Base.commune("setView", { view: this.viewState });
|
|
167
|
-
}
|
|
168
|
-
|
|
169
131
|
/**
|
|
170
132
|
* Appends html to the head.
|
|
171
133
|
* @param {String} html The html to append.
|
package/views/explorer.ejs
CHANGED
|
@@ -17,7 +17,7 @@
|
|
|
17
17
|
<div class="form">
|
|
18
18
|
<h3>Login to Your Account</h3>
|
|
19
19
|
<label>
|
|
20
|
-
<h4>Your
|
|
20
|
+
<h4>Your Username:</h4>
|
|
21
21
|
<input type="text" placeholder="Username" id="username">
|
|
22
22
|
</label>
|
|
23
23
|
<label>
|
|
@@ -76,8 +76,4 @@
|
|
|
76
76
|
<% } %>
|
|
77
77
|
</main>
|
|
78
78
|
|
|
79
|
-
<%- include("./footer.ejs"); %>
|
|
80
|
-
|
|
81
|
-
<script>
|
|
82
|
-
base.createToggleViewButton();
|
|
83
|
-
</script>
|
|
79
|
+
<%- include("./footer.ejs"); %>
|