You cannot select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
228 lines
9.1 KiB
HTML
228 lines
9.1 KiB
HTML
<!DOCTYPE html>
|
|
<html lang="de-DE">
|
|
|
|
<head>
|
|
<meta charset="UTF-8">
|
|
<meta name="viewport" content="width=device-width, initial-scale=1.0, user-scalable=no, viewport-fit=cover" />
|
|
<meta name="description" content="RW Form Management System" />
|
|
<title>RWFMS</title>
|
|
<link rel="icon" type="image/x-icon" href="./supply/favicon.ico">
|
|
|
|
<!-- W3.CSS: -->
|
|
<!--link rel="stylesheet" href="https://www.w3schools.com/w3css/4/w3.css"-->
|
|
<link rel="stylesheet" href="./css/w3.css">
|
|
<!--link rel="stylesheet" href="./css/w3-theme-green.css"-->
|
|
<link rel="stylesheet" href="./css/w3-theme-rw.css">
|
|
<link rel="stylesheet" href="./css/w3-ext.css">
|
|
|
|
<!-- W3.js: -->
|
|
<script src="./xjs/w3.js"></script>
|
|
|
|
<!-- font awesome -->
|
|
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.2.1/css/all.min.css">
|
|
|
|
<!-- alertifyjs: -->
|
|
<script src="./node_modules/alertifyjs/build/alertify.min.js"></script>
|
|
<link rel="stylesheet" href="./node_modules/alertifyjs/build/css/alertify.min.css" />
|
|
<!--link rel="stylesheet" href="./node_modules/alertifyjs/build/css/themes/default.min.css"-->
|
|
<link rel="stylesheet" href="./css/alertify-theme-ext.css" />
|
|
|
|
<!-- jsPDF: -->
|
|
<script src="./node_modules/jspdf/dist/jspdf.umd.min.js"></script>
|
|
|
|
<!-- Compressor: -->
|
|
<script src="./node_modules/compressorjs/dist/compressor.min.js"></script>
|
|
|
|
|
|
<!-- jsonTreeViewer: ->
|
|
<link href="./XJS/jsonTreeViewer/jsonTree.css" rel="stylesheet" />
|
|
<script src="./XJS/jsonTreeViewer/jsonTree.js"></script-->
|
|
|
|
<!--link href="https://rawgit.com/summerstyle/jsonTreeViewer/master/libs/jsonTree/jsonTree.css" rel="stylesheet" />
|
|
<script src="https://rawgit.com/summerstyle/jsonTreeViewer/master/libs/jsonTree/jsonTree.js"></script-->
|
|
|
|
|
|
</head>
|
|
|
|
<body>
|
|
<!--eader id="grHeader" class="w3-container w3-padding-bottom-32 w3-teal"
|
|
style="position: fixed; left: 0; top: 0; width: 100%; height:80px;overflow:auto;"></header>>
|
|
<div class="w3-xxlarge">Lorem ipsum -- dolor
|
|
<a href="login.html" class="w3-btn w3-teal w3-large w3-round-xxlarge w3-right" style="margin-top: 8px">log
|
|
in</a>
|
|
</div>
|
|
</header>
|
|
<div id="grFormSection" class="w3-rw-formSection w3-border" style="margin-top:100px;">grFormSection</div>
|
|
<div id="grDebug">grDebug</div>
|
|
<footer id="grFooter" class="w3-teal"
|
|
style="position: fixed;left:0;bottom:0;width:100%;text-align:center;height:25px;overflow:auto;">Footer</footer-->
|
|
<div id="grForm"></div>
|
|
<script type="text/javascript">
|
|
globalThis.XRW = {
|
|
Broker: {},
|
|
Dom: {},
|
|
lang: 'de',
|
|
Local: 'de-DE',
|
|
|
|
//##!!USER!!#BEG#!!
|
|
_LOG_UID: -1,
|
|
SID: null,
|
|
USR_EMail: null,
|
|
USR_UID: null,
|
|
USR_Data: { USR_FirstName: "Max", USR_LastName: "Muster" },
|
|
USR_Pass: null,
|
|
OU_Name: null,
|
|
LOG_Role: 'USER',
|
|
//##!!USER!!#END#!!
|
|
|
|
//##!!UPLOAD!!#BEG#!!
|
|
fileUploadAccept: ".png, .jpg, .jpeg",
|
|
fileUploadMaxSize: 4 * 1024 * 1024,
|
|
//##!!UPLOAD!!#BEG#!!
|
|
|
|
DebugLevel: 1,
|
|
jsApp: null,
|
|
FDFake: 0,
|
|
mForm: new Map(),
|
|
rwLib: 'PRD',
|
|
rwLib_DEV: {
|
|
Broker: './lib_10_broker/mkBroker.mjs',
|
|
Render: './lib_20_render/mkRender.mjs',
|
|
Folder: './lib_30_folder/mkFolder.mjs',
|
|
Form: './lib_40_form/mkForm.mjs',
|
|
},
|
|
rwLib_PRD: {
|
|
Broker: './oc/mkBroker_oc.js',
|
|
Render: './oc/mkRender_oc.js',
|
|
Folder: './oc/mkFolder_oc.js',
|
|
Form: '../oc/mkForm_oc.js',
|
|
},
|
|
onUnloadPrompt: null,
|
|
pTimeOutID: [],
|
|
windowResizeTimeout: null,
|
|
windowHeight: window.innerHeight,
|
|
windowWidth: window.innerWidth,
|
|
windowResizeCallBack: null,
|
|
testSample: null,
|
|
ynTestRender: 'N',
|
|
testRenderType: 'HTML',
|
|
ynTestFolder: 'N',
|
|
ynAlertError: 'Y',
|
|
ynAlertPanic: 'Y',
|
|
ynThrowError: 'Y',
|
|
ynThrowPanic: 'Y',
|
|
ynDebugWarn: 'N',
|
|
ynDebugError: 'Y',
|
|
};
|
|
globalThis.readURL = () => {
|
|
let s = window.location.href;
|
|
let pMatch = s.matchAll(/[?&]+([^=&]+)=([^&]*)/gi);
|
|
for (const match of pMatch) {
|
|
let key = match[1];
|
|
let value = decodeURIComponent(match[2]);
|
|
if (key in globalThis.XRW) {
|
|
globalThis.XRW[key] = value;
|
|
} else {
|
|
let msg = (`XRW parameter unknown:"${key}=${value}"`);
|
|
console.log(msg);
|
|
if (key in globalThis.XRW) {
|
|
globalThis.XRW[key] = value;
|
|
} else {
|
|
let msg = (`XRW parameter unknown:"${key}=${value}"`);
|
|
console.log(msg);
|
|
alert(msg);
|
|
}
|
|
}
|
|
}
|
|
};
|
|
window.addEventListener("pageshow", function (event) {
|
|
// https://stackoverflow.com/questions/43043113/how-to-force-reloading-a-page-when-using-browser-back-button
|
|
var historyTraversal = event.persisted ||
|
|
(typeof window.performance != "undefined" &&
|
|
window.performance.navigation.type === 2);
|
|
if (historyTraversal) {
|
|
// Handle page restore.
|
|
window.location.reload();
|
|
}
|
|
});
|
|
window.addEventListener('resize', async function (event) {
|
|
// https://bencentra.com/code/2015/02/27/optimizing-window-resize.html
|
|
clearTimeout(XRW.windowResizeTimeout);
|
|
XRW.windowResizeTimeout = setTimeout(() => {
|
|
XRW.windowHeight = window.innerHeight;
|
|
XRW.windowWidth = window.innerWidth;
|
|
XRW.windowResizeCallBack(event);
|
|
}, 750);
|
|
});
|
|
if (XRW.onUnloadPrompt) {
|
|
window.addEventListener('beforeunload', (event) => {
|
|
event.returnValue = XRW.onUnloadPrompt;
|
|
});
|
|
}
|
|
window.onload = async () => {
|
|
// http-server . -p 5000 -c-1
|
|
globalThis.readURL();
|
|
let rwLib = XRW[`rwLib_${XRW.rwLib}`];
|
|
await import(rwLib.Broker);
|
|
await import(rwLib.Render);
|
|
if (XRW.testSample) {
|
|
await import("./supply/samples.mjs");
|
|
XRW.assert.object(XRW.samples, `Importing sample failed`);
|
|
if (!(XRW.testSample in XRW.samples)) return XRW.panic(`Importing samples: "${XRW.testSample}" not found`)
|
|
}
|
|
if (XRW.ynTestRender == 'Y') {
|
|
const repaint = async () => {
|
|
let testRenderType = XRW.testRenderType || 'HTML';
|
|
let render = XRW.mkRender(testRenderType, { fs: 12, anchor: "grForm" });
|
|
render.clearAll();
|
|
await render.test(XRW.samples[XRW.testSample]);
|
|
}
|
|
XRW.windowResizeCallBack = (event) => {
|
|
(async () => { await repaint(); })();
|
|
}
|
|
await repaint();
|
|
return;
|
|
}
|
|
await import(rwLib.Folder);
|
|
if (XRW.ynTestFolder == 'Y') {
|
|
let folder = XRW.mkFolder();
|
|
folder.setArg('WikiExample', XRW.samples.jsonWiki);
|
|
folder.debug();
|
|
return;
|
|
}
|
|
await import('./formElem/mkFormElem.js');
|
|
await import(rwLib.Form);
|
|
//##!DEBUG!## BEG put in oDevTool!
|
|
globalThis.fd = (_FD_Prefix, NOT_FD_Prefix) => {
|
|
let pForm = Array.from(XRW.mForm.values());
|
|
for (let form of pForm) {
|
|
form.folder.debug(_FD_Prefix, NOT_FD_Prefix);
|
|
}
|
|
}
|
|
globalThis.feg = (FEG_Prefix) => {
|
|
let pForm = Array.from(XRW.mForm.values());
|
|
for (let form of pForm) {
|
|
// form.folder.debug(_FD_Prefix, NOT_FD_Prefix);
|
|
for (let key in form.pFEGMember) {
|
|
if (FEG_Prefix && key != FEG_Prefix) continue;
|
|
let feg = form.pFEGMember[key];
|
|
console.log(feg);
|
|
}
|
|
}
|
|
}
|
|
//##!DEBUG!## END
|
|
if (!XRW.jsApp) {
|
|
XRW.message(`Missing jsApp`);
|
|
return;
|
|
}
|
|
await import(XRW.jsApp);
|
|
if (oApp.Init) await oApp.Init();
|
|
await oApp.Start();
|
|
console.dir("oApp", oApp);
|
|
|
|
XRW.info("onload finished");
|
|
}
|
|
</script>
|
|
</body>
|
|
|
|
</html> |