diff --git a/TMP/COZe - Negozio Livelli.pdf b/TMP/COZe - Negozio Livelli.pdf new file mode 100644 index 0000000..485818d Binary files /dev/null and b/TMP/COZe - Negozio Livelli.pdf differ diff --git a/TMP/g42072.png b/TMP/g42072.png deleted file mode 100644 index 2ccaf53..0000000 Binary files a/TMP/g42072.png and /dev/null differ diff --git a/TMP/g42973.png b/TMP/g42973.png deleted file mode 100644 index 0156d65..0000000 Binary files a/TMP/g42973.png and /dev/null differ diff --git a/TMP/g43100.png b/TMP/g43100.png deleted file mode 100644 index f230c95..0000000 Binary files a/TMP/g43100.png and /dev/null differ diff --git a/TMP/g45216-4.png b/TMP/g45216-4.png deleted file mode 100644 index 617cc11..0000000 Binary files a/TMP/g45216-4.png and /dev/null differ diff --git a/TMP/review coze per carmine.pptx b/TMP/review coze per carmine.pptx new file mode 100644 index 0000000..65d467b Binary files /dev/null and b/TMP/review coze per carmine.pptx differ diff --git a/TMP/use41625.png b/TMP/use41625.png deleted file mode 100644 index d7b7421..0000000 Binary files a/TMP/use41625.png and /dev/null differ diff --git a/TMP/use41627.png b/TMP/use41627.png deleted file mode 100644 index 26eeed9..0000000 Binary files a/TMP/use41627.png and /dev/null differ diff --git a/css/styles.css b/css/styles.css index 584241b..b3ce73a 100644 --- a/css/styles.css +++ b/css/styles.css @@ -14556,12 +14556,13 @@ a:hover { /* line 81, global.scss */ #MainContent { - top: 50px; + padding-top: 30px; z-index: 0; overflow: hidden; + height: 100vh; } -/* line 87, global.scss */ +/* line 88, global.scss */ #map { width: 100%; border-radius: 3px; @@ -14569,7 +14570,7 @@ a:hover { padding: 10px; } -/* line 96, global.scss */ +/* line 97, global.scss */ #dropLoading { display: none; position: fixed; @@ -14580,7 +14581,7 @@ a:hover { background: rgba(0, 0, 0, 0.8); overflow: hidden; } -/* line 107, global.scss */ +/* line 108, global.scss */ #dropLoading .box { position: fixed; height: 220px; @@ -14589,7 +14590,7 @@ a:hover { left: 50%; transform: translate(-50%, -50%); } -/* line 115, global.scss */ +/* line 116, global.scss */ #dropLoading .box div { position: fixed; top: 50%; @@ -14597,15 +14598,15 @@ a:hover { transform: translate(-50%, -50%); animation: fade 7s linear 0s 1 normal; } -/* line 123, global.scss */ +/* line 124, global.scss */ #dropLoading .box .anim { animation: pop-up 7s ease-in 0s 1 normal; } -/* line 127, global.scss */ +/* line 128, global.scss */ #dropLoading .box .count { color: white; } -/* line 130, global.scss */ +/* line 131, global.scss */ #dropLoading .box .text { width: 100vw; color: white; @@ -14614,14 +14615,14 @@ a:hover { top: calc(50% + 140px); } -/* line 142, global.scss */ +/* line 143, global.scss */ .next { position: absolute; bottom: 10px; right: 10px; } -/* line 150, global.scss */ +/* line 151, global.scss */ .login { position: fixed; top: 0; @@ -14630,7 +14631,7 @@ a:hover { width: 100%; z-index: 200; } -/* line 158, global.scss */ +/* line 159, global.scss */ .login .head { background: #bf0f3d; background-image: url(../images/logo.png); @@ -14640,7 +14641,7 @@ a:hover { height: 25vh; width: 100%; } -/* line 168, global.scss */ +/* line 169, global.scss */ .login .content { position: relative; width: 100%; @@ -14749,6 +14750,13 @@ button.discard, background: black; } /* line 54, forms.scss */ +input[type=button].grey, +input[type=submit].grey, +button.grey, +.button.grey { + background: #2f2f2f; +} +/* line 57, forms.scss */ input[type=button].dotted, input[type=submit].dotted, button.dotted, @@ -14820,15 +14828,17 @@ header .container .row .menu ul li.active a:hover, header .container .row .menu /* line 2, sections/modules.scss */ .modules { - min-height: calc(100vh - 50px); + /* min-height: calc(100vh - 50px); */ + height: 100vh; width: 100%; } -/* line 6, sections/modules.scss */ +/* line 7, sections/modules.scss */ .modules .sidebar { - min-height: calc(100vh - 50px); + /* min-height: calc(100vh - 50px); */ + height: 100vh; padding: 50px; } -/* line 10, sections/modules.scss */ +/* line 12, sections/modules.scss */ .modules .sidebar .div-drag-container { width: 100%; height: 40px; @@ -14840,7 +14850,7 @@ header .container .row .menu ul li.active a:hover, header .container .row .menu text-align: center; font-size: 0.75rem; } -/* line 20, sections/modules.scss */ +/* line 22, sections/modules.scss */ .modules .sidebar .div-drag-container .div-drag { width: 100%; height: 40px; @@ -14852,24 +14862,24 @@ header .container .row .menu ul li.active a:hover, header .container .row .menu border-radius: 8px; cursor: grab; } -/* line 34, sections/modules.scss */ +/* line 36, sections/modules.scss */ .modules .content { background: #f2f2f2; padding: 50px; } -/* line 39, sections/modules.scss */ +/* line 41, sections/modules.scss */ .modules .content .drop-action { transition: .4s; } -/* line 41, sections/modules.scss */ +/* line 43, sections/modules.scss */ .modules .content .drop-action.drop-inactive { opacity: .3; } -/* line 45, sections/modules.scss */ +/* line 47, sections/modules.scss */ .modules .content .drop-action.droppable.drop-active { border: 2px solid #bf0f3d; } -/* line 51, sections/modules.scss */ +/* line 53, sections/modules.scss */ .modules .content .dropdown { height: 40px; line-height: 36px; @@ -14880,13 +14890,13 @@ header .container .row .menu ul li.active a:hover, header .container .row .menu position: relative; transition: .4s; } -/* line 61, sections/modules.scss */ +/* line 63, sections/modules.scss */ .modules .content .dropdown .label { font-size: 0.75rem; font-weight: bold; color: black; } -/* line 67, sections/modules.scss */ +/* line 69, sections/modules.scss */ .modules .content .dropdown .data { position: absolute; font-size: 0.625rem; @@ -14895,7 +14905,7 @@ header .container .row .menu ul li.active a:hover, header .container .row .menu right: 10px; top: 0; } -/* line 76, sections/modules.scss */ +/* line 78, sections/modules.scss */ .modules .content .dropdown:after { content: '\f107'; font-family: "FontAwesome"; @@ -14905,31 +14915,31 @@ header .container .row .menu ul li.active a:hover, header .container .row .menu top: 0; right: -25px; } -/* line 86, sections/modules.scss */ +/* line 88, sections/modules.scss */ .modules .content .dropdown.active { border: 2px solid #ccc; } -/* line 88, sections/modules.scss */ +/* line 90, sections/modules.scss */ .modules .content .dropdown.active:after { color: #ccc; } -/* line 97, sections/modules.scss */ +/* line 99, sections/modules.scss */ .modules .content .dropdown-links .link { width: 100%; height: 20px; border-top: 1px solid #ccc; border-right: 1px solid #ccc; } -/* line 102, sections/modules.scss */ +/* line 104, sections/modules.scss */ .modules .content .dropdown-links .link:first-child { border-left: 1px solid #ccc; } -/* line 106, sections/modules.scss */ +/* line 108, sections/modules.scss */ .modules .content .dropdown-links .link.source { border: 0; position: relative; } -/* line 109, sections/modules.scss */ +/* line 111, sections/modules.scss */ .modules .content .dropdown-links .link.source:before { content: ''; position: absolute; @@ -14937,7 +14947,7 @@ header .container .row .menu ul li.active a:hover, header .container .row .menu height: 100%; border-left: 1px solid #ccc; } -/* line 120, sections/modules.scss */ +/* line 122, sections/modules.scss */ .modules .content .div-drop { width: 100px; padding: 10px; @@ -14948,7 +14958,7 @@ header .container .row .menu ul li.active a:hover, header .container .row .menu font-size: 0.75rem; border-radius: 8px; } -/* line 133, sections/modules.scss */ +/* line 135, sections/modules.scss */ .modules .content .user-sheet { position: relative; background: white; @@ -14956,13 +14966,13 @@ header .container .row .menu ul li.active a:hover, header .container .row .menu border-radius: 6px; padding: 90px 15px 15px 15px; } -/* line 140, sections/modules.scss */ +/* line 142, sections/modules.scss */ .modules .content .user-sheet .fa { position: absolute; left: 15px; top: 15px; } -/* line 145, sections/modules.scss */ +/* line 147, sections/modules.scss */ .modules .content .user-sheet .name { position: absolute; left: 35px; @@ -14970,14 +14980,14 @@ header .container .row .menu ul li.active a:hover, header .container .row .menu font-size: 0.75rem; font-weight: 700; } -/* line 152, sections/modules.scss */ +/* line 154, sections/modules.scss */ .modules .content .user-sheet .rule { position: absolute; left: 35px; top: 35px; font-size: 0.625rem; } -/* line 158, sections/modules.scss */ +/* line 160, sections/modules.scss */ .modules .content .user-sheet .avatar { position: absolute; right: 15px; @@ -14985,17 +14995,17 @@ header .container .row .menu ul li.active a:hover, header .container .row .menu height: 60px; width: 60px; } -/* line 164, sections/modules.scss */ +/* line 166, sections/modules.scss */ .modules .content .user-sheet .avatar img { height: 60px; width: 60px; } -/* line 170, sections/modules.scss */ +/* line 172, sections/modules.scss */ .modules .content .user-sheet .modules-title { font-size: 0.5rem; text-transform: uppercase; } -/* line 176, sections/modules.scss */ +/* line 178, sections/modules.scss */ .modules .content .user-sheet .modules-container .div-drag { width: 100%; height: 40px; @@ -15007,7 +15017,7 @@ header .container .row .menu ul li.active a:hover, header .container .row .menu font-size: 0.75rem; border-radius: 8px; } -/* line 189, sections/modules.scss */ +/* line 191, sections/modules.scss */ .modules .content .user-sheet .modules-empty { width: 100%; height: 40px; @@ -15021,7 +15031,7 @@ header .container .row .menu ul li.active a:hover, header .container .row .menu border-radius: 8px; } -/* line 208, sections/modules.scss */ +/* line 210, sections/modules.scss */ #dropConfirm { display: none; position: fixed; @@ -15032,7 +15042,7 @@ header .container .row .menu ul li.active a:hover, header .container .row .menu background: rgba(0, 0, 0, 0.8); overflow: hidden; } -/* line 218, sections/modules.scss */ +/* line 220, sections/modules.scss */ #dropConfirm .alert { position: fixed; top: 50%; @@ -15043,7 +15053,7 @@ header .container .row .menu ul li.active a:hover, header .container .row .menu border-radius: 4px; padding: 30px 80px; } -/* line 229, sections/modules.scss */ +/* line 231, sections/modules.scss */ #dropConfirm .alert .title { margin: 10px 0 20px 0; font-size: 0.75rem; @@ -15052,19 +15062,20 @@ header .container .row .menu ul li.active a:hover, header .container .row .menu /* line 2, sections/compatibility.scss */ .compatibility { - min-height: calc(100vh - 50px); + /* min-height: calc(100vh - 50px); */ + height: 100vh; width: 100%; } -/* line 6, sections/compatibility.scss */ +/* line 7, sections/compatibility.scss */ .compatibility .content { padding: 0 50px; } -/* line 10, sections/compatibility.scss */ +/* line 11, sections/compatibility.scss */ .compatibility .content .user-sheet { position: relative; padding-top: 80px; } -/* line 13, sections/compatibility.scss */ +/* line 14, sections/compatibility.scss */ .compatibility .content .user-sheet .avatar { position: absolute; top: 0; @@ -15072,12 +15083,12 @@ header .container .row .menu ul li.active a:hover, header .container .row .menu height: 60px; width: 60px; } -/* line 19, sections/compatibility.scss */ +/* line 20, sections/compatibility.scss */ .compatibility .content .user-sheet .avatar img { height: 60px; width: 60px; } -/* line 24, sections/compatibility.scss */ +/* line 25, sections/compatibility.scss */ .compatibility .content .user-sheet .name { position: absolute; left: 85px; @@ -15085,26 +15096,26 @@ header .container .row .menu ul li.active a:hover, header .container .row .menu font-size: 0.75rem; font-weight: 700; } -/* line 31, sections/compatibility.scss */ +/* line 32, sections/compatibility.scss */ .compatibility .content .user-sheet .rule { position: absolute; left: 85px; top: 30px; font-size: 0.625rem; } -/* line 37, sections/compatibility.scss */ +/* line 38, sections/compatibility.scss */ .compatibility .content .user-sheet .sheet-title { font-size: 0.75rem; font-weight: 700; } -/* line 42, sections/compatibility.scss */ +/* line 43, sections/compatibility.scss */ .compatibility .content .user-sheet .sheet-container .value { width: 90%; height: 25px; background: #ccc; margin-bottom: 10px; } -/* line 47, sections/compatibility.scss */ +/* line 48, sections/compatibility.scss */ .compatibility .content .user-sheet .sheet-container .value .percent { width: 0%; height: 25px; @@ -15255,20 +15266,21 @@ header .container .row .menu ul li.active a:hover, header .container .row .menu height: 20px; width: 20px; cursor: pointer; + z-index: 10; } -/* line 136, sections/plans.scss */ +/* line 137, sections/plans.scss */ .plans .phone .content .video .video-close:after { content: '\f00d'; font-family: "FontAwesome"; font-size: 1.25rem; color: white; } -/* line 143, sections/plans.scss */ +/* line 144, sections/plans.scss */ .plans .phone .content .video video { height: 371px; width: 223px; } -/* line 150, sections/plans.scss */ +/* line 151, sections/plans.scss */ .plans .phone .input { position: absolute; top: 516px; @@ -15446,29 +15458,37 @@ header .container .row .menu ul li.active a:hover, header .container .row .menu width: 50px; background-repeat: no-repeat; background-size: contain; - background-position: center; + background-position: center bottom; } /* line 164, sections/training.scss */ .training .store .people.luca { - background-image: url(../images/people/luca.png); + background-image: url(../images/people/lucaSel.png); } /* line 165, sections/training.scss */ .training .store .people.sarah { - background-image: url(../images/people/sarah.png); + background-image: url(../images/people/sarahSel.png); } /* line 166, sections/training.scss */ +.training .store .people.mariaSel { + background-image: url(../images/people/mariaSel.png); +} +/* line 167, sections/training.scss */ .training .store .people.maria { background-image: url(../images/people/maria.png); } -/* line 167, sections/training.scss */ +/* line 168, sections/training.scss */ .training .store .people.fabio { background-image: url(../images/people/fabio.png); } -/* line 168, sections/training.scss */ +/* line 169, sections/training.scss */ .training .store .people.lucia { background-image: url(../images/people/lucia.png); } -/* line 169, sections/training.scss */ +/* line 170, sections/training.scss */ +.training .store .people.paoloSel { + background-image: url(../images/people/paoloSel.png); +} +/* line 171, sections/training.scss */ .training .store .people.paolo { background-image: url(../images/people/paolo.png); } @@ -15652,29 +15672,37 @@ header .container .row .menu ul li.active a:hover, header .container .row .menu width: 50px; background-repeat: no-repeat; background-size: contain; - background-position: center; + background-position: center bottom; } /* line 162, sections/monitoring.scss */ .monitoring .store .people.luca { - background-image: url(../images/people/luca.png); + background-image: url(../images/people/lucaSel.png); } /* line 163, sections/monitoring.scss */ .monitoring .store .people.sarah { - background-image: url(../images/people/sarah.png); + background-image: url(../images/people/sarahSel.png); } /* line 164, sections/monitoring.scss */ +.monitoring .store .people.mariaSel { + background-image: url(../images/people/mariaSel.png); +} +/* line 165, sections/monitoring.scss */ .monitoring .store .people.maria { background-image: url(../images/people/maria.png); } -/* line 165, sections/monitoring.scss */ +/* line 166, sections/monitoring.scss */ .monitoring .store .people.fabio { background-image: url(../images/people/fabio.png); } -/* line 166, sections/monitoring.scss */ +/* line 167, sections/monitoring.scss */ .monitoring .store .people.lucia { background-image: url(../images/people/lucia.png); } -/* line 167, sections/monitoring.scss */ +/* line 168, sections/monitoring.scss */ +.monitoring .store .people.paoloSel { + background-image: url(../images/people/paoloSel.png); +} +/* line 169, sections/monitoring.scss */ .monitoring .store .people.paolo { background-image: url(../images/people/paolo.png); } diff --git a/images/people/fabio.png b/images/people/fabio.png index ae4a346..f4333b8 100644 Binary files a/images/people/fabio.png and b/images/people/fabio.png differ diff --git a/images/people/luca.png b/images/people/luca.png deleted file mode 100644 index f230c95..0000000 Binary files a/images/people/luca.png and /dev/null differ diff --git a/images/people/lucaSel.png b/images/people/lucaSel.png new file mode 100644 index 0000000..5b7af42 Binary files /dev/null and b/images/people/lucaSel.png differ diff --git a/images/people/lucia.png b/images/people/lucia.png index 7c55a37..c43e145 100644 Binary files a/images/people/lucia.png and b/images/people/lucia.png differ diff --git a/images/people/maria.png b/images/people/maria.png index 0156d65..571dab2 100644 Binary files a/images/people/maria.png and b/images/people/maria.png differ diff --git a/images/people/mariaSel.png b/images/people/mariaSel.png new file mode 100644 index 0000000..1d3e7ad Binary files /dev/null and b/images/people/mariaSel.png differ diff --git a/images/people/paolo.png b/images/people/paolo.png index 617cc11..04ec516 100644 Binary files a/images/people/paolo.png and b/images/people/paolo.png differ diff --git a/images/people/paoloSel.png b/images/people/paoloSel.png new file mode 100644 index 0000000..1249fe7 Binary files /dev/null and b/images/people/paoloSel.png differ diff --git a/images/people/sarah.png b/images/people/sarah.png deleted file mode 100644 index 5d964e0..0000000 Binary files a/images/people/sarah.png and /dev/null differ diff --git a/images/people/sarahSel.png b/images/people/sarahSel.png new file mode 100644 index 0000000..df110e5 Binary files /dev/null and b/images/people/sarahSel.png differ diff --git a/images/photo-compare.jpg b/images/photo-compare.jpg new file mode 100644 index 0000000..e3a7b74 Binary files /dev/null and b/images/photo-compare.jpg differ diff --git a/images/photo-compare2.jpg b/images/photo-compare2.jpg new file mode 100644 index 0000000..a35f8f3 Binary files /dev/null and b/images/photo-compare2.jpg differ diff --git a/js/monitoring-intern.js b/js/monitoring-intern.js index dd13f0e..81a282f 100644 --- a/js/monitoring-intern.js +++ b/js/monitoring-intern.js @@ -15,9 +15,9 @@ $(document).ready(()=>{ const luca = monitoring.find('.people.luca') const sarah = monitoring.find('.people.sarah') const fabio = monitoring.find('.people.fabio') - const maria = monitoring.find('.people.maria') + const maria = monitoring.find('.people.mariaSel') const lucia = monitoring.find('.people.lucia') - const paolo = monitoring.find('.people.paolo') + const paolo = monitoring.find('.people.paoloSel') luca.css({'top': '425px','left': '370px'}).fadeIn(400) sarah.css({'top': '415px','left': '390px'}) diff --git a/js/monitoring-seller.js b/js/monitoring-seller.js index 462beb9..eb47df8 100644 --- a/js/monitoring-seller.js +++ b/js/monitoring-seller.js @@ -2,9 +2,10 @@ $(document).ready(()=>{ const monitoring = $('.monitoring') - const smartwatch = monitoring.find('.smartwatch') + const phone = monitoring.find('.phone') const clouds = monitoring.find('.cloud') - const content = smartwatch.find('.content') + const content = phone.find('.content') + const action = content.find('.button') const firstChild = content.find('.cloud').first() const delay = 1200 @@ -39,16 +40,36 @@ $(document).ready(()=>{ }, delay*3) setTimeout(()=>{ - clouds.fadeIn() - $('#notify1')[0].play() + + clouds.each((index,elem)=>{ + const el = $(elem) + + if(!el.hasClass('scroll')){ + $('#notify1')[0].play() + el.fadeIn(500) + } + }) }, delay*6) - - $('.next').on('click',()=> { - window.location = 'monitoring-seller' + action.on('click', (e)=>{ + + const elem = $(e.currentTarget) + const show = $('#' + elem.data('cloud')) + let offset = 0 + + $('#notify1')[0].play() + + show.fadeIn(400,()=>{ + if(show.hasClass('scroll')){ + offset = show.offset().top - content.offset().top - 20 + firstChild.animate({'margin-top': '-' + offset},400) + } + }) + }) + }) diff --git a/js/plans.js b/js/plans.js index 5d5b5db..153c933 100644 --- a/js/plans.js +++ b/js/plans.js @@ -82,5 +82,10 @@ $(document).ready(()=>{ }) + + $('.next').on('click',()=> { + window.location = 'training-pull' + }) + }) diff --git a/js/scripts.js b/js/scripts.js index 610152b..f5de0d0 100644 --- a/js/scripts.js +++ b/js/scripts.js @@ -15,3 +15,35 @@ function timeout_trigger(){ } + +$(document).ready(()=>{ + for(let i=0; i<5; i++){ + setTimeout(()=>{ + $('header.red .text-white').fadeOut(200,()=>{ + $('header.red .text-white').fadeIn(500) + }) + },i*1000) + } + + $(document).keydown((event)=> { +// event.preventDefault() + const content = $('.phone .content.focus') + const firstChild = content.find('.cloud').first() + let top = parseInt(firstChild.css('margin-top')) + + if(event.key == "ArrowUp"){ + top+=70 + } + if(event.key == "ArrowDown"){ + top-=70 + } + + firstChild.animate({'margin-top':top}) + + }) + + $('.phone .content').on('click',(e)=>{ + $('.phone .content').removeClass('focus') + $(e.currentTarget).addClass('focus') + }) +}) diff --git a/js/training-pull.js b/js/training-pull.js index ad1c38b..e302fe4 100644 --- a/js/training-pull.js +++ b/js/training-pull.js @@ -16,9 +16,9 @@ $(document).ready(()=>{ const luca = training.find('.people.luca') const sarah = training.find('.people.sarah') const fabio = training.find('.people.fabio') - const maria = training.find('.people.maria') + const maria = training.find('.people.mariaSel') const lucia = training.find('.people.lucia') - const paolo = training.find('.people.paolo') + const paolo = training.find('.people.paoloSel') luca.css({'top': '425px','left': '370px'}).fadeIn(400) sarah.css({'top': '415px','left': '390px'}) diff --git a/js/training-push.js b/js/training-push.js index e6e45d3..b7e19ec 100644 --- a/js/training-push.js +++ b/js/training-push.js @@ -66,19 +66,12 @@ $(document).ready(()=>{ switch(cloudCount){ case 1: - newCloud = $('
File | ++ | Statements | ++ | Branches | ++ | Functions | ++ | Lines | ++ |
---|---|---|---|---|---|---|---|---|---|
index.js | ++ | 100% | +(37 / 37) | +92.86% | +(13 / 14) | +100% | +(7 / 7) | +100% | +(37 / 37) | +
1 +2 +3 +4 +5 +6 +7 +8 +9 +10 +11 +12 +13 +14 +15 +16 +17 +18 +19 +20 +21 +22 +23 +24 +25 +26 +27 +28 +29 +30 +31 +32 +33 +34 +35 +36 +37 +38 +39 +40 +41 +42 +43 +44 +45 +46 +47 +48 +49 +50 +51 +52 +53 +54 +55 +56 +57 +58 +59 +60 +61 +62 +63 +64 +65 +66 +67 +68 | + +1 +7 +1 + + +6 +6 +6 +6 +6 +6 + + +1 + + + + + +1 +3 +13 +13 +13 + + + +1 + +19 + + + +1 +45 +6 + +39 +13 +13 +13 +13 + + +39 +18 +6 +6 + + + + +1 +6 +6 +6 + + + +1 +13 +13 + + +1 + | 'use strict';
+
+function Queue(options) {
+ if (!(this instanceof Queue)) {
+ return new Queue(options);
+ }
+
+ options = options || {};
+ this.concurrency = options.concurrency || Infinity;
+ this.pending = 0;
+ this.jobs = [];
+ this.cbs = [];
+ this._done = done.bind(this);
+}
+
+var arrayAddMethods = [
+ 'push',
+ 'unshift',
+ 'splice'
+];
+
+arrayAddMethods.forEach(function(method) {
+ Queue.prototype[method] = function() {
+ var methodResult = Array.prototype[method].apply(this.jobs, arguments);
+ this._run();
+ return methodResult;
+ };
+});
+
+Object.defineProperty(Queue.prototype, 'length', {
+ get: function() {
+ return this.pending + this.jobs.length;
+ }
+});
+
+Queue.prototype._run = function() {
+ if (this.pending === this.concurrency) {
+ return;
+ }
+ if (this.jobs.length) {
+ var job = this.jobs.shift();
+ this.pending++;
+ job(this._done);
+ this._run();
+ }
+
+ if (this.pending === 0) {
+ while (this.cbs.length !== 0) {
+ var cb = this.cbs.pop();
+ process.nextTick(cb);
+ }
+ }
+};
+
+Queue.prototype.onDone = function(cb) {
+ Eif (typeof cb === 'function') {
+ this.cbs.push(cb);
+ this._run();
+ }
+};
+
+function done() {
+ this.pending--;
+ this._run();
+}
+
+module.exports = Queue;
+ |
File | ++ | Statements | ++ | Branches | ++ | Functions | ++ | Lines | ++ |
---|---|---|---|---|---|---|---|---|---|
async-throttle/ | ++ | 100% | +(37 / 37) | +92.86% | +(13 / 14) | +100% | +(7 / 7) | +100% | +(37 / 37) | +