mirror of
https://github.com/Karaka-Management/jsOMS.git
synced 2026-01-10 17:38:41 +00:00
code fixes
This commit is contained in:
parent
44ea99b106
commit
e9e235e7c6
|
|
@ -40,7 +40,7 @@ Autoloader.defineNamespace = function (namespace)
|
|||
paths.splice(0, 1);
|
||||
|
||||
const length = paths.length;
|
||||
let current = omsApp;
|
||||
let current = window.omsApp;
|
||||
|
||||
for (let i = 0; i < length; ++i) {
|
||||
if (typeof current[paths[i]] === 'undefined') {
|
||||
|
|
|
|||
|
|
@ -64,13 +64,17 @@ export class BrowserNotification
|
|||
send (msg)
|
||||
{
|
||||
/** global: Notification */
|
||||
if (Notification.permission === 'granted') {
|
||||
if (Notification.permission !== 'granted') {
|
||||
return;
|
||||
}
|
||||
|
||||
navigator.serviceWorker.ready.then((registration) => {
|
||||
registration.showNotification(msg.title, {
|
||||
body: msg.message,
|
||||
icon: "../images/touch/chrome-touch-icon-192x192.png",
|
||||
icon: '../images/touch/chrome-touch-icon-192x192.png',
|
||||
vibrate: [msg.vibrate ? 200 : 0],
|
||||
tag: "notification",
|
||||
tag: 'notification'
|
||||
});
|
||||
}
|
||||
});
|
||||
};
|
||||
};
|
||||
|
|
|
|||
|
|
@ -20,6 +20,6 @@ export class ModuleFactory
|
|||
*/
|
||||
static getInstance (module, app)
|
||||
{
|
||||
return new omsApp.Modules[module](app);
|
||||
return new window.omsApp.Modules[module](app);
|
||||
};
|
||||
};
|
||||
|
|
|
|||
|
|
@ -673,8 +673,8 @@ export class Form
|
|||
jsOMS.removeClass(updateElements[i], 'animated');
|
||||
jsOMS.removeClass(updateElements[i], 'greenCircleFade');
|
||||
|
||||
requestAnimationFrame((time) => {
|
||||
requestAnimationFrame((time) => {
|
||||
window.requestAnimationFrame((_) => {
|
||||
window.requestAnimationFrame((_) => {
|
||||
jsOMS.addClass(updateElements[i], 'animated');
|
||||
jsOMS.addClass(updateElements[i], 'medium-duration');
|
||||
jsOMS.addClass(updateElements[i], 'greenCircleFade');
|
||||
|
|
@ -705,8 +705,8 @@ export class Form
|
|||
jsOMS.removeClass(updateElements[i], 'greenCircleFade');
|
||||
jsOMS.removeClass(updateElements[i], 'medium-duration');
|
||||
|
||||
requestAnimationFrame((_) => {
|
||||
requestAnimationFrame((_) => {
|
||||
window.requestAnimationFrame((_) => {
|
||||
window.requestAnimationFrame((_) => {
|
||||
// Important: all classes need to be done in one go otherwise it doesn't work (timing issue?)
|
||||
jsOMS.addClass(updateElements[i], 'animated medium-duration greenCircleFade');
|
||||
});
|
||||
|
|
@ -890,7 +890,7 @@ export class Form
|
|||
}
|
||||
|
||||
// define remote response behavior
|
||||
self.forms[externalFormId].setSuccess(function (response) {
|
||||
self.forms[id].setSuccess(function (response) {
|
||||
if (response.get('status') !== 'undefined'
|
||||
&& response.get('status') !== NotificationLevel.HIDDEN
|
||||
) {
|
||||
|
|
@ -1184,6 +1184,8 @@ export class Form
|
|||
window.location = headerLocation;
|
||||
}
|
||||
|
||||
let statusCode = null;
|
||||
|
||||
if (xhr.getResponseHeader('content-type').includes('application/octet-stream')) {
|
||||
const blob = new Blob([xhr.response], { type: 'application/octet-stream' });
|
||||
const doc = document.createElement('a');
|
||||
|
|
@ -1225,7 +1227,7 @@ export class Form
|
|||
const response = new Response(o);
|
||||
let successInject = null;
|
||||
|
||||
const statusCode = parseInt(xhr.getResponseHeader('status'));
|
||||
statusCode = parseInt(xhr.getResponseHeader('status'));
|
||||
|
||||
if ((successInject = form.getSuccess()) !== null
|
||||
&& (statusCode === 200 || statusCode === null)
|
||||
|
|
|
|||
|
|
@ -140,7 +140,7 @@ export class jsOMS
|
|||
static htmlspecialchars_encode = function (str)
|
||||
{
|
||||
let escaped = str;
|
||||
const length = htmlspecialchars.length;
|
||||
const length = jsOMS.htmlspecialchars.length;
|
||||
|
||||
for (let i = 0; i < length; ++i) {
|
||||
escaped = escaped.replace(
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user