Skip to content

Commit 22cb510

Browse files
committed
Updates
1 parent d54a6fc commit 22cb510

5 files changed

Lines changed: 231 additions & 5 deletions

File tree

src/chat/elementjson/chat-styles.css

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,11 @@
2828
var(--accent-default-saturation),
2929
21%
3030
);
31+
--input-disabled-bg-color: hsl(
32+
var(--accent-default-hue),
33+
var(--accent-default-saturation),
34+
2%
35+
);
3136
--input-text-color: hsl(
3237
var(--accent-default-hue),
3338
var(--accent-default-saturation),
@@ -351,6 +356,10 @@ body {
351356
outline: none;
352357
font-family: var(--main-font);
353358
}
359+
.inputText1 [disabled] {
360+
background-color: var(--input-disabled-bg-color);
361+
pointer-events: none;
362+
}
354363
.sep1 {
355364
border-top: 3px dashed var(--separator-color);
356365
padding: 0px 20px;
@@ -1665,6 +1674,7 @@ a {
16651674
}
16661675

16671676
.veryImportantDialog {
1677+
/* Important dialogs go to the front so that they can be visible */
16681678
position: fixed;
16691679
top: 0;
16701680
left: 0;

src/chat/interface/userlist-menu.js

Lines changed: 182 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,12 @@ var shtml = require("../../safehtmlencode.js");
99
var cacheBust = require("./cachebust.js");
1010
var sws = require("./sharedwebsocket.js");
1111

12-
function makeUserListDiv(username, removeFunction, selectFunction) {
12+
function makeUserListDiv(
13+
username,
14+
removeFunction,
15+
selectFunction,
16+
addFunction
17+
) {
1318
var pfp = accountHelper.getProfilePictureURL(username);
1419
var ownerNoteThing = {
1520
element: "div",
@@ -68,6 +73,72 @@ function makeUserListDiv(username, removeFunction, selectFunction) {
6873
});
6974
}
7075

76+
if (addFunction) {
77+
var isAdded = false;
78+
const SELECT_IMAGE = "images/check.svg";
79+
const SELECT_TEXT = "Select";
80+
const DESELECT_IMAGE = "images/remove.svg";
81+
const DESELECT_TEXT = "Deselect";
82+
var selectElm = null;
83+
icons.push({
84+
element: "div",
85+
style: {
86+
height: "23px",
87+
marginLeft: "4px",
88+
},
89+
className: "divButton roundborder",
90+
title: "Click to add this user",
91+
GPWhenCreated: function (elm) {
92+
selectElm = elm;
93+
},
94+
children: [
95+
{
96+
element: "img",
97+
src: SELECT_IMAGE,
98+
height: 20,
99+
},
100+
{
101+
element: "span",
102+
textContent: SELECT_TEXT,
103+
},
104+
],
105+
eventListeners: [
106+
{
107+
event: "click",
108+
func: function () {
109+
isAdded = !isAdded;
110+
if (isAdded) {
111+
elements.setInnerJSON(selectElm, [
112+
{
113+
element: "img",
114+
src: DESELECT_IMAGE,
115+
height: 20,
116+
},
117+
{
118+
element: "span",
119+
textContent: DESELECT_TEXT,
120+
},
121+
]);
122+
} else {
123+
elements.setInnerJSON(selectElm, [
124+
{
125+
element: "img",
126+
src: SELECT_IMAGE,
127+
height: 20,
128+
},
129+
{
130+
element: "span",
131+
textContent: SELECT_TEXT,
132+
},
133+
]);
134+
}
135+
addFunction(isAdded);
136+
},
137+
},
138+
],
139+
});
140+
}
141+
71142
var dom = [
72143
{
73144
element: "div",
@@ -569,6 +640,116 @@ class UserListMenu {
569640
])[0];
570641
});
571642
}
643+
644+
getUsersPrompt(infoText = "Choose users") {
645+
var _this = this;
646+
return new Promise(async (accept, reject) => {
647+
var usernameInput = null;
648+
await _this.loadUserListMenu();
649+
var selectedUsers = [];
650+
var dialogElement = elements.appendElementsFromJSON(document.body, [
651+
{
652+
element: "div",
653+
children: [
654+
//Background
655+
{
656+
element: "div",
657+
className: "dialogBackground",
658+
},
659+
//Dialog box
660+
{
661+
element: "div",
662+
className: "whiteBox centerMiddle popupDialogAnimation",
663+
style: {
664+
overflowY: "auto",
665+
maxHeight: "calc(100vh - 100px)",
666+
maxWidth: "calc(100vw - 300px)",
667+
},
668+
children: [
669+
{
670+
element: "span",
671+
style: {
672+
fontSize: "30px",
673+
fontWeight: "bold",
674+
},
675+
textContent: infoText,
676+
},
677+
678+
{
679+
element: "br",
680+
},
681+
{
682+
element: "button",
683+
className: "roundborder",
684+
textContent: "OK",
685+
eventListeners: [
686+
{
687+
event: "click",
688+
func: function () {
689+
dialogElement.remove();
690+
accept(selectedUsers);
691+
},
692+
},
693+
],
694+
},
695+
{
696+
element: "button",
697+
className: "roundborder",
698+
textContent: "Cancel",
699+
eventListeners: [
700+
{
701+
event: "click",
702+
func: function () {
703+
dialogElement.remove();
704+
accept([]);
705+
},
706+
},
707+
],
708+
},
709+
{
710+
element: "br",
711+
},
712+
713+
{
714+
element: "br",
715+
},
716+
717+
{
718+
element: "span",
719+
textContent: "From your known user list: ",
720+
},
721+
722+
{
723+
element: "div",
724+
className: "usersContainerRoomSettings",
725+
style: {
726+
maxHeight: "130px",
727+
overflow: "auto",
728+
},
729+
children: _this.currentUserList.map((username) => {
730+
return makeUserListDiv(
731+
username,
732+
null,
733+
null,
734+
function (addOrRemove) {
735+
if (addOrRemove) {
736+
selectedUsers.push(username);
737+
} else {
738+
selectedUsers = selectedUsers.filter(
739+
(otherUser) => otherUser !== username
740+
);
741+
}
742+
}
743+
);
744+
}),
745+
},
746+
],
747+
},
748+
],
749+
},
750+
])[0];
751+
});
752+
}
572753
}
573754

574755
module.exports = new UserListMenu();

src/randomquotes.txt

Lines changed: 37 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5,8 +5,6 @@
55
"Our final essays were sacrificed for your entertainment."
66
"Your Chromebook was built for work. We consider that a bug."
77
"This was coded during lectures we definitely should've heard."
8-
"Your school may take your Chromebook away after this."
9-
"The fastest way to get your Chromebook privileges revoked."
108
"Our dedication to not working is what made this possible."
119
"Our homework is still unfinished just so you can ignore yours."
1210
"The digital equivalent of passing notes in class."
@@ -40,4 +38,40 @@
4038
"We took an 'F' in participation to create this."
4139
"Sorry, not sorry teachers - We made this during study time."
4240
"Made during class work time, also enjoyed during class work time."
43-
"Our class time became site development time - so your class time can be rant time."
41+
"Our class time became site development time - so your class time can be rant time."
42+
"We loved having fun when we shouldn't - so we made this."
43+
"Never do classwork - to the max."
44+
"We got grounded - but the fun continues on our Chromebooks."
45+
"Built by productiveless students - for productiveless students."
46+
"Your Chromebook's 'Work Only' settings? We took that personally."
47+
"Our school gave us the tools for learning. We found the tools for lurking."
48+
"The only thing we successfully hacked was our own motivation."
49+
"We spent more time clearing our browser history than reading history textbooks."
50+
"Built on a foundation of blocked websites and unblocked fun."
51+
"The firewall is strong, but our need to rant is stronger."
52+
"We consider bypassing the school filter Advanced Computer Science."
53+
"The true function of a school-issued laptop is now online."
54+
"Our only successful 'group project' was getting this site to work on our schools Wi-Fi."
55+
"We found the balance: zero productivity, maximum entertainment."
56+
"This is what happens when you substitute studying for coding (and ranting)."
57+
"Our commitment to not doing homework is now a service for the community."
58+
"We went from passing notes to passing judgment."
59+
"We skipped the final exam review to finalize this masterpiece."
60+
"The digital manifestation of the phrase, 'I'll do it later.'"
61+
"The goal was never success. The goal was to survive the semester."
62+
"Welcome to the site that turns your A+ grade into F- grade."
63+
"This site was literally built on not doing our classwork. We had no other choice."
64+
"This site is a testament to what happens when you prioritize passion over passing."
65+
"The only thing we aced this semester was the launch of this website."
66+
"We gave the school an 'F' by giving you this 'A+' platform."
67+
"Welcome to the site that validates your decision to close the textbook."
68+
"Our lack of attendance is your gain in entertainment."
69+
"We couldn't handle the pressure of being good students, so we built a place for the academically free."
70+
"The ultimate guide to mismanaging your time (it works, trust us)."
71+
"This is where all the unwritten papers went to become something useful."
72+
"We didn't drop out, we just redirected our resources."
73+
"Our grades are non-existent, but this community is very real."
74+
"The grades were a suggestion. This site is a mandate."
75+
"We sacrificed a perfectly good valedictorian speech for this."
76+
"The site born from the realization that we were never going to study anyway."
77+
"Every click here is another reason we can't get into a good college."

wpstatic/images/remove.svg

Lines changed: 1 addition & 0 deletions
Loading

wpstatic/version.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
{"timestamp":"1761913275737"}
1+
{"timestamp":"1761917009748"}

0 commit comments

Comments
 (0)