Basic chat UI complete.

This commit is contained in:
rainbow napkin 2025-10-01 04:33:24 -04:00
parent f109314163
commit e81a4c0973
11 changed files with 393 additions and 71 deletions

View file

@ -150,17 +150,14 @@ class pmHandler{
* @returns {String} sanatized/validates message, returns null on validation failure
*/
sanatizeMessage(msg){
//if msg is empty or null
if(msg == null || msg == ''){
//Pimp slap that shit into fucking oblivion
return null;
}
//Normally I'd kill empty messages here
//But instead we're allowing them for sesh startups
//Trim and Sanatize for XSS
msg = validator.trim(validator.escape(msg));
//Return whether or not the shit was long enough
if(validator.isLength(msg, {min: 1, max: 255})){
//Return whether or not the shit was too long
if(validator.isLength(msg, {min: 0, max: 255})){
//If it's valid return the message
return msg;
}

View file

@ -26,11 +26,13 @@ along with this program. If not, see <https://www.gnu.org/licenses/>. %>
</div>
<div id="pm-panel-sesh-container">
<div id="pm-panel-sesh-buffer">
<div id="pm-panel-sesh-welcome">
<h1>Start a sesh to start chatting!</h1>
</div>
</div>
<div class="control-prompt" id="pm-panel-sesh-control-div">
<input class="control-prompt" id="pm-panel-message-prompt" placeholder="Chat...">
<button class="positive-button" id="pm-panel-send-button">Send</button>
<input class="control-prompt" id="pm-panel-message-prompt" placeholder="Chat..." disabled>
<button class="positive-button" id="pm-panel-send-button" disabled>Send</button>
</div>
</div>
</div>