First commit

This commit is contained in:
2025-12-25 11:16:59 +01:00
commit 0c5ca09a63
720 changed files with 329234 additions and 0 deletions

View File

@@ -0,0 +1,8 @@
import user from '/user/user.js';
export default class commentEditAuthor extends user{
display = "none";
}

View File

@@ -0,0 +1,16 @@
import commentBody from '../comment.body.js';
import textarea from '/elements/textarea.js';
export default class commentEditBody extends commentBody, textarea{
useCustomElement = true;
height = "97px";
placeholder = "Message";
}

View File

@@ -0,0 +1,103 @@
import comment from '../comment.js';
import saveButton from './comment.saveButton.js';
import userLabel from './comment.userLabel.js';
import commentEditTitle from './comment.create.title.js';
import commentEditBody from './comment.create.body.js';
import commentEditAuthor from './comment.create.author.js';
import header from '/elements/header.js';
import collection from '/unify/collection.js';
import groups from '/user/group/user.group.permission.js';
export default class createComment extends comment{
display = "flex";
body = new commentEditBody();
saveButton = new saveButton();
title = false;
author = this.user; // bug destroys the permission system
#ifdef WINDOWS
#ifdef DARK
#endif
#ifdef LIGHT
#endif
#endif
#ifdef MACOS
#ifdef DARK
background = "#00000042";
#endif
#ifdef LIGHT
background = "#ffffffd1";
#endif
#endif
width = "50vw";
debug = true;
width = "100%";
marginTop = 40;
async create() {
this.body.value = "";
this.setID( false );
}
disableWRITE() {
this.hide();
}
enableWRITE() {
this.show();
}
permission() {
this.allow( groups.member, "WRITE" );
this.allow( groups.admin, "WRITE" );
}
}

View File

@@ -0,0 +1,8 @@
import commentTitle from '../comment.title.js';
export default class commentEditTitle extends commentTitle{
}

View File

@@ -0,0 +1,29 @@
import button from '/elements/button.js';
import tools from '/unify/tools.js';
export default class saveCommentButton extends button {
label = "Create comment";
async click( event ){
var result = await this.socketManager.get( "table", "save", this.parent );
this.parent.create();
await this.parent.parent.commentsMessages.sync();
this.parent.parent.customElement.scrollTo( 0, this.parent.parent.customElement.scrollHeight);
console.log("laatste", this.parent.parent.customElement.scrollHeight);
}
}

View File

@@ -0,0 +1,38 @@
import input from '/elements/input.js';
export default class userLabel extends input{
float = "right";
useCustomElement = false;
height = 20;
float = "right";
marginLeft = 100;
marginTop = 20;
setAuthor( author ) {
if( author.username ) {
this.value = "author: " + author.username.value;
}
}
create() {
var author = this.parent.parent.author;
this.setAuthor( author );
}
}