This is an automated email from the ASF dual-hosted git repository. jleroux pushed a commit to branch release17.12 in repository https://gitbox.apache.org/repos/asf/ofbiz-framework.git
commit c071fb0ee98c577da9292dbe181f36cb165a3a30 Author: Jacques Le Roux <jacques.le.r...@les7arts.com> AuthorDate: Thu Dec 19 06:45:58 2019 +0100 Saving files before refreshing line endings --- .../js/jquery/plugins/fjTimer/jquerytimer-min.js | 2 +- .../js/jquery/plugins/fjTimer/jquerytimer.js | 258 ++++++++++----------- 2 files changed, 130 insertions(+), 130 deletions(-) diff --git a/themes/common/webapp/common/js/jquery/plugins/fjTimer/jquerytimer-min.js b/themes/common/webapp/common/js/jquery/plugins/fjTimer/jquerytimer-min.js index 2800450..f679981 100644 --- a/themes/common/webapp/common/js/jquery/plugins/fjTimer/jquerytimer-min.js +++ b/themes/common/webapp/common/js/jquery/plugins/fjTimer/jquerytimer-min.js @@ -8,4 +8,4 @@ jQuery.extend({fjFunctionQueue:function(a){if(a==null){if(jQuery.fjFunctionQueue 0)jQuery.fjFunctionQueue();else{jQuery.fjFunctionQueue.queue.running=false;jQuery.fjFunctionQueue.queue.index=0;jQuery.fjFunctionQueue.queue.properties.onComplete()}}});else{jQuery.fjFunctionQueue.queue.running=true;jQuery.fjFunctionQueue()}}else{if(jQuery.fjFunctionQueue.queue==null)jQuery.fjFunctionQueue.queue={index:0,running:false,queue:[],properties:{interval:1,onComplete:function(){},onStart:function(){},autoStart:true,onTick:function(d,e){e()}}};var b=jQuery.fjFunctionQueue.queue. [...] 0;if(jQuery.isFunction(a))jQuery.fjFunctionQueue.queue.queue.push(a);else if(jQuery.isArray(a))for(var c=0;c<a.length;c++)jQuery.fjFunctionQueue.queue.queue.push(a[c]);else jQuery.fjFunctionQueue.queue.properties=jQuery.extend(jQuery.fjFunctionQueue.queue.properties,a);if(b&&jQuery.fjFunctionQueue.queue.queue.length>0&&!jQuery.fjFunctionQueue.queue.running&&jQuery.fjFunctionQueue.queue.properties.autoStart){jQuery.fjFunctionQueue.queue.running=true;jQuery.fjFunctionQueue.queue.properties [...] jQuery.fjFunctionQueue.queue.running=false;jQuery.fjFunctionQueue()}}},fjTimer:function(a){a=jQuery.extend({interval:10,tick:function(){},repeat:false,random:false,onComplete:function(){},step:1},a);var b=0,c=new (function(){this.timerId=null;this.stop=function(){clearInterval(this.timerId)}});c.timerId=setInterval(function(){try{a.tick(b,c);b+=a.step}catch(d){alert(d)}if(a.repeat!==true&&(a.repeat*a.step<=b||a.repeat===false)){c.stop();a.onComplete()}},a.interval)},fjTimerEach:function( [...] -a.array,c=a.tick;a.repeat=b.length;if(a.step!=null)a.repeat=Math.ceil(b.length/parseInt(a.step,10));a.tick=function(d){c(d,b[d])};jQuery.fjTimer(a)}}); +a.array,c=a.tick;a.repeat=b.length;if(a.step!=null)a.repeat=Math.ceil(b.length/parseInt(a.step,10));a.tick=function(d){c(d,b[d])};jQuery.fjTimer(a)}}); diff --git a/themes/common/webapp/common/js/jquery/plugins/fjTimer/jquerytimer.js b/themes/common/webapp/common/js/jquery/plugins/fjTimer/jquerytimer.js index e4cd663..dadab45 100644 --- a/themes/common/webapp/common/js/jquery/plugins/fjTimer/jquerytimer.js +++ b/themes/common/webapp/common/js/jquery/plugins/fjTimer/jquerytimer.js @@ -5,132 +5,132 @@ * http://www.opensource.org/licenses/mit-license.php **/ -/****************************** -Simple jQuery based timer. Simple usage: - -jQuery.fjTimer({ - interval: 1000, - repeat: 5, - tick: function(counter, timerId) { - alert("tick:" + counter); - } -}); -properties are: -* interval - ticker interval in milliseconds, default 10 -* repeat - number of repeat times or boolean if reapeat forever or in case false not repeat at all -* tick - ticker function itself with parameter of counter and timerId paramerer if you want to clear interval yourself - -fjTimerEach method can be used with arrays only. No objects! -jQuery.fjTimerEach({ - interval: 1000, - tick: function(counter, object) { - alert("tick:" + counter + " - " + object); - }, - array: ["me", "myself", "I"] -}); -Usage is similar to fjTimer with some exceptions: -* tick comes with parameters index and object in array. -* step property - if you want to walk through array with bigger steps than 1 -* array property - this is simple array element. - -fjFunctionQueue idea is that we have alot of functions going on. Sometimes browsers(mostly IE) hangs if alot of dom is changed or something is going on. So I wrote simple queue. -Simple usage, just add function to queue: -jQuery.fjFunctionQueue(function() {alert("a")}); - -Configuration -jQuery.fjFunctionQueue({ interval: 1, onStart: function(){ alert("start")}, onComplete: function(){alert("complete!"}, autoStart: false, tick: function(index, func) {func();}, }); - -properties are: -* interval - ticker interval in milliseconds. Default 1; -* onStart function executed when queue starts;. -* onComplete function executed when queue is complete (including added functions); -* autoStart property, if queue should started automatically. Default true; -* tick function is executed before each queue item execution. Parameters are index and executed function itself. When exteding it func method must be called manually. -******************************/ -jQuery.extend({ - fjFunctionQueue: function(funcToQue) { - if (funcToQue == null) { - if (jQuery.fjFunctionQueue.queue != null && jQuery.fjFunctionQueue.queue.queue.length > 0) { - if (jQuery.fjFunctionQueue.queue.running) { - jQuery.fjTimer({ - interval: jQuery.fjFunctionQueue.queue.properties.interval, - tick: function(counter, timer) { - var func = jQuery.fjFunctionQueue.queue.queue.shift(); - try { - jQuery.fjFunctionQueue.queue.properties.onTick(jQuery.fjFunctionQueue.queue.index, func); - jQuery.fjFunctionQueue.queue.index++; - } catch (e) { - jQuery.fjFunctionQueue(); - throw e; - } - if (jQuery.fjFunctionQueue.queue.queue.length > 0) { - jQuery.fjFunctionQueue(); - } else { - jQuery.fjFunctionQueue.queue.running = false; - jQuery.fjFunctionQueue.queue.index = 0; - jQuery.fjFunctionQueue.queue.properties.onComplete(); - } - } - }); - } else { - jQuery.fjFunctionQueue.queue.running = true; - jQuery.fjFunctionQueue(); - } - } - } else { - if (jQuery.fjFunctionQueue.queue == null) { - jQuery.fjFunctionQueue.queue = {index: 0, running: false, queue:[], properties: {interval: 1, onComplete: function(){}, onStart: function(){}, autoStart: true, onTick: function(counter, func) {func();}}}; - } - var isEmptyArray = jQuery.fjFunctionQueue.queue.queue.length == 0; - if (jQuery.isFunction(funcToQue)) { - jQuery.fjFunctionQueue.queue.queue.push(funcToQue); - } else if (jQuery.isArray(funcToQue)) { - for(var i = 0; i < funcToQue.length; i++) { - jQuery.fjFunctionQueue.queue.queue.push(funcToQue[i]); - } - } else { - jQuery.fjFunctionQueue.queue.properties = jQuery.extend(jQuery.fjFunctionQueue.queue.properties, funcToQue); - } - if (isEmptyArray && jQuery.fjFunctionQueue.queue.queue.length > 0 && !jQuery.fjFunctionQueue.queue.running && jQuery.fjFunctionQueue.queue.properties.autoStart) { - jQuery.fjFunctionQueue.queue.running = true; - jQuery.fjFunctionQueue.queue.properties.onStart(); - jQuery.fjFunctionQueue.queue.running = false; - jQuery.fjFunctionQueue(); - } - } - }, - fjTimer : function(properties) { - properties = jQuery.extend({interval: 10, tick: function(){}, repeat: false, random :false, onComplete: function(){}, step: 1}, properties); - var counter = 0; - var timer = new function() { - this.timerId = null; - this.stop = function() { - clearInterval(this.timerId); - } - } - timer.timerId = setInterval(function() { - try { - properties.tick(counter, timer); - counter+=properties.step; - } catch (e) { - alert(e); - } - if (properties.repeat !== true && ((properties.repeat * properties.step) <= counter || properties.repeat === false)) { - timer.stop(); - properties.onComplete(); - } - }, properties.interval); - }, - fjTimerEach: function(properties) { - var ___array = properties.array; - var ___callback = properties.tick; - properties.repeat = ___array.length; - if (properties.step != null) { - properties.repeat = Math.ceil(___array.length / parseInt(properties.step, 10)); - } - properties.tick = function(counter, timer) { - ___callback(counter, ___array[counter]); - } - jQuery.fjTimer(properties); - } -}); +/****************************** +Simple jQuery based timer. Simple usage: + +jQuery.fjTimer({ + interval: 1000, + repeat: 5, + tick: function(counter, timerId) { + alert("tick:" + counter); + } +}); +properties are: +* interval - ticker interval in milliseconds, default 10 +* repeat - number of repeat times or boolean if reapeat forever or in case false not repeat at all +* tick - ticker function itself with parameter of counter and timerId paramerer if you want to clear interval yourself + +fjTimerEach method can be used with arrays only. No objects! +jQuery.fjTimerEach({ + interval: 1000, + tick: function(counter, object) { + alert("tick:" + counter + " - " + object); + }, + array: ["me", "myself", "I"] +}); +Usage is similar to fjTimer with some exceptions: +* tick comes with parameters index and object in array. +* step property - if you want to walk through array with bigger steps than 1 +* array property - this is simple array element. + +fjFunctionQueue idea is that we have alot of functions going on. Sometimes browsers(mostly IE) hangs if alot of dom is changed or something is going on. So I wrote simple queue. +Simple usage, just add function to queue: +jQuery.fjFunctionQueue(function() {alert("a")}); + +Configuration +jQuery.fjFunctionQueue({ interval: 1, onStart: function(){ alert("start")}, onComplete: function(){alert("complete!"}, autoStart: false, tick: function(index, func) {func();}, }); + +properties are: +* interval - ticker interval in milliseconds. Default 1; +* onStart function executed when queue starts;. +* onComplete function executed when queue is complete (including added functions); +* autoStart property, if queue should started automatically. Default true; +* tick function is executed before each queue item execution. Parameters are index and executed function itself. When exteding it func method must be called manually. +******************************/ +jQuery.extend({ + fjFunctionQueue: function(funcToQue) { + if (funcToQue == null) { + if (jQuery.fjFunctionQueue.queue != null && jQuery.fjFunctionQueue.queue.queue.length > 0) { + if (jQuery.fjFunctionQueue.queue.running) { + jQuery.fjTimer({ + interval: jQuery.fjFunctionQueue.queue.properties.interval, + tick: function(counter, timer) { + var func = jQuery.fjFunctionQueue.queue.queue.shift(); + try { + jQuery.fjFunctionQueue.queue.properties.onTick(jQuery.fjFunctionQueue.queue.index, func); + jQuery.fjFunctionQueue.queue.index++; + } catch (e) { + jQuery.fjFunctionQueue(); + throw e; + } + if (jQuery.fjFunctionQueue.queue.queue.length > 0) { + jQuery.fjFunctionQueue(); + } else { + jQuery.fjFunctionQueue.queue.running = false; + jQuery.fjFunctionQueue.queue.index = 0; + jQuery.fjFunctionQueue.queue.properties.onComplete(); + } + } + }); + } else { + jQuery.fjFunctionQueue.queue.running = true; + jQuery.fjFunctionQueue(); + } + } + } else { + if (jQuery.fjFunctionQueue.queue == null) { + jQuery.fjFunctionQueue.queue = {index: 0, running: false, queue:[], properties: {interval: 1, onComplete: function(){}, onStart: function(){}, autoStart: true, onTick: function(counter, func) {func();}}}; + } + var isEmptyArray = jQuery.fjFunctionQueue.queue.queue.length == 0; + if (jQuery.isFunction(funcToQue)) { + jQuery.fjFunctionQueue.queue.queue.push(funcToQue); + } else if (jQuery.isArray(funcToQue)) { + for(var i = 0; i < funcToQue.length; i++) { + jQuery.fjFunctionQueue.queue.queue.push(funcToQue[i]); + } + } else { + jQuery.fjFunctionQueue.queue.properties = jQuery.extend(jQuery.fjFunctionQueue.queue.properties, funcToQue); + } + if (isEmptyArray && jQuery.fjFunctionQueue.queue.queue.length > 0 && !jQuery.fjFunctionQueue.queue.running && jQuery.fjFunctionQueue.queue.properties.autoStart) { + jQuery.fjFunctionQueue.queue.running = true; + jQuery.fjFunctionQueue.queue.properties.onStart(); + jQuery.fjFunctionQueue.queue.running = false; + jQuery.fjFunctionQueue(); + } + } + }, + fjTimer : function(properties) { + properties = jQuery.extend({interval: 10, tick: function(){}, repeat: false, random :false, onComplete: function(){}, step: 1}, properties); + var counter = 0; + var timer = new function() { + this.timerId = null; + this.stop = function() { + clearInterval(this.timerId); + } + } + timer.timerId = setInterval(function() { + try { + properties.tick(counter, timer); + counter+=properties.step; + } catch (e) { + alert(e); + } + if (properties.repeat !== true && ((properties.repeat * properties.step) <= counter || properties.repeat === false)) { + timer.stop(); + properties.onComplete(); + } + }, properties.interval); + }, + fjTimerEach: function(properties) { + var ___array = properties.array; + var ___callback = properties.tick; + properties.repeat = ___array.length; + if (properties.step != null) { + properties.repeat = Math.ceil(___array.length / parseInt(properties.step, 10)); + } + properties.tick = function(counter, timer) { + ___callback(counter, ___array[counter]); + } + jQuery.fjTimer(properties); + } +});