From 4eb521f3c4b9de0853a57af2234e80ab84a05497 Mon Sep 17 00:00:00 2001 From: Dennis Eichhorn Date: Sat, 10 Feb 2018 21:41:27 +0100 Subject: [PATCH] Improve increment --- Animation/Canvas/ParticleAnimation.js | 6 +++--- Asset/AssetManager.js | 2 +- Autoloader.js | 6 +++--- Chart/CalendarChart.js | 6 +++--- Chart/PyramidChart.js | 2 +- Chart/VWaterfallChart.js | 4 ++-- Chart/WaterfallChart.js | 2 +- Math/MathProcessor.js | 4 ++-- Spreadsheet/Spreadsheet.js | 2 +- UI/ActionManager.js | 4 ++-- UI/Component/Form.js | 4 ++-- UI/Component/Input.js | 4 ++-- UI/Component/Tab.js | 2 +- UI/Component/Table.js | 2 +- UI/DragNDrop.js | 2 +- UI/GeneralUI.js | 4 ++-- UI/Input/Keyboard/KeyboardManager.js | 2 +- UI/Input/Mouse/MouseManager.js | 2 +- Uri/UriFactory.js | 2 +- Utils/StringUtils.js | 2 +- Utils/UiUtils.js | 4 ++-- Utils/oLib.js | 6 +++--- Views/FormView.js | 8 ++++---- 23 files changed, 41 insertions(+), 41 deletions(-) diff --git a/Animation/Canvas/ParticleAnimation.js b/Animation/Canvas/ParticleAnimation.js index 4653003..2d23a7d 100644 --- a/Animation/Canvas/ParticleAnimation.js +++ b/Animation/Canvas/ParticleAnimation.js @@ -37,7 +37,7 @@ this.maxDistance = 70; this.gravitation = 10000000; - for (let i = 0; i < this.width * this.height / 3000; i++) { + for (let i = 0; i < this.width * this.height / 3000; ++i) { this.particles.push(new jsOMS.Animation.Canvas.Particle( Math.random() * this.width, Math.random() * this.height, @@ -66,7 +66,7 @@ const length = self.particles.length; - for (let i = 0; i < length; i++) { + for (let i = 0; i < length; ++i) { self.particles[i].draw(self.ctx); } @@ -109,7 +109,7 @@ const length = this.particles.length; - for (let i = 0; i < length; i++) { + for (let i = 0; i < length; ++i) { particle = this.particles[i]; pos = particle.getPosition(); vel = particle.getVelocity(); diff --git a/Asset/AssetManager.js b/Asset/AssetManager.js index fbca08a..16865bf 100644 --- a/Asset/AssetManager.js +++ b/Asset/AssetManager.js @@ -39,7 +39,7 @@ this.assets = {}; - for (let i = 0; i < length; i++) { + for (let i = 0; i < length; ++i) { this.assets[jsOMS.hash(scripts[i].src)] = scripts[i].src; } }; diff --git a/Autoloader.js b/Autoloader.js index 3221303..2ccea7a 100644 --- a/Autoloader.js +++ b/Autoloader.js @@ -36,7 +36,7 @@ const length = paths.length; let current = jsOMS; - for (let i = 0; i < length; i++) { + for (let i = 0; i < length; ++i) { if (typeof current[paths[i]] === 'undefined') { current[paths[i]] = {}; } @@ -58,7 +58,7 @@ const scripts = document.getElementsByTagName('script'), length = !scripts ? 0 : scripts.length; - for (let i = 0; i < length; i++) { + for (let i = 0; i < length; ++i) { /** global: URL */ /** @var {string} URL */ scripts[i].src.replace(URL + '/', ''); @@ -95,7 +95,7 @@ { const length = file.length; - for (let i = 0; i < length; i++) { + for (let i = 0; i < length; ++i) { if (jsOMS.Autoloader.loaded.indexOf(file) === -1) { this.assetLoader.load(file, 'js'); diff --git a/Chart/CalendarChart.js b/Chart/CalendarChart.js index 61b4f28..3f9bb61 100644 --- a/Chart/CalendarChart.js +++ b/Chart/CalendarChart.js @@ -86,7 +86,7 @@ let year = d.split('-')[0], length = self.chart.dataset.length; - for (let i = 0; i < length; i++) { + for (let i = 0; i < length; ++i) { if (self.chart.dataset[i].name != year) { continue; } @@ -108,7 +108,7 @@ let year = d.split('-')[0], length = self.chart.dataset.length; - for (let i = 0; i < length; i++) { + for (let i = 0; i < length; ++i) { if (self.chart.dataset[i].name != year) { continue; } @@ -129,7 +129,7 @@ let year = d.split('-')[0], length = self.chart.dataset.length; - for (let i = 0; i < length; i++) { + for (let i = 0; i < length; ++i) { if (self.chart.dataset[i].name != year) { continue; } diff --git a/Chart/PyramidChart.js b/Chart/PyramidChart.js index 28d232f..1a2599b 100644 --- a/Chart/PyramidChart.js +++ b/Chart/PyramidChart.js @@ -68,7 +68,7 @@ add = 0; // todo: remove value since positive and negative can be checked by looking at the diff of y-y0 - for (let i = 0; i < length - 1; i++) { + for (let i = 0; i < length - 1; ++i) { dataset[0].points[i] = { name: data[i].name, y0: add, y: data[i].value + add }; add += data[i].value; } diff --git a/Chart/VWaterfallChart.js b/Chart/VWaterfallChart.js index 95b1856..d077e34 100644 --- a/Chart/VWaterfallChart.js +++ b/Chart/VWaterfallChart.js @@ -54,7 +54,7 @@ visible: true } }; - + this.chart.subtype = 'vwaterfall'; }; @@ -70,7 +70,7 @@ add = 0; // todo: remove value since positive and negative can be checked by looking at the diff of y-y0 - for (let i = 0; i < length - 1; i++) { + for (let i = 0; i < length - 1; ++i) { dataset[0].points[i] = { name: data[i].name, y0: add, y: data[i].value + add }; add += data[i].value; } diff --git a/Chart/WaterfallChart.js b/Chart/WaterfallChart.js index 2807172..c57d424 100644 --- a/Chart/WaterfallChart.js +++ b/Chart/WaterfallChart.js @@ -70,7 +70,7 @@ add = 0; // todo: remove value since positive and negative can be checked by looking at the diff of y-y0 - for (let i = 0; i < length - 1; i++) { + for (let i = 0; i < length - 1; ++i) { dataset[0].points[i] = { name: data[i].name, y0: add, y: data[i].value + add }; add += data[i].value; } diff --git a/Math/MathProcessor.js b/Math/MathProcessor.js index c4a4b09..0f372f5 100644 --- a/Math/MathProcessor.js +++ b/Math/MathProcessor.js @@ -7,7 +7,7 @@ postfix = jsOMS.shuntingYard(equation); length = postfix.length; - for (let i = 0; i < length; i++) { + for (let i = 0; i < length; ++i) { if (!isNaN(parseFloat(postfix[i])) && isFinite(postfix[i])) { stack.push(postfix[i]); } else { @@ -52,7 +52,7 @@ equation = equation.split(/([\+\-\*\/\^\(\)])/).filter(function (n) { return n !== '' }); let length = equation.length; - for (let i = 0; i < length; i++) { + for (let i = 0; i < length; ++i) { let token = equation[i]; if (!isNaN(parseFloat(token)) && isFinite(token)) { diff --git a/Spreadsheet/Spreadsheet.js b/Spreadsheet/Spreadsheet.js index a76cada..c1be26c 100644 --- a/Spreadsheet/Spreadsheet.js +++ b/Spreadsheet/Spreadsheet.js @@ -33,7 +33,7 @@ j = 0, this.compiledData = this.dataset; - for (let i = 0; i < cRows; i++) { + for (let i = 0; i < cRows; ++i) { cCols = this.compiledData[i].length(); for (j = 0; j < cCols; j++) { diff --git a/UI/ActionManager.js b/UI/ActionManager.js index d441e50..9128474 100644 --- a/UI/ActionManager.js +++ b/UI/ActionManager.js @@ -44,7 +44,7 @@ const uiElements = typeof id === 'undefined' ? document.querySelectorAll('[data-action]') : (typeof id.length !== 'undefined' ? id : [id]), length = uiElements.length; - for (let i = 0; i < length; i++) { + for (let i = 0; i < length; ++i) { if (uiElements[i] !== null && uiElements[i].hasAttribute('data-action')) { this.bindElement(uiElements[i]); } @@ -69,7 +69,7 @@ self = this; // For everey action an event is registered - for (let i = 0; i < listenerLength; i++) { + for (let i = 0; i < listenerLength; ++i) { let c = [e], hasSelector = false; if (listeners[i].hasOwnProperty('selector')) { diff --git a/UI/Component/Form.js b/UI/Component/Form.js index 675d0e0..d658828 100644 --- a/UI/Component/Form.js +++ b/UI/Component/Form.js @@ -76,7 +76,7 @@ const forms = document.getElementsByTagName('form'), length = !forms ? 0 : forms.length; - for (let i = 0; i < length; i++) { + for (let i = 0; i < length; ++i) { if (typeof forms[i].getAttribute('id') !== 'undefined' && forms[i].getAttribute('id') !== null && typeof this.ignore[forms[i].getAttribute('id')] === 'undefined') { this.bindForm(forms[i].getAttribute('id')); } @@ -106,7 +106,7 @@ const submits = this.forms[id].getSubmit(), length = submits.length; - for (let i = 0; i < length; i++) { + for (let i = 0; i < length; ++i) { submits[i].addEventListener('click', function (event) { jsOMS.preventAll(event); diff --git a/UI/Component/Input.js b/UI/Component/Input.js index d02e9d1..f687ff2 100644 --- a/UI/Component/Input.js +++ b/UI/Component/Input.js @@ -124,7 +124,7 @@ data = tempResponse.getData(), length = data.length; - for (let i = 0; i < length; i++) { + for (let i = 0; i < length; ++i) { option = document.createElement('option'); option.value = tempResponse.value; option.text = tempResponse.text; @@ -151,7 +151,7 @@ { const length = datalist.options.length; - for (let i = 0; i < length; i++) { + for (let i = 0; i < length; ++i) { datalist.remove(0); } }; diff --git a/UI/Component/Tab.js b/UI/Component/Tab.js index 9c614ab..bc509aa 100644 --- a/UI/Component/Tab.js +++ b/UI/Component/Tab.js @@ -43,7 +43,7 @@ const tabs = document.querySelectorAll('.tabview'), length = !tabs ? 0 : tabs.length; - for (let i = 0; i < length; i++) { + for (let i = 0; i < length; ++i) { this.bindElement(tabs[i]); } } diff --git a/UI/Component/Table.js b/UI/Component/Table.js index fa113de..df824df 100644 --- a/UI/Component/Table.js +++ b/UI/Component/Table.js @@ -43,7 +43,7 @@ const tables = document.getElementsByTagName('table'), length = !tables ? 0 : tables.length; - for (let i = 0; i < length; i++) { + for (let i = 0; i < length; ++i) { this.bindElement(tables[i]); } } diff --git a/UI/DragNDrop.js b/UI/DragNDrop.js index da37e5d..e226674 100644 --- a/UI/DragNDrop.js +++ b/UI/DragNDrop.js @@ -51,7 +51,7 @@ const elements = document.querySelectorAll('[draggable]'), length = !elements ? 0 : elements.length; - for (let i = 0; i < length; i++) { + for (let i = 0; i < length; ++i) { if (typeof elements[i].getAttribute('id') !== 'undefined' && elements[i].getAttribute('id') !== null) { this.bindElement(elements[i].getAttribute('id')); } diff --git a/UI/GeneralUI.js b/UI/GeneralUI.js index ac2b7b4..eefa2c3 100644 --- a/UI/GeneralUI.js +++ b/UI/GeneralUI.js @@ -58,7 +58,7 @@ e = e !== null ? e.querySelectorAll('[data-href]') : document.querySelectorAll('[data-href]'); const length = e.length; - for (let i = 0; i < length; i++) { + for (let i = 0; i < length; ++i) { e[i].addEventListener('click', function(event) { jsOMS.preventAll(event); window.location = jsOMS.Uri.UriFactory.build(this.getAttribute('data-href')); @@ -93,7 +93,7 @@ }); } - for (let i = 0; i < length; i++) { + for (let i = 0; i < length; ++i) { if (!this.visObs) { e[i].src = e[i].dataset.lazyload; delete e[i].dataset.lazyload; diff --git a/UI/Input/Keyboard/KeyboardManager.js b/UI/Input/Keyboard/KeyboardManager.js index 7703861..a2e5773 100644 --- a/UI/Input/Keyboard/KeyboardManager.js +++ b/UI/Input/Keyboard/KeyboardManager.js @@ -89,7 +89,7 @@ keyLength = this.down.length; let match = false; - for (let i = 0; i < length; i++) { + for (let i = 0; i < length; ++i) { for (let j = 0; j < keyLength; j++) { if (actions[i].keys.indexOf(this.down[j]) === -1) { match = false; diff --git a/UI/Input/Mouse/MouseManager.js b/UI/Input/Mouse/MouseManager.js index c9ae300..654d5ab 100644 --- a/UI/Input/Mouse/MouseManager.js +++ b/UI/Input/Mouse/MouseManager.js @@ -108,7 +108,7 @@ const actions = this.elements[element], length = actions.length; - for (let i = 0; i < length; i++) { + for (let i = 0; i < length; ++i) { if ((!actions[i].exact || event.target.getAttribute('id') === element) && actions[i].button === event.button ) { diff --git a/Uri/UriFactory.js b/Uri/UriFactory.js index 65be284..4a9ac91 100644 --- a/Uri/UriFactory.js +++ b/Uri/UriFactory.js @@ -155,7 +155,7 @@ spl = null, length = pars.length; - for (let i = 0; i < length; i++) { + for (let i = 0; i < length; ++i) { spl = pars[i].split('='); comps[spl[0]] = spl[1]; } diff --git a/Utils/StringUtils.js b/Utils/StringUtils.js index 6649edf..02d6735 100644 --- a/Utils/StringUtils.js +++ b/Utils/StringUtils.js @@ -123,7 +123,7 @@ let res = 0 const len = str.length; - for (let i = 0; i < len; i++) { + for (let i = 0; i < len; ++i) { res = res * 31 + str.charCodeAt(i); } diff --git a/Utils/UiUtils.js b/Utils/UiUtils.js index 6c150ca..2ec9a5d 100644 --- a/Utils/UiUtils.js +++ b/Utils/UiUtils.js @@ -194,7 +194,7 @@ { const length = ele.childNodes.length; - for (let i = 0; i < length; i++) { + for (let i = 0; i < length; ++i) { if (jsOMS.hasClass(ele.childNodes[i], cls)) { return ele.childNodes[i]; } @@ -218,7 +218,7 @@ { const length = e.length; - for (let i = 0; i < length; i++) { + for (let i = 0; i < length; ++i) { e[i].addEventListener(event, callback); } }; diff --git a/Utils/oLib.js b/Utils/oLib.js index 5acdf7f..7e622ff 100644 --- a/Utils/oLib.js +++ b/Utils/oLib.js @@ -297,7 +297,7 @@ let res = 0; const len = str.length; - for (let i = 0; i < len; i++) { + for (let i = 0; i < len; ++i) { res = res * 31 + str.charCodeAt(i); } @@ -364,7 +364,7 @@ { const length = ele.childNodes.length; - for (let i = 0; i < length; i++) { + for (let i = 0; i < length; ++i) { if (jsOMS.hasClass(ele.childNodes[i], cls)) { return ele.childNodes[i]; } @@ -388,7 +388,7 @@ { const length = e.length; - for (let i = 0; i < length; i++) { + for (let i = 0; i < length; ++i) { e[i].addEventListener(event, callback); } }; diff --git a/Views/FormView.js b/Views/FormView.js index 5dccc0e..24ef749 100644 --- a/Views/FormView.js +++ b/Views/FormView.js @@ -157,7 +157,7 @@ let value = null; - for (let i = 0; i < length; i++) { + for (let i = 0; i < length; ++i) { if (elements[i].tagName.toLowerCase() === 'canvas') { value = elements[i].toDataURL('image/png'); } else { @@ -195,7 +195,7 @@ length = elements.length; try { - for (let i = 0; i < length; i++) { + for (let i = 0; i < length; ++i) { if ((elements[i].required && elements[i].value === '') || (typeof elements[i].pattern !== 'undefined' && elements[i].pattern !== '' @@ -282,7 +282,7 @@ const elements = this.getFormElements(), length = elements.length; - for (let i = 0; i < length; i++) { + for (let i = 0; i < length; ++i) { switch (elements[i].tagName) { case 'input': jsOMS.UI.Input.bind(elements[i]); @@ -311,7 +311,7 @@ const elements = this.getFormElements(), length = elements.length; - for (let i = 0; i < length; i++) { + for (let i = 0; i < length; ++i) { switch (elements[i].tagName) { case 'input': jsOMS.UI.Input.unbind(elements[i]);