notherbase-fs 1.5.0 → 1.5.1

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.
@@ -71,7 +71,7 @@ router.post("/logout", authCheck, async function(req, res) {
71
71
 
72
72
  router.get("/all", async function(req, res) {
73
73
  try {
74
- let foundUsers = await user.find({}, 'username coin home authLevels location attributes');
74
+ let foundUsers = await user.find({}, 'username coin home authLevels location attributes email');
75
75
 
76
76
  res.status(200).send({ foundUsers: foundUsers });
77
77
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "notherbase-fs",
3
- "version": "1.5.0",
3
+ "version": "1.5.1",
4
4
  "description": "Functions to help make developing for NotherBase easier.",
5
5
  "exports": "./notherbase-fs.js",
6
6
  "scripts": {
@@ -6,6 +6,7 @@ class ChatBox {
6
6
  this.$div = $(`.chat-box#${room}`);
7
7
  this.$chatLog = null;
8
8
  this.$entry = null;
9
+ this.maxMessages = 100;
9
10
 
10
11
  this.socket = io({
11
12
  query: {
@@ -21,6 +22,13 @@ class ChatBox {
21
22
  newMessage = (msg) => {
22
23
  let time = new Date(msg.time);
23
24
  this.$chatLog.append(`<p>[${time.toLocaleTimeString('en-US')}] ${msg.name}: ${msg.text}</p>`);
25
+ this.$chatLog.scrollTop(this.$chatLog.prop("scrollHeight"));
26
+ let msgs = this.$chatLog.find("p");
27
+ if (msgs.length > this.maxMessages) {
28
+ for (let i = 0; i < msgs.length - this.maxMessages; i++) {
29
+ msgs[i].remove();
30
+ }
31
+ }
24
32
  }
25
33
 
26
34
  sendMessage = () => {
@@ -1,9 +1,8 @@
1
1
  .chat-box {
2
2
  position: relative;
3
- box-shadow: 5px 5px 10px 5px var(--shadowColor);
4
- margin-top: 20px;
3
+ box-shadow: var(--boxShadow);
5
4
  width: 100%;
6
- min-height: 200px;
5
+ height: 400px;
7
6
  }
8
7
 
9
8
  .chat-name {
@@ -13,24 +12,23 @@
13
12
 
14
13
  .chat-log {
15
14
  width: 100%;
16
- height: calc(100% - 65px);
15
+ height: 300px;
17
16
  background-color: rgba(0, 0, 0, 0.534);
18
17
  overflow: auto;
19
18
  padding: 5px;
20
19
  }
21
20
 
22
21
  .chat-send {
23
- position: absolute;
24
- right: 0;
25
- bottom: 0;
26
- height: 25px;
22
+ height: calc(var(--pSize) + 2 * var(--padding));
27
23
  width: 5em;
28
24
  outline: none;
29
25
  background-color: var(--bgColor);
30
- border: 1px solid var(--textColor);
26
+ border: var(--standardBorder);
31
27
  color: var(--textColor);
32
28
  text-align: center;
33
- padding: 2px;
29
+ padding: 0;
30
+ margin: 0;
31
+ border-radius: 0;
34
32
  }
35
33
 
36
34
  .chat-send:hover {
@@ -40,21 +38,20 @@
40
38
  }
41
39
 
42
40
  .chat-entry {
43
- position: absolute;
44
- left: 0;
45
- bottom: 0;
46
- height: 25px;
41
+ height: calc(var(--pSize) + 2 * var(--padding));
47
42
  width: calc(100% - 5em);
48
43
  outline: none;
49
44
  background-color: var(--bgColor);
50
- border: 1px solid var(--textColor);
45
+ border: var(--standardBorder);
51
46
  color: var(--textColor);
47
+ margin: 0;
48
+ padding: var(--padding);
52
49
  }
53
50
 
54
51
  .chat-log > p {
55
52
  color: var(--textColor);
56
53
  margin: 0;
57
- padding: 0;
54
+ padding: 2px;
58
55
  line-height: 1em;
59
56
  text-align: left;
60
57
  }
@@ -1,7 +1,5 @@
1
- import path from 'node:path';
2
1
  import NotherBaseFS from "../notherbase-fs.js";
3
2
  import { fileURLToPath } from 'node:url';
4
3
  const __dirname = fileURLToPath(new URL('./', import.meta.url));
5
- console.log(__dirname);
6
4
 
7
5
  const notherBaseFS = new NotherBaseFS(__dirname, `${__dirname}void`, __dirname, `${__dirname}pages`);