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,19 @@
import newsBody from '../news.body.js';
import textarea from '/elements/textarea.js';
export default class newsPageBody extends newsBody, textarea{
placeholder = "Message";
height = 120;
async keyup( event ) {
this.value = event.target.value;
}
}

View File

@@ -0,0 +1,39 @@
import button from '/elements/button.js';
export default class editButton extends button {
label = "Save";
async click( event, object ){
var result = await this.parent.parent.save();
// reset id so you can create a new row again
var editNewsDialog = this.parent.parent;
editNewsDialog.id = false;
// reset title
editNewsDialog.newsTitleRow.title.value = "";
// reset body
editNewsDialog.newsBodyRow.body.value = "";
editNewsDialog.hide();
this.parents("newsPages").newsPage.sync();
if( this.parents("newsItemPage").newsListTable ) {
this.parents("newsItemPage").newsListTable.body.update();
}
}
}

View File

@@ -0,0 +1,246 @@
import news from '../news.js';
import newsEditTitle from './news.edit.title.js';
import newsEditBody from './news.edit.body.js';
import newsEditbutton from './news.edit.button.js';
import newsEditPrice from './news.edit.price.js';
import groups from '/user/group/user.group.permission.js';
import label from '/elements/label/left.js';
import panel from '/elements/panel.js';
import frostedGlass from '/elements/window/frostedGlass.js';
import draggable from '/elements/window/draggable.js';
import button from '/elements/button.js';
import panelRow from '/elements/panel/row.js';
class newsBodyRow extends panelRow{
#ifdef WINDOWS
background = "none";
#endif
border = "none"
label = new label("Message");
body = new newsEditBody();
}
class newsTitleRow extends panelRow{
#ifdef WINDOWS
background = "none";
#endif
border = "none"
label = new label("Title");
title = new newsEditTitle();
}
class newsPriceRow extends panelRow{
#ifdef WINDOWS
background = "none";
#endif
border = "none"
label = new label("Price");
price = new newsEditPrice();
}
class cancelButton extends button{
text = "Cancel";
boxWidth = "100%"
click() {
this.parent.parent.hide();
}
}
class newsButtonRow extends panelRow{
border = "none"
cancelButton = new cancelButton();
newsEditbutton = new newsEditbutton();
#ifdef WINDOWS
background = "none";
#endif
}
import header from '/elements/window/header.js';
export default class newsEdit extends news, panel, draggable {
header = new header("News");
layers = 2;
zIndex = 10000;
#ifdef WINDOWS
fontFamily = "segoe";
#endif
#ifdef MACOS
fontFamily = "sf-ui";
width = 600;
#ifdef DARK
background = "#161110bf";
#endif
#ifdef LIGHT
//background = "white";
background = "#fdfdfdbf"
#endif
backdropFilter = "blur(22px)";
#endif
#ifdef WINDOWS
fontFamily = "SegoeUI";
width = 600;
#ifdef DARK
background = "#202020cc";
border = "1px solid rgb(44 45 46)";
#endif
#ifdef LIGHT
//background = "white";
background = "#fdfdfdbf"
#endif
backdropFilter = "blur(22px)";
#endif
selector = "#application";
display = "none";
flexDirection = "column";
debug = true;
position = "absolute"
boxBackgroundImage;
newsTitleRow = new newsTitleRow();
newsPriceRow = new newsPriceRow();
newsBodyRow = new newsBodyRow();
newsButtonRow = new newsButtonRow();
debug = true;
height = "fit-content";
async create() {
//await this.sync();
//this.hide();
}
afterLoad() {
this.center();
}
permission() {
this.allow( groups.member, "READ" );
this.allow( groups.admin, "READ" );
this.allow( groups.visitor, "READ" );
this.allow( groups.member, "WRITE" );
this.allow( groups.admin, "WRITE" );
this.allow( groups.visitor, "WRITE" );
}
}

View File

@@ -0,0 +1,18 @@
import newsPrice from '../news.price.js';
import input from '/elements/input.js';
export default class newsPagePrice extends newsPrice, input{
placeholder = "Price";
async keyup( event ) {
this.value = event.target.value;
}
}

View File

@@ -0,0 +1,11 @@
import newsTitle from '../news.title.js';
import input from '/elements/input.js';
export default class newsEditTitle extends input, newsTitle{
placeholder = "Title";
}