mirror of
https://github.com/Karaka-Management/jsOMS.git
synced 2026-01-11 01:48:40 +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 ()
|
||||
{
|
||||
for (let id in this.axis) {
|
||||
for (const id in this.axis) {
|
||||
if (!this.axis.hasOwnProperty(id)) {
|
||||
continue;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -56,7 +56,7 @@ export class EventManager
|
|||
*/
|
||||
reset (group)
|
||||
{
|
||||
for (let id in this.groups[group]) {
|
||||
for (const id in this.groups[group]) {
|
||||
if (this.groups[group].hasOwnProperty(id)) {
|
||||
this.groups[group][id] = false;
|
||||
}
|
||||
|
|
@ -78,7 +78,7 @@ export class EventManager
|
|||
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]) {
|
||||
return true;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -62,7 +62,7 @@ export class Logger
|
|||
{
|
||||
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') {
|
||||
message = message.replace('{' + replace + '}', context[replace]);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -109,7 +109,7 @@ export class Request
|
|||
*/
|
||||
static getOS()
|
||||
{
|
||||
for (let os in OSType) {
|
||||
for (const os in OSType) {
|
||||
if (OSType.hasOwnProperty(os)) {
|
||||
/** global: navigator */
|
||||
if (navigator.appVersion.toLowerCase().indexOf(OSType[os]) !== -1) {
|
||||
|
|
@ -330,7 +330,7 @@ export class Request
|
|||
queryfy(obj)
|
||||
{
|
||||
const str = [];
|
||||
for (let p in obj) {
|
||||
for (const p in obj) {
|
||||
if (obj.hasOwnProperty(p)) {
|
||||
str.push(encodeURIComponent(p) + "=" + encodeURIComponent(obj[p]));
|
||||
}
|
||||
|
|
@ -357,7 +357,7 @@ export class Request
|
|||
if (this.xhr.readyState !== 1) {
|
||||
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] !== '') {
|
||||
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);
|
||||
let value = {};
|
||||
|
||||
for (let i in e) {
|
||||
for (const i in e) {
|
||||
/** global: HTMLElement */
|
||||
if (!e.hasOwnProperty(i) || !(e[i] instanceof HTMLElement)) {
|
||||
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);
|
||||
|
||||
for (let i in popup) {
|
||||
for (const i in popup) {
|
||||
/** global: HTMLElement */
|
||||
if (!popup.hasOwnProperty(i) || !popup[i] || !(popup[i] instanceof HTMLElement)) {
|
||||
continue;
|
||||
|
|
@ -26,7 +26,7 @@ export function popupButtonAction (action, callback, id)
|
|||
document.getElementById('dim').classList.remove('vh');
|
||||
}
|
||||
|
||||
for (let j in clone) {
|
||||
for (const j in clone) {
|
||||
if (!clone.hasOwnProperty(j) || !(clone[j] instanceof HTMLElement)) {
|
||||
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 dim = document.getElementById('dim');
|
||||
|
||||
for (let i in e) {
|
||||
for (const i in e) {
|
||||
/** global: HTMLElement */
|
||||
if (!e.hasOwnProperty(i) || !e[i] || !(e[i] instanceof HTMLElement)) {
|
||||
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);
|
||||
|
||||
for (let i in e) {
|
||||
for (const i in e) {
|
||||
/** global: HTMLElement */
|
||||
if (!e.hasOwnProperty(i) || !(e[i] instanceof HTMLElement)) {
|
||||
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);
|
||||
|
||||
for (let i in fill) {
|
||||
for (const i in fill) {
|
||||
/** global: HTMLElement */
|
||||
if (!fill.hasOwnProperty(i) || !(fill[i] instanceof HTMLElement)) {
|
||||
continue;
|
||||
|
|
|
|||
|
|
@ -12,14 +12,14 @@ export function dataCollectionAction (action, callback)
|
|||
|
||||
let elements, data = {};
|
||||
|
||||
for (let selector in action.collect) {
|
||||
for (const selector in action.collect) {
|
||||
if (!action.collect.hasOwnProperty(selector)) {
|
||||
continue;
|
||||
}
|
||||
|
||||
elements = document.querySelectorAll(action.collect[selector]);
|
||||
|
||||
for (let e in elements) {
|
||||
for (const e in elements) {
|
||||
if (!elements.hasOwnProperty(e)) {
|
||||
continue;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -275,7 +275,7 @@ export class Form
|
|||
}
|
||||
|
||||
// Run all injects first
|
||||
for (let property in injects) {
|
||||
for (const property in injects) {
|
||||
if (injects.hasOwnProperty(property)) {
|
||||
++counter;
|
||||
//this.app.eventManager.addGroup(form.getId(), counter);
|
||||
|
|
|
|||
|
|
@ -97,7 +97,7 @@ export class UriFactory
|
|||
let success = false;
|
||||
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)) {
|
||||
delete UriFactory.uri[key];
|
||||
success = true;
|
||||
|
|
@ -137,7 +137,7 @@ export class UriFactory
|
|||
}
|
||||
|
||||
let pars = [];
|
||||
for (let a in comps) {
|
||||
for (const a in comps) {
|
||||
if (comps.hasOwnProperty(a)) {
|
||||
pars.push(a + '=' + comps[a]);
|
||||
}
|
||||
|
|
@ -245,7 +245,7 @@ export class UriFactory
|
|||
|
||||
const query = uri.getQuery();
|
||||
|
||||
for (let key in query) {
|
||||
for (const key in query) {
|
||||
if (query.hasOwnProperty(key)) {
|
||||
UriFactory.setQuery('?' + key, query[key]);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -28,7 +28,7 @@
|
|||
let pathParts = jsOMS.ltrim(path, delim).split(delim);
|
||||
let current = data;
|
||||
|
||||
for (let key in pathParts) {
|
||||
for (const key in pathParts) {
|
||||
if (!pathParts.hasOwnProperty(key)) {
|
||||
continue;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -80,7 +80,7 @@ validatePage = function(url)
|
|||
|
||||
// analyze css usage
|
||||
let cssFound;
|
||||
for (let i in cssSelectors) {
|
||||
for (const i in cssSelectors) {
|
||||
try {
|
||||
cssFound = document.querySelectorAll(i.replace(/:hover|:active/gi, ''));
|
||||
cssSelectors[i] = cssFound === null ? 0 : cssFound.length
|
||||
|
|
|
|||
|
|
@ -45,7 +45,7 @@
|
|||
{
|
||||
const out = jsOMS.clone(target);
|
||||
|
||||
for (let p in source) {
|
||||
for (const p in source) {
|
||||
if (source.hasOwnProperty(p)) {
|
||||
// Property in destination object set; update its value.
|
||||
if (typeof source[p] === 'object') {
|
||||
|
|
|
|||
|
|
@ -57,7 +57,7 @@
|
|||
const pathParts = jsOMS.ltrim(path, delim).split(delim);
|
||||
let current = data;
|
||||
|
||||
for (let key in pathParts) {
|
||||
for (const key in pathParts) {
|
||||
if (!pathParts.hasOwnProperty(key)) {
|
||||
continue;
|
||||
}
|
||||
|
|
@ -528,7 +528,7 @@
|
|||
{
|
||||
const out = jsOMS.clone(target);
|
||||
|
||||
for (let p in source) {
|
||||
for (const p in source) {
|
||||
if (source.hasOwnProperty(p)) {
|
||||
// Property in destination object set; update its value.
|
||||
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)) {
|
||||
formData.append(key, data[key].constructor === Array ? JSON.stringify(data[key]) : data[key]);
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user