mirror of
https://github.com/Karaka-Management/jsOMS.git
synced 2026-02-12 07:38:41 +00:00
bump
This commit is contained in:
parent
3c830054bd
commit
44ea99b106
|
|
@ -48,7 +48,7 @@ export class BrowserNotification
|
||||||
{
|
{
|
||||||
/** global: Notification */
|
/** global: Notification */
|
||||||
if (Notification.permission !== 'granted' && Notification.permission !== 'denied') {
|
if (Notification.permission !== 'granted' && Notification.permission !== 'denied') {
|
||||||
Notification.requestPermission().then(function (permission) { });
|
Notification.requestPermission();
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
@ -65,9 +65,12 @@ export class BrowserNotification
|
||||||
{
|
{
|
||||||
/** global: Notification */
|
/** global: Notification */
|
||||||
if (Notification.permission === 'granted') {
|
if (Notification.permission === 'granted') {
|
||||||
const notification = new Notification(msg.title, { body: msg.message, vibrate: [msg.vibrate ? 200 : 0] });
|
registration.showNotification(msg.title, {
|
||||||
|
body: msg.message,
|
||||||
setTimeout(notification.close.bind(notification), 5000);
|
icon: "../images/touch/chrome-touch-icon-192x192.png",
|
||||||
|
vibrate: [msg.vibrate ? 200 : 0],
|
||||||
|
tag: "notification",
|
||||||
|
});
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
|
|
||||||
|
|
@ -10,6 +10,8 @@ import { RequestType } from './RequestType.js';
|
||||||
* @license OMS License 2.0
|
* @license OMS License 2.0
|
||||||
* @version 1.0.0
|
* @version 1.0.0
|
||||||
* @since 1.0.0
|
* @since 1.0.0
|
||||||
|
*
|
||||||
|
* @question Consider to completely remove and replace with fetch
|
||||||
*/
|
*/
|
||||||
export class Request
|
export class Request
|
||||||
{
|
{
|
||||||
|
|
@ -312,6 +314,7 @@ export class Request
|
||||||
|
|
||||||
const self = this;
|
const self = this;
|
||||||
|
|
||||||
|
// @question Consider to change to fetch
|
||||||
if (this.xhr.readyState !== 1) {
|
if (this.xhr.readyState !== 1) {
|
||||||
if (this.type === RequestType.FORM_DATA) {
|
if (this.type === RequestType.FORM_DATA) {
|
||||||
// GET request doesn't allow body/payload. Therefor we have to put the data into the uri
|
// GET request doesn't allow body/payload. Therefor we have to put the data into the uri
|
||||||
|
|
|
||||||
|
|
@ -575,7 +575,7 @@ export class Form
|
||||||
/** @var {object} remoteUrls Texts and values which come from remote sources */
|
/** @var {object} remoteUrls Texts and values which come from remote sources */
|
||||||
const remoteUrls = {};
|
const remoteUrls = {};
|
||||||
|
|
||||||
jsOMS.removeClass(element, 'hidden');
|
jsOMS.removeClass(element, 'vh');
|
||||||
|
|
||||||
// todo bind failure here, if failure do cancel, if success to remove edit template
|
// todo bind failure here, if failure do cancel, if success to remove edit template
|
||||||
self.forms[id].setSuccess(function (response, xhr) {
|
self.forms[id].setSuccess(function (response, xhr) {
|
||||||
|
|
@ -728,19 +728,19 @@ export class Form
|
||||||
let buttonLength = addButtons.length;
|
let buttonLength = addButtons.length;
|
||||||
|
|
||||||
for (let i = 0; i < buttonLength; ++i) {
|
for (let i = 0; i < buttonLength; ++i) {
|
||||||
jsOMS.removeClass(addButtons[i], 'hidden');
|
jsOMS.removeClass(addButtons[i], 'vh');
|
||||||
}
|
}
|
||||||
|
|
||||||
const saveButtons = self.forms[externalFormId].getSave();
|
const saveButtons = self.forms[externalFormId].getSave();
|
||||||
buttonLength = saveButtons.length;
|
buttonLength = saveButtons.length;
|
||||||
for (let i = 0; i < buttonLength; ++i) {
|
for (let i = 0; i < buttonLength; ++i) {
|
||||||
jsOMS.addClass(saveButtons[i], 'hidden');
|
jsOMS.addClass(saveButtons[i], 'vh');
|
||||||
}
|
}
|
||||||
|
|
||||||
const cancelButtons = self.forms[externalFormId].getCancel();
|
const cancelButtons = self.forms[externalFormId].getCancel();
|
||||||
buttonLength = cancelButtons.length;
|
buttonLength = cancelButtons.length;
|
||||||
for (let i = 0; i < buttonLength; ++i) {
|
for (let i = 0; i < buttonLength; ++i) {
|
||||||
jsOMS.addClass(cancelButtons[i], 'hidden');
|
jsOMS.addClass(cancelButtons[i], 'vh');
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -773,7 +773,7 @@ export class Form
|
||||||
/** @var {Element} elementContainer Original element */
|
/** @var {Element} elementContainer Original element */
|
||||||
const element = uiContainer.querySelector('.hidden[data-id="' + elementContainer.getAttribute('data-id') + '"]');
|
const element = uiContainer.querySelector('.hidden[data-id="' + elementContainer.getAttribute('data-id') + '"]');
|
||||||
|
|
||||||
jsOMS.removeClass(element, 'hidden');
|
jsOMS.removeClass(element, 'vh');
|
||||||
|
|
||||||
elementContainer.parentNode.removeChild(elementContainer);
|
elementContainer.parentNode.removeChild(elementContainer);
|
||||||
}
|
}
|
||||||
|
|
@ -792,19 +792,19 @@ export class Form
|
||||||
const addButtons = self.forms[id].getAdd();
|
const addButtons = self.forms[id].getAdd();
|
||||||
length = addButtons.length;
|
length = addButtons.length;
|
||||||
for (let i = 0; i < length; ++i) {
|
for (let i = 0; i < length; ++i) {
|
||||||
jsOMS.removeClass(addButtons[i], 'hidden');
|
jsOMS.removeClass(addButtons[i], 'vh');
|
||||||
}
|
}
|
||||||
|
|
||||||
const saveButtons = self.forms[id].getSave();
|
const saveButtons = self.forms[id].getSave();
|
||||||
length = saveButtons.length;
|
length = saveButtons.length;
|
||||||
for (let i = 0; i < length; ++i) {
|
for (let i = 0; i < length; ++i) {
|
||||||
jsOMS.addClass(saveButtons[i], 'hidden');
|
jsOMS.addClass(saveButtons[i], 'vh');
|
||||||
}
|
}
|
||||||
|
|
||||||
const cancelButtons = self.forms[id].getCancel();
|
const cancelButtons = self.forms[id].getCancel();
|
||||||
length = cancelButtons.length;
|
length = cancelButtons.length;
|
||||||
for (let i = 0; i < length; ++i) {
|
for (let i = 0; i < length; ++i) {
|
||||||
jsOMS.addClass(cancelButtons[i], 'hidden');
|
jsOMS.addClass(cancelButtons[i], 'vh');
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -830,7 +830,7 @@ export class Form
|
||||||
|
|
||||||
/** @var {Element} elementContainer Element container that holds the data that should get updated */
|
/** @var {Element} elementContainer Element container that holds the data that should get updated */
|
||||||
const elementContainer = event.target.closest(formElement.getAttribute('data-ui-element'));
|
const elementContainer = event.target.closest(formElement.getAttribute('data-ui-element'));
|
||||||
jsOMS.addClass(elementContainer, 'hidden');
|
jsOMS.addClass(elementContainer, 'vh');
|
||||||
|
|
||||||
/** @var {NodeListOf<Element>} values Value elements of the element to update */
|
/** @var {NodeListOf<Element>} values Value elements of the element to update */
|
||||||
const values = elementContainer.querySelectorAll('[data-tpl-value]');
|
const values = elementContainer.querySelectorAll('[data-tpl-value]');
|
||||||
|
|
@ -880,13 +880,13 @@ export class Form
|
||||||
const saveButtons = self.forms[id].getSave();
|
const saveButtons = self.forms[id].getSave();
|
||||||
let buttonLength = saveButtons.length;
|
let buttonLength = saveButtons.length;
|
||||||
for (let i = 0; i < buttonLength; ++i) {
|
for (let i = 0; i < buttonLength; ++i) {
|
||||||
jsOMS.removeClass(saveButtons[i], 'hidden');
|
jsOMS.removeClass(saveButtons[i], 'vh');
|
||||||
}
|
}
|
||||||
|
|
||||||
const cancelButtons = self.forms[id].getCancel();
|
const cancelButtons = self.forms[id].getCancel();
|
||||||
buttonLength = cancelButtons.length;
|
buttonLength = cancelButtons.length;
|
||||||
for (let i = 0; i < buttonLength; ++i) {
|
for (let i = 0; i < buttonLength; ++i) {
|
||||||
jsOMS.removeClass(cancelButtons[i], 'hidden');
|
jsOMS.removeClass(cancelButtons[i], 'vh');
|
||||||
}
|
}
|
||||||
|
|
||||||
// define remote response behavior
|
// define remote response behavior
|
||||||
|
|
@ -937,19 +937,19 @@ export class Form
|
||||||
const addButtons = self.forms[externalFormId].getAdd();
|
const addButtons = self.forms[externalFormId].getAdd();
|
||||||
length = addButtons.length;
|
length = addButtons.length;
|
||||||
for (let i = 0; i < length; ++i) {
|
for (let i = 0; i < length; ++i) {
|
||||||
jsOMS.addClass(addButtons[i], 'hidden');
|
jsOMS.addClass(addButtons[i], 'vh');
|
||||||
}
|
}
|
||||||
|
|
||||||
const saveButtons = self.forms[externalFormId].getSave();
|
const saveButtons = self.forms[externalFormId].getSave();
|
||||||
length = saveButtons.length;
|
length = saveButtons.length;
|
||||||
for (let i = 0; i < length; ++i) {
|
for (let i = 0; i < length; ++i) {
|
||||||
jsOMS.removeClass(saveButtons[i], 'hidden');
|
jsOMS.removeClass(saveButtons[i], 'vh');
|
||||||
}
|
}
|
||||||
|
|
||||||
const cancelButtons = self.forms[externalFormId].getCancel();
|
const cancelButtons = self.forms[externalFormId].getCancel();
|
||||||
length = cancelButtons.length;
|
length = cancelButtons.length;
|
||||||
for (let i = 0; i < length; ++i) {
|
for (let i = 0; i < length; ++i) {
|
||||||
jsOMS.removeClass(cancelButtons[i], 'hidden');
|
jsOMS.removeClass(cancelButtons[i], 'vh');
|
||||||
}
|
}
|
||||||
|
|
||||||
/** @var {object} remoteUrls Texts and values which come from remote sources */
|
/** @var {object} remoteUrls Texts and values which come from remote sources */
|
||||||
|
|
|
||||||
|
|
@ -182,7 +182,7 @@ export class Table
|
||||||
const rows = header.parentElement.getElementsByTagName('tr');
|
const rows = header.parentElement.getElementsByTagName('tr');
|
||||||
const rowLength = rows.length;
|
const rowLength = rows.length;
|
||||||
|
|
||||||
if (state === '1' && !jsOMS.hasClass(columns[i], 'hidden')) {
|
if (state === '1' && !jsOMS.hasClass(columns[i], 'vh')) {
|
||||||
for (let j = 0; j < rowLength; ++j) {
|
for (let j = 0; j < rowLength; ++j) {
|
||||||
const cols = rows[j].getElementsByTagName('td');
|
const cols = rows[j].getElementsByTagName('td');
|
||||||
|
|
||||||
|
|
@ -190,9 +190,9 @@ export class Table
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
|
||||||
jsOMS.addClass(cols[i], 'hidden');
|
jsOMS.addClass(cols[i], 'vh');
|
||||||
}
|
}
|
||||||
} else if ((state === '0' || state === null) && jsOMS.hasClass(columns[i], 'hidden')) {
|
} else if ((state === '0' || state === null) && jsOMS.hasClass(columns[i], 'vh')) {
|
||||||
for (let j = 0; j < rowLength; ++j) {
|
for (let j = 0; j < rowLength; ++j) {
|
||||||
const cols = rows[j].getElementsByTagName('td');
|
const cols = rows[j].getElementsByTagName('td');
|
||||||
|
|
||||||
|
|
@ -200,7 +200,7 @@ export class Table
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
|
||||||
jsOMS.removeClass(cols[i], 'hidden');
|
jsOMS.removeClass(cols[i], 'vh');
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
@ -240,7 +240,7 @@ export class Table
|
||||||
menuLine.firstElementChild.firstElementChild.setAttribute('id', lineId);
|
menuLine.firstElementChild.firstElementChild.setAttribute('id', lineId);
|
||||||
menuLine.firstElementChild.appendChild(document.createTextNode(columns[i].firstElementChild.innerText.trim()));
|
menuLine.firstElementChild.appendChild(document.createTextNode(columns[i].firstElementChild.innerText.trim()));
|
||||||
|
|
||||||
const isHidden = jsOMS.hasClass(columns[i], 'hidden');
|
const isHidden = jsOMS.hasClass(columns[i], 'vh');
|
||||||
|
|
||||||
menu.getElementsByTagName('ul')[0].appendChild(menuLine);
|
menu.getElementsByTagName('ul')[0].appendChild(menuLine);
|
||||||
menu.querySelector('ul').lastElementChild.querySelector('input[type="checkbox"]').checked = !isHidden;
|
menu.querySelector('ul').lastElementChild.querySelector('input[type="checkbox"]').checked = !isHidden;
|
||||||
|
|
@ -249,7 +249,7 @@ export class Table
|
||||||
const rows = header.parentElement.getElementsByTagName('tr');
|
const rows = header.parentElement.getElementsByTagName('tr');
|
||||||
const rowLength = rows.length;
|
const rowLength = rows.length;
|
||||||
|
|
||||||
const isHidden = jsOMS.hasClass(columns[i], 'hidden');
|
const isHidden = jsOMS.hasClass(columns[i], 'vh');
|
||||||
|
|
||||||
if (isHidden) {
|
if (isHidden) {
|
||||||
window.localStorage.setItem('ui-state-' + self.id + '-header-' + i, JSON.stringify('0'));
|
window.localStorage.setItem('ui-state-' + self.id + '-header-' + i, JSON.stringify('0'));
|
||||||
|
|
@ -261,9 +261,9 @@ export class Table
|
||||||
const cols = rows[j].getElementsByTagName('td');
|
const cols = rows[j].getElementsByTagName('td');
|
||||||
|
|
||||||
if (isHidden) {
|
if (isHidden) {
|
||||||
jsOMS.removeClass(cols[i], 'hidden');
|
jsOMS.removeClass(cols[i], 'vh');
|
||||||
} else {
|
} else {
|
||||||
jsOMS.addClass(cols[i], 'hidden');
|
jsOMS.addClass(cols[i], 'vh');
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue
Block a user