From 8e45d1830c271144358b09827b062261866c3c1e Mon Sep 17 00:00:00 2001 From: Itay Weinberger Date: Sun, 25 Oct 2015 16:51:01 +0200 Subject: [PATCH] #29 fixed csv export filename. --- Gruntfile.js | 5 + build/release/joola.js | 2 +- build/release/joola.min.css | 2 +- build/release/joola.shim.js | 41921 ++++++++++++++++++++++++++++++++++ build/temp/joola.js | 2 +- src/lib/viz/Table.js | 2 +- 6 files changed, 41930 insertions(+), 4 deletions(-) create mode 100644 build/release/joola.shim.js diff --git a/Gruntfile.js b/Gruntfile.js index 44f8cff..2804060 100644 --- a/Gruntfile.js +++ b/Gruntfile.js @@ -136,6 +136,10 @@ module.exports = function (grunt) { main: { src: 'build/temp/joola.css', dest: 'build/release/joola.css' + }, + shim: { + src: 'build/temp/joola.js', + dest: 'build/release/joola.shim.js' } }, @@ -196,6 +200,7 @@ module.exports = function (grunt) { grunt.registerTask('default', ['clean', 'http', 'jshint', 'browserify', 'concat', 'uglify', 'cssmin', 'copy']); //'csslint', grunt.registerTask('build', ['browserify', 'concat', 'copy']); grunt.registerTask('dev', ['build', 'cssmin','watch']); + grunt.registerTask('shim', ['browserify','copy:shim']); grunt.registerTask('css', ['concat', 'cssmin', 'copy']); //'csslint', grunt.registerTask('test', ['default', 'connect', 'mocha']); grunt.registerTask('test:bare', ['connect', 'mocha']); diff --git a/build/release/joola.js b/build/release/joola.js index 09a7ca8..0d1c5cc 100644 --- a/build/release/joola.js +++ b/build/release/joola.js @@ -43263,7 +43263,7 @@ var Table = module.exports = function (options, callback) { var encodedUri = encodeURI(csvContent); var link = document.createElement("a"); link.setAttribute("href", encodedUri); - link.setAttribute("download", "Odobo_Analytics.csv"); + link.setAttribute("download", "analytics.csv"); link.click(); // This will download the data file named "my_data.csv". }); }; diff --git a/build/release/joola.min.css b/build/release/joola.min.css index 3d845a8..1f75bc1 100644 --- a/build/release/joola.min.css +++ b/build/release/joola.min.css @@ -1,2 +1,2 @@ -/*! joola.sdk - v0.8.9 - 2015-10-19 */ +/*! joola.sdk - v0.8.9 - 2015-10-21 */ [jio-domain=joola]{-webkit-box-sizing:border-box;-moz-box-sizing:border-box;box-sizing:border-box;border-collapse:collapse;border-spacing:0}[jio-domain=joola]{font-family:Signika,helvetica,arial,sans-serif}[jio-domain=joola] .clearfix{clear:both}[jio-domain=joola] .btn-group,.btn-group-vertical{position:relative;display:inline-block;vertical-align:middle}[jio-domain=joola] .btn{display:inline-block;padding:6px 12px;margin-bottom:0;font-size:14px;font-weight:400;line-height:1.428571429;text-align:center;white-space:nowrap;vertical-align:middle;cursor:pointer;background-image:none;border:1px solid transparent;border-radius:4px;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;-o-user-select:none;user-select:none;color:#333;background-color:#fff;border-color:#ccc}[jio-domain=joola] .btn:hover,.btn:focus{color:#333;text-decoration:none}[jio-domain=joola] .btn:active,.btn.active{background-image:none;outline:0;-webkit-box-shadow:inset 0 3px 5px rgba(0,0,0,.125);box-shadow:inset 0 3px 5px rgba(0,0,0,.125)}[jio-domain=joola] .btn-default:hover,.btn-default:focus,.btn-default:active,.btn-default.active,.open .dropdown-toggle.btn-default{color:#333;background-color:#ebebeb;border-color:#adadad}[jio-domain=joola] .btn-default:hover,.btn-default:focus,.btn-default:active,.btn-default.active,.open .dropdown-toggle.btn-default{color:#333;background-color:#ebebeb;border-color:#adadad}[jio-domain=joola] .btn-default:active,.btn-default.active,.open .dropdown-toggle.btn-default{background-image:none}[jio-domain=joola] .btn-group>.btn,.btn-group-vertical>.btn{position:relative;float:left}[jio-domain=joola] .btn-group>.btn:first-child:not(:last-child):not(.dropdown-toggle){border-top-right-radius:0;border-bottom-right-radius:0}[jio-domain=joola] .btn-group .btn+.btn,.btn-group .btn+.btn-group,.btn-group .btn-group+.btn,.btn-group .btn-group+.btn-group{margin-left:-1px}[jio-domain=joola] .btn-group>.btn:not(:first-child):not(:last-child):not(.dropdown-toggle){border-radius:0}[jio-domain=joola] .btn-group>.btn:first-child{margin-left:0}[jio-domain=joola] .btn-group>.btn:last-child:not(:first-child),.btn-group>.dropdown-toggle:not(:first-child){border-bottom-left-radius:0;border-top-left-radius:0}[jio-domain=joola] .unselectable{-moz-user-select:-moz-none;-khtml-user-select:none;-webkit-user-select:none;-o-user-select:none;user-select:none}[jio-domain=joola] .line-separator{height:1px}[jio-domain=joola] .chevron.before::before{border-style:solid;border-width:.25em .25em 0 0;content:'';display:inline-block;height:.45em;left:.15em;position:relative;transform:rotate(-45deg);width:.45em}[jio-domain=joola] .chevron.before.right:before{left:-.15em;transform:rotate(45deg)}[jio-domain=joola] .chevron.before.bottom:before{top:0;transform:rotate(135deg)}[jio-domain=joola] .chevron.before.left:before{transform:rotate(-135deg)}[jio-domain=joola] .chevron.after::after{border-style:solid;border-width:.25em .25em 0 0;content:'';display:inline-block;height:.45em;left:.15em;position:relative;transform:rotate(-45deg);width:.45em}[jio-domain=joola] .chevron.after.right:after{left:-.15em;transform:rotate(45deg)}[jio-domain=joola] .chevron.after.bottom:after{top:0;transform:rotate(135deg)}[jio-domain=joola] .chevron.after.left:after{transform:rotate(-135deg)}[jio-domain=joola] span.icon-help{position:relative;display:inline}[jio-domain=joola] span.icon-help span{position:absolute;width:150px;color:#FFF;background:#000;height:30px;line-height:30px;text-align:center;visibility:hidden;border-radius:6px;padding-left:5px;padding-right:5px;font-size:12px}[jio-domain=joola] span.icon-help span:after{content:'';position:absolute;bottom:100%;left:48%;margin-left:-8px;width:0;height:0;border-bottom:8px solid #000;border-right:8px solid transparent;border-left:8px solid transparent}[jio-domain=joola] span:hover.icon-help span{visibility:visible;opacity:.8;top:30px;left:48%;margin-left:-76px;z-index:999}[jio-type=bartable] .table{margin-bottom:10px;width:100%}[jio-type=bartable] .table tr{vertical-align:top}[jio-type=bartable] .table td{padding-top:8px;padding-bottom:5px}[jio-type=bartable] .table tr:first-of-type td{text-overflow:ellipsis;padding-top:5px;padding-bottom:5px;white-space:nowrap;overflow:hidden;min-width:100px}[jio-type=bartable] .table td .caption{text-overflow:ellipsis;line-height:17px;color:#666;font-weight:500;text-transform:uppercase;white-space:nowrap;overflow:hidden}[jio-type=bartable] .table td .subcaption{color:#999;font-size:12px;font-weight:400;line-height:1;text-transform:uppercase;margin-top:2px}[jio-type=bartable] .table.table-striped tbody>tr:nth-child(even)>td{background-color:#fff}[jio-type=bartable] .bartable-caption{line-height:1.2857142857em;margin:20px 0;padding:0;text-transform:uppercase;font-size:18px;font-weight:400;color:#333;text-align:center}[jio-type=bartable] .nodata,[jio-type=bartable] .loading{text-align:center}[jio-type=bartable] .barwrapper{float:left;width:95%}[jio-type=bartable] .barwrapper.compare .tablebar{height:15px}[jio-type=bartable] .barwrapper.compare .tablebar.compare_ratio{margin-top:1px}[jio-type=bartable] .tablebar{background-color:#058dc7;float:left;height:30px}[jio-type=bartable] tr[data-selectable=true] td{cursor:pointer}[jio-type=bartable] tr[data-selectable=true]:hover{background-color:#efefef}[jio-type=bartable] tr[data-selectable=true].active td{background-color:#efefef}[jio-type=datepicker]{float:right}[jio-type=datepicker] a{color:#428bca;text-decoration:none}[jio-type=datepicker] .jcontainer{background-color:#fff;border:1px solid #f5f5f5;cursor:pointer;position:relative;z-index:19;border-radius:5px;-moz-border-radius:5px;-webkit-border-radius:5px}[jio-type=datepicker] .jcontainer:hover{border:1px solid #CCC}[jio-type=datepicker] .expanded{border:1px solid #CCC;border-bottom:1px solid #fff;border-radius:5px 5px 0 0;-moz-border-radius:5px 5px 0 0;-webkit-border-top-left-radius:5px;-webkit-border-top-right-radius:5px;-webkit-border-bottom-left-radius:0;-webkit-border-bottom-right-radius:0}[jio-type=datepicker] .picker.compare{margin-top:17px}[jio-type=datepicker] .datetable{border-collapse:collapse}[jio-type=datepicker] .datetable .dates{padding:5px;text-align:left}[jio-type=datepicker] .datetable .dates .datelabel{color:#1C2E3D}[jio-type=datepicker] .datetable .dates .compare{color:#999;font-size:13px}[jio-type=datepicker] .datetable .dates .compare .datelabel.fromdate,[jio-type=datepicker] .datetable .dates .compare .datelabel.todate{font-size:13px;color:#333}[jio-type=datepicker] .datebox .dropdownmarker-wrapper{width:25px;background-color:#f5f5f5}[jio-type=datepicker] .datetable .dropdownmarker{position:absolute;top:12px;right:8px;display:block;width:0;height:0;content:"";border:5px solid;border-right-color:transparent;border-left-color:transparent;border-bottom-color:transparent;border-top-color:inherit}[jio-type=datepicker].compare .datetable .dropdownmarker{top:20px}[jio-type=datepicker] .datebox.expanded .datetable .dropdownmarker{top:5px;border-right-color:transparent;border-left-color:transparent;border-top-color:transparent;border-bottom-color:inherit}[jio-type=datepicker].compare .datebox.expanded .datetable .dropdownmarker{top:13px}[jio-type=datepicker] .picker{position:absolute;background-color:#F7F7F7;border:1px solid #CCC;margin-left:1px;margin-top:-1px;padding:10px;white-space:nowrap;z-index:1000;border-radius:5px 0 5px 5px;-moz-border-radius:5px 0 5px 5px;-webkit-border-bottom-left-radius:5px;-webkit-border-bottom-right-radius:5px}[jio-type=datepicker] .picker .wrapper .control{padding:0 10px;white-space:nowrap;vertical-align:top}[jio-type=datepicker] .picker .wrapper .control .optionscontainer{display:block;clear:both;padding:5px;font-size:16px;line-height:20px}[jio-type=datepicker] .picker .wrapper .control .optionscontainer .customdate{font-weight:700;margin-bottom:3px}[jio-type=datepicker] .picker .wrapper .control .optionscontainer .customdate select{border:#9A9A9A solid 1px;background-color:#fff;color:#000}[jio-type=datepicker] .picker .wrapper .control .optionscontainer .customdate select.selector{width:auto;height:auto;padding:1px;margin-bottom:5px;margin-left:6px;width:120px}[jio-type=datepicker] .picker .wrapper .control .optionscontainer .compareoption span{top:-2px;position:relative}[jio-type=datepicker] .picker .wrapper .control .optionscontainer .daterange .dateoption{border:#ccc solid 1px;cursor:pointer;width:6.5em;line-height:20px;padding:2px;padding-left:5px;margin-bottom:6px;margin-left:2px;margin-right:2px;margin-top:2px;font-size:16px;font-family:Signika,helvetica,arial,sans-serif}[jio-type=datepicker] .picker .wrapper .control .optionscontainer .daterange .dateoption.active{border:#07C solid 3px;margin-top:0;margin-bottom:4px;margin-left:2px;margin-right:2px}[jio-type=datepicker] .picker .wrapper .control .optionscontainer .comparerange .dateoption.active{border:#86BE2B solid 3px;margin-bottom:4px;margin-left:2px;margin-right:2px}[jio-type=datepicker] .picker .wrapper .control .optionscontainer .daterange .dateoption.invalid{border:#B00 solid 3px;margin-bottom:4px}[jio-type=datepicker] .picker .wrapper .control .optionscontainer .compareoption{padding:3px;white-space:nowrap;padding-right:22px;display:none;margin-bottom:3px}[jio-type=datepicker] .picker .wrapper .control .optionscontainer .compareoption .checker{}[jio-type=datepicker] .picker .wrapper .control .optionscontainer .compareoption.visible{display:block}[jio-type=datepicker] .picker .wrapper .control .optionscontainer .divider{border-top:#666 dotted 1px;margin-top:3px}[jio-type=datepicker] .picker .wrapper .control .optionscontainer .buttons{padding-top:15px}[jio-type=datepicker] .picker .wrapper .control .optionscontainer .apply{margin-top:-15px}[jio-type=datepicker] .picker .wrapper .control .optionscontainer .cancel{text-decoration:underline;color:#24B;cursor:pointer;padding-left:10px}[jio-type=datepicker] .picker .wrapper .calendars{white-space:nowrap;margin:2px;width:405px}[jio-type=datepicker] .picker .wrapper .calendars table{border-collapse:collapse}[jio-type=datepicker] .picker .wrapper .calendars .datetable-prev,[jio-type=datepicker] .picker .wrapper .calendars .datetable-next{vertical-align:top}[jio-type=datepicker] .picker .wrapper .calendars .datetable-prev div,[jio-type=datepicker] .picker .wrapper .calendars .datetable-next div{border:#CCC solid 1px;background-color:#DDD;cursor:pointer}[jio-type=datepicker] .picker .wrapper .calendars .datetable-prev div{border-radius:3px 0 0 3px;-moz-border-radius:3px 0 0 3px;-webkit-border-top-left-radius:3px;-webkit-border-top-right-radius:0;-webkit-border-bottom-left-radius:3px;-webkit-border-bottom-right-radius:0}[jio-type=datepicker] .picker .wrapper .calendars .datetable-next div{border-radius:0 3px 3px 0;-moz-border-radius:0 3px 3px 0;-webkit-border-top-left-radius:0;-webkit-border-top-right-radius:3px;-webkit-border-bottom-left-radius:0;-webkit-border-bottom-right-radius:3px}[jio-type=datepicker] .picker .wrapper .calendars .datetable-prev div div.inline-block,[jio-type=datepicker] .picker .wrapper .calendars .datetable-next div div.inline-block{height:9px;padding:0;width:4px}[jio-type=datepicker] .picker .wrapper .calendars .datetable-prev div div.inline-block{display:block;width:0;height:0;content:"";border:5px solid;border-left-color:transparent;border-top-color:transparent;border-bottom-color:transparent;margin-right:6px;margin-top:-5px}[jio-type=datepicker] .picker .wrapper .calendars .datetable-next div div.inline-block{display:block;width:0;height:0;content:"";border:5px solid;border-right-color:transparent;border-top-color:transparent;border-bottom-color:transparent;margin-left:6px;margin-top:-5px}[jio-type=datepicker] .picker .wrapper .control .optionscontainer input,[jio-type=datepicker] .picker .wrapper .control .optionscontainer textarea{-webkit-box-shadow:inset 0 1px 1px rgba(0,0,0,.075);-moz-box-shadow:inset 0 1px 1px rgba(0,0,0,.075);box-shadow:inset 0 1px 1px rgba(0,0,0,.075);-webkit-transition:none;-moz-transition:border linear .1s,box-shadow linear .1s;-ms-transition:border linear .1s,box-shadow linear .1s;-o-transition:border linear .1s,box-shadow linear .1s;transition:border linear .1s,box-shadow linear .1s}[jio-type=datepicker] .picker .wrapper .calendars .ui-datepicker-prev,[jio-type=datepicker] .picker .wrapper .calendars .ui-datepicker-next{display:none}[jio-type=datepicker] .ui-datepicker-calendar td{border-bottom:#F7F7F7 solid 1px;border-right:#F7F7F7 solid 1px;background-color:#fff}[jio-type=datepicker] .ui-datepicker-title{text-align:center;background-color:#DDD;font-size:85%;color:#07C;cursor:default;border-bottom:#CCC solid 1px;height:18px}[jio-type=datepicker] .daycell{text-align:center;padding:2px 3px;vertical-align:middle;font-size:72%;cursor:pointer}[jio-type=datepicker] .daycell a{text-decoration:none}[jio-type=datepicker] .daycell:hover{background-color:#FC3}[jio-type=datepicker] .daycell.disabled,[jio-type=datepicker] .daycell.ui-state-disabled{cursor:default;color:#DDD;font-weight:400;background-color:#fff}[jio-type=datepicker] .daycell.inrange{background-color:#07C}[jio-type=datepicker] .daycell.inrange:hover{background-color:#FC3}[jio-type=datepicker] .daycell.inrange a{color:#fff}[jio-type=datepicker] .daycell.compare.disabled{cursor:default;color:#DDD;font-weight:400;background-color:#fff}[jio-type=datepicker] .daycell.compare.inrange{background-color:#86BE2B}[jio-type=datepicker] .daycell.basencompare.inrange{background-color:#00B1AB}[jio-type=datepicker] .daycell.compare.inrange:hover{background-color:#FC3}[jio-type=datepicker] .ui-datepicker-calendar th{text-align:center;padding:2px 3px;vertical-align:middle;font-size:80%;border-bottom:#F7F7F7 solid 1px;border-right:#F7F7F7 solid 1px;background-color:#fff;cursor:default;border-bottom:#CCC solid 1px}[jio-type=datepicker] .jcontainer{background:0}[jio-type=datepicker] select{display:inline-block;float:none;height:auto;margin-top:auto;width:auto}[jio-type=datepicker] .daterange{padding-left:0!important}[jio-type=datepicker] .picker .wrapper .control .optionscontainer .compareoption .checker{top:4px;margin-left:0}[jio-type=datepicker] .picker .wrapper .control .optionscontainer .compareoption{font-weight:300}[jio-type=datepicker] .picker .wrapper .control .optionscontainer .customdate{font-weight:300}[jio-type=datepicker] .daycell{font-size:11px;font-weight:300;line-height:22px}[jio-type=datepicker] .daycell a{color:#08c;border-bottom:0}.ui-datepicker-calendar th{font-weight:600;line-height:22px}[jio-type=datepicker] .picker .wrapper .control .optionscontainer .apply{margin-top:-5px;font-family:Signika,helvetica,arial,sans-serif;background-color:#6d6d6d;background-image:-webkit-gradient(linear,50% 0,50% 100%,color-stop(0%,#6d6d6d),color-stop(100%,#1a1a1a));background-image:-webkit-linear-gradient(top,#6d6d6d,#1a1a1a);background-image:-moz-linear-gradient(to bottom,#6d6d6d,#1a1a1a);background-image:-o-linear-gradient(top,#6d6d6d,#1a1a1a);background-image:linear-gradient(top,#6d6d6d,#1a1a1a);filter:progid:DXImageTransform.Microsoft.gradient(GradientType=0, StartColorStr='#6d6d6d', EndColorStr='#1a1a1a');border:1px solid #4c4c4c;border-bottom:0;border-radius:5px;color:#fff;text-shadow:0 -1px 0 #272727;font-size:.875em;height:28px;line-height:26px;padding:1px 10px;text-transform:uppercase}[jio-type=datepicker] .picker .wrapper .control .optionscontainer .apply:hover{background-color:#7f7f7f;background-image:-webkit-gradient(linear,50% 0,50% 100%,color-stop(0%,#7f7f7f),color-stop(100%,#1a1a1a));background-image:-webkit-linear-gradient(top,#7f7f7f,#1a1a1a);background-image:-moz-linear-gradient(to bottom,#7f7f7f,#1a1a1a);background-image:-o-linear-gradient(top,#7f7f7f,#1a1a1a);background-image:linear-gradient(top,#7f7f7f,#1a1a1a);filter:progid:DXImageTransform.Microsoft.gradient(GradientType=0, StartColorStr='#7f7f7f', EndColorStr='#1a1a1a')}[jio-type=datepicker] .picker .wrapper .calendars .datetable-prev div,[jio-type=datepicker] .picker .wrapper .calendars .datetable-next div{padding-top:14px;height:28px;-webkit-box-sizing:border-box;-moz-box-sizing:border-box;box-sizing:border-box}[jio-type=datepicker] .picker .wrapper .calendars .datetable-prev div div.inline-block,[jio-type=datepicker] .picker .wrapper .calendars .datetable-next div div.inline-block{}[jio-type=datepicker] .picker .wrapper .control .optionscontainer .customdate{display:none}[jio-type=datepicker] .picker .wrapper .control .optionscontainer .divider{display:none}[jio-type=datepicker] ._buttons{bottom:15px;position:absolute;right:25px}[jio-type=datepicker] .picker .wrapper .control .optionscontainer input,[jio-type=datepicker] .picker .wrapper .control .optionscontainer textarea{-webkit-transition:none;-moz-transition:none;-ms-transition:none;-o-transition:none;transition:none}[jio-type=datepicker] .picker .wrapper .control .optionscontainer .daterange .dateoption.active{margin-left:2px;margin-right:2px}[jio-type=datepicker] .picker .wrapper .calendars{padding-top:5px}[jio-type=datepicker] .ui-datepicker-title{height:28px;color:#666;padding-bottom:4px;padding-top:7px;font-weight:300;-webkit-box-sizing:border-box;-moz-box-sizing:border-box;box-sizing:border-box}[jio-type=dimensionpicker]{float:left;position:relative}[jio-type=dimensionpicker] .picker-container{position:absolute;background-color:#fff;display:none;border:1px solid #ddd;padding:5px;z-index:1000}[jio-type=dimensionpicker] .picker-container.active{display:block}[jio-type=dimensionpicker] .name{font-weight:700}[jio-type=dimensionpicker] .dimensionOption{padding:5px;background-color:#dae2cb;border:1px solid #738d68;margin-top:2px;margin-bottom:2px;margin-left:7px;cursor:pointer;font-size:13px;font-weight:700;color:#738d68}[jio-type=dimensionpicker] .dimensionOption:hover,[jio-type=dimensionpicker] .dimensionOption.active{background-color:#9bb47a;color:#fff}[jio-type=dimensionpicker] .dimensionOption.disabled{opacity:.6;cursor:default}[jio-type=dimensionpicker] .dimensionOption.active{opacity:1;cursor:default}[jio-type=dimensionpicker] input.quicksearch{padding:5px;border:1px solid #DDD;font-family:Signika,helvetica,arial,sans-serif;font-size:14px;background-color:#FFF;margin-left:7px}[jio-type=dimensionpicker] input.quicksearch{margin-bottom:5px}[jio-type=filterbox]{}[jio-type=filterbox] .filterbox{padding:5px;margin:0;border-top:0;min-height:0;border-bottom:1px solid #ddd;margin-bottom:10px;display:none}[jio-type=filterbox] .filterbox:not(:empty){display:block}[jio-type=filterbox] .filter{display:inline-block;padding:5px;padding-left:8px;padding-right:8px;border:1px solid #ddd}[jio-type=filterbox] .filter:not(:first-of-type){margin-left:10px}[jio-type=filterbox] .close{padding-left:5px;cursor:pointer}.animate-spin{-moz-animation:spin 2s infinite linear;-o-animation:spin 2s infinite linear;-webkit-animation:spin 2s infinite linear;animation:spin 2s infinite linear;display:inline-block}@-moz-keyframes spin{0%{-moz-transform:rotate(0deg);-o-transform:rotate(0deg);-webkit-transform:rotate(0deg);transform:rotate(0deg)}100%{-moz-transform:rotate(359deg);-o-transform:rotate(359deg);-webkit-transform:rotate(359deg);transform:rotate(359deg)}}@-webkit-keyframes spin{0%{-moz-transform:rotate(0deg);-o-transform:rotate(0deg);-webkit-transform:rotate(0deg);transform:rotate(0deg)}100%{-moz-transform:rotate(359deg);-o-transform:rotate(359deg);-webkit-transform:rotate(359deg);transform:rotate(359deg)}}@-o-keyframes spin{0%{-moz-transform:rotate(0deg);-o-transform:rotate(0deg);-webkit-transform:rotate(0deg);transform:rotate(0deg)}100%{-moz-transform:rotate(359deg);-o-transform:rotate(359deg);-webkit-transform:rotate(359deg);transform:rotate(359deg)}}@-ms-keyframes spin{0%{-moz-transform:rotate(0deg);-o-transform:rotate(0deg);-webkit-transform:rotate(0deg);transform:rotate(0deg)}100%{-moz-transform:rotate(359deg);-o-transform:rotate(359deg);-webkit-transform:rotate(359deg);transform:rotate(359deg)}}@keyframes spin{0%{-moz-transform:rotate(0deg);-o-transform:rotate(0deg);-webkit-transform:rotate(0deg);transform:rotate(0deg)}100%{-moz-transform:rotate(359deg);-o-transform:rotate(359deg);-webkit-transform:rotate(359deg);transform:rotate(359deg)}}.icon-help:before{content:'\e800'}.icon-sort-desc:before{content:'\e801'}.icon-sort-asc:before{content:'\e802'}.icon-close:before{content:'\e803'}.icon-download:before{content:'\e804'}@font-face{font-family:fontello;src:url(./font/fontello.eot?62438657);src:url(./font/fontello.eot?62438657#iefix) format('embedded-opentype'),url(./font/fontello.svg?62438657#fontello) format('svg');font-weight:400;font-style:normal}@font-face{font-family:fontello;src:url(data:application/octet-stream;base64,d09GRgABAAAAAAzcAA4AAAAAFqgAAQAAAAAAAAAAAAAAAAAAAAAAAAAAAABPUy8yAAABRAAAAEQAAABWPihJSmNtYXAAAAGIAAAAOgAAAUrQFRm3Y3Z0IAAAAcQAAAAKAAAACgAAAABmcGdtAAAB0AAABZQAAAtwiJCQWWdhc3AAAAdkAAAACAAAAAgAAAAQZ2x5ZgAAB2wAAAKsAAAETNsx23xoZWFkAAAKGAAAADUAAAA2BVxa1WhoZWEAAApQAAAAHgAAACQHlwNQaG10eAAACnAAAAAYAAAAGBZJAABsb2NhAAAKiAAAAA4AAAAOA/4Cqm1heHAAAAqYAAAAIAAAACAAnwvabmFtZQAACrgAAAF3AAACzcydGx1wb3N0AAAMMAAAAEMAAABXmX5G0HByZXAAAAx0AAAAZQAAAHvdawOFeJxjYGTezjiBgZWBg6mKaQ8DA0MPhGZ8wGDIyMTAwMTAysyAFQSkuaYwOLxgeMHCHPQ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AAFSBHsAAjQrIAAQEVFBMusDEqLbBFLLAAFSBHsAAjQrIAAQEVFBMusDEqLbBGLLEAARQTsDIqLbBHLLA0Ki2wSCywABZFIyAuIEaKI2E4sSsBFCstsEkssAgjQrBIKy2wSiyyAABBKy2wSyyyAAFBKy2wTCyyAQBBKy2wTSyyAQFBKy2wTiyyAABCKy2wTyyyAAFCKy2wUCyyAQBCKy2wUSyyAQFCKy2wUiyyAAA+Ky2wUyyyAAE+Ky2wVCyyAQA+Ky2wVSyyAQE+Ky2wViyyAABAKy2wVyyyAAFAKy2wWCyyAQBAKy2wWSyyAQFAKy2wWiyyAABDKy2wWyyyAAFDKy2wXCyyAQBDKy2wXSyyAQFDKy2wXiyyAAA/Ky2wXyyyAAE/Ky2wYCyyAQA/Ky2wYSyyAQE/Ky2wYiywNysusSsBFCstsGMssDcrsDsrLbBkLLA3K7A8Ky2wZSywABawNyuwPSstsGYssDgrLrErARQrLbBnLLA4K7A7Ky2waCywOCuwPCstsGkssDgrsD0rLbBqLLA5Ky6xKwEUKy2wayywOSuwOystsGwssDkrsDwrLbBtLLA5K7A9Ky2wbiywOisusSsBFCstsG8ssDorsDsrLbBwLLA6K7A8Ky2wcSywOiuwPSstsHIsswkEAgNFWCEbIyFZQiuwCGWwAyRQeLABFTAtAEu4AMhSWLEBAY5ZsAG5CAAIAGNwsQAFQrEAACqxAAVCsQAIKrEABUKxAAgqsQAFQrkAAAAJKrEABUK5AAAACSqxAwBEsSQBiFFYsECIWLEDZESxJgGIUVi6CIAAAQRAiGNUWLEDAERZWVlZsQAMKrgB/4WwBI2xAgBEAA==) format('truetype')}[class^=icon-]:before,[class*=" icon-"]:before{font-family:fontello;font-style:normal;font-weight:400;speak:none;display:inline-block;text-decoration:inherit;width:1em;margin-right:.2em;text-align:center;font-variant:normal;text-transform:none;line-height:1em;margin-left:.2em}.icon-help:before{content:'\e800'}.icon-sort-desc:before{content:'\e801'}.icon-sort-asc:before{content:'\e802'}.icon-close:before{content:'\e803'}.icon-download:before{content:'\e804'}.icon-help{*zoom:expression(this.runtimeStyle[=zoom]='1',this.innerHTML=' ')}.icon-sort-desc{*zoom:expression(this.runtimeStyle[=zoom]='1',this.innerHTML=' ')}.icon-sort-asc{*zoom:expression(this.runtimeStyle[=zoom]='1',this.innerHTML=' ')}.icon-close{*zoom:expression(this.runtimeStyle[=zoom]='1',this.innerHTML=' ')}.icon-download{*zoom:expression(this.runtimeStyle[=zoom]='1',this.innerHTML=' ')}[class^=icon-],[class*=" icon-"]{font-family:fontello;font-style:normal;font-weight:400;line-height:1em}.icon-help{*zoom:expression(this.runtimeStyle[=zoom]='1',this.innerHTML=' ')}.icon-sort-desc{*zoom:expression(this.runtimeStyle[=zoom]='1',this.innerHTML=' ')}.icon-sort-asc{*zoom:expression(this.runtimeStyle[=zoom]='1',this.innerHTML=' ')}.icon-close{*zoom:expression(this.runtimeStyle[=zoom]='1',this.innerHTML=' ')}.icon-download{*zoom:expression(this.runtimeStyle[=zoom]='1',this.innerHTML=' ')}@font-face{font-family:fontello;src:url(./font/fontello.eot?367386);src:url(./font/fontello.eot?367386#iefix) format('embedded-opentype'),url(./font/fontello.woff?367386) format('woff'),url(./font/fontello.ttf?367386) format('truetype'),url(./font/fontello.svg?367386#fontello) format('svg');font-weight:400;font-style:normal}[class^=icon-]:before,[class*=" icon-"]:before{font-family:fontello;font-style:normal;font-weight:400;speak:none;display:inline-block;text-decoration:inherit;width:1em;margin-right:.2em;text-align:center;font-variant:normal;text-transform:none;line-height:1em;margin-left:.2em}.icon-help:before{content:'\e800'}.icon-sort-desc:before{content:'\e801'}.icon-sort-asc:before{content:'\e802'}.icon-close:before{content:'\e803'}.icon-download:before{content:'\e804'}[jio-type=metric]{padding:5px;margin:0;float:none;border-top:0;min-height:0;text-align:center}[jio-type=metric] .caption{line-height:1.2857142857em;margin:0 0 10px;padding:0;text-transform:uppercase;padding-top:10px;color:#999;font-size:18px;font-weight:300;margin-bottom:0}[jio-type=metric] .value{color:#666;font-weight:300;font-size:32px;text-shadow:0 1px 5px rgba(0,0,0,.15)}[jio-type=metric] .summary{color:#999;padding-top:10px}[jio-type=metric] .base{padding-right:5px}[jio-type=metric] .compare{padding-left:5px}[jio-type=metricpicker]{float:left;position:relative}[jio-type=metricpicker] .picker-container{position:absolute;background-color:#fff;display:none;border:1px solid #ddd;padding:5px;z-index:1000}[jio-type=metricpicker] .picker-container.active{display:block}[jio-type=metricpicker] .name{font-weight:700}[jio-type=metricpicker] .metricOption{padding:5px;background-color:#c5dcfe;border:1px solid #2f67b4;margin-top:2px;margin-bottom:2px;margin-left:7px;cursor:pointer;font-size:13px;font-weight:700;color:#2f67b4}[jio-type=metricpicker] .metricOption:hover,[jio-type=metricpicker] .metricOption.active{background-color:#6faefd;color:#fff}[jio-type=metricpicker] .metricOption.disabled{opacity:.6;cursor:default}[jio-type=metricpicker] .metricOption.active{opacity:1;cursor:default}[jio-type=metricpicker] input.quicksearch{padding:5px;border:1px solid #DDD;font-family:Signika,helvetica,arial,sans-serif;font-size:14px;background-color:#FFF;margin-left:7px}[jio-type=metricpicker] input.quicksearch{margin-bottom:5px}[jio-type=table] .table-wrapper{overflow:auto}[jio-type=table] .table{border-top:1px solid #ddd;border-left:1px solid #ddd;margin-bottom:10px;width:100%;border-collapse:collapse;border-spacing:0}[jio-type=table] .table tr{vertical-align:top}[jio-type=table] .table td{padding-top:8px;padding-bottom:5px;padding-left:15px;padding-right:15px;border-right:1px solid #ddd;border-bottom:1px solid #ddd}[jio-type=table] .table th.checkbox,[jio-type=table] .table td.checkbox{width:1%;min-width:0}[jio-type=table] .table th{text-overflow:ellipsis;padding-top:10px;padding-bottom:10px;padding-left:15px;text-align:left;background-color:#e9e9e9;font-weight:700;white-space:nowrap;min-width:100px;border-bottom:2px solid #ddd;border-right:1px solid #ddd;cursor:pointer;text-transform:uppercase}[jio-type=table] .table th .icon-help,[jio-type=table] .table th .icon-close{margin-left:5px}[jio-type=table] .table th .caret-sort{margin-left:15px;margin-right:15px}[jio-type=table] .table td.value.metric{text-align:right}[jio-type=table] .table td.caption.change{font-weight:700}[jio-type=table] .table td.value.change{text-align:right;font-weight:700}[jio-type=table] .table td.sorted{background-color:#F5F5F5}[jio-type=table] .table td.sorted{background-color:#F5F5F5}[jio-type=table] .table td.sorted.value{font-weight:700}[jio-type=table] .table td.value .summary{color:#999;font-size:13px;font-weight:400}[jio-type=table] .table.table-striped tbody>tr:nth-child(even)>td{background-color:#fff}[jio-type=table] .table-caption{line-height:1.2857142857em;margin:20px 0;padding:0;text-transform:uppercase;font-size:18px;font-weight:400;color:#333;text-align:center}[jio-type=table] .nodata,[jio-type=table] .loading{text-align:center}[jio-type=table] .controls{background-color:#f5f5f5;border-top:1px solid #ddd;border-left:1px solid #ddd;border-right:1px solid #ddd;padding:5px;padding-left:15px;padding-top:10px;padding-bottom:10px}[jio-type=table] .table-picker:not(:first-of-type){margin-left:10px}[jio-type=table] .search-wrapper{float:right;margin-right:30px;width:250px}[jio-type=table] .search-wrapper input.search{padding:5px;border:1px solid #DDD;font-family:Signika,helvetica,arial,sans-serif;font-size:16px;background-color:#FFF;margin-left:7px;width:100%}[jio-type=table] .paging{float:right;display:table;vertical-align:middle}[jio-type=table] .paging-wrapper{display:table-cell}[jio-type=table] .showing{display:inline-block;margin-left:20px;margin-right:20px}[jio-type=table] .navigation{display:table-cell}[jio-type=table] .prev,[jio-type=table] .next{padding:5px;padding-left:10px;padding-right:10px;border:1px solid #ddd;cursor:pointer;display:table-cell}[jio-type=table] .prev:hover,[jio-type=table] .next:hover{background-color:#e9e9e9}[jio-type=table] .prev.disabled,[jio-type=table] .next.disabled{opacity:.6}[jio-type=table] .prev.disabled:hover,[jio-type=table] .next.disabled:hover{background-color:inherit}[jio-type=table] .page-size select{padding:3px;border:1px solid #ddd;font-family:Signika,helvetica,arial,sans-serif;font-size:16px;background-color:#fff;margin-left:7px}[jio-type=table] .btn.export{float:right}[jio-type=timeline]{}[jio-type=timeline] .sep{float:left;padding-left:10px;padding-right:10px;padding-top:5px;font-weight:400} \ No newline at end of file diff --git a/build/release/joola.shim.js b/build/release/joola.shim.js new file mode 100644 index 0000000..753e85f --- /dev/null +++ b/build/release/joola.shim.js @@ -0,0 +1,41921 @@ +(function e(t,n,r){function s(o,u){if(!n[o]){if(!t[o]){var a=typeof require=="function"&&require;if(!u&&a)return a(o,!0);if(i)return i(o,!0);throw new Error("Cannot find module '"+o+"'")}var f=n[o]={exports:{}};t[o][0].call(f.exports,function(e){var n=t[o][1][e];return s(n?n:e)},f,f.exports,e,t,n,r)}return n[o].exports}var i=typeof require=="function"&&require;for(var o=0;o= arr.length) { + callback(null); + } + } + })); + }); + }; + async.forEach = async.each; + + async.eachSeries = function (arr, iterator, callback) { + callback = callback || function () {}; + if (!arr.length) { + return callback(); + } + var completed = 0; + var iterate = function () { + iterator(arr[completed], function (err) { + if (err) { + callback(err); + callback = function () {}; + } + else { + completed += 1; + if (completed >= arr.length) { + callback(null); + } + else { + iterate(); + } + } + }); + }; + iterate(); + }; + async.forEachSeries = async.eachSeries; + + async.eachLimit = function (arr, limit, iterator, callback) { + var fn = _eachLimit(limit); + fn.apply(null, [arr, iterator, callback]); + }; + async.forEachLimit = async.eachLimit; + + var _eachLimit = function (limit) { + + return function (arr, iterator, callback) { + callback = callback || function () {}; + if (!arr.length || limit <= 0) { + return callback(); + } + var completed = 0; + var started = 0; + var running = 0; + + (function replenish () { + if (completed >= arr.length) { + return callback(); + } + + while (running < limit && started < arr.length) { + started += 1; + running += 1; + iterator(arr[started - 1], function (err) { + if (err) { + callback(err); + callback = function () {}; + } + else { + completed += 1; + running -= 1; + if (completed >= arr.length) { + callback(); + } + else { + replenish(); + } + } + }); + } + })(); + }; + }; + + + var doParallel = function (fn) { + return function () { + var args = Array.prototype.slice.call(arguments); + return fn.apply(null, [async.each].concat(args)); + }; + }; + var doParallelLimit = function(limit, fn) { + return function () { + var args = Array.prototype.slice.call(arguments); + return fn.apply(null, [_eachLimit(limit)].concat(args)); + }; + }; + var doSeries = function (fn) { + return function () { + var args = Array.prototype.slice.call(arguments); + return fn.apply(null, [async.eachSeries].concat(args)); + }; + }; + + + var _asyncMap = function (eachfn, arr, iterator, callback) { + var results = []; + arr = _map(arr, function (x, i) { + return {index: i, value: x}; + }); + eachfn(arr, function (x, callback) { + iterator(x.value, function (err, v) { + results[x.index] = v; + callback(err); + }); + }, function (err) { + callback(err, results); + }); + }; + async.map = doParallel(_asyncMap); + async.mapSeries = doSeries(_asyncMap); + async.mapLimit = function (arr, limit, iterator, callback) { + return _mapLimit(limit)(arr, iterator, callback); + }; + + var _mapLimit = function(limit) { + return doParallelLimit(limit, _asyncMap); + }; + + // reduce only has a series version, as doing reduce in parallel won't + // work in many situations. + async.reduce = function (arr, memo, iterator, callback) { + async.eachSeries(arr, function (x, callback) { + iterator(memo, x, function (err, v) { + memo = v; + callback(err); + }); + }, function (err) { + callback(err, memo); + }); + }; + // inject alias + async.inject = async.reduce; + // foldl alias + async.foldl = async.reduce; + + async.reduceRight = function (arr, memo, iterator, callback) { + var reversed = _map(arr, function (x) { + return x; + }).reverse(); + async.reduce(reversed, memo, iterator, callback); + }; + // foldr alias + async.foldr = async.reduceRight; + + var _filter = function (eachfn, arr, iterator, callback) { + var results = []; + arr = _map(arr, function (x, i) { + return {index: i, value: x}; + }); + eachfn(arr, function (x, callback) { + iterator(x.value, function (v) { + if (v) { + results.push(x); + } + callback(); + }); + }, function (err) { + callback(_map(results.sort(function (a, b) { + return a.index - b.index; + }), function (x) { + return x.value; + })); + }); + }; + async.filter = doParallel(_filter); + async.filterSeries = doSeries(_filter); + // select alias + async.select = async.filter; + async.selectSeries = async.filterSeries; + + var _reject = function (eachfn, arr, iterator, callback) { + var results = []; + arr = _map(arr, function (x, i) { + return {index: i, value: x}; + }); + eachfn(arr, function (x, callback) { + iterator(x.value, function (v) { + if (!v) { + results.push(x); + } + callback(); + }); + }, function (err) { + callback(_map(results.sort(function (a, b) { + return a.index - b.index; + }), function (x) { + return x.value; + })); + }); + }; + async.reject = doParallel(_reject); + async.rejectSeries = doSeries(_reject); + + var _detect = function (eachfn, arr, iterator, main_callback) { + eachfn(arr, function (x, callback) { + iterator(x, function (result) { + if (result) { + main_callback(x); + main_callback = function () {}; + } + else { + callback(); + } + }); + }, function (err) { + main_callback(); + }); + }; + async.detect = doParallel(_detect); + async.detectSeries = doSeries(_detect); + + async.some = function (arr, iterator, main_callback) { + async.each(arr, function (x, callback) { + iterator(x, function (v) { + if (v) { + main_callback(true); + main_callback = function () {}; + } + callback(); + }); + }, function (err) { + main_callback(false); + }); + }; + // any alias + async.any = async.some; + + async.every = function (arr, iterator, main_callback) { + async.each(arr, function (x, callback) { + iterator(x, function (v) { + if (!v) { + main_callback(false); + main_callback = function () {}; + } + callback(); + }); + }, function (err) { + main_callback(true); + }); + }; + // all alias + async.all = async.every; + + async.sortBy = function (arr, iterator, callback) { + async.map(arr, function (x, callback) { + iterator(x, function (err, criteria) { + if (err) { + callback(err); + } + else { + callback(null, {value: x, criteria: criteria}); + } + }); + }, function (err, results) { + if (err) { + return callback(err); + } + else { + var fn = function (left, right) { + var a = left.criteria, b = right.criteria; + return a < b ? -1 : a > b ? 1 : 0; + }; + callback(null, _map(results.sort(fn), function (x) { + return x.value; + })); + } + }); + }; + + async.auto = function (tasks, callback) { + callback = callback || function () {}; + var keys = _keys(tasks); + if (!keys.length) { + return callback(null); + } + + var results = {}; + + var listeners = []; + var addListener = function (fn) { + listeners.unshift(fn); + }; + var removeListener = function (fn) { + for (var i = 0; i < listeners.length; i += 1) { + if (listeners[i] === fn) { + listeners.splice(i, 1); + return; + } + } + }; + var taskComplete = function () { + _each(listeners.slice(0), function (fn) { + fn(); + }); + }; + + addListener(function () { + if (_keys(results).length === keys.length) { + callback(null, results); + callback = function () {}; + } + }); + + _each(keys, function (k) { + var task = (tasks[k] instanceof Function) ? [tasks[k]]: tasks[k]; + var taskCallback = function (err) { + var args = Array.prototype.slice.call(arguments, 1); + if (args.length <= 1) { + args = args[0]; + } + if (err) { + var safeResults = {}; + _each(_keys(results), function(rkey) { + safeResults[rkey] = results[rkey]; + }); + safeResults[k] = args; + callback(err, safeResults); + // stop subsequent errors hitting callback multiple times + callback = function () {}; + } + else { + results[k] = args; + async.setImmediate(taskComplete); + } + }; + var requires = task.slice(0, Math.abs(task.length - 1)) || []; + var ready = function () { + return _reduce(requires, function (a, x) { + return (a && results.hasOwnProperty(x)); + }, true) && !results.hasOwnProperty(k); + }; + if (ready()) { + task[task.length - 1](taskCallback, results); + } + else { + var listener = function () { + if (ready()) { + removeListener(listener); + task[task.length - 1](taskCallback, results); + } + }; + addListener(listener); + } + }); + }; + + async.waterfall = function (tasks, callback) { + callback = callback || function () {}; + if (tasks.constructor !== Array) { + var err = new Error('First argument to waterfall must be an array of functions'); + return callback(err); + } + if (!tasks.length) { + return callback(); + } + var wrapIterator = function (iterator) { + return function (err) { + if (err) { + callback.apply(null, arguments); + callback = function () {}; + } + else { + var args = Array.prototype.slice.call(arguments, 1); + var next = iterator.next(); + if (next) { + args.push(wrapIterator(next)); + } + else { + args.push(callback); + } + async.setImmediate(function () { + iterator.apply(null, args); + }); + } + }; + }; + wrapIterator(async.iterator(tasks))(); + }; + + var _parallel = function(eachfn, tasks, callback) { + callback = callback || function () {}; + if (tasks.constructor === Array) { + eachfn.map(tasks, function (fn, callback) { + if (fn) { + fn(function (err) { + var args = Array.prototype.slice.call(arguments, 1); + if (args.length <= 1) { + args = args[0]; + } + callback.call(null, err, args); + }); + } + }, callback); + } + else { + var results = {}; + eachfn.each(_keys(tasks), function (k, callback) { + tasks[k](function (err) { + var args = Array.prototype.slice.call(arguments, 1); + if (args.length <= 1) { + args = args[0]; + } + results[k] = args; + callback(err); + }); + }, function (err) { + callback(err, results); + }); + } + }; + + async.parallel = function (tasks, callback) { + _parallel({ map: async.map, each: async.each }, tasks, callback); + }; + + async.parallelLimit = function(tasks, limit, callback) { + _parallel({ map: _mapLimit(limit), each: _eachLimit(limit) }, tasks, callback); + }; + + async.series = function (tasks, callback) { + callback = callback || function () {}; + if (tasks.constructor === Array) { + async.mapSeries(tasks, function (fn, callback) { + if (fn) { + fn(function (err) { + var args = Array.prototype.slice.call(arguments, 1); + if (args.length <= 1) { + args = args[0]; + } + callback.call(null, err, args); + }); + } + }, callback); + } + else { + var results = {}; + async.eachSeries(_keys(tasks), function (k, callback) { + tasks[k](function (err) { + var args = Array.prototype.slice.call(arguments, 1); + if (args.length <= 1) { + args = args[0]; + } + results[k] = args; + callback(err); + }); + }, function (err) { + callback(err, results); + }); + } + }; + + async.iterator = function (tasks) { + var makeCallback = function (index) { + var fn = function () { + if (tasks.length) { + tasks[index].apply(null, arguments); + } + return fn.next(); + }; + fn.next = function () { + return (index < tasks.length - 1) ? makeCallback(index + 1): null; + }; + return fn; + }; + return makeCallback(0); + }; + + async.apply = function (fn) { + var args = Array.prototype.slice.call(arguments, 1); + return function () { + return fn.apply( + null, args.concat(Array.prototype.slice.call(arguments)) + ); + }; + }; + + var _concat = function (eachfn, arr, fn, callback) { + var r = []; + eachfn(arr, function (x, cb) { + fn(x, function (err, y) { + r = r.concat(y || []); + cb(err); + }); + }, function (err) { + callback(err, r); + }); + }; + async.concat = doParallel(_concat); + async.concatSeries = doSeries(_concat); + + async.whilst = function (test, iterator, callback) { + if (test()) { + iterator(function (err) { + if (err) { + return callback(err); + } + async.whilst(test, iterator, callback); + }); + } + else { + callback(); + } + }; + + async.doWhilst = function (iterator, test, callback) { + iterator(function (err) { + if (err) { + return callback(err); + } + if (test()) { + async.doWhilst(iterator, test, callback); + } + else { + callback(); + } + }); + }; + + async.until = function (test, iterator, callback) { + if (!test()) { + iterator(function (err) { + if (err) { + return callback(err); + } + async.until(test, iterator, callback); + }); + } + else { + callback(); + } + }; + + async.doUntil = function (iterator, test, callback) { + iterator(function (err) { + if (err) { + return callback(err); + } + if (!test()) { + async.doUntil(iterator, test, callback); + } + else { + callback(); + } + }); + }; + + async.queue = function (worker, concurrency) { + if (concurrency === undefined) { + concurrency = 1; + } + function _insert(q, data, pos, callback) { + if(data.constructor !== Array) { + data = [data]; + } + _each(data, function(task) { + var item = { + data: task, + callback: typeof callback === 'function' ? callback : null + }; + + if (pos) { + q.tasks.unshift(item); + } else { + q.tasks.push(item); + } + + if (q.saturated && q.tasks.length === concurrency) { + q.saturated(); + } + async.setImmediate(q.process); + }); + } + + var workers = 0; + var q = { + tasks: [], + concurrency: concurrency, + saturated: null, + empty: null, + drain: null, + push: function (data, callback) { + _insert(q, data, false, callback); + }, + unshift: function (data, callback) { + _insert(q, data, true, callback); + }, + process: function () { + if (workers < q.concurrency && q.tasks.length) { + var task = q.tasks.shift(); + if (q.empty && q.tasks.length === 0) { + q.empty(); + } + workers += 1; + var next = function () { + workers -= 1; + if (task.callback) { + task.callback.apply(task, arguments); + } + if (q.drain && q.tasks.length + workers === 0) { + q.drain(); + } + q.process(); + }; + var cb = only_once(next); + worker(task.data, cb); + } + }, + length: function () { + return q.tasks.length; + }, + running: function () { + return workers; + } + }; + return q; + }; + + async.cargo = function (worker, payload) { + var working = false, + tasks = []; + + var cargo = { + tasks: tasks, + payload: payload, + saturated: null, + empty: null, + drain: null, + push: function (data, callback) { + if(data.constructor !== Array) { + data = [data]; + } + _each(data, function(task) { + tasks.push({ + data: task, + callback: typeof callback === 'function' ? callback : null + }); + if (cargo.saturated && tasks.length === payload) { + cargo.saturated(); + } + }); + async.setImmediate(cargo.process); + }, + process: function process() { + if (working) return; + if (tasks.length === 0) { + if(cargo.drain) cargo.drain(); + return; + } + + var ts = typeof payload === 'number' + ? tasks.splice(0, payload) + : tasks.splice(0); + + var ds = _map(ts, function (task) { + return task.data; + }); + + if(cargo.empty) cargo.empty(); + working = true; + worker(ds, function () { + working = false; + + var args = arguments; + _each(ts, function (data) { + if (data.callback) { + data.callback.apply(null, args); + } + }); + + process(); + }); + }, + length: function () { + return tasks.length; + }, + running: function () { + return working; + } + }; + return cargo; + }; + + var _console_fn = function (name) { + return function (fn) { + var args = Array.prototype.slice.call(arguments, 1); + fn.apply(null, args.concat([function (err) { + var args = Array.prototype.slice.call(arguments, 1); + if (typeof console !== 'undefined') { + if (err) { + if (console.error) { + console.error(err); + } + } + else if (console[name]) { + _each(args, function (x) { + console[name](x); + }); + } + } + }])); + }; + }; + async.log = _console_fn('log'); + async.dir = _console_fn('dir'); + /*async.info = _console_fn('info'); + async.warn = _console_fn('warn'); + async.error = _console_fn('error');*/ + + async.memoize = function (fn, hasher) { + var memo = {}; + var queues = {}; + hasher = hasher || function (x) { + return x; + }; + var memoized = function () { + var args = Array.prototype.slice.call(arguments); + var callback = args.pop(); + var key = hasher.apply(null, args); + if (key in memo) { + callback.apply(null, memo[key]); + } + else if (key in queues) { + queues[key].push(callback); + } + else { + queues[key] = [callback]; + fn.apply(null, args.concat([function () { + memo[key] = arguments; + var q = queues[key]; + delete queues[key]; + for (var i = 0, l = q.length; i < l; i++) { + q[i].apply(null, arguments); + } + }])); + } + }; + memoized.memo = memo; + memoized.unmemoized = fn; + return memoized; + }; + + async.unmemoize = function (fn) { + return function () { + return (fn.unmemoized || fn).apply(null, arguments); + }; + }; + + async.times = function (count, iterator, callback) { + var counter = []; + for (var i = 0; i < count; i++) { + counter.push(i); + } + return async.map(counter, iterator, callback); + }; + + async.timesSeries = function (count, iterator, callback) { + var counter = []; + for (var i = 0; i < count; i++) { + counter.push(i); + } + return async.mapSeries(counter, iterator, callback); + }; + + async.compose = function (/* functions... */) { + var fns = Array.prototype.reverse.call(arguments); + return function () { + var that = this; + var args = Array.prototype.slice.call(arguments); + var callback = args.pop(); + async.reduce(fns, args, function (newargs, fn, cb) { + fn.apply(that, newargs.concat([function () { + var err = arguments[0]; + var nextargs = Array.prototype.slice.call(arguments, 1); + cb(err, nextargs); + }])) + }, + function (err, results) { + callback.apply(that, [err].concat(results)); + }); + }; + }; + + var _applyEach = function (eachfn, fns /*args...*/) { + var go = function () { + var that = this; + var args = Array.prototype.slice.call(arguments); + var callback = args.pop(); + return eachfn(fns, function (fn, cb) { + fn.apply(that, args.concat([cb])); + }, + callback); + }; + if (arguments.length > 2) { + var args = Array.prototype.slice.call(arguments, 2); + return go.apply(this, args); + } + else { + return go; + } + }; + async.applyEach = doParallel(_applyEach); + async.applyEachSeries = doSeries(_applyEach); + + async.forever = function (fn, callback) { + function next(err) { + if (err) { + if (callback) { + return callback(err); + } + throw err; + } + fn(next); + } + next(); + }; + + // AMD / RequireJS + if (typeof define !== 'undefined' && define.amd) { + define([], function () { + return async; + }); + } + // Node.js + else if (typeof module !== 'undefined' && module.exports) { + module.exports = async; + } + // included directly via