First commit
This commit is contained in:
8
application/demo/comment/create/comment.create.author.js
Normal file
8
application/demo/comment/create/comment.create.author.js
Normal file
@@ -0,0 +1,8 @@
|
||||
|
||||
import user from '/user/user.js';
|
||||
|
||||
export default class commentEditAuthor extends user{
|
||||
|
||||
display = "none";
|
||||
|
||||
}
|
||||
16
application/demo/comment/create/comment.create.body.js
Normal file
16
application/demo/comment/create/comment.create.body.js
Normal 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";
|
||||
|
||||
}
|
||||
103
application/demo/comment/create/comment.create.js
Normal file
103
application/demo/comment/create/comment.create.js
Normal 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" );
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
||||
8
application/demo/comment/create/comment.create.title.js
Normal file
8
application/demo/comment/create/comment.create.title.js
Normal file
@@ -0,0 +1,8 @@
|
||||
|
||||
|
||||
import commentTitle from '../comment.title.js';
|
||||
|
||||
|
||||
export default class commentEditTitle extends commentTitle{
|
||||
|
||||
}
|
||||
29
application/demo/comment/create/comment.saveButton.js
Normal file
29
application/demo/comment/create/comment.saveButton.js
Normal 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);
|
||||
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
38
application/demo/comment/create/comment.userLabel.js
Normal file
38
application/demo/comment/create/comment.userLabel.js
Normal 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 );
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user