JSFiddle - React, Tailwind, and code Playground
by techunter
HTML
<div id="main"></div>
CSS
div#main {
position:relative;
}
div.variable {
margin:7px;
width: 700px;
position:relative;
}
.variable label {
left:0px;
}
.variable input {
position:absolute;
right:0px;
width:500px;
}
.variable.locals {
background-color:#EEE;
}
JavaScript
var checkLoop = {
max: {},
running: true,
firstStop: true,
iterators: {},
display: function () {},
start: function (it, max, zeroBased) {
checkLoop.iterators[it] = zeroBased ? -1 : 0;
checkLoop.max[it] = (max !== 'undefined' && max >= 0) ? max : 100;
},
end: function (it) {
delete checkLoop.max[it];
delete checkLoop.iterators[it];
},
onStop: function (it) {
if (checkLoop.firstStop) {
console.log('Max reached, stopped : ' + it + '->' + checkLoop.iterators[it]);
checkLoop.firstStop = false;
checkLoop.display();
debugger;
}
return true;
},
check: function (it, nonBlocking) {
if (checkLoop.running) {
var val = checkLoop.iterators[it];
checkLoop.iterators[it] = ++val;
var out = val >= checkLoop.max[it];
console.log(it + ' --> ' + val);
checkLoop.running = (!out || nonBlocking);
if (out) {
console.log(nonBlocking);
console.log(checkLoop);
}
if (!checkLoop.running) checkLoop.onStop(it);
return checkLoop.running && !out;
}
return false;
}
};
$(function () {
var globals = {
OptimumBlockList: ["BLOC_060"],
Block: ["BLOC_060", "BLOC_060"],
WhlOptimum: ["260013082", "260013083"],
NbHum: [1, 6],
NbDMX: [10, 1],
DepthListOrdered: ["110.0"],
ProcessListOrdered: [100000122],
EmptyWHL: ["260013080", "260013081", "260013084", "260013072", "260013060", "260013048", "260013036", "260013024", "260013012", "2600130511"],
DepthCycleListOrdered: ["STANDARD"],
HumNbDmxList: [1],
WHLOList: [],
DWHLTList: [],
QHumToAddList: [],
QHumDWHLList: [],
QDmxHumDWHLList: [],
CycleDWHLList: [],
DepthDWHLList: [],
ProcessDWHLList: []
...