246 lines
3.0 KiB
JavaScript
246 lines
3.0 KiB
JavaScript
|
|
|
|
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" );
|
|
|
|
}
|
|
|
|
} |