mirror of
https://github.com/Karaka-Management/jsOMS.git
synced 2026-02-15 00:38:42 +00:00
let in to const in
This commit is contained in:
parent
c517b37e0e
commit
32856280b4
|
|
@ -224,7 +224,7 @@
|
||||||
|
|
||||||
jsOMS.Chart.ChartAbstract.prototype.findAxisDomain = function ()
|
jsOMS.Chart.ChartAbstract.prototype.findAxisDomain = function ()
|
||||||
{
|
{
|
||||||
for (let id in this.axis) {
|
for (const id in this.axis) {
|
||||||
if (!this.axis.hasOwnProperty(id)) {
|
if (!this.axis.hasOwnProperty(id)) {
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -56,7 +56,7 @@ export class EventManager
|
||||||
*/
|
*/
|
||||||
reset (group)
|
reset (group)
|
||||||
{
|
{
|
||||||
for (let id in this.groups[group]) {
|
for (const id in this.groups[group]) {
|
||||||
if (this.groups[group].hasOwnProperty(id)) {
|
if (this.groups[group].hasOwnProperty(id)) {
|
||||||
this.groups[group][id] = false;
|
this.groups[group][id] = false;
|
||||||
}
|
}
|
||||||
|
|
@ -78,7 +78,7 @@ export class EventManager
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
for (let id in this.groups[group]) {
|
for (const id in this.groups[group]) {
|
||||||
if (!this.groups[group].hasOwnProperty(id) || !this.groups[group][id]) {
|
if (!this.groups[group].hasOwnProperty(id) || !this.groups[group][id]) {
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -62,7 +62,7 @@ export class Logger
|
||||||
{
|
{
|
||||||
message = typeof message === 'undefined' ? Logger.MSG_FULL : message;
|
message = typeof message === 'undefined' ? Logger.MSG_FULL : message;
|
||||||
|
|
||||||
for (let replace in context) {
|
for (const replace in context) {
|
||||||
if (context.hasOwnProperty(replace) && typeof message === 'string') {
|
if (context.hasOwnProperty(replace) && typeof message === 'string') {
|
||||||
message = message.replace('{' + replace + '}', context[replace]);
|
message = message.replace('{' + replace + '}', context[replace]);
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -109,7 +109,7 @@ export class Request
|
||||||
*/
|
*/
|
||||||
static getOS()
|
static getOS()
|
||||||
{
|
{
|
||||||
for (let os in OSType) {
|
for (const os in OSType) {
|
||||||
if (OSType.hasOwnProperty(os)) {
|
if (OSType.hasOwnProperty(os)) {
|
||||||
/** global: navigator */
|
/** global: navigator */
|
||||||
if (navigator.appVersion.toLowerCase().indexOf(OSType[os]) !== -1) {
|
if (navigator.appVersion.toLowerCase().indexOf(OSType[os]) !== -1) {
|
||||||
|
|
@ -330,7 +330,7 @@ export class Request
|
||||||
queryfy(obj)
|
queryfy(obj)
|
||||||
{
|
{
|
||||||
const str = [];
|
const str = [];
|
||||||
for (let p in obj) {
|
for (const p in obj) {
|
||||||
if (obj.hasOwnProperty(p)) {
|
if (obj.hasOwnProperty(p)) {
|
||||||
str.push(encodeURIComponent(p) + "=" + encodeURIComponent(obj[p]));
|
str.push(encodeURIComponent(p) + "=" + encodeURIComponent(obj[p]));
|
||||||
}
|
}
|
||||||
|
|
@ -357,7 +357,7 @@ export class Request
|
||||||
if (this.xhr.readyState !== 1) {
|
if (this.xhr.readyState !== 1) {
|
||||||
this.xhr.open(this.method, UriFactory.build(this.uri));
|
this.xhr.open(this.method, UriFactory.build(this.uri));
|
||||||
|
|
||||||
for (let p in this.requestHeader) {
|
for (const p in this.requestHeader) {
|
||||||
if (this.requestHeader.hasOwnProperty(p) && this.requestHeader[p] !== '') {
|
if (this.requestHeader.hasOwnProperty(p) && this.requestHeader[p] !== '') {
|
||||||
this.xhr.setRequestHeader(p, this.requestHeader[p]);
|
this.xhr.setRequestHeader(p, this.requestHeader[p]);
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -14,7 +14,7 @@ export function domGetValue (action, callback, id)
|
||||||
const e = action.base === 'self' ? (action.selector === '' || typeof action.selector === 'undefined' ? [document.getElementById(id)] : document.getElementById(id).querySelectorAll(action.selector)) : document.querySelectorAll(action.selector);
|
const e = action.base === 'self' ? (action.selector === '' || typeof action.selector === 'undefined' ? [document.getElementById(id)] : document.getElementById(id).querySelectorAll(action.selector)) : document.querySelectorAll(action.selector);
|
||||||
let value = {};
|
let value = {};
|
||||||
|
|
||||||
for (let i in e) {
|
for (const i in e) {
|
||||||
/** global: HTMLElement */
|
/** global: HTMLElement */
|
||||||
if (!e.hasOwnProperty(i) || !(e[i] instanceof HTMLElement)) {
|
if (!e.hasOwnProperty(i) || !(e[i] instanceof HTMLElement)) {
|
||||||
continue;
|
continue;
|
||||||
|
|
|
||||||
|
|
@ -13,7 +13,7 @@ export function popupButtonAction (action, callback, id)
|
||||||
|
|
||||||
const popup = action.base === 'self' ? (action.selector === '' ? [document.getElementById(id)] : document.getElementById(id).querySelectorAll(action.selector)) : document.querySelectorAll(action.selector);
|
const popup = action.base === 'self' ? (action.selector === '' ? [document.getElementById(id)] : document.getElementById(id).querySelectorAll(action.selector)) : document.querySelectorAll(action.selector);
|
||||||
|
|
||||||
for (let i in popup) {
|
for (const i in popup) {
|
||||||
/** global: HTMLElement */
|
/** global: HTMLElement */
|
||||||
if (!popup.hasOwnProperty(i) || !popup[i] || !(popup[i] instanceof HTMLElement)) {
|
if (!popup.hasOwnProperty(i) || !popup[i] || !(popup[i] instanceof HTMLElement)) {
|
||||||
continue;
|
continue;
|
||||||
|
|
@ -26,7 +26,7 @@ export function popupButtonAction (action, callback, id)
|
||||||
document.getElementById('dim').classList.remove('vh');
|
document.getElementById('dim').classList.remove('vh');
|
||||||
}
|
}
|
||||||
|
|
||||||
for (let j in clone) {
|
for (const j in clone) {
|
||||||
if (!clone.hasOwnProperty(j) || !(clone[j] instanceof HTMLElement)) {
|
if (!clone.hasOwnProperty(j) || !(clone[j] instanceof HTMLElement)) {
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -14,7 +14,7 @@ export function removeButtonAction (action, callback, id)
|
||||||
const e = action.base === 'self' ? (action.selector === '' || typeof action.selector === 'undefined' ? [document.getElementById(id)] : document.getElementById(id).querySelectorAll(action.selector)) : document.querySelectorAll(action.selector);
|
const e = action.base === 'self' ? (action.selector === '' || typeof action.selector === 'undefined' ? [document.getElementById(id)] : document.getElementById(id).querySelectorAll(action.selector)) : document.querySelectorAll(action.selector);
|
||||||
const dim = document.getElementById('dim');
|
const dim = document.getElementById('dim');
|
||||||
|
|
||||||
for (let i in e) {
|
for (const i in e) {
|
||||||
/** global: HTMLElement */
|
/** global: HTMLElement */
|
||||||
if (!e.hasOwnProperty(i) || !e[i] || !(e[i] instanceof HTMLElement)) {
|
if (!e.hasOwnProperty(i) || !e[i] || !(e[i] instanceof HTMLElement)) {
|
||||||
continue;
|
continue;
|
||||||
|
|
|
||||||
|
|
@ -13,7 +13,7 @@ export function domRemoveValue (action, callback, id)
|
||||||
|
|
||||||
const e = action.base === 'self' ? (action.selector === '' || typeof action.selector === 'undefined' ? [document.getElementById(id)] : document.getElementById(id).querySelectorAll(action.selector)) : document.querySelectorAll(action.selector);
|
const e = action.base === 'self' ? (action.selector === '' || typeof action.selector === 'undefined' ? [document.getElementById(id)] : document.getElementById(id).querySelectorAll(action.selector)) : document.querySelectorAll(action.selector);
|
||||||
|
|
||||||
for (let i in e) {
|
for (const i in e) {
|
||||||
/** global: HTMLElement */
|
/** global: HTMLElement */
|
||||||
if (!e.hasOwnProperty(i) || !(e[i] instanceof HTMLElement)) {
|
if (!e.hasOwnProperty(i) || !(e[i] instanceof HTMLElement)) {
|
||||||
continue;
|
continue;
|
||||||
|
|
|
||||||
|
|
@ -33,7 +33,7 @@ export function domSetValue (action, callback, id)
|
||||||
|
|
||||||
const fill = action.base === 'self' ? (action.selector === '' ? [document.getElementById(id)] : document.getElementById(id).querySelectorAll(action.selector)) : document.querySelectorAll(action.selector);
|
const fill = action.base === 'self' ? (action.selector === '' ? [document.getElementById(id)] : document.getElementById(id).querySelectorAll(action.selector)) : document.querySelectorAll(action.selector);
|
||||||
|
|
||||||
for (let i in fill) {
|
for (const i in fill) {
|
||||||
/** global: HTMLElement */
|
/** global: HTMLElement */
|
||||||
if (!fill.hasOwnProperty(i) || !(fill[i] instanceof HTMLElement)) {
|
if (!fill.hasOwnProperty(i) || !(fill[i] instanceof HTMLElement)) {
|
||||||
continue;
|
continue;
|
||||||
|
|
|
||||||
|
|
@ -12,14 +12,14 @@ export function dataCollectionAction (action, callback)
|
||||||
|
|
||||||
let elements, data = {};
|
let elements, data = {};
|
||||||
|
|
||||||
for (let selector in action.collect) {
|
for (const selector in action.collect) {
|
||||||
if (!action.collect.hasOwnProperty(selector)) {
|
if (!action.collect.hasOwnProperty(selector)) {
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
|
||||||
elements = document.querySelectorAll(action.collect[selector]);
|
elements = document.querySelectorAll(action.collect[selector]);
|
||||||
|
|
||||||
for (let e in elements) {
|
for (const e in elements) {
|
||||||
if (!elements.hasOwnProperty(e)) {
|
if (!elements.hasOwnProperty(e)) {
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -275,7 +275,7 @@ export class Form
|
||||||
}
|
}
|
||||||
|
|
||||||
// Run all injects first
|
// Run all injects first
|
||||||
for (let property in injects) {
|
for (const property in injects) {
|
||||||
if (injects.hasOwnProperty(property)) {
|
if (injects.hasOwnProperty(property)) {
|
||||||
++counter;
|
++counter;
|
||||||
//this.app.eventManager.addGroup(form.getId(), counter);
|
//this.app.eventManager.addGroup(form.getId(), counter);
|
||||||
|
|
|
||||||
|
|
@ -97,7 +97,7 @@ export class UriFactory
|
||||||
let success = false;
|
let success = false;
|
||||||
const regexp = new RegExp(pattern);
|
const regexp = new RegExp(pattern);
|
||||||
|
|
||||||
for (let key in UriFactory.uri) {
|
for (const key in UriFactory.uri) {
|
||||||
if (UriFactory.uri.hasOwnProperty(key) && regexp.test(key)) {
|
if (UriFactory.uri.hasOwnProperty(key) && regexp.test(key)) {
|
||||||
delete UriFactory.uri[key];
|
delete UriFactory.uri[key];
|
||||||
success = true;
|
success = true;
|
||||||
|
|
@ -137,7 +137,7 @@ export class UriFactory
|
||||||
}
|
}
|
||||||
|
|
||||||
let pars = [];
|
let pars = [];
|
||||||
for (let a in comps) {
|
for (const a in comps) {
|
||||||
if (comps.hasOwnProperty(a)) {
|
if (comps.hasOwnProperty(a)) {
|
||||||
pars.push(a + '=' + comps[a]);
|
pars.push(a + '=' + comps[a]);
|
||||||
}
|
}
|
||||||
|
|
@ -245,7 +245,7 @@ export class UriFactory
|
||||||
|
|
||||||
const query = uri.getQuery();
|
const query = uri.getQuery();
|
||||||
|
|
||||||
for (let key in query) {
|
for (const key in query) {
|
||||||
if (query.hasOwnProperty(key)) {
|
if (query.hasOwnProperty(key)) {
|
||||||
UriFactory.setQuery('?' + key, query[key]);
|
UriFactory.setQuery('?' + key, query[key]);
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -28,7 +28,7 @@
|
||||||
let pathParts = jsOMS.ltrim(path, delim).split(delim);
|
let pathParts = jsOMS.ltrim(path, delim).split(delim);
|
||||||
let current = data;
|
let current = data;
|
||||||
|
|
||||||
for (let key in pathParts) {
|
for (const key in pathParts) {
|
||||||
if (!pathParts.hasOwnProperty(key)) {
|
if (!pathParts.hasOwnProperty(key)) {
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -80,7 +80,7 @@ validatePage = function(url)
|
||||||
|
|
||||||
// analyze css usage
|
// analyze css usage
|
||||||
let cssFound;
|
let cssFound;
|
||||||
for (let i in cssSelectors) {
|
for (const i in cssSelectors) {
|
||||||
try {
|
try {
|
||||||
cssFound = document.querySelectorAll(i.replace(/:hover|:active/gi, ''));
|
cssFound = document.querySelectorAll(i.replace(/:hover|:active/gi, ''));
|
||||||
cssSelectors[i] = cssFound === null ? 0 : cssFound.length
|
cssSelectors[i] = cssFound === null ? 0 : cssFound.length
|
||||||
|
|
|
||||||
|
|
@ -45,7 +45,7 @@
|
||||||
{
|
{
|
||||||
const out = jsOMS.clone(target);
|
const out = jsOMS.clone(target);
|
||||||
|
|
||||||
for (let p in source) {
|
for (const p in source) {
|
||||||
if (source.hasOwnProperty(p)) {
|
if (source.hasOwnProperty(p)) {
|
||||||
// Property in destination object set; update its value.
|
// Property in destination object set; update its value.
|
||||||
if (typeof source[p] === 'object') {
|
if (typeof source[p] === 'object') {
|
||||||
|
|
|
||||||
|
|
@ -57,7 +57,7 @@
|
||||||
const pathParts = jsOMS.ltrim(path, delim).split(delim);
|
const pathParts = jsOMS.ltrim(path, delim).split(delim);
|
||||||
let current = data;
|
let current = data;
|
||||||
|
|
||||||
for (let key in pathParts) {
|
for (const key in pathParts) {
|
||||||
if (!pathParts.hasOwnProperty(key)) {
|
if (!pathParts.hasOwnProperty(key)) {
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
|
@ -528,7 +528,7 @@
|
||||||
{
|
{
|
||||||
const out = jsOMS.clone(target);
|
const out = jsOMS.clone(target);
|
||||||
|
|
||||||
for (let p in source) {
|
for (const p in source) {
|
||||||
if (source.hasOwnProperty(p)) {
|
if (source.hasOwnProperty(p)) {
|
||||||
// Property in destination object set; update its value.
|
// Property in destination object set; update its value.
|
||||||
if (typeof source[p] === 'object') {
|
if (typeof source[p] === 'object') {
|
||||||
|
|
|
||||||
|
|
@ -428,7 +428,7 @@ export class FormView
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
for (let key in data) {
|
for (const key in data) {
|
||||||
if (data.hasOwnProperty(key)) {
|
if (data.hasOwnProperty(key)) {
|
||||||
formData.append(key, data[key].constructor === Array ? JSON.stringify(data[key]) : data[key]);
|
formData.append(key, data[key].constructor === Array ? JSON.stringify(data[key]) : data[key]);
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue
Block a user