Compare commits
No commits in common. "77f43372c948419ce453c420f8673ecb58681c94" and "fda85b38f9c69da527a7e8433841dc8fcd1f8531" have entirely different histories.
77f43372c9
...
fda85b38f9
18 changed files with 347 additions and 704 deletions
191
lib/plankton/plankton.d.ts
vendored
191
lib/plankton/plankton.d.ts
vendored
|
@ -2995,10 +2995,6 @@ declare namespace lib_plankton.pit {
|
||||||
type type_pit = int;
|
type type_pit = int;
|
||||||
}
|
}
|
||||||
declare namespace lib_plankton.pit {
|
declare namespace lib_plankton.pit {
|
||||||
/**
|
|
||||||
* @todo complete
|
|
||||||
*/
|
|
||||||
function timezone_name_to_timezone_shift(timezone_name: string): int;
|
|
||||||
/**
|
/**
|
||||||
*/
|
*/
|
||||||
function date_object_get_week_of_year(date: Date): int;
|
function date_object_get_week_of_year(date: Date): int;
|
||||||
|
@ -3012,7 +3008,7 @@ declare namespace lib_plankton.pit {
|
||||||
*/
|
*/
|
||||||
function to_date_object(pit: type_pit): Date;
|
function to_date_object(pit: type_pit): Date;
|
||||||
/**
|
/**
|
||||||
* @todo test
|
* @todo timezone
|
||||||
*/
|
*/
|
||||||
function to_datetime(pit: type_pit, options?: {
|
function to_datetime(pit: type_pit, options?: {
|
||||||
timezone_shift?: int;
|
timezone_shift?: int;
|
||||||
|
@ -3052,18 +3048,6 @@ declare namespace lib_plankton.pit {
|
||||||
function to_ywd(pit: type_pit, options?: {
|
function to_ywd(pit: type_pit, options?: {
|
||||||
timezone_shift?: int;
|
timezone_shift?: int;
|
||||||
}): type_ywd;
|
}): type_ywd;
|
||||||
/**
|
|
||||||
* computes the point in time for switching to central european summer time
|
|
||||||
*
|
|
||||||
* @todo write tests
|
|
||||||
*/
|
|
||||||
function cest_switch_on(year: int): type_pit;
|
|
||||||
/**
|
|
||||||
* computes the point in time for switching away from central european summer time
|
|
||||||
*
|
|
||||||
* @todo write tests
|
|
||||||
*/
|
|
||||||
function cest_switch_off(year: int): type_pit;
|
|
||||||
}
|
}
|
||||||
declare namespace lib_plankton.www_form {
|
declare namespace lib_plankton.www_form {
|
||||||
/**
|
/**
|
||||||
|
@ -3582,55 +3566,6 @@ declare namespace lib_plankton.zoo_input {
|
||||||
write(value: string): Promise<void>;
|
write(value: string): Promise<void>;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
declare namespace lib_plankton.zoo_input {
|
|
||||||
/**
|
|
||||||
*/
|
|
||||||
type type_translations = {
|
|
||||||
add?: string;
|
|
||||||
remove?: string;
|
|
||||||
};
|
|
||||||
/**
|
|
||||||
* @author fenris
|
|
||||||
*/
|
|
||||||
export class class_input_list<type_element> implements interface_input<Array<type_element>> {
|
|
||||||
/**
|
|
||||||
*/
|
|
||||||
private element_input_factory;
|
|
||||||
/**
|
|
||||||
*/
|
|
||||||
private elements_container_dom;
|
|
||||||
/**
|
|
||||||
*/
|
|
||||||
private elements;
|
|
||||||
/**
|
|
||||||
*/
|
|
||||||
private translations;
|
|
||||||
/**
|
|
||||||
*/
|
|
||||||
constructor(element_input_factory: (() => interface_input<type_element>), options?: {
|
|
||||||
translations?: type_translations;
|
|
||||||
});
|
|
||||||
/**
|
|
||||||
*/
|
|
||||||
private clear;
|
|
||||||
/**
|
|
||||||
*/
|
|
||||||
private add;
|
|
||||||
/**
|
|
||||||
* [implementation]
|
|
||||||
*/
|
|
||||||
setup(parent: HTMLElement): Promise<void>;
|
|
||||||
/**
|
|
||||||
* [implementation]
|
|
||||||
*/
|
|
||||||
read(): Promise<Array<type_element>>;
|
|
||||||
/**
|
|
||||||
* [implementation]
|
|
||||||
*/
|
|
||||||
write(value: Array<type_element>): Promise<void>;
|
|
||||||
}
|
|
||||||
export {};
|
|
||||||
}
|
|
||||||
declare namespace lib_plankton.zoo_input {
|
declare namespace lib_plankton.zoo_input {
|
||||||
/**
|
/**
|
||||||
* @author fenris
|
* @author fenris
|
||||||
|
@ -3709,6 +3644,31 @@ declare namespace lib_plankton.zoo_input {
|
||||||
write(value: (null | lib_plankton.pit.type_time)): Promise<void>;
|
write(value: (null | lib_plankton.pit.type_time)): Promise<void>;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
declare namespace lib_plankton.zoo_input {
|
||||||
|
/**
|
||||||
|
*/
|
||||||
|
class class_input_datetime implements interface_input<lib_plankton.pit.type_datetime> {
|
||||||
|
/**
|
||||||
|
*/
|
||||||
|
private core;
|
||||||
|
/**
|
||||||
|
*/
|
||||||
|
constructor(options?: {
|
||||||
|
label_timezone_shift?: string;
|
||||||
|
label_date?: string;
|
||||||
|
label_time?: string;
|
||||||
|
});
|
||||||
|
/**
|
||||||
|
*/
|
||||||
|
setup(parent: HTMLElement): Promise<void>;
|
||||||
|
/**
|
||||||
|
*/
|
||||||
|
read(): Promise<lib_plankton.pit.type_datetime>;
|
||||||
|
/**
|
||||||
|
*/
|
||||||
|
write(value: lib_plankton.pit.type_datetime): Promise<void>;
|
||||||
|
}
|
||||||
|
}
|
||||||
declare namespace lib_plankton.zoo_input {
|
declare namespace lib_plankton.zoo_input {
|
||||||
/**
|
/**
|
||||||
* @author fenris
|
* @author fenris
|
||||||
|
@ -3739,6 +3699,55 @@ declare namespace lib_plankton.zoo_input {
|
||||||
write(value: type_record): Promise<void>;
|
write(value: type_record): Promise<void>;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
declare namespace lib_plankton.zoo_input {
|
||||||
|
/**
|
||||||
|
*/
|
||||||
|
type type_translations = {
|
||||||
|
add?: string;
|
||||||
|
remove?: string;
|
||||||
|
};
|
||||||
|
/**
|
||||||
|
* @author fenris
|
||||||
|
*/
|
||||||
|
export class class_input_list<type_element> implements interface_input<Array<type_element>> {
|
||||||
|
/**
|
||||||
|
*/
|
||||||
|
private element_input_factory;
|
||||||
|
/**
|
||||||
|
*/
|
||||||
|
private elements_container_dom;
|
||||||
|
/**
|
||||||
|
*/
|
||||||
|
private elements;
|
||||||
|
/**
|
||||||
|
*/
|
||||||
|
private translations;
|
||||||
|
/**
|
||||||
|
*/
|
||||||
|
constructor(element_input_factory: (() => interface_input<type_element>), options?: {
|
||||||
|
translations?: type_translations;
|
||||||
|
});
|
||||||
|
/**
|
||||||
|
*/
|
||||||
|
private clear;
|
||||||
|
/**
|
||||||
|
*/
|
||||||
|
private add;
|
||||||
|
/**
|
||||||
|
* [implementation]
|
||||||
|
*/
|
||||||
|
setup(parent: HTMLElement): Promise<void>;
|
||||||
|
/**
|
||||||
|
* [implementation]
|
||||||
|
*/
|
||||||
|
read(): Promise<Array<type_element>>;
|
||||||
|
/**
|
||||||
|
* [implementation]
|
||||||
|
*/
|
||||||
|
write(value: Array<type_element>): Promise<void>;
|
||||||
|
}
|
||||||
|
export {};
|
||||||
|
}
|
||||||
declare namespace lib_plankton.zoo_input {
|
declare namespace lib_plankton.zoo_input {
|
||||||
/**
|
/**
|
||||||
*/
|
*/
|
||||||
|
@ -3766,56 +3775,6 @@ declare namespace lib_plankton.zoo_input {
|
||||||
write(map: lib_plankton.map.type_map<type_key, type_value>): Promise<void>;
|
write(map: lib_plankton.map.type_map<type_key, type_value>): Promise<void>;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
declare namespace lib_plankton.zoo_input {
|
|
||||||
/**
|
|
||||||
*/
|
|
||||||
class class_input_datetime implements interface_input<lib_plankton.pit.type_datetime> {
|
|
||||||
/**
|
|
||||||
*/
|
|
||||||
private core;
|
|
||||||
/**
|
|
||||||
*/
|
|
||||||
constructor(options?: {
|
|
||||||
label_timezone_shift?: string;
|
|
||||||
label_date?: string;
|
|
||||||
label_time?: string;
|
|
||||||
});
|
|
||||||
/**
|
|
||||||
*/
|
|
||||||
setup(parent: HTMLElement): Promise<void>;
|
|
||||||
/**
|
|
||||||
*/
|
|
||||||
read(): Promise<lib_plankton.pit.type_datetime>;
|
|
||||||
/**
|
|
||||||
*/
|
|
||||||
write(value: lib_plankton.pit.type_datetime): Promise<void>;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
declare namespace lib_plankton.zoo_input {
|
|
||||||
/**
|
|
||||||
* for central europe with daylight saving time feature
|
|
||||||
*/
|
|
||||||
class class_input_datetime_central_europe implements interface_input<lib_plankton.pit.type_datetime> {
|
|
||||||
/**
|
|
||||||
*/
|
|
||||||
private core;
|
|
||||||
/**
|
|
||||||
*/
|
|
||||||
constructor(options?: {
|
|
||||||
label_date?: string;
|
|
||||||
label_time?: string;
|
|
||||||
});
|
|
||||||
/**
|
|
||||||
*/
|
|
||||||
setup(parent: HTMLElement): Promise<void>;
|
|
||||||
/**
|
|
||||||
*/
|
|
||||||
read(): Promise<lib_plankton.pit.type_datetime>;
|
|
||||||
/**
|
|
||||||
*/
|
|
||||||
write(value: lib_plankton.pit.type_datetime): Promise<void>;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
declare namespace lib_plankton.zoo_form {
|
declare namespace lib_plankton.zoo_form {
|
||||||
/**
|
/**
|
||||||
*/
|
*/
|
||||||
|
|
|
@ -8357,23 +8357,6 @@ var lib_plankton;
|
||||||
(function (lib_plankton) {
|
(function (lib_plankton) {
|
||||||
var pit;
|
var pit;
|
||||||
(function (pit_1) {
|
(function (pit_1) {
|
||||||
/**
|
|
||||||
* @todo complete
|
|
||||||
*/
|
|
||||||
function timezone_name_to_timezone_shift(timezone_name) {
|
|
||||||
const map = {
|
|
||||||
"UTC": 0,
|
|
||||||
"CET": +1,
|
|
||||||
"CEST": +2,
|
|
||||||
};
|
|
||||||
if (!(timezone_name in map)) {
|
|
||||||
throw (new Error("unhandled timezone: " + timezone_name));
|
|
||||||
}
|
|
||||||
else {
|
|
||||||
return map[timezone_name];
|
|
||||||
}
|
|
||||||
}
|
|
||||||
pit_1.timezone_name_to_timezone_shift = timezone_name_to_timezone_shift;
|
|
||||||
/**
|
/**
|
||||||
*/
|
*/
|
||||||
function date_object_get_week_of_year(date) {
|
function date_object_get_week_of_year(date) {
|
||||||
|
@ -8419,7 +8402,7 @@ var lib_plankton;
|
||||||
return Math.round(date_object.getTime() / 1000);
|
return Math.round(date_object.getTime() / 1000);
|
||||||
}
|
}
|
||||||
/**
|
/**
|
||||||
* @todo test
|
* @todo timezone
|
||||||
*/
|
*/
|
||||||
function to_datetime(pit, options = {}) {
|
function to_datetime(pit, options = {}) {
|
||||||
options = Object.assign({
|
options = Object.assign({
|
||||||
|
@ -8677,58 +8660,6 @@ var lib_plankton;
|
||||||
]);
|
]);
|
||||||
}
|
}
|
||||||
pit_1.to_ywd = to_ywd;
|
pit_1.to_ywd = to_ywd;
|
||||||
/**
|
|
||||||
* computes the point in time for switching to central european summer time
|
|
||||||
*
|
|
||||||
* @todo write tests
|
|
||||||
*/
|
|
||||||
function cest_switch_on(year) {
|
|
||||||
return lib_plankton.call.convey(year, [
|
|
||||||
(x) => ({
|
|
||||||
"timezone_shift": 0,
|
|
||||||
"date": {
|
|
||||||
"year": x,
|
|
||||||
"month": 4,
|
|
||||||
"day": 1,
|
|
||||||
},
|
|
||||||
"time": {
|
|
||||||
"hour": 2,
|
|
||||||
"minute": 0,
|
|
||||||
"second": 0
|
|
||||||
},
|
|
||||||
}),
|
|
||||||
from_datetime,
|
|
||||||
trunc_week,
|
|
||||||
x => shift_day(x, -1),
|
|
||||||
]);
|
|
||||||
}
|
|
||||||
pit_1.cest_switch_on = cest_switch_on;
|
|
||||||
/**
|
|
||||||
* computes the point in time for switching away from central european summer time
|
|
||||||
*
|
|
||||||
* @todo write tests
|
|
||||||
*/
|
|
||||||
function cest_switch_off(year) {
|
|
||||||
return lib_plankton.call.convey(year, [
|
|
||||||
(x) => ({
|
|
||||||
"timezone_shift": 0,
|
|
||||||
"date": {
|
|
||||||
"year": x,
|
|
||||||
"month": 11,
|
|
||||||
"day": 1,
|
|
||||||
},
|
|
||||||
"time": {
|
|
||||||
"hour": 1,
|
|
||||||
"minute": 0,
|
|
||||||
"second": 0
|
|
||||||
},
|
|
||||||
}),
|
|
||||||
from_datetime,
|
|
||||||
trunc_week,
|
|
||||||
x => shift_day(x, -1),
|
|
||||||
]);
|
|
||||||
}
|
|
||||||
pit_1.cest_switch_off = cest_switch_off;
|
|
||||||
})(pit = lib_plankton.pit || (lib_plankton.pit = {}));
|
})(pit = lib_plankton.pit || (lib_plankton.pit = {}));
|
||||||
})(lib_plankton || (lib_plankton = {}));
|
})(lib_plankton || (lib_plankton = {}));
|
||||||
/*
|
/*
|
||||||
|
@ -10222,153 +10153,6 @@ but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||||
GNU Lesser General Public License for more details.
|
GNU Lesser General Public License for more details.
|
||||||
|
|
||||||
You should have received a copy of the GNU Lesser General Public License
|
|
||||||
along with »bacterio-plankton:zoo-input«. If not, see <http://www.gnu.org/licenses/>.
|
|
||||||
*/
|
|
||||||
var lib_plankton;
|
|
||||||
(function (lib_plankton) {
|
|
||||||
var zoo_input;
|
|
||||||
(function (zoo_input) {
|
|
||||||
/**
|
|
||||||
* @author fenris
|
|
||||||
*/
|
|
||||||
class class_input_list {
|
|
||||||
/**
|
|
||||||
*/
|
|
||||||
constructor(element_input_factory, options = {}) {
|
|
||||||
options = Object.assign({
|
|
||||||
"translations": {
|
|
||||||
"add": "add",
|
|
||||||
"remove": "remove",
|
|
||||||
},
|
|
||||||
}, options);
|
|
||||||
this.element_input_factory = element_input_factory;
|
|
||||||
this.elements = [];
|
|
||||||
this.elements_container_dom = null;
|
|
||||||
this.translations = options.translations;
|
|
||||||
}
|
|
||||||
/**
|
|
||||||
*/
|
|
||||||
clear() {
|
|
||||||
this.elements_container_dom.innerHTML = "";
|
|
||||||
this.elements = [];
|
|
||||||
return Promise.resolve(undefined);
|
|
||||||
}
|
|
||||||
/**
|
|
||||||
*/
|
|
||||||
async add() {
|
|
||||||
// model
|
|
||||||
let element_dom = document.createElement("div");
|
|
||||||
const input = this.element_input_factory();
|
|
||||||
this.elements.push({ "dom": element_dom, "input": input });
|
|
||||||
// view & control
|
|
||||||
{
|
|
||||||
element_dom.classList.add("plankton_input_list_element");
|
|
||||||
// remover
|
|
||||||
{
|
|
||||||
let remover_dom = document.createElement("button");
|
|
||||||
remover_dom.classList.add("plankton_input_list_button");
|
|
||||||
remover_dom.classList.add("plankton_input_list_element_remover");
|
|
||||||
remover_dom.setAttribute("title", this.translations.remove);
|
|
||||||
remover_dom.textContent = "x";
|
|
||||||
remover_dom.addEventListener("click", (event) => {
|
|
||||||
event.preventDefault();
|
|
||||||
const index = this.elements.findIndex(element => (element.input === input));
|
|
||||||
const element = this.elements[index];
|
|
||||||
this.elements_container_dom.removeChild(element.dom);
|
|
||||||
this.elements.splice(index, 1);
|
|
||||||
});
|
|
||||||
element_dom.appendChild(remover_dom);
|
|
||||||
}
|
|
||||||
// input
|
|
||||||
{
|
|
||||||
let input_dom = document.createElement("div");
|
|
||||||
input_dom.classList.add("plankton_input_list_element_input");
|
|
||||||
await input.setup(input_dom);
|
|
||||||
element_dom.appendChild(input_dom);
|
|
||||||
}
|
|
||||||
this.elements_container_dom.appendChild(element_dom);
|
|
||||||
}
|
|
||||||
return Promise.resolve(input);
|
|
||||||
}
|
|
||||||
/**
|
|
||||||
* [implementation]
|
|
||||||
*/
|
|
||||||
setup(parent) {
|
|
||||||
let container_dom = document.createElement("div");
|
|
||||||
container_dom.classList.add("plankton_input_list");
|
|
||||||
// elements
|
|
||||||
{
|
|
||||||
this.elements_container_dom = document.createElement("div");
|
|
||||||
this.elements_container_dom.classList.add("plankton_input_list_elements");
|
|
||||||
container_dom.appendChild(this.elements_container_dom);
|
|
||||||
}
|
|
||||||
// foot
|
|
||||||
{
|
|
||||||
let footer_dom = document.createElement("div");
|
|
||||||
footer_dom.classList.add("plankton_input_list_foot");
|
|
||||||
// adder
|
|
||||||
{
|
|
||||||
let adder_dom = document.createElement("button");
|
|
||||||
adder_dom.classList.add("plankton_input_list_button");
|
|
||||||
adder_dom.classList.add("plankton_input_list_adder");
|
|
||||||
adder_dom.setAttribute("title", this.translations.add);
|
|
||||||
adder_dom.textContent = "+";
|
|
||||||
adder_dom.addEventListener("click", (event) => {
|
|
||||||
event.preventDefault();
|
|
||||||
this.add();
|
|
||||||
});
|
|
||||||
footer_dom.appendChild(adder_dom);
|
|
||||||
}
|
|
||||||
container_dom.appendChild(footer_dom);
|
|
||||||
}
|
|
||||||
parent.appendChild(container_dom);
|
|
||||||
return Promise.resolve(undefined);
|
|
||||||
}
|
|
||||||
/**
|
|
||||||
* [implementation]
|
|
||||||
*/
|
|
||||||
read() {
|
|
||||||
return (Promise.all(this.elements
|
|
||||||
.map((element, index) => (element.input.read()
|
|
||||||
.then((element_value) => Promise.resolve({
|
|
||||||
"index": index,
|
|
||||||
"value": element_value,
|
|
||||||
})))))
|
|
||||||
.then((elements) => Promise.resolve(elements
|
|
||||||
.sort((x, y) => ((x.index <= y.index) ? 0 : 1))
|
|
||||||
.map(element => element.value))));
|
|
||||||
}
|
|
||||||
/**
|
|
||||||
* [implementation]
|
|
||||||
*/
|
|
||||||
write(value) {
|
|
||||||
return (this.clear()
|
|
||||||
.then(() => Promise.all(value
|
|
||||||
.map((element_value) => (this.add()
|
|
||||||
.then(element_input => element_input.write(element_value))))))
|
|
||||||
.then(() => Promise.resolve(undefined)));
|
|
||||||
}
|
|
||||||
}
|
|
||||||
zoo_input.class_input_list = class_input_list;
|
|
||||||
})(zoo_input = lib_plankton.zoo_input || (lib_plankton.zoo_input = {}));
|
|
||||||
})(lib_plankton || (lib_plankton = {}));
|
|
||||||
/*
|
|
||||||
This file is part of »bacterio-plankton:zoo-input«.
|
|
||||||
|
|
||||||
Copyright 2016-2024 'Christian Fraß, Christian Neubauer, Martin Springwald GbR'
|
|
||||||
<info@greenscale.de>
|
|
||||||
|
|
||||||
»bacterio-plankton:zoo-input« is free software: you can redistribute it and/or modify
|
|
||||||
it under the terms of the GNU Lesser General Public License as published by
|
|
||||||
the Free Software Foundation, either version 3 of the License, or
|
|
||||||
(at your option) any later version.
|
|
||||||
|
|
||||||
»bacterio-plankton:zoo-input« is distributed in the hope that it will be useful,
|
|
||||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
||||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
||||||
GNU Lesser General Public License for more details.
|
|
||||||
|
|
||||||
You should have received a copy of the GNU Lesser General Public License
|
You should have received a copy of the GNU Lesser General Public License
|
||||||
along with »bacterio-plankton:zoo-input«. If not, see <http://www.gnu.org/licenses/>.
|
along with »bacterio-plankton:zoo-input«. If not, see <http://www.gnu.org/licenses/>.
|
||||||
*/
|
*/
|
||||||
|
@ -10576,6 +10360,77 @@ but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||||
GNU Lesser General Public License for more details.
|
GNU Lesser General Public License for more details.
|
||||||
|
|
||||||
|
You should have received a copy of the GNU Lesser General Public License
|
||||||
|
along with »bacterio-plankton:zoo-input«. If not, see <http://www.gnu.org/licenses/>.
|
||||||
|
*/
|
||||||
|
var lib_plankton;
|
||||||
|
(function (lib_plankton) {
|
||||||
|
var zoo_input;
|
||||||
|
(function (zoo_input) {
|
||||||
|
/**
|
||||||
|
*/
|
||||||
|
class class_input_datetime {
|
||||||
|
/**
|
||||||
|
*/
|
||||||
|
constructor(options = {}) {
|
||||||
|
options = Object.assign({
|
||||||
|
"label_timezone_shift": "",
|
||||||
|
"label_date": "",
|
||||||
|
"label_time": "",
|
||||||
|
}, options);
|
||||||
|
this.core = new zoo_input.class_input_group([
|
||||||
|
{
|
||||||
|
"name": "timezone_shift",
|
||||||
|
"input": new zoo_input.class_input_number(),
|
||||||
|
"label": options.label_timezone_shift,
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "date",
|
||||||
|
"input": new zoo_input.class_input_date(),
|
||||||
|
"label": options.label_date,
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "time",
|
||||||
|
"input": new zoo_input.class_input_soft(new zoo_input.class_input_time()),
|
||||||
|
"label": options.label_time,
|
||||||
|
},
|
||||||
|
]);
|
||||||
|
}
|
||||||
|
/**
|
||||||
|
*/
|
||||||
|
async setup(parent) {
|
||||||
|
return this.core.setup(parent);
|
||||||
|
}
|
||||||
|
/**
|
||||||
|
*/
|
||||||
|
async read() {
|
||||||
|
return this.core.read();
|
||||||
|
}
|
||||||
|
/**
|
||||||
|
*/
|
||||||
|
async write(value) {
|
||||||
|
return this.core.write(value);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
zoo_input.class_input_datetime = class_input_datetime;
|
||||||
|
})(zoo_input = lib_plankton.zoo_input || (lib_plankton.zoo_input = {}));
|
||||||
|
})(lib_plankton || (lib_plankton = {}));
|
||||||
|
/*
|
||||||
|
This file is part of »bacterio-plankton:zoo-input«.
|
||||||
|
|
||||||
|
Copyright 2016-2024 'Christian Fraß, Christian Neubauer, Martin Springwald GbR'
|
||||||
|
<info@greenscale.de>
|
||||||
|
|
||||||
|
»bacterio-plankton:zoo-input« is free software: you can redistribute it and/or modify
|
||||||
|
it under the terms of the GNU Lesser General Public License as published by
|
||||||
|
the Free Software Foundation, either version 3 of the License, or
|
||||||
|
(at your option) any later version.
|
||||||
|
|
||||||
|
»bacterio-plankton:zoo-input« is distributed in the hope that it will be useful,
|
||||||
|
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||||
|
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||||
|
GNU Lesser General Public License for more details.
|
||||||
|
|
||||||
You should have received a copy of the GNU Lesser General Public License
|
You should have received a copy of the GNU Lesser General Public License
|
||||||
along with »bacterio-plankton:zoo-input«. If not, see <http://www.gnu.org/licenses/>.
|
along with »bacterio-plankton:zoo-input«. If not, see <http://www.gnu.org/licenses/>.
|
||||||
*/
|
*/
|
||||||
|
@ -10683,6 +10538,153 @@ but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||||
GNU Lesser General Public License for more details.
|
GNU Lesser General Public License for more details.
|
||||||
|
|
||||||
|
You should have received a copy of the GNU Lesser General Public License
|
||||||
|
along with »bacterio-plankton:zoo-input«. If not, see <http://www.gnu.org/licenses/>.
|
||||||
|
*/
|
||||||
|
var lib_plankton;
|
||||||
|
(function (lib_plankton) {
|
||||||
|
var zoo_input;
|
||||||
|
(function (zoo_input) {
|
||||||
|
/**
|
||||||
|
* @author fenris
|
||||||
|
*/
|
||||||
|
class class_input_list {
|
||||||
|
/**
|
||||||
|
*/
|
||||||
|
constructor(element_input_factory, options = {}) {
|
||||||
|
options = Object.assign({
|
||||||
|
"translations": {
|
||||||
|
"add": "add",
|
||||||
|
"remove": "remove",
|
||||||
|
},
|
||||||
|
}, options);
|
||||||
|
this.element_input_factory = element_input_factory;
|
||||||
|
this.elements = [];
|
||||||
|
this.elements_container_dom = null;
|
||||||
|
this.translations = options.translations;
|
||||||
|
}
|
||||||
|
/**
|
||||||
|
*/
|
||||||
|
clear() {
|
||||||
|
this.elements_container_dom.innerHTML = "";
|
||||||
|
this.elements = [];
|
||||||
|
return Promise.resolve(undefined);
|
||||||
|
}
|
||||||
|
/**
|
||||||
|
*/
|
||||||
|
async add() {
|
||||||
|
// model
|
||||||
|
let element_dom = document.createElement("div");
|
||||||
|
const input = this.element_input_factory();
|
||||||
|
this.elements.push({ "dom": element_dom, "input": input });
|
||||||
|
// view & control
|
||||||
|
{
|
||||||
|
element_dom.classList.add("plankton_input_list_element");
|
||||||
|
// remover
|
||||||
|
{
|
||||||
|
let remover_dom = document.createElement("button");
|
||||||
|
remover_dom.classList.add("plankton_input_list_button");
|
||||||
|
remover_dom.classList.add("plankton_input_list_element_remover");
|
||||||
|
remover_dom.setAttribute("title", this.translations.remove);
|
||||||
|
remover_dom.textContent = "x";
|
||||||
|
remover_dom.addEventListener("click", (event) => {
|
||||||
|
event.preventDefault();
|
||||||
|
const index = this.elements.findIndex(element => (element.input === input));
|
||||||
|
const element = this.elements[index];
|
||||||
|
this.elements_container_dom.removeChild(element.dom);
|
||||||
|
this.elements.splice(index, 1);
|
||||||
|
});
|
||||||
|
element_dom.appendChild(remover_dom);
|
||||||
|
}
|
||||||
|
// input
|
||||||
|
{
|
||||||
|
let input_dom = document.createElement("div");
|
||||||
|
input_dom.classList.add("plankton_input_list_element_input");
|
||||||
|
await input.setup(input_dom);
|
||||||
|
element_dom.appendChild(input_dom);
|
||||||
|
}
|
||||||
|
this.elements_container_dom.appendChild(element_dom);
|
||||||
|
}
|
||||||
|
return Promise.resolve(input);
|
||||||
|
}
|
||||||
|
/**
|
||||||
|
* [implementation]
|
||||||
|
*/
|
||||||
|
setup(parent) {
|
||||||
|
let container_dom = document.createElement("div");
|
||||||
|
container_dom.classList.add("plankton_input_list");
|
||||||
|
// elements
|
||||||
|
{
|
||||||
|
this.elements_container_dom = document.createElement("div");
|
||||||
|
this.elements_container_dom.classList.add("plankton_input_list_elements");
|
||||||
|
container_dom.appendChild(this.elements_container_dom);
|
||||||
|
}
|
||||||
|
// foot
|
||||||
|
{
|
||||||
|
let footer_dom = document.createElement("div");
|
||||||
|
footer_dom.classList.add("plankton_input_list_foot");
|
||||||
|
// adder
|
||||||
|
{
|
||||||
|
let adder_dom = document.createElement("button");
|
||||||
|
adder_dom.classList.add("plankton_input_list_button");
|
||||||
|
adder_dom.classList.add("plankton_input_list_adder");
|
||||||
|
adder_dom.setAttribute("title", this.translations.add);
|
||||||
|
adder_dom.textContent = "+";
|
||||||
|
adder_dom.addEventListener("click", (event) => {
|
||||||
|
event.preventDefault();
|
||||||
|
this.add();
|
||||||
|
});
|
||||||
|
footer_dom.appendChild(adder_dom);
|
||||||
|
}
|
||||||
|
container_dom.appendChild(footer_dom);
|
||||||
|
}
|
||||||
|
parent.appendChild(container_dom);
|
||||||
|
return Promise.resolve(undefined);
|
||||||
|
}
|
||||||
|
/**
|
||||||
|
* [implementation]
|
||||||
|
*/
|
||||||
|
read() {
|
||||||
|
return (Promise.all(this.elements
|
||||||
|
.map((element, index) => (element.input.read()
|
||||||
|
.then((element_value) => Promise.resolve({
|
||||||
|
"index": index,
|
||||||
|
"value": element_value,
|
||||||
|
})))))
|
||||||
|
.then((elements) => Promise.resolve(elements
|
||||||
|
.sort((x, y) => ((x.index <= y.index) ? 0 : 1))
|
||||||
|
.map(element => element.value))));
|
||||||
|
}
|
||||||
|
/**
|
||||||
|
* [implementation]
|
||||||
|
*/
|
||||||
|
write(value) {
|
||||||
|
return (this.clear()
|
||||||
|
.then(() => Promise.all(value
|
||||||
|
.map((element_value) => (this.add()
|
||||||
|
.then(element_input => element_input.write(element_value))))))
|
||||||
|
.then(() => Promise.resolve(undefined)));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
zoo_input.class_input_list = class_input_list;
|
||||||
|
})(zoo_input = lib_plankton.zoo_input || (lib_plankton.zoo_input = {}));
|
||||||
|
})(lib_plankton || (lib_plankton = {}));
|
||||||
|
/*
|
||||||
|
This file is part of »bacterio-plankton:zoo-input«.
|
||||||
|
|
||||||
|
Copyright 2016-2024 'Christian Fraß, Christian Neubauer, Martin Springwald GbR'
|
||||||
|
<info@greenscale.de>
|
||||||
|
|
||||||
|
»bacterio-plankton:zoo-input« is free software: you can redistribute it and/or modify
|
||||||
|
it under the terms of the GNU Lesser General Public License as published by
|
||||||
|
the Free Software Foundation, either version 3 of the License, or
|
||||||
|
(at your option) any later version.
|
||||||
|
|
||||||
|
»bacterio-plankton:zoo-input« is distributed in the hope that it will be useful,
|
||||||
|
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||||
|
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||||
|
GNU Lesser General Public License for more details.
|
||||||
|
|
||||||
You should have received a copy of the GNU Lesser General Public License
|
You should have received a copy of the GNU Lesser General Public License
|
||||||
along with »bacterio-plankton:zoo-input«. If not, see <http://www.gnu.org/licenses/>.
|
along with »bacterio-plankton:zoo-input«. If not, see <http://www.gnu.org/licenses/>.
|
||||||
*/
|
*/
|
||||||
|
@ -10737,180 +10739,6 @@ var lib_plankton;
|
||||||
})(zoo_input = lib_plankton.zoo_input || (lib_plankton.zoo_input = {}));
|
})(zoo_input = lib_plankton.zoo_input || (lib_plankton.zoo_input = {}));
|
||||||
})(lib_plankton || (lib_plankton = {}));
|
})(lib_plankton || (lib_plankton = {}));
|
||||||
/*
|
/*
|
||||||
This file is part of »bacterio-plankton:zoo-input«.
|
|
||||||
|
|
||||||
Copyright 2016-2024 'Christian Fraß, Christian Neubauer, Martin Springwald GbR'
|
|
||||||
<info@greenscale.de>
|
|
||||||
|
|
||||||
»bacterio-plankton:zoo-input« is free software: you can redistribute it and/or modify
|
|
||||||
it under the terms of the GNU Lesser General Public License as published by
|
|
||||||
the Free Software Foundation, either version 3 of the License, or
|
|
||||||
(at your option) any later version.
|
|
||||||
|
|
||||||
»bacterio-plankton:zoo-input« is distributed in the hope that it will be useful,
|
|
||||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
||||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
||||||
GNU Lesser General Public License for more details.
|
|
||||||
|
|
||||||
You should have received a copy of the GNU Lesser General Public License
|
|
||||||
along with »bacterio-plankton:zoo-input«. If not, see <http://www.gnu.org/licenses/>.
|
|
||||||
*/
|
|
||||||
var lib_plankton;
|
|
||||||
(function (lib_plankton) {
|
|
||||||
var zoo_input;
|
|
||||||
(function (zoo_input) {
|
|
||||||
/**
|
|
||||||
*/
|
|
||||||
class class_input_datetime {
|
|
||||||
/**
|
|
||||||
*/
|
|
||||||
constructor(options = {}) {
|
|
||||||
options = Object.assign({
|
|
||||||
"label_timezone_shift": "",
|
|
||||||
"label_date": "",
|
|
||||||
"label_time": "",
|
|
||||||
}, options);
|
|
||||||
this.core = new zoo_input.class_input_group([
|
|
||||||
{
|
|
||||||
"name": "timezone_shift",
|
|
||||||
"input": new zoo_input.class_input_number(),
|
|
||||||
"label": options.label_timezone_shift,
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"name": "date",
|
|
||||||
"input": new zoo_input.class_input_date(),
|
|
||||||
"label": options.label_date,
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"name": "time",
|
|
||||||
"input": new zoo_input.class_input_soft(new zoo_input.class_input_time()),
|
|
||||||
"label": options.label_time,
|
|
||||||
},
|
|
||||||
]);
|
|
||||||
}
|
|
||||||
/**
|
|
||||||
*/
|
|
||||||
setup(parent) {
|
|
||||||
return this.core.setup(parent);
|
|
||||||
}
|
|
||||||
/**
|
|
||||||
*/
|
|
||||||
read() {
|
|
||||||
return this.core.read();
|
|
||||||
}
|
|
||||||
/**
|
|
||||||
*/
|
|
||||||
write(value) {
|
|
||||||
return this.core.write(value);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
zoo_input.class_input_datetime = class_input_datetime;
|
|
||||||
})(zoo_input = lib_plankton.zoo_input || (lib_plankton.zoo_input = {}));
|
|
||||||
})(lib_plankton || (lib_plankton = {}));
|
|
||||||
/*
|
|
||||||
This file is part of »bacterio-plankton:zoo-input«.
|
|
||||||
|
|
||||||
Copyright 2016-2024 'Christian Fraß, Christian Neubauer, Martin Springwald GbR'
|
|
||||||
<info@greenscale.de>
|
|
||||||
|
|
||||||
»bacterio-plankton:zoo-input« is free software: you can redistribute it and/or modify
|
|
||||||
it under the terms of the GNU Lesser General Public License as published by
|
|
||||||
the Free Software Foundation, either version 3 of the License, or
|
|
||||||
(at your option) any later version.
|
|
||||||
|
|
||||||
»bacterio-plankton:zoo-input« is distributed in the hope that it will be useful,
|
|
||||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
||||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
||||||
GNU Lesser General Public License for more details.
|
|
||||||
|
|
||||||
You should have received a copy of the GNU Lesser General Public License
|
|
||||||
along with »bacterio-plankton:zoo-input«. If not, see <http://www.gnu.org/licenses/>.
|
|
||||||
*/
|
|
||||||
var lib_plankton;
|
|
||||||
(function (lib_plankton) {
|
|
||||||
var zoo_input;
|
|
||||||
(function (zoo_input) {
|
|
||||||
/**
|
|
||||||
* for central europe with daylight saving time feature
|
|
||||||
*/
|
|
||||||
class class_input_datetime_central_europe {
|
|
||||||
/**
|
|
||||||
*/
|
|
||||||
constructor(options = {}) {
|
|
||||||
options = Object.assign({
|
|
||||||
"label_date": "",
|
|
||||||
"label_time": "",
|
|
||||||
}, options);
|
|
||||||
this.core = new zoo_input.class_input_group([
|
|
||||||
{
|
|
||||||
"name": "date",
|
|
||||||
"input": new zoo_input.class_input_date(),
|
|
||||||
"label": options.label_date,
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"name": "time",
|
|
||||||
"input": new zoo_input.class_input_soft(new zoo_input.class_input_time()),
|
|
||||||
"label": options.label_time,
|
|
||||||
},
|
|
||||||
]);
|
|
||||||
}
|
|
||||||
/**
|
|
||||||
*/
|
|
||||||
setup(parent) {
|
|
||||||
return this.core.setup(parent);
|
|
||||||
}
|
|
||||||
/**
|
|
||||||
*/
|
|
||||||
async read() {
|
|
||||||
const datetime_easy = await this.core.read();
|
|
||||||
const datetime_cet = {
|
|
||||||
"timezone_shift": 1,
|
|
||||||
"date": datetime_easy.date,
|
|
||||||
"time": datetime_easy.time,
|
|
||||||
};
|
|
||||||
const datetime_cest = {
|
|
||||||
"timezone_shift": 2,
|
|
||||||
"date": datetime_easy.date,
|
|
||||||
"time": datetime_easy.time,
|
|
||||||
};
|
|
||||||
const datetime = (lib_plankton.pit.is_between(lib_plankton.pit.from_datetime(datetime_cet), lib_plankton.pit.cest_switch_on(datetime_easy.date.year), lib_plankton.pit.cest_switch_off(datetime_easy.date.year))
|
|
||||||
?
|
|
||||||
datetime_cest
|
|
||||||
:
|
|
||||||
datetime_cet);
|
|
||||||
if (datetime_easy.time === null) {
|
|
||||||
datetime.time = null;
|
|
||||||
}
|
|
||||||
else {
|
|
||||||
// do nothing
|
|
||||||
}
|
|
||||||
return Promise.resolve(datetime);
|
|
||||||
}
|
|
||||||
/**
|
|
||||||
*/
|
|
||||||
async write(value) {
|
|
||||||
const pit = lib_plankton.pit.from_datetime(value);
|
|
||||||
const datetime_utc = lib_plankton.pit.to_datetime(pit, {
|
|
||||||
"timezone_shift": 0,
|
|
||||||
});
|
|
||||||
const datetime_relative = lib_plankton.pit.to_datetime(pit, {
|
|
||||||
"timezone_shift": (lib_plankton.pit.is_between(lib_plankton.pit.from_datetime(datetime_utc), lib_plankton.pit.cest_switch_on(datetime_utc.date.year), lib_plankton.pit.cest_switch_off(datetime_utc.date.year))
|
|
||||||
?
|
|
||||||
2
|
|
||||||
:
|
|
||||||
1)
|
|
||||||
});
|
|
||||||
const datetime_easy = {
|
|
||||||
"date": datetime_relative.date,
|
|
||||||
"time": ((value.time === null) ? null : datetime_relative.time),
|
|
||||||
};
|
|
||||||
return this.core.write(datetime_easy);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
zoo_input.class_input_datetime_central_europe = class_input_datetime_central_europe;
|
|
||||||
})(zoo_input = lib_plankton.zoo_input || (lib_plankton.zoo_input = {}));
|
|
||||||
})(lib_plankton || (lib_plankton = {}));
|
|
||||||
/*
|
|
||||||
This file is part of »bacterio-plankton:zoo-form«.
|
This file is part of »bacterio-plankton:zoo-form«.
|
||||||
|
|
||||||
Copyright 2016-2024 'Christian Fraß, Christian Neubauer, Martin Springwald GbR'
|
Copyright 2016-2024 'Christian Fraß, Christian Neubauer, Martin Springwald GbR'
|
||||||
|
|
|
@ -14,9 +14,6 @@
|
||||||
"common.weekday.saturday": "Sa",
|
"common.weekday.saturday": "Sa",
|
||||||
"common.weekday.sunday": "So",
|
"common.weekday.sunday": "So",
|
||||||
"common.open": "öffnen",
|
"common.open": "öffnen",
|
||||||
"common.edit": "bearbeiten",
|
|
||||||
"common.show": "zeigen",
|
|
||||||
"common.hide": "ausblenden",
|
|
||||||
"access_level.none": "nichts",
|
"access_level.none": "nichts",
|
||||||
"access_level.view": "nur lesen",
|
"access_level.view": "nur lesen",
|
||||||
"access_level.edit": "lesen und bearbeiten",
|
"access_level.edit": "lesen und bearbeiten",
|
||||||
|
|
|
@ -14,9 +14,6 @@
|
||||||
"common.weekday.saturday": "Sat",
|
"common.weekday.saturday": "Sat",
|
||||||
"common.weekday.sunday": "Sun",
|
"common.weekday.sunday": "Sun",
|
||||||
"common.open": "open",
|
"common.open": "open",
|
||||||
"common.edit": "edit",
|
|
||||||
"common.show": "show",
|
|
||||||
"common.hide": "hide",
|
|
||||||
"access_level.none": "none",
|
"access_level.none": "none",
|
||||||
"access_level.view": "read only",
|
"access_level.view": "read only",
|
||||||
"access_level.edit": "read and write",
|
"access_level.edit": "read and write",
|
||||||
|
|
|
@ -52,11 +52,6 @@ namespace _zeitbild.frontend_web.conf
|
||||||
"type": "string",
|
"type": "string",
|
||||||
"default": "http://localhost:8888/#oidc_finish,session_key={{session_key}}"
|
"default": "http://localhost:8888/#oidc_finish,session_key={{session_key}}"
|
||||||
},
|
},
|
||||||
"use_central_europe_specific_datetime_inputs": {
|
|
||||||
"nullable": true,
|
|
||||||
"type": "boolean",
|
|
||||||
"default": false
|
|
||||||
},
|
|
||||||
},
|
},
|
||||||
"required": [
|
"required": [
|
||||||
],
|
],
|
||||||
|
|
|
@ -257,30 +257,4 @@ namespace _zeitbild.frontend_web.helpers
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
/**
|
|
||||||
*/
|
|
||||||
export function datetime_input(
|
|
||||||
) : lib_plankton.zoo_input.interface_input<lib_plankton.pit.type_datetime>
|
|
||||||
{
|
|
||||||
return (
|
|
||||||
_zeitbild.frontend_web.conf.get().misc.use_central_europe_specific_datetime_inputs
|
|
||||||
?
|
|
||||||
new lib_plankton.zoo_input.class_input_datetime_central_europe(
|
|
||||||
{
|
|
||||||
"label_date": lib_plankton.translate.get("common.date"),
|
|
||||||
"label_time": lib_plankton.translate.get("common.time"),
|
|
||||||
}
|
|
||||||
)
|
|
||||||
:
|
|
||||||
new lib_plankton.zoo_input.class_input_datetime(
|
|
||||||
{
|
|
||||||
"label_timezone_shift": lib_plankton.translate.get("common.timezone_shift"),
|
|
||||||
"label_date": lib_plankton.translate.get("common.date"),
|
|
||||||
"label_time": lib_plankton.translate.get("common.time"),
|
|
||||||
}
|
|
||||||
)
|
|
||||||
);
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -140,13 +140,25 @@ namespace _zeitbild.frontend_web.pages
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"name": "begin",
|
"name": "begin",
|
||||||
"input": _zeitbild.frontend_web.helpers.datetime_input(),
|
"input": new lib_plankton.zoo_input.class_input_datetime(
|
||||||
|
{
|
||||||
|
"label_timezone_shift": lib_plankton.translate.get("common.timezone_shift"),
|
||||||
|
"label_date": lib_plankton.translate.get("common.date"),
|
||||||
|
"label_time": lib_plankton.translate.get("common.time"),
|
||||||
|
}
|
||||||
|
),
|
||||||
"label": lib_plankton.translate.get("event.begin")
|
"label": lib_plankton.translate.get("event.begin")
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"name": "end",
|
"name": "end",
|
||||||
"input": new lib_plankton.zoo_input.class_input_soft<lib_plankton.pit.type_datetime>(
|
"input": new lib_plankton.zoo_input.class_input_soft<lib_plankton.pit.type_datetime>(
|
||||||
_zeitbild.frontend_web.helpers.datetime_input()
|
new lib_plankton.zoo_input.class_input_datetime(
|
||||||
|
{
|
||||||
|
"label_timezone_shift": lib_plankton.translate.get("common.timezone_shift"),
|
||||||
|
"label_date": lib_plankton.translate.get("common.date"),
|
||||||
|
"label_time": lib_plankton.translate.get("common.time"),
|
||||||
|
}
|
||||||
|
)
|
||||||
),
|
),
|
||||||
"label": lib_plankton.translate.get("event.end")
|
"label": lib_plankton.translate.get("event.end")
|
||||||
},
|
},
|
||||||
|
|
|
@ -70,13 +70,25 @@ namespace _zeitbild.frontend_web.pages
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"name": "begin",
|
"name": "begin",
|
||||||
"input": _zeitbild.frontend_web.helpers.datetime_input(),
|
"input": new lib_plankton.zoo_input.class_input_datetime(
|
||||||
|
{
|
||||||
|
"label_timezone_shift": lib_plankton.translate.get("common.timezone_shift"),
|
||||||
|
"label_date": lib_plankton.translate.get("common.date"),
|
||||||
|
"label_time": lib_plankton.translate.get("common.time"),
|
||||||
|
}
|
||||||
|
),
|
||||||
"label": lib_plankton.translate.get("event.begin")
|
"label": lib_plankton.translate.get("event.begin")
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"name": "end",
|
"name": "end",
|
||||||
"input": new lib_plankton.zoo_input.class_input_soft<lib_plankton.pit.type_datetime>(
|
"input": new lib_plankton.zoo_input.class_input_soft<lib_plankton.pit.type_datetime>(
|
||||||
_zeitbild.frontend_web.helpers.datetime_input()
|
new lib_plankton.zoo_input.class_input_datetime(
|
||||||
|
{
|
||||||
|
"label_timezone_shift": lib_plankton.translate.get("common.timezone_shift"),
|
||||||
|
"label_date": lib_plankton.translate.get("common.date"),
|
||||||
|
"label_time": lib_plankton.translate.get("common.time"),
|
||||||
|
}
|
||||||
|
)
|
||||||
),
|
),
|
||||||
"label": lib_plankton.translate.get("event.end")
|
"label": lib_plankton.translate.get("event.end")
|
||||||
},
|
},
|
||||||
|
|
|
@ -31,8 +31,6 @@ namespace _zeitbild.frontend_web.pages.overview
|
||||||
}
|
}
|
||||||
);
|
);
|
||||||
target_element.querySelector("#overview").classList.toggle("overview-compact", compact);
|
target_element.querySelector("#overview").classList.toggle("overview-compact", compact);
|
||||||
let widget_weekview : _zeitbild.frontend_web.widgets.weekview.class_widget_weekview;
|
|
||||||
let widget_listview : _zeitbild.frontend_web.widgets.listview.class_widget_listview;
|
|
||||||
// hint
|
// hint
|
||||||
{
|
{
|
||||||
if (! await _zeitbild.frontend_web.backend.is_logged_in()) {
|
if (! await _zeitbild.frontend_web.backend.is_logged_in()) {
|
||||||
|
@ -55,7 +53,7 @@ namespace _zeitbild.frontend_web.pages.overview
|
||||||
const widget_sources = new _zeitbild.frontend_web.widgets.sources.class_widget_sources(
|
const widget_sources = new _zeitbild.frontend_web.widgets.sources.class_widget_sources(
|
||||||
data,
|
data,
|
||||||
{
|
{
|
||||||
"action_open": (entry) => {
|
"action_select": (entry) => {
|
||||||
switch (entry.access_level) {
|
switch (entry.access_level) {
|
||||||
case _zeitbild.frontend_web.type.enum_access_level.none: {
|
case _zeitbild.frontend_web.type.enum_access_level.none: {
|
||||||
throw (new Error("this event should not be visible"));
|
throw (new Error("this event should not be visible"));
|
||||||
|
@ -88,9 +86,6 @@ namespace _zeitbild.frontend_web.pages.overview
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"action_toggle_visibility": (entry) => {
|
|
||||||
widget_weekview.toggle_visibility(entry.id);
|
|
||||||
},
|
|
||||||
}
|
}
|
||||||
);
|
);
|
||||||
await widget_sources.load(target_element.querySelector("#overview-pane-left"));
|
await widget_sources.load(target_element.querySelector("#overview-pane-left"));
|
||||||
|
@ -141,7 +136,7 @@ namespace _zeitbild.frontend_web.pages.overview
|
||||||
};
|
};
|
||||||
// listview
|
// listview
|
||||||
{
|
{
|
||||||
widget_listview = (
|
const widget = (
|
||||||
new _zeitbild.frontend_web.widgets.listview.class_widget_listview(
|
new _zeitbild.frontend_web.widgets.listview.class_widget_listview(
|
||||||
get_entries,
|
get_entries,
|
||||||
{
|
{
|
||||||
|
@ -162,11 +157,11 @@ namespace _zeitbild.frontend_web.pages.overview
|
||||||
}
|
}
|
||||||
)
|
)
|
||||||
);
|
);
|
||||||
await widget_listview.load(target_element.querySelector("#overview-pane-right-listview"));
|
await widget.load(target_element.querySelector("#overview-pane-right-listview"));
|
||||||
}
|
}
|
||||||
// weekview
|
// weekview
|
||||||
{
|
{
|
||||||
widget_weekview = (
|
const widget = (
|
||||||
new _zeitbild.frontend_web.widgets.weekview.class_widget_weekview(
|
new _zeitbild.frontend_web.widgets.weekview.class_widget_weekview(
|
||||||
get_entries,
|
get_entries,
|
||||||
{
|
{
|
||||||
|
@ -187,7 +182,7 @@ namespace _zeitbild.frontend_web.pages.overview
|
||||||
}
|
}
|
||||||
)
|
)
|
||||||
);
|
);
|
||||||
await widget_weekview.load(target_element.querySelector("#overview-pane-right-weekview"));
|
await widget.load(target_element.querySelector("#overview-pane-right-weekview"));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
return Promise.resolve<void>(undefined);
|
return Promise.resolve<void>(undefined);
|
||||||
|
|
4
source/style/common.css
Normal file
4
source/style/common.css
Normal file
|
@ -0,0 +1,4 @@
|
||||||
|
.tableview-sources-entry:not(.tableview-sources-entry-active)
|
||||||
|
{
|
||||||
|
filter: saturate(0);
|
||||||
|
}
|
|
@ -43,7 +43,7 @@ a:hover
|
||||||
transition: 1s ease color;
|
transition: 1s ease color;
|
||||||
}
|
}
|
||||||
|
|
||||||
input,select,textarea
|
input,select
|
||||||
{
|
{
|
||||||
padding: 4px;
|
padding: 4px;
|
||||||
}
|
}
|
||||||
|
@ -55,7 +55,7 @@ button
|
||||||
cursor: pointer;
|
cursor: pointer;
|
||||||
}
|
}
|
||||||
|
|
||||||
input,select,textarea,button
|
input,select,button
|
||||||
{
|
{
|
||||||
background-color: hsl(0, 0%, 0%);
|
background-color: hsl(0, 0%, 0%);
|
||||||
color: hsl(0, 0%, 100%);
|
color: hsl(0, 0%, 100%);
|
||||||
|
|
|
@ -36,11 +36,6 @@
|
||||||
|
|
||||||
.plankton_input_group_field textarea
|
.plankton_input_group_field textarea
|
||||||
{
|
{
|
||||||
min-width: 350px;
|
min-width: 250px;
|
||||||
min-height: 200px;
|
min-height: 75px;
|
||||||
}
|
|
||||||
|
|
||||||
.plankton_input_soft_setter
|
|
||||||
{
|
|
||||||
vertical-align: top;
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -10,43 +10,5 @@
|
||||||
{
|
{
|
||||||
margin: 8px;
|
margin: 8px;
|
||||||
padding: 4px;
|
padding: 4px;
|
||||||
}
|
|
||||||
|
|
||||||
.sources-entry-head
|
|
||||||
{
|
|
||||||
cursor: pointer;
|
cursor: pointer;
|
||||||
}
|
}
|
||||||
|
|
||||||
.sources-entry-body
|
|
||||||
{
|
|
||||||
display: block;
|
|
||||||
transition: max-height ease 0.5s;
|
|
||||||
}
|
|
||||||
|
|
||||||
.sources-entry-body > ul
|
|
||||||
{
|
|
||||||
list-style-type: none;
|
|
||||||
padding: 0;
|
|
||||||
margin-left: 8px;
|
|
||||||
margin-bottom: 8px;
|
|
||||||
}
|
|
||||||
|
|
||||||
.sources-entry-body > ul > li
|
|
||||||
{
|
|
||||||
/*
|
|
||||||
display: block;
|
|
||||||
*/
|
|
||||||
margin-top: 8px;
|
|
||||||
cursor: pointer;
|
|
||||||
}
|
|
||||||
|
|
||||||
.sources-entry:not(.sources-entry-open) > .sources-entry-head {}
|
|
||||||
.sources-entry:not(.sources-entry-open) > .sources-entry-body {max-height: 0; overflow: hidden;}
|
|
||||||
|
|
||||||
.sources-entry.sources-entry-open > .sources-entry-head {}
|
|
||||||
.sources-entry.sources-entry-open > .sources-entry-body {max-height: 240px; overflow: auto;}
|
|
||||||
|
|
||||||
.sources-entry-hidden
|
|
||||||
{
|
|
||||||
filter: saturate(0);
|
|
||||||
}
|
|
||||||
|
|
|
@ -45,11 +45,6 @@
|
||||||
outline: 2px solid hsl(0, 0%, 100%);
|
outline: 2px solid hsl(0, 0%, 100%);
|
||||||
}
|
}
|
||||||
|
|
||||||
.weekview-cell-hidden
|
|
||||||
{
|
|
||||||
display: none;
|
|
||||||
}
|
|
||||||
|
|
||||||
.weekview-day
|
.weekview-day
|
||||||
{
|
{
|
||||||
font-size: 0.75em;
|
font-size: 0.75em;
|
||||||
|
|
|
@ -27,12 +27,7 @@ namespace _zeitbild.frontend_web.widgets.sources
|
||||||
|
|
||||||
/**
|
/**
|
||||||
*/
|
*/
|
||||||
private action_open : ((entry : type_entry) => void);
|
private action_select : ((entry : type_entry) => void);
|
||||||
|
|
||||||
|
|
||||||
/**
|
|
||||||
*/
|
|
||||||
private action_toggle_visibility : ((entry : type_entry) => void);
|
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -40,15 +35,13 @@ namespace _zeitbild.frontend_web.widgets.sources
|
||||||
public constructor(
|
public constructor(
|
||||||
entries : Array<type_entry>,
|
entries : Array<type_entry>,
|
||||||
options : {
|
options : {
|
||||||
action_open ?: ((entry : type_entry) => void);
|
action_select ?: ((entry : type_entry) => void);
|
||||||
action_toggle_visibility ?: ((entry : type_entry) => void);
|
|
||||||
} = {}
|
} = {}
|
||||||
)
|
)
|
||||||
{
|
{
|
||||||
options = Object.assign(
|
options = Object.assign(
|
||||||
{
|
{
|
||||||
"action_open": (calendar_id) => {},
|
"action_select": (calendar_id) => {},
|
||||||
"action_toggle_visibility": (calendar_id) => {},
|
|
||||||
},
|
},
|
||||||
options
|
options
|
||||||
);
|
);
|
||||||
|
@ -62,8 +55,7 @@ namespace _zeitbild.frontend_web.widgets.sources
|
||||||
this.data[key] = entry;
|
this.data[key] = entry;
|
||||||
}
|
}
|
||||||
);
|
);
|
||||||
this.action_open = options.action_open;
|
this.action_select = options.action_select;
|
||||||
this.action_toggle_visibility = options.action_toggle_visibility;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@ -90,17 +82,9 @@ namespace _zeitbild.frontend_web.widgets.sources
|
||||||
"entry",
|
"entry",
|
||||||
{
|
{
|
||||||
"name": entry.name,
|
"name": entry.name,
|
||||||
"label_toggle": lib_plankton.string.coin(
|
|
||||||
"{{show}}/{{hide}}",
|
|
||||||
{
|
|
||||||
"show": lib_plankton.translate.get("common.show"),
|
|
||||||
"hide": lib_plankton.translate.get("common.hide"),
|
|
||||||
}
|
|
||||||
),
|
|
||||||
"label_edit": lib_plankton.translate.get("common.edit"),
|
|
||||||
// "access_level": entry.access_level, // TODO
|
// "access_level": entry.access_level, // TODO
|
||||||
// TODO centralize
|
// TODO centralize
|
||||||
"color_head": lib_plankton.color.output_hex(
|
"color": lib_plankton.color.output_hex(
|
||||||
lib_plankton.color.give_generic(
|
lib_plankton.color.give_generic(
|
||||||
(entry.id - 1),
|
(entry.id - 1),
|
||||||
{
|
{
|
||||||
|
@ -109,15 +93,6 @@ namespace _zeitbild.frontend_web.widgets.sources
|
||||||
}
|
}
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
"color_body": lib_plankton.color.output_hex(
|
|
||||||
lib_plankton.color.give_generic(
|
|
||||||
(entry.id - 1),
|
|
||||||
{
|
|
||||||
"saturation": 0.375,
|
|
||||||
"value": 0.25,
|
|
||||||
}
|
|
||||||
),
|
|
||||||
),
|
|
||||||
"rel": key,
|
"rel": key,
|
||||||
}
|
}
|
||||||
);
|
);
|
||||||
|
@ -129,38 +104,14 @@ namespace _zeitbild.frontend_web.widgets.sources
|
||||||
),
|
),
|
||||||
}
|
}
|
||||||
);
|
);
|
||||||
target_element.querySelectorAll(".sources-entry-head").forEach(
|
target_element.querySelectorAll(".sources-entry").forEach(
|
||||||
(element) => {
|
(element) => {
|
||||||
element.addEventListener(
|
element.addEventListener(
|
||||||
"click",
|
"click",
|
||||||
(event) => {
|
(event) => {
|
||||||
element.parentElement.classList.toggle("sources-entry-open");
|
const key : string = element.getAttribute("rel");
|
||||||
}
|
|
||||||
);
|
|
||||||
}
|
|
||||||
);
|
|
||||||
target_element.querySelectorAll(".sources-entry-toggle").forEach(
|
|
||||||
(element) => {
|
|
||||||
element.addEventListener(
|
|
||||||
"click",
|
|
||||||
() => {
|
|
||||||
const key : string = element.parentElement.parentElement.parentElement.getAttribute("rel");
|
|
||||||
const entry : type_entry = this.data[key];
|
const entry : type_entry = this.data[key];
|
||||||
element.parentElement.parentElement.parentElement.classList.toggle("sources-entry-hidden");
|
this.action_select(entry);
|
||||||
element.parentElement.parentElement.parentElement.classList.toggle("sources-entry-open", false);
|
|
||||||
this.action_toggle_visibility(entry);
|
|
||||||
}
|
|
||||||
);
|
|
||||||
}
|
|
||||||
);
|
|
||||||
target_element.querySelectorAll(".sources-entry-edit").forEach(
|
|
||||||
(element) => {
|
|
||||||
element.addEventListener(
|
|
||||||
"click",
|
|
||||||
(event) => {
|
|
||||||
const key : string = element.parentElement.parentElement.parentElement.getAttribute("rel");
|
|
||||||
const entry : type_entry = this.data[key];
|
|
||||||
this.action_open(entry);
|
|
||||||
}
|
}
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,11 +1 @@
|
||||||
<li class="sources-entry" style="background-color: {{color_head}}" rel="{{rel}}">
|
<li class="sources-entry" style="background-color: {{color}}" rel="{{rel}}">{{name}}</li>
|
||||||
<div class="sources-entry-head">
|
|
||||||
<span>{{name}}</span>
|
|
||||||
</div>
|
|
||||||
<div class="sources-entry-body" style="background-color: {{color_body}}">
|
|
||||||
<ul>
|
|
||||||
<li class="sources-entry-action sources-entry-toggle">{{label_toggle}}</li>
|
|
||||||
<li class="sources-entry-action sources-entry-edit">{{label_edit}}</li>
|
|
||||||
</ul>
|
|
||||||
</div>
|
|
||||||
</li>
|
|
||||||
|
|
|
@ -620,7 +620,7 @@ namespace _zeitbild.frontend_web.widgets.weekview
|
||||||
{
|
{
|
||||||
"extra_classes": (
|
"extra_classes": (
|
||||||
[""]
|
[""]
|
||||||
.concat(cell.today ? ["weekview-cell-today"] : [])
|
.concat(cell.today ? ["calendar-cell-today"] : [])
|
||||||
.join(" ")
|
.join(" ")
|
||||||
),
|
),
|
||||||
"title": lib_plankton.call.convey(
|
"title": lib_plankton.call.convey(
|
||||||
|
@ -792,7 +792,7 @@ namespace _zeitbild.frontend_web.widgets.weekview
|
||||||
// do nothing
|
// do nothing
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
context.querySelectorAll(".weekview-cell-regular").forEach(
|
context.querySelectorAll(".calendar-cell-regular").forEach(
|
||||||
(element) => {
|
(element) => {
|
||||||
element.addEventListener(
|
element.addEventListener(
|
||||||
"click",
|
"click",
|
||||||
|
@ -822,7 +822,7 @@ namespace _zeitbild.frontend_web.widgets.weekview
|
||||||
// do nothing
|
// do nothing
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
context.querySelectorAll(".weekview-event_entry").forEach(
|
context.querySelectorAll(".calendar-event_entry").forEach(
|
||||||
(element) => {
|
(element) => {
|
||||||
element.addEventListener(
|
element.addEventListener(
|
||||||
"click",
|
"click",
|
||||||
|
@ -861,28 +861,6 @@ namespace _zeitbild.frontend_web.widgets.weekview
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
/**
|
|
||||||
*/
|
|
||||||
public toggle_visibility(
|
|
||||||
calendar_id: _zeitbild.frontend_web.type.calendar_id
|
|
||||||
) : void
|
|
||||||
{
|
|
||||||
this.container.querySelectorAll(".weekview-event_entry").forEach(
|
|
||||||
(element) => {
|
|
||||||
const rel : string = element.getAttribute("rel");
|
|
||||||
const parts : Array<string> = rel.split("/");
|
|
||||||
const calendar_id_ : _zeitbild.frontend_web.type.calendar_id = parseInt(parts[0]);
|
|
||||||
if (! (calendar_id === calendar_id_)) {
|
|
||||||
// do nothing
|
|
||||||
}
|
|
||||||
else {
|
|
||||||
element.classList.toggle("weekview-cell-hidden");
|
|
||||||
}
|
|
||||||
}
|
|
||||||
);
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* [implementation]
|
* [implementation]
|
||||||
*/
|
*/
|
||||||
|
|
1
todo.md
1
todo.md
|
@ -1 +0,0 @@
|
||||||
- unterschiedliche Ansichten für Betrachten und Bearbeiten von Terminen und Kalendern
|
|
Loading…
Add table
Reference in a new issue