notherbase-fs 4.3.4 → 4.3.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.
@@ -17,8 +17,6 @@ export default class User {
17
17
  this.router.post("/login", this.login);
18
18
  this.router.post("/deletePermanently", this.deletePermanently);
19
19
  this.router.post("/getInfo", this.getInfo);
20
- this.router.post("/getView", this.getView);
21
- this.router.post("/setView", this.setView);
22
20
  this.router.post("/downloadData", this.downloadData);
23
21
  this.router.post("/deleteAlldata", this.deleteAlldata);
24
22
  this.router.post("/importData", this.importData);
@@ -262,35 +260,6 @@ export default class User {
262
260
  }
263
261
  }
264
262
 
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
263
  //download all spirit data belonging to the user
295
264
  downloadData = async (req, res) => {
296
265
  if (loginCheck(req, res)) {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "notherbase-fs",
3
- "version": "4.3.4",
3
+ "version": "4.3.6",
4
4
  "description": "Functions to help make developing for NotherBase easier.",
5
5
  "exports": "./notherbase-fs.js",
6
6
  "scripts": {
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.
@@ -17,7 +17,7 @@
17
17
  <div class="form">
18
18
  <h3>Login to Your Account</h3>
19
19
  <label>
20
- <h4>Your Name:</h4>
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"); %>