From 1051d0fe6cb12267e745c50a37907cb91cf12b57 Mon Sep 17 00:00:00 2001 From: Fran Verona Date: Mon, 16 Apr 2018 16:59:13 +0100 Subject: [PATCH] Version 2.2.1 - Code style - Javascript: setProgress method now checks if element exists. - Added Gruntfile. - Fixed Javascript examples. --- Gruntfile.js | 53 ++ examples/javascript/index.html | 162 +++-- examples/javascript/main.js | 93 ++- examples/jquery/index.html | 30 +- examples/jquery/main.js | 127 ++-- loadgo-nojquery.js | 265 ++++---- loadgo-nojquery.min.js | 12 +- loadgo.js | 251 ++++---- loadgo.min.js | 12 +- package-lock.json | 1042 ++++++++++++++++++++++++++++++++ package.json | 9 +- 11 files changed, 1691 insertions(+), 365 deletions(-) create mode 100644 Gruntfile.js create mode 100644 package-lock.json diff --git a/Gruntfile.js b/Gruntfile.js new file mode 100644 index 0000000..a12fba2 --- /dev/null +++ b/Gruntfile.js @@ -0,0 +1,53 @@ +module.exports = function(grunt) { + + grunt.initConfig({ + pkg: grunt.file.readJSON('package.json'), + uglify: { + options: { + mangle: { + reserved: ['jQuery', '$'] + }, + output: { + comments: 'some', + }, + }, + loadgo: { + files: { + 'loadgo.min.js': ['loadgo.js'], + 'loadgo-nojquery.min.js': ['loadgo-nojquery.js'], + } + } + }, + clean : { + oldminifies: { + src: [ + 'loadgo.min.js', + 'loadgo-nojquery.min.js', + ] + } + }, + replace: { + loadgo: { + src: ['loadgo.js', 'loadgo.min.js', 'loadgo-nojquery.js', 'loadgo-nojquery.min.js'], + overwrite: true, + replacements: [ + { + from: /@preserve\sLoadGo\sv([0-9]+)\.?([0-9]+)(\.([0-9]+))?\s\(http:\/\/franverona.com\/loadgo\)/g, + to: '@preserve LoadGo v<%= pkg.version %> (http://franverona.com/loadgo)' + }, + { + from: /([0-9])+\s-\sFran Verona/g, + to: '<%= grunt.template.today("yyyy") %> - Fran Verona' + }, + ] + } + } + }); + + grunt.loadNpmTasks('grunt-contrib-uglify-es'); + grunt.loadNpmTasks('grunt-contrib-clean'); + grunt.loadNpmTasks('grunt-text-replace'); + + grunt.registerTask('default', ['clean', 'uglify', 'replace']); + +}; diff --git a/examples/javascript/index.html b/examples/javascript/index.html index 0fbbc78..ba15ac1 100644 --- a/examples/javascript/index.html +++ b/examples/javascript/index.html @@ -5,7 +5,7 @@ - + LoadGo - Your own images as a progress bar @@ -44,10 +44,15 @@

- jQuery + Javascript

-$('#disney').loadgo();
+// Default - Javascript +var disney = document.getElementById('disney'); +disney.src = '../logos/disney.png'; +disney.onload = function () { + Loadgo.init(disney); +};
@@ -74,14 +79,19 @@

- jQuery + Javascript

-$('#superman').loadgo({
-  'opacity':    0.2,
-  'animated':   false,
-  'bgcolor':    '#01AEF0'
-});
+// Opacity, no animation and background color - Javascript +var superman = document.getElementById('superman'); +superman.src = '../logos/superman.png'; +superman.onload = function () { + Loadgo.init(superman, { + 'opacity': 0.2, + 'animated': false, + 'bgcolor': '#01AEF0' + }); +};
@@ -108,13 +118,18 @@

- jQuery + Javascript

-$('#batman').loadgo({
-  'opacity':  1,
-  'image':    'batman-overlay.png'
-});
+// Overlay - Javascript +var batman = document.getElementById('batman'); +batman.src = '../logos/batman.png'; +batman.onload = function () { + Loadgo.init(batman, { + 'opacity': 1, + 'image': '../logos/batman-overlay.png' + }); +};
@@ -141,10 +156,14 @@

-// Left to Right - jQuery
-$('#jurassiclr').loadgo({
-  'direction':    'lr'
-});
+// Left to Right - Javascript
+var jurassiclr = document.getElementById('jurassiclr');
+jurassiclr.src = '../logos/jurassic.png';
+jurassiclr.onload = function () {
+  Loadgo.init(jurassiclr, {
+    'direction': 'lr'
+  });
+};
 
@@ -160,10 +179,14 @@

-// Right to Left - jQuery
-$('#jurassicrl').loadgo({
-  'direction':    'rl'
-});
+// Right to Left - Javascript
+var jurassicrl = document.getElementById('jurassicrl');
+jurassicrl.src = '../logos/jurassic.png';
+jurassicrl.onload = function () {
+  Loadgo.init(jurassicrl, {
+    'direction': 'rl'
+  });
+};
 
@@ -181,10 +204,14 @@

-// Bottom to Top - jQuery
-$('#jurassicbt').loadgo({
-  'direction':    'bt'
-});
+// Top to Bottom - Javascript
+var jurassictb = document.getElementById('jurassictb');
+jurassictb.src = '../logos/jurassic.png';
+jurassictb.onload = function () {
+  Loadgo.init(jurassictb, {
+    'direction': 'tb'
+  });
+};
 
@@ -200,10 +227,14 @@

-// Top to Bottom - jQuery
-$('#jurassictb').loadgo({
-  'direction':    'tb'
-});
+// Bottom to Top - Javascript
+var jurassicbt = document.getElementById('jurassicbt');
+jurassicbt.src = '../logos/jurassic.png';
+jurassicbt.onload = function () {
+  Loadgo.init(jurassicbt, {
+    'direction': 'bt'
+  });
+};
 
@@ -227,10 +258,14 @@

-// Sepia - jQuery
-$('#spidermanSepia').loadgo({
-  'filter':    'sepia'
-});
+// Sepia - Javascript
+var spidermanSepia = document.getElementById('spidermanSepia');
+spidermanSepia.src = '../logos/spiderman.png';
+spidermanSepia.onload = function () {
+  Loadgo.init(spidermanSepia, {
+    'filter': 'sepia'
+  });
+};
 
@@ -246,10 +281,14 @@

-// Blur - jQuery
-$('#spidermanBlur').loadgo({
-  'filter':    'blur'
-});
+// Blur - Javascript
+var spidermanBlur = document.getElementById('spidermanBlur');
+spidermanBlur.src = '../logos/spiderman.png';
+spidermanBlur.onload = function () {
+  Loadgo.init(spidermanBlur, {
+    'filter': 'blur'
+  });
+};
 
@@ -267,10 +306,14 @@

-// Invert - jQuery
-$('#spidermanInvert').loadgo({
-  'filter':    'invert'
-});
+// Invert - Javascript
+var spidermanInvert = document.getElementById('spidermanInvert');
+spidermanInvert.src = '../logos/spiderman.png';
+spidermanInvert.onload = function () {
+  Loadgo.init(spidermanInvert, {
+    'filter': 'invert'
+  });
+};
 
@@ -286,10 +329,14 @@

-// Hue Rotate - jQuery
-$('#spidermanHue').loadgo({
-  'filter':    'hue-rotate'
-});
+// Hue - Javascript
+var spidermanHue = document.getElementById('spidermanHue');
+spidermanHue.src = '../logos/spiderman.png';
+spidermanHue.onload = function () {
+  Loadgo.init(spidermanHue, {
+    'filter': 'hue-rotate'
+  });
+};
 
@@ -308,10 +355,13 @@

-// Opacity - jQuery
-$('#spidermanOpacity').loadgo({
-  'filter':    'opacity'
-});
+// Opacity - Javascript
+var spidermanOpacity = document.getElementById('spidermanOpacity');
+spidermanOpacity.onload = function () {
+  Loadgo.init(spidermanOpacity, {
+    'filter': 'opacity'
+  });
+};
 
@@ -327,10 +377,14 @@

-// Grayscale - jQuery
-$('#spidermanGrayscale').loadgo({
-  'filter':    'grayscale'
-});
+// Grayscale - Javascript
+var spidermanGrayscale = document.getElementById('spidermanGrayscale');
+spidermanGrayscale.src = '../logos/spiderman.png';
+spidermanGrayscale.onload = function () {
+  Loadgo.init(spidermanGrayscale, {
+    'filter': 'grayscale'
+  });
+};
 
diff --git a/examples/javascript/main.js b/examples/javascript/main.js index 79c5f81..fae5764 100644 --- a/examples/javascript/main.js +++ b/examples/javascript/main.js @@ -1,11 +1,30 @@ -var cocacolaInterval, disneyInterval, supermanInterval, batmanInterval, - jurassicIntervalLR, jurassicIntervalRL, jurassicIntervalBT, jurassicIntervalTB, - spidermanSepiaInterval, spidermanBlurInterval, spidermanInvertInterval, spidermanOpacityInterval, spidermanHueInterval, spidermanGrayscaleInterval; - -function playDemo (_id, index, interval) { - var image = document.getElementById(_id), - demoMsg = document.getElementById('demo-msg-' + index), - demoProgress = document.getElementById('demo-progress-' + index); +// Default example +var disneyInterval; + +// Example with some options +var supermanInterval; + +// Example with overlay +var batmanInterval; + +// Examples with directions +var jurassicIntervalLR; +var jurassicIntervalRL; +var jurassicIntervalBT; +var jurassicIntervalTB; + +// Examples with filters +var spidermanSepiaInterval; +var spidermanBlurInterval; +var spidermanInvertInterval; +var spidermanOpacityInterval; +var spidermanHueInterval; +var spidermanGrayscaleInterval; + +function playDemo (id, index, interval) { + var image = document.getElementById(id); + var demoMsg = document.getElementById('demo-msg-' + index); + var demoProgress = document.getElementById('demo-progress-' + index); demoMsg.style.opacity = '0'; demoProgress.style.opacity = '1'; @@ -20,105 +39,116 @@ function playDemo (_id, index, interval) { window.clearInterval(interval); demoMsg.style.opacity = '1'; demoProgress.style.opacity = '0'; + return; } - else { - var prog = p * 10; - Loadgo.setprogress(image, prog); - demoProgress.innerHTML = prog + '%'; - p++; - } + + var prog = p * 10; + Loadgo.setprogress(image, prog); + demoProgress.innerHTML = prog + '%'; + p++; }, 150); }, 300); } -//window.onload = function () { +window.onload = function () { // Main demo var disney = document.getElementById('disney'); + disney.src = '../logos/disney.png'; disney.onload = function () { Loadgo.init(disney); }; // Example #2 var superman = document.getElementById('superman'); + superman.src = '../logos/superman.png'; superman.onload = function () { Loadgo.init(superman, { - 'opacity': 0.2, - 'animated': false, - 'bgcolor': '#01AEF0' + 'opacity': 0.2, + 'animated': false, + 'bgcolor': '#01AEF0' }); }; // Example #3 var batman = document.getElementById('batman'); + batman.src = '../logos/batman.png'; batman.onload = function () { Loadgo.init(batman, { - 'opacity': 1, - 'image': '../logos/batman-overlay.png' + 'opacity': 1, + 'image': '../logos/batman-overlay.png' }); }; // Example #4 var jurassiclr = document.getElementById('jurassiclr'); + jurassiclr.src = '../logos/jurassic.png'; jurassiclr.onload = function () { Loadgo.init(jurassiclr, { - 'direction': 'lr' + 'direction': 'lr' }); }; // Example #4 var jurassicrl = document.getElementById('jurassicrl'); + jurassicrl.src = '../logos/jurassic.png'; jurassicrl.onload = function () { Loadgo.init(jurassicrl, { - 'direction': 'rl' + 'direction': 'rl' }); }; // Example #4 var jurassictb = document.getElementById('jurassictb'); + jurassictb.src = '../logos/jurassic.png'; jurassictb.onload = function () { Loadgo.init(jurassictb, { - 'direction': 'tb' + 'direction': 'tb' }); }; // Example #4 var jurassicbt = document.getElementById('jurassicbt'); + jurassicbt.src = '../logos/jurassic.png'; jurassicbt.onload = function () { Loadgo.init(jurassicbt, { - 'direction': 'bt' + 'direction': 'bt' }); }; // Example #5 var spidermanSepia = document.getElementById('spidermanSepia'); + spidermanSepia.src = '../logos/spiderman.png'; spidermanSepia.onload = function () { Loadgo.init(spidermanSepia, { - 'filter': 'sepia' + 'filter': 'sepia' }); }; // Example #5 var spidermanBlur = document.getElementById('spidermanBlur'); + spidermanBlur.src = '../logos/spiderman.png'; spidermanBlur.onload = function () { Loadgo.init(spidermanBlur, { - 'filter': 'blur' + 'filter': 'blur' }); }; // Example #5 var spidermanInvert = document.getElementById('spidermanInvert'); + spidermanInvert.src = '../logos/spiderman.png'; spidermanInvert.onload = function () { Loadgo.init(spidermanInvert, { - 'filter': 'invert' + 'filter': 'invert' }); }; // Example #5 var spidermanHue = document.getElementById('spidermanHue'); + spidermanHue.src = '../logos/spiderman.png'; spidermanHue.onload = function () { Loadgo.init(spidermanHue, { - 'filter': 'hue-rotate' + 'filter': 'hue-rotate' }); }; @@ -126,16 +156,17 @@ function playDemo (_id, index, interval) { var spidermanOpacity = document.getElementById('spidermanOpacity'); spidermanOpacity.onload = function () { Loadgo.init(spidermanOpacity, { - 'filter': 'opacity' + 'filter': 'opacity' }); }; // Example #5 var spidermanGrayscale = document.getElementById('spidermanGrayscale'); + spidermanGrayscale.src = '../logos/spiderman.png'; spidermanGrayscale.onload = function () { Loadgo.init(spidermanGrayscale, { - 'filter': 'grayscale' + 'filter': 'grayscale' }); }; -//}; +}; diff --git a/examples/jquery/index.html b/examples/jquery/index.html index 79079a8..3295455 100644 --- a/examples/jquery/index.html +++ b/examples/jquery/index.html @@ -78,9 +78,9 @@

 $('#superman').loadgo({
-  'opacity':    0.2,
-  'animated':   false,
-  'bgcolor':    '#01AEF0'
+  'opacity': 0.2,
+  'animated': false,
+  'bgcolor': '#01AEF0'
 });
@@ -112,8 +112,8 @@

 $('#batman').loadgo({
-  'opacity':  1,
-  'image':    'batman-overlay.png'
+  'opacity': 1,
+  'image': 'batman-overlay.png'
 });
@@ -143,7 +143,7 @@

 // Left to Right - jQuery
 $('#jurassiclr').loadgo({
-  'direction':    'lr'
+  'direction': 'lr'
 });
 
@@ -162,7 +162,7 @@

 // Right to Left - jQuery
 $('#jurassicrl').loadgo({
-  'direction':    'rl'
+  'direction': 'rl'
 });
 
@@ -183,7 +183,7 @@

 // Bottom to Top - jQuery
 $('#jurassicbt').loadgo({
-  'direction':    'bt'
+  'direction': 'bt'
 });
 
@@ -202,7 +202,7 @@

 // Top to Bottom - jQuery
 $('#jurassictb').loadgo({
-  'direction':    'tb'
+  'direction': 'tb'
 });
 
@@ -229,7 +229,7 @@

 // Sepia - jQuery
 $('#spidermanSepia').loadgo({
-  'filter':    'sepia'
+  'filter': 'sepia'
 });
 
@@ -248,7 +248,7 @@

 // Blur - jQuery
 $('#spidermanBlur').loadgo({
-  'filter':    'blur'
+  'filter': 'blur'
 });
 
@@ -269,7 +269,7 @@

 // Invert - jQuery
 $('#spidermanInvert').loadgo({
-  'filter':    'invert'
+  'filter': 'invert'
 });
 
@@ -288,7 +288,7 @@

 // Hue Rotate - jQuery
 $('#spidermanHue').loadgo({
-  'filter':    'hue-rotate'
+  'filter': 'hue-rotate'
 });
 
@@ -310,7 +310,7 @@

 // Opacity - jQuery
 $('#spidermanOpacity').loadgo({
-  'filter':    'opacity'
+  'filter': 'opacity'
 });
 
@@ -329,7 +329,7 @@

 // Grayscale - jQuery
 $('#spidermanGrayscale').loadgo({
-  'filter':    'grayscale'
+  'filter': 'grayscale'
 });
 
diff --git a/examples/jquery/main.js b/examples/jquery/main.js index fdbeee6..3037b31 100644 --- a/examples/jquery/main.js +++ b/examples/jquery/main.js @@ -1,8 +1,27 @@ -var cocacolaInterval, disneyInterval, supermanInterval, batmanInterval, - jurassicIntervalLR, jurassicIntervalRL, jurassicIntervalBT, jurassicIntervalTB, - spidermanSepiaInterval, spidermanBlurInterval, spidermanInvertInterval, spidermanOpacityInterval, spidermanHueInterval, spidermanGrayscaleInterval; - -function playDemo (_id, index, interval) { +// Default example +var disneyInterval; + +// Example with some options +var supermanInterval; + +// Example with overlay +var batmanInterval; + +// Examples with directions +var jurassicIntervalLR; +var jurassicIntervalRL; +var jurassicIntervalBT; +var jurassicIntervalTB; + +// Examples with filters +var spidermanSepiaInterval; +var spidermanBlurInterval; +var spidermanInvertInterval; +var spidermanOpacityInterval; +var spidermanHueInterval; +var spidermanGrayscaleInterval; + +function playDemo (id, index, interval) { $('#demo-msg-' + index).animate({ 'opacity': '0' }); @@ -10,11 +29,11 @@ function playDemo (_id, index, interval) { 'opacity': '1' }); var p = 0; - $('#' + _id).loadgo('resetprogress'); + $('#' + id).loadgo('resetprogress'); $('#demo-progress-' + index).html('0%'); window.setTimeout(function () { interval = window.setInterval(function (){ - if ($('#' + _id).loadgo('getprogress') === 100) { + if ($('#' + id).loadgo('getprogress') === 100) { window.clearInterval(interval); $('#demo-msg-' + index).animate({ 'opacity': '1' @@ -22,13 +41,13 @@ function playDemo (_id, index, interval) { $('#demo-progress-' + index).animate({ 'opacity': '0' }); + return; } - else { - var prog = p * 10; - $('#' + _id).loadgo('setprogress', prog); - $('#demo-progress-' + index).html(prog + '%'); - p++; - } + + var prog = p * 10; + $('#' + id).loadgo('setprogress', prog); + $('#demo-progress-' + index).html(prog + '%'); + p++; }, 150); }, 300); } @@ -39,118 +58,144 @@ $(window).load(function () { // Example #1 $('#disney').loadgo(); }).each(function() { - if(this.complete) $(this).load(); + if (this.complete) { + $(this).load(); + } }); $("#superman").load(function() { // Example #2 $('#superman').loadgo({ - 'opacity': 0.2, - 'animated': false, - 'bgcolor': '#01AEF0' + 'opacity': 0.2, + 'animated': false, + 'bgcolor': '#01AEF0' }); }).each(function() { - if(this.complete) $(this).load(); + if (this.complete) { + $(this).load(); + } }); $("#batman").load(function() { // Example #3 $('#batman').loadgo({ - 'opacity': 1, - 'image': '../logos/batman-overlay.png' + 'opacity': 1, + 'image': '../logos/batman-overlay.png' }); }).each(function() { - if(this.complete) $(this).load(); + if (this.complete) { + $(this).load(); + } }); $("#jurassiclr").load(function() { // Example #4 $('#jurassiclr').loadgo({ - 'direction': 'lr' + 'direction': 'lr' }); }).each(function() { - if(this.complete) $(this).load(); + if (this.complete) { + $(this).load(); + } }); $("#jurassicrl").load(function() { // Example #4 $('#jurassicrl').loadgo({ - 'direction': 'rl' + 'direction': 'rl' }); }).each(function() { - if(this.complete) $(this).load(); + if (this.complete) { + $(this).load(); + } }); $("#jurassictb").load(function() { // Example #4 $('#jurassictb').loadgo({ - 'direction': 'tb' + 'direction': 'tb' }); }).each(function() { - if(this.complete) $(this).load(); + if (this.complete) { + $(this).load(); + } }); $("#jurassicbt").load(function() { // Example #4 $('#jurassicbt').loadgo({ - 'direction': 'bt' + 'direction': 'bt' }); }).each(function() { - if(this.complete) $(this).load(); + if (this.complete) { + $(this).load(); + } }); $("#spidermanSepia").load(function() { // Example #5 $('#spidermanSepia').loadgo({ - 'filter': 'sepia' + 'filter': 'sepia' }); }).each(function() { - if(this.complete) $(this).load(); + if (this.complete) { + $(this).load(); + } }); $("#spidermanBlur").load(function() { // Example #5 $('#spidermanBlur').loadgo({ - 'filter': 'blur' + 'filter': 'blur' }); }).each(function() { - if(this.complete) $(this).load(); + if (this.complete) { + $(this).load(); + } }); $("#spidermanInvert").load(function() { // Example #5 $('#spidermanInvert').loadgo({ - 'filter': 'invert' + 'filter': 'invert' }); }).each(function() { - if(this.complete) $(this).load(); + if (this.complete) { + $(this).load(); + } }); $("#spidermanHue").load(function() { // Example #5 $('#spidermanHue').loadgo({ - 'filter': 'hue-rotate' + 'filter': 'hue-rotate' }); }).each(function() { - if(this.complete) $(this).load(); + if (this.complete) { + $(this).load(); + } }); $("#spidermanOpacity").load(function() { // Example #5 $('#spidermanOpacity').loadgo({ - 'filter': 'opacity' + 'filter': 'opacity' }); }).each(function() { - if(this.complete) $(this).load(); + if (this.complete) { + $(this).load(); + } }); $("#spidermanGrayscale").load(function() { // Example #5 $('#spidermanGrayscale').loadgo({ - 'filter': 'grayscale' + 'filter': 'grayscale' }); }).each(function() { - if(this.complete) $(this).load(); + if (this.complete) { + $(this).load(); + } }); }); diff --git a/loadgo-nojquery.js b/loadgo-nojquery.js index c3aa132..a8f60e3 100644 --- a/loadgo-nojquery.js +++ b/loadgo-nojquery.js @@ -1,6 +1,6 @@ /** - * @preserve LoadGo v2.2 (http://franverona.com/loadgo) - * 2017 - Fran Verona + * @preserve LoadGo v2.2.1 (http://franverona.com/loadgo) + * 2018 - Fran Verona * Licensed under MIT (https://github.com/franverona/loadgo/blob/master/LICENSE) */ @@ -8,9 +8,11 @@ // Rudimentary indexOf method for < IE 8 compatibility var indexOf = function (array, element) { - for (var i = 0, l = array.length; i < l; i++) - if (array[i] === element) + for (var i = 0, l = array.length; i < l; i++) { + if (array[i] === element) { return i; + } + } return -1; }; @@ -20,60 +22,70 @@ var result = {}, obj1Clone, obj2Clone; if (typeof obj1 === 'undefined') { obj2Clone = JSON.parse(JSON.stringify(obj2)); - if (obj2.resize) + if (obj2.resize) { obj2Clone.resize = obj2.resize; // Functions won't be serialized, so we need to do it manually + } result = obj2Clone; - } - else if (typeof obj2 === 'undefined') { + } else if (typeof obj2 === 'undefined') { obj1Clone = JSON.parse(JSON.stringify(obj1)); - if (obj1.resize) + if (obj1.resize) { obj1Clone.resize = obj1.resize; // Functions won't be serialized, so we need to do it manually + } result = obj1Clone; - } - else { + } else { obj1Clone = JSON.parse(JSON.stringify(obj1)); - if (obj1.resize) + if (obj1.resize) { obj1Clone.resize = obj1.resize; // Functions won't be serialized, so we need to do it manually + } obj1 = obj1Clone; obj2Clone = JSON.parse(JSON.stringify(obj2)); - if (obj2.resize) + if (obj2.resize) { obj2Clone.resize = obj2.resize; // Functions won't be serialized, so we need to do it manually + } obj2 = obj2Clone; result = obj1; - for (var prop in obj2) + for (var prop in obj2) { result[prop] = obj2[prop]; + } } return result; }; // Get Loadgo properties for element var getProperties = function (elementId) { - for (var i = 0, l = domElements.length; i < l; i++) - if (domElements[i].id === elementId) + for (var i = 0, l = domElements.length; i < l; i++) { + if (domElements[i].id === elementId) { return domElements[i].properties; + } + } return null; }; // Get array index on domElements array var getIndex = function (elementId) { - for (var i = 0, l = domElements.length; i < l; i++) - if (domElements[i].id === elementId) + for (var i = 0, l = domElements.length; i < l; i++) { + if (domElements[i].id === elementId) { return i; + } + } return -1; }; // Returns true if element is valid; false otherwise var elementIsValid = function (element) { - if (typeof element === 'undefined' || element === null) + if (typeof element === 'undefined' || element === null) { return false; + } - if (element.nodeName !== 'IMG') + if (element.nodeName !== 'IMG') { throw new Error('LoadGo only works on img elements.'); + } - if (element.length > 1) + if (element.length > 1) { throw new Error('LoadGo only works on one element at a time. Try with a valid #id.'); + } return true; }; @@ -82,14 +94,17 @@ var parseOffset = function (element, property) { var measure = element.style[property] if (measure === 'auto') { - if (property.toLowerCase().indexOf('left') !== -1 || property.toLowerCase().indexOf('right') !== -1) + if (property.toLowerCase().indexOf('left') !== -1 || property.toLowerCase().indexOf('right') !== -1) { return parseFloat(element.offsetLeft); - if (property.toLowerCase().indexOf('top') !== -1 || property.toLowerCase().indexOf('bottom') !== -1) + } + if (property.toLowerCase().indexOf('top') !== -1 || property.toLowerCase().indexOf('bottom') !== -1) { return parseFloat(element.offsetTop); + } } - if (measure.indexOf('px') !== -1) + if (measure.indexOf('px') !== -1) { return parseFloat(measure); + } return 0; }; @@ -103,14 +118,14 @@ // Loadgo default options var defaultOptions = { - 'bgcolor': '#FFFFFF', // Overlay color - 'opacity': '0.5', // Overlay opacity - 'animated': true, // Overlay smooth animation when setting progress - 'image': null, // Overlay image - 'class': null, // Overlay CSS class - 'resize': null, // Resize functions (optional) - 'direction': 'lr', // Direction animation (optional) - 'filter': null // Image filter (optional) + 'bgcolor': '#FFFFFF', // Overlay color + 'opacity': '0.5', // Overlay opacity + 'animated': true, // Overlay smooth animation when setting progress + 'image': null, // Overlay image + 'class': null, // Overlay CSS class + 'resize': null, // Resize functions (optional) + 'direction': 'lr', // Direction animation (optional) + 'filter': null // Image filter (optional) }; Loadgo = window.Loadgo || {}; @@ -122,20 +137,22 @@ */ Loadgo.init = function (element, useroptions) { - if (!elementIsValid(element)) + if (!elementIsValid(element)) { return; + } var domElementsIndex = getIndex(element.id); if (domElementsIndex === -1) { domElements.push({ - id: element.id, - properties: {} + id: element.id, + properties: {} }); domElementsIndex = domElements.length - 1; } - else + else { // Plugin options. We need to reset options to avoid future errors domElements[domElementsIndex].properties = {}; + } var pluginOptions = Loadgo.options(element, useroptions); @@ -144,8 +161,9 @@ // Overlay classes var overlayClasses = ['loadgo-overlay']; - if (pluginOptions['class']) + if (pluginOptions['class']) { overlayClasses.push(pluginOptions['class']); + } overlay.className = overlayClasses.join(' '); // Overlay background color @@ -156,16 +174,20 @@ // Overlay width var gbc = element.getBoundingClientRect(); - if (gbc.width) + if (gbc.width) { overlay.style.width = gbc.width + 'px'; // for modern browsers - else + } + else { overlay.style.width = element.offsetWidth; // for oldIE + } // Overlay height - if (gbc.height) + if (gbc.height) { overlay.style.height = gbc.height + 'px'; // for modern browsers - else + } + else { overlay.style.height = element.offsetWidth; // for oldIE + } // Overlay will be positioned absolute overlay.style.position = 'absolute'; @@ -181,33 +203,35 @@ // Filters if (pluginOptions.filter) { - if (pluginOptions.filter === 'blur') + if (pluginOptions.filter === 'blur') { element.style['-webkit-filter'] = pluginOptions.filter + '(10px)'; - else if (pluginOptions.filter === 'hue-rotate') + } else if (pluginOptions.filter === 'hue-rotate') { element.style['-webkit-filter'] = pluginOptions.filter + '(360deg)'; - else if (pluginOptions.filter === 'opacity') + } else if (pluginOptions.filter === 'opacity') { element.style['-webkit-filter'] = pluginOptions.filter + '(0)'; - else + } else { element.style['-webkit-filter'] = pluginOptions.filter + '(1)'; + } if (pluginOptions.animated) { - element.style['transition'] = '0.6s filter ease'; - element.style['-webkit-transition'] = '0.6s -webkit-filter ease'; - element.style['-moz-transition'] = '0.6s -moz-filter ease'; - element.style['-ms-transition'] = '0.6s -ms-filter ease'; - element.style['-o-transition'] = '0.6s -o-filter ease'; + element.style['transition'] = '0.6s filter ease'; + element.style['-webkit-transition'] = '0.6s -webkit-filter ease'; + element.style['-moz-transition'] = '0.6s -moz-filter ease'; + element.style['-ms-transition'] = '0.6s -ms-filter ease'; + element.style['-o-transition'] = '0.6s -o-filter ease'; } } // Background image if (pluginOptions.image) { var bgposition = '100% 0%'; // Left to right animation by default - if (pluginOptions.direction === 'rl') + if (pluginOptions.direction === 'rl') { bgposition = '0% 50%'; // Right to left animation - else if (pluginOptions.direction === 'bt') + } else if (pluginOptions.direction === 'bt') { bgposition = '100% 0%'; // Bottom to top animation - else if (pluginOptions.direction === 'tb') + } else if (pluginOptions.direction === 'tb') { bgposition = '0% 100%'; // Top to bottom animation + } overlay.style['background-image'] = 'url("' + pluginOptions.image + '")'; overlay.style['background-repeat'] = 'no-repeat'; @@ -237,14 +261,14 @@ container.appendChild(overlay); // We need to add margins and paddings to set the overlay exactly above our image - var pl = parseOffset(element, 'paddingLeft'), - pr = parseOffset(element, 'paddingRight'), - pt = parseOffset(element, 'paddingTop'), - pb = parseOffset(element, 'paddingBottom'), - ml = parseOffset(element, 'marginLeft'), - mr = parseOffset(element, 'marginRight'), - mt = parseOffset(element, 'marginTop'), - mb = parseOffset(element, 'marginBottom'); + var pl = parseOffset(element, 'paddingLeft'); + var pr = parseOffset(element, 'paddingRight'); + var pt = parseOffset(element, 'paddingTop'); + var pb = parseOffset(element, 'paddingBottom'); + var ml = parseOffset(element, 'marginLeft'); + var mr = parseOffset(element, 'marginRight'); + var mt = parseOffset(element, 'marginTop'); + var mb = parseOffset(element, 'marginBottom'); if (pluginOptions.direction === 'lr') { // Left to right animation @@ -275,33 +299,39 @@ // Resize event var resizeFunction = function () { - var data = getProperties(element.id), elementIndex = getIndex(element.id); + var data = getProperties(element.id) + var elementIndex = getIndex(element.id); if (data !== null) { - var overlay = document.getElementById(data.overlay), gbc = element.getBoundingClientRect(); + var overlay = document.getElementById(data.overlay); + var gbc = element.getBoundingClientRect(); if (overlay) { // Overlay width - if (gbc.width) + if (gbc.width) { overlay.style.width = gbc.width + 'px'; // for modern browsers - else + } + else { overlay.style.width = element.offsetWidth; // for oldIE + } // Overlay height - if (gbc.height) + if (gbc.height) { overlay.style.height = gbc.height + 'px'; // for modern browsers - else + } + else { overlay.style.height = element.offsetWidth; // for oldIE + } // We need to add margins and paddings to set the overlay exactly above our image - var pl = parseOffset(element, 'paddingLeft'), - pr = parseOffset(element, 'paddingRight'), - pt = parseOffset(element, 'paddingTop'), - pb = parseOffset(element, 'paddingBottom'), - ml = parseOffset(element, 'marginLeft'), - mr = parseOffset(element, 'marginRight'), - mt = parseOffset(element, 'marginTop'), - mb = parseOffset(element, 'marginBottom'); + var pl = parseOffset(element, 'paddingLeft'); + var pr = parseOffset(element, 'paddingRight'); + var pt = parseOffset(element, 'paddingTop'); + var pb = parseOffset(element, 'paddingBottom'); + var ml = parseOffset(element, 'marginLeft'); + var mr = parseOffset(element, 'marginRight'); + var mt = parseOffset(element, 'marginTop'); + var mb = parseOffset(element, 'marginBottom'); if (pluginOptions.direction === 'lr') { // Left to right animation @@ -331,55 +361,66 @@ } }; - if (pluginOptions.resize) + if (pluginOptions.resize) { resizeFunction = pluginOptions.resize; + } - if (window.addEventListener) + if (window.addEventListener) { window.addEventListener('resize', resizeFunction, false); - else + } + else { window.attachEvent('onresize', resizeFunction); + } }; Loadgo.options = function (element, useroptions) { - if (!elementIsValid(element)) + if (!elementIsValid(element)) { return; + } // Store Loadgo properties var domElementsIndex = getIndex(element.id); - if (domElementsIndex === -1) + if (domElementsIndex === -1) { return; + } var currentOptions = domElements[domElementsIndex].properties; // If no param is provided, then is a 'get' - if (JSON.stringify(currentOptions) !== '{}') + if (JSON.stringify(currentOptions) !== '{}') { return currentOptions; + } if (typeof useroptions !== 'undefined') { // Parse to number the 'opacity' option - if (typeof useroptions.opacity !== 'undefined') + if (typeof useroptions.opacity !== 'undefined') { useroptions.opacity = parseFloat(useroptions.opacity); + } } - if (JSON.stringify(currentOptions) === '{}') + if (JSON.stringify(currentOptions) === '{}') { currentOptions = extend(defaultOptions, useroptions); - else + } + else { currentOptions = extend(currentOptions, useroptions); + } // Check for valid direction var validDirections = ['lr', 'rl', 'bt', 'tb']; - if (indexOf(validDirections, currentOptions.direction.toLowerCase()) === -1) + if (indexOf(validDirections, currentOptions.direction.toLowerCase()) === -1) { // Invalid value for "direction" option. Possible values: blur, grayscale, sepia, hue-rotate, invert, opacity. Using default value: "lr". currentOptions.direction = 'lr'; + } // Check for valid filter if (currentOptions.filter) { var validFilters = ['blur', 'grayscale', 'sepia', 'hue-rotate', 'invert', 'opacity']; - if (indexOf(validFilters, currentOptions.filter.toLowerCase()) === -1) + if (indexOf(validFilters, currentOptions.filter.toLowerCase()) === -1) { // Invalid value for "filter" option. Possible values: blur, grayscale, sepia, hue-rotate, invert, opacity. This option will be ignored. currentOptions.filter = null; + } } // Store user options with default options @@ -396,19 +437,29 @@ */ Loadgo.setprogress = function (element, progress) { - if (!elementIsValid(element)) + if (!elementIsValid(element)) { return; + } // LoadGo expects progress number between 0 (0%) and 100 (100%). - if (progress < 0 || progress > 100) + if (progress < 0 || progress > 100) { return; + } + + // Element exists? + var domElementsIndex = getIndex(element.id); + if (domElementsIndex === -1) { + return; + } var data = getProperties(element.id); if (data !== null) { - var _w, _h, overlay = document.getElementById(data.overlay), - w = data.width, - h = data.height; + var _w; + var _h; + var overlay = document.getElementById(data.overlay); + var w = data.width; + var h = data.height; if (overlay) { var direction = data.direction; @@ -430,10 +481,10 @@ overlay.style.height = _h + 'px'; overlay.style.top = (h - _h) + 'px'; } - } else { - var filter = data.filter, p; + var p; + var filter = data.filter; switch (filter) { case 'blur': p = (100 - progress) / 10; @@ -455,7 +506,7 @@ } - domElements[getIndex(element.id)].properties.progress = progress; + domElements[domElementsIndex].properties.progress = progress; }; @@ -464,9 +515,9 @@ * @param {DOM} element DOM element using document.getElementById */ Loadgo.getprogress = function (element) { - - if (!elementIsValid(element)) + if (!elementIsValid(element)) { return; + } var properties = getProperties(element.id); return (properties !== null)? properties.progress : 0; @@ -487,8 +538,9 @@ */ Loadgo.loop = function (element, duration) { - if (!elementIsValid(element)) + if (!elementIsValid(element)) { return; + } if (getIndex(element.id) === -1) { console.error('Trying to loop a non initialized element. You have to run "init" method first.'); @@ -507,7 +559,8 @@ } // Store interval so we can stop it later - var domIndex = getIndex(element.id), toggle = true; + var toggle = true; + var domIndex = getIndex(element.id); domElements[domIndex].properties.interval = setInterval(function(){ if (toggle) { domElements[domIndex].properties.progress += 1; @@ -540,9 +593,9 @@ // Stops the loop interval and shows image Loadgo.stop = function (element) { - - if (!elementIsValid(element)) + if (!elementIsValid(element)) { return; + } if (getIndex(element.id) === -1) { console.error('Trying to stop loop for a non initialized element. You have to run "init" method first.'); @@ -559,23 +612,27 @@ */ Loadgo.destroy = function (element) { var domElementsIndex = getIndex(element.id); - if (domElementsIndex === -1) + if (domElementsIndex === -1) { return; // element was never initialized + } var opt = Loadgo.options(element); domElements.splice(domElementsIndex); element.before(container); - var container = element.parentNode, parent = container.parentNode, overlay = document.getElementById(opt.overlay); - if (overlay) - if (overlay.parentNode) + var container = element.parentNode; + var parent = container.parentNode; + var overlay = document.getElementById(opt.overlay); + if (overlay) { + if (overlay.parentNode) { container.removeChild(opt.overlay) // Removes overlay + } + } if (parent) { parent.appendChild(element); // Moves image to "loadgo-container" parent parent.removeChild(container); // Removes "loadgo-container" element } - }; window.Loadgo = Loadgo; diff --git a/loadgo-nojquery.min.js b/loadgo-nojquery.min.js index 56058de..a8536c6 100644 --- a/loadgo-nojquery.min.js +++ b/loadgo-nojquery.min.js @@ -1,6 +1,6 @@ -/* - LoadGo v2.2 (http://franverona.com/loadgo) - 2017 - Fran Verona - Licensed under MIT (https://github.com/franverona/loadgo/blob/master/LICENSE) -*/ -(function(){var e=function(e,t){for(var i=0,r=e.length;i1)throw new Error("LoadGo only works on one element at a time. Try with a valid #id.");return!0},s=function(e,t){var i=e.style[t];if("auto"===i){if(-1!==t.toLowerCase().indexOf("left")||-1!==t.toLowerCase().indexOf("right"))return parseFloat(e.offsetLeft);if(-1!==t.toLowerCase().indexOf("top")||-1!==t.toLowerCase().indexOf("bottom"))return parseFloat(e.offsetTop)}return-1!==i.indexOf("px")?parseFloat(i):0},n=function(){return(new Date).getTime().toString()},l=[],a={bgcolor:"#FFFFFF",opacity:"0.5",animated:!0,image:null,class:null,resize:null,direction:"lr",filter:null};Loadgo=window.Loadgo||{},Loadgo.init=function(e,a){if(o(e)){var d=r(e.id);-1===d?(l.push({id:e.id,properties:{}}),d=l.length-1):l[d].properties={};var p=Loadgo.options(e,a),f=document.createElement("div");f.id="loadgo-"+n();var g=["loadgo-overlay"];p.class&&g.push(p.class),f.className=g.join(" "),f.style.backgroundColor=p.bgcolor,f.style.opacity=p.opacity;var y=e.getBoundingClientRect();if(y.width?f.style.width=y.width+"px":f.style.width=e.offsetWidth,y.height?f.style.height=y.height+"px":f.style.height=e.offsetWidth,f.style.position="absolute",p.animated&&(f.style.transition="all 0.6s ease",f.style["-webkit-transition"]="all 0.6s ease",f.style["-moz-transition"]="all 0.6s ease",f.style["-ms-transition"]="all 0.6s ease",f.style["-o-transition"]="all 0.6s ease"),p.filter&&("blur"===p.filter?e.style["-webkit-filter"]=p.filter+"(10px)":"hue-rotate"===p.filter?e.style["-webkit-filter"]=p.filter+"(360deg)":"opacity"===p.filter?e.style["-webkit-filter"]=p.filter+"(0)":e.style["-webkit-filter"]=p.filter+"(1)",p.animated&&(e.style.transition="0.6s filter ease",e.style["-webkit-transition"]="0.6s -webkit-filter ease",e.style["-moz-transition"]="0.6s -moz-filter ease",e.style["-ms-transition"]="0.6s -ms-filter ease",e.style["-o-transition"]="0.6s -o-filter ease")),p.image){var c="100% 0%";"rl"===p.direction?c="0% 50%":"bt"===p.direction?c="100% 0%":"tb"===p.direction&&(c="0% 100%"),f.style["background-image"]='url("'+p.image+'")',f.style["background-repeat"]="no-repeat",f.style["background-size"]="cover",f.style["background-color"]="transparent",f.style["background-position"]=c}var h={progress:0};if(null===p.filter){var u=document.createElement("div");u.className="loadgo-container",u.style.position="relative",e.before(u),u.appendChild(e),u.appendChild(f);var v=s(e,"paddingLeft"),m=s(e,"paddingRight"),w=s(e,"paddingTop"),b=s(e,"paddingBottom"),L=s(e,"marginLeft"),x=s(e,"marginRight"),z=s(e,"marginTop"),k=s(e,"marginBottom");"lr"===p.direction?(f.style.right=m+x+"px",f.style.top=w+z+"px"):"rl"===p.direction?(f.style.left=v+L+"px",f.style.top=w+z+"px"):"bt"===p.direction?(f.style.top=w+z+"px",f.style.left=v+L+"px"):"tb"===p.direction&&(f.style.bottom=b+k+"px",f.style.left=v+L+"px"),h.overlay=f.id,h.width=f.clientWidth,h.height=f.clientHeight}l[d].properties=t(p,h);var N=function(){var t=i(e.id),o=r(e.id);if(null!==t){var n=document.getElementById(t.overlay),a=e.getBoundingClientRect();if(n){a.width?n.style.width=a.width+"px":n.style.width=e.offsetWidth,a.height?n.style.height=a.height+"px":n.style.height=e.offsetWidth;var d=s(e,"paddingLeft"),f=s(e,"paddingRight"),g=s(e,"paddingTop"),y=s(e,"paddingBottom"),c=s(e,"marginLeft"),h=s(e,"marginRight"),u=s(e,"marginTop"),v=s(e,"marginBottom");"lr"===p.direction?(n.style.right=f+h+"px",n.style.top=g+u+"px"):"rl"===p.direction?(n.style.left=d+c+"px",n.style.top=g+u+"px"):"bt"===p.direction?(n.style.top=g+u+"px",n.style.left=d+c+"px"):"tb"===p.direction&&(n.style.bottom=y+v+"px",n.style.left=d+c+"px"),l[o].properties.width=parseFloat(n.style.width),l[o].properties.height=parseFloat(n.style.height),Loadgo.setprogress(e,t.progress)}}};p.resize&&(N=p.resize),window.addEventListener?window.addEventListener("resize",N,!1):window.attachEvent("onresize",N)}},Loadgo.options=function(i,s){if(o(i)){var n=r(i.id);if(-1!==n){var d=l[n].properties;return"{}"!==JSON.stringify(d)?d:(void 0!==s&&void 0!==s.opacity&&(s.opacity=parseFloat(s.opacity)),d="{}"===JSON.stringify(d)?t(a,s):t(d,s),-1===e(["lr","rl","bt","tb"],d.direction.toLowerCase())&&(d.direction="lr"),d.filter&&-1===e(["blur","grayscale","sepia","hue-rotate","invert","opacity"],d.filter.toLowerCase())&&(d.filter=null),l[n].properties=d,d)}}},Loadgo.setprogress=function(e,t){if(o(e)&&!(t<0||t>100)){var s=i(e.id);if(null!==s){var n,a,d=document.getElementById(s.overlay),p=s.width,f=s.height;if(d){var g=s.direction;"lr"===g?(n=p*(1-t/100),d.style.width=n+"px"):"rl"===g?(n=p*(1-t/100),d.style.width=n+"px"):"bt"===g?(a=f*(1-t/100),d.style.height=a+"px"):"tb"===g&&(a=f*(1-t/100),d.style.height=a+"px",d.style.top=f-a+"px")}else{var y;switch(s.filter){case"blur":y=(100-t)/10,e.style["-webkit-filter"]=s.filter+"("+y+"px)";break;case"hue-rotate":y=360*t/100,e.style["-webkit-filter"]=s.filter+"("+y+"deg)";break;case"opacity":y=t/100,e.style["-webkit-filter"]=s.filter+"("+y+")";break;default:y=1-t/100,e.style["-webkit-filter"]=s.filter+"("+y+")"}}}l[r(e.id)].properties.progress=t}},Loadgo.getprogress=function(e){if(o(e)){var t=i(e.id);return null!==t?t.progress:0}},Loadgo.resetprogress=function(e){Loadgo.setprogress(e,0)},Loadgo.loop=function(e,t){if(o(e))if(-1!==r(e.id)){var s=i(e.id);if(null!==s)if(s.interval)console.warn("LoadGo requires you to stop the current loop before modifying it.");else{var n=r(e.id),a=!0;l[n].properties.interval=setInterval(function(){a?(l[n].properties.progress+=1,l[n].properties.progress>=100&&(a=!1)):(l[n].properties.progress-=1,l[n].properties.progress<=0&&(a=!0));var t=document.getElementById(l[n].properties.overlay);t&&(t.style.transition="none",t.style["-webkit-transition"]="none",t.style["-moz-transition"]="none",t.style["-ms-transition"]="none",t.style["-o-transition"]="none"),Loadgo.setprogress(e,l[n].properties.progress)},t)}else console.warn("Element do not have Loadgo properties. Maybe it is uninitialized.")}else console.error('Trying to loop a non initialized element. You have to run "init" method first.')},Loadgo.stop=function(e){o(e)&&(-1!==r(e.id)?(clearInterval(l[r(e.id)].properties.interval),Loadgo.setprogress(e,100)):console.error('Trying to stop loop for a non initialized element. You have to run "init" method first.'))},Loadgo.destroy=function(e){var t=r(e.id);if(-1!==t){var i=Loadgo.options(e);l.splice(t),e.before(o);var o=e.parentNode,s=o.parentNode,n=document.getElementById(i.overlay);n&&n.parentNode&&o.removeChild(i.overlay),s&&(s.appendChild(e),s.removeChild(o))}},window.Loadgo=Loadgo}).call(this); \ No newline at end of file +/** + * @preserve LoadGo v2.2.1 (http://franverona.com/loadgo) + * 2018 - Fran Verona + * Licensed under MIT (https://github.com/franverona/loadgo/blob/master/LICENSE) + */ +(function(){var e=function(e,t){for(var i=0,r=e.length;i1)throw new Error("LoadGo only works on one element at a time. Try with a valid #id.");return!0},s=function(e,t){var i=e.style[t];if("auto"===i){if(-1!==t.toLowerCase().indexOf("left")||-1!==t.toLowerCase().indexOf("right"))return parseFloat(e.offsetLeft);if(-1!==t.toLowerCase().indexOf("top")||-1!==t.toLowerCase().indexOf("bottom"))return parseFloat(e.offsetTop)}return-1!==i.indexOf("px")?parseFloat(i):0},n=[],l={bgcolor:"#FFFFFF",opacity:"0.5",animated:!0,image:null,class:null,resize:null,direction:"lr",filter:null};Loadgo=window.Loadgo||{},Loadgo.init=function(e,l){if(o(e)){var a=r(e.id);-1===a?(n.push({id:e.id,properties:{}}),a=n.length-1):n[a].properties={};var d=Loadgo.options(e,l),p=document.createElement("div");p.id="loadgo-"+(new Date).getTime().toString();var f=["loadgo-overlay"];d.class&&f.push(d.class),p.className=f.join(" "),p.style.backgroundColor=d.bgcolor,p.style.opacity=d.opacity;var g=e.getBoundingClientRect();if(g.width?p.style.width=g.width+"px":p.style.width=e.offsetWidth,g.height?p.style.height=g.height+"px":p.style.height=e.offsetWidth,p.style.position="absolute",d.animated&&(p.style.transition="all 0.6s ease",p.style["-webkit-transition"]="all 0.6s ease",p.style["-moz-transition"]="all 0.6s ease",p.style["-ms-transition"]="all 0.6s ease",p.style["-o-transition"]="all 0.6s ease"),d.filter&&("blur"===d.filter?e.style["-webkit-filter"]=d.filter+"(10px)":"hue-rotate"===d.filter?e.style["-webkit-filter"]=d.filter+"(360deg)":"opacity"===d.filter?e.style["-webkit-filter"]=d.filter+"(0)":e.style["-webkit-filter"]=d.filter+"(1)",d.animated&&(e.style.transition="0.6s filter ease",e.style["-webkit-transition"]="0.6s -webkit-filter ease",e.style["-moz-transition"]="0.6s -moz-filter ease",e.style["-ms-transition"]="0.6s -ms-filter ease",e.style["-o-transition"]="0.6s -o-filter ease")),d.image){var y="100% 0%";"rl"===d.direction?y="0% 50%":"bt"===d.direction?y="100% 0%":"tb"===d.direction&&(y="0% 100%"),p.style["background-image"]='url("'+d.image+'")',p.style["background-repeat"]="no-repeat",p.style["background-size"]="cover",p.style["background-color"]="transparent",p.style["background-position"]=y}var c={progress:0};if(null===d.filter){var h=document.createElement("div");h.className="loadgo-container",h.style.position="relative",e.before(h),h.appendChild(e),h.appendChild(p);var u=s(e,"paddingLeft"),v=s(e,"paddingRight"),m=s(e,"paddingTop"),w=s(e,"paddingBottom"),b=s(e,"marginLeft"),L=s(e,"marginRight"),x=s(e,"marginTop"),z=s(e,"marginBottom");"lr"===d.direction?(p.style.right=v+L+"px",p.style.top=m+x+"px"):"rl"===d.direction?(p.style.left=u+b+"px",p.style.top=m+x+"px"):"bt"===d.direction?(p.style.top=m+x+"px",p.style.left=u+b+"px"):"tb"===d.direction&&(p.style.bottom=w+z+"px",p.style.left=u+b+"px"),c.overlay=p.id,c.width=p.clientWidth,c.height=p.clientHeight}n[a].properties=t(d,c);var k=function(){var t=i(e.id),o=r(e.id);if(null!==t){var l=document.getElementById(t.overlay),a=e.getBoundingClientRect();if(l){a.width?l.style.width=a.width+"px":l.style.width=e.offsetWidth,a.height?l.style.height=a.height+"px":l.style.height=e.offsetWidth;var p=s(e,"paddingLeft"),f=s(e,"paddingRight"),g=s(e,"paddingTop"),y=s(e,"paddingBottom"),c=s(e,"marginLeft"),h=s(e,"marginRight"),u=s(e,"marginTop"),v=s(e,"marginBottom");"lr"===d.direction?(l.style.right=f+h+"px",l.style.top=g+u+"px"):"rl"===d.direction?(l.style.left=p+c+"px",l.style.top=g+u+"px"):"bt"===d.direction?(l.style.top=g+u+"px",l.style.left=p+c+"px"):"tb"===d.direction&&(l.style.bottom=y+v+"px",l.style.left=p+c+"px"),n[o].properties.width=parseFloat(l.style.width),n[o].properties.height=parseFloat(l.style.height),Loadgo.setprogress(e,t.progress)}}};d.resize&&(k=d.resize),window.addEventListener?window.addEventListener("resize",k,!1):window.attachEvent("onresize",k)}},Loadgo.options=function(i,s){if(o(i)){var a=r(i.id);if(-1!==a){var d=n[a].properties;if("{}"!==JSON.stringify(d))return d;void 0!==s&&void 0!==s.opacity&&(s.opacity=parseFloat(s.opacity)),d="{}"===JSON.stringify(d)?t(l,s):t(d,s);if(-1===e(["lr","rl","bt","tb"],d.direction.toLowerCase())&&(d.direction="lr"),d.filter){-1===e(["blur","grayscale","sepia","hue-rotate","invert","opacity"],d.filter.toLowerCase())&&(d.filter=null)}return n[a].properties=d,d}}},Loadgo.setprogress=function(e,t){if(o(e)&&!(t<0||t>100)){var s=r(e.id);if(-1!==s){var l=i(e.id);if(null!==l){var a,d,p=document.getElementById(l.overlay),f=l.width,g=l.height;if(p){var y=l.direction;"lr"===y?(a=f*(1-t/100),p.style.width=a+"px"):"rl"===y?(a=f*(1-t/100),p.style.width=a+"px"):"bt"===y?(d=g*(1-t/100),p.style.height=d+"px"):"tb"===y&&(d=g*(1-t/100),p.style.height=d+"px",p.style.top=g-d+"px")}else{var c;switch(l.filter){case"blur":c=(100-t)/10,e.style["-webkit-filter"]=l.filter+"("+c+"px)";break;case"hue-rotate":c=360*t/100,e.style["-webkit-filter"]=l.filter+"("+c+"deg)";break;case"opacity":c=t/100,e.style["-webkit-filter"]=l.filter+"("+c+")";break;default:c=1-t/100,e.style["-webkit-filter"]=l.filter+"("+c+")"}}}n[s].properties.progress=t}}},Loadgo.getprogress=function(e){if(o(e)){var t=i(e.id);return null!==t?t.progress:0}},Loadgo.resetprogress=function(e){Loadgo.setprogress(e,0)},Loadgo.loop=function(e,t){if(o(e))if(-1!==r(e.id)){var s=i(e.id);if(null!==s)if(s.interval)console.warn("LoadGo requires you to stop the current loop before modifying it.");else{var l=!0,a=r(e.id);n[a].properties.interval=setInterval(function(){l?(n[a].properties.progress+=1,n[a].properties.progress>=100&&(l=!1)):(n[a].properties.progress-=1,n[a].properties.progress<=0&&(l=!0));var t=document.getElementById(n[a].properties.overlay);t&&(t.style.transition="none",t.style["-webkit-transition"]="none",t.style["-moz-transition"]="none",t.style["-ms-transition"]="none",t.style["-o-transition"]="none"),Loadgo.setprogress(e,n[a].properties.progress)},t)}else console.warn("Element do not have Loadgo properties. Maybe it is uninitialized.")}else console.error('Trying to loop a non initialized element. You have to run "init" method first.')},Loadgo.stop=function(e){o(e)&&(-1!==r(e.id)?(clearInterval(n[r(e.id)].properties.interval),Loadgo.setprogress(e,100)):console.error('Trying to stop loop for a non initialized element. You have to run "init" method first.'))},Loadgo.destroy=function(e){var t=r(e.id);if(-1!==t){var i=Loadgo.options(e);n.splice(t),e.before(o);var o=e.parentNode,s=o.parentNode,l=document.getElementById(i.overlay);l&&l.parentNode&&o.removeChild(i.overlay),s&&(s.appendChild(e),s.removeChild(o))}},window.Loadgo=Loadgo}).call(this); \ No newline at end of file diff --git a/loadgo.js b/loadgo.js index 123b015..9eec438 100644 --- a/loadgo.js +++ b/loadgo.js @@ -1,35 +1,38 @@ /** - * @preserve LoadGo v2.2 (http://franverona.com/loadgo) - * 2017 - Fran Verona + * @preserve LoadGo v2.2.1 (http://franverona.com/loadgo) + * 2018 - Fran Verona * Licensed under MIT (https://github.com/franverona/loadgo/blob/master/LICENSE) */ if (typeof jQuery === 'undefined') - throw new Error('LoadGo requires jQuery. Make sure you are loading jQuery before LoadGo, or try pure Javascript version if needed.'); + throw new Error('LoadGo requires jQuery. Make sure you are loading jQuery before LoadGo, or try pure Javascript version instead.'); -(function ( $ ) { +(function($) { var methods = { - init: function (useroptions) { + init: function(useroptions) { var $this = $(this); - if ($this.length === 0) + if ($this.length === 0) { return; + } - if (!$this.is('img')) + if (!$this.is('img')) { throw new Error('LoadGo only works on img elements.'); + } - if ($this.length > 1) + if ($this.length > 1) { throw new Error('LoadGo only works on one element at a time. Try with a valid #id.'); + } // Plugin options. We need to reset options to avoid future errors $this.data('loadgo-options', {}); var pluginOptions = $this.loadgo('options', useroptions); - var _w = $this[0].getBoundingClientRect().width, - _h = $this[0].getBoundingClientRect().height; + var _w = $this[0].getBoundingClientRect().width; + var _h = $this[0].getBoundingClientRect().height; var overlayTemplate = '
'; @@ -42,61 +45,67 @@ if (typeof jQuery === 'undefined') $overlay = $(overlayWithOptions); - if (pluginOptions.animated) + if (pluginOptions.animated) { + var overlayCSS = 'width 0.6s ease, height 0.6s ease, top 0.6s ease'; $overlay.css({ - 'transition': 'width 0.6s ease, height 0.6s ease, top 0.6s ease', - '-webkit-transition': 'width 0.6s ease, height 0.6s ease, top 0.6s ease', - '-moz-transition': 'width 0.6s ease, height 0.6s ease, top 0.6s ease', - '-ms-transition': 'width 0.6s ease, height 0.6s ease, top 0.6s ease', - '-o-transition': 'width 0.6s ease, height 0.6s ease, top 0.6s ease', + 'transition': overlayCSS, + '-webkit-transition': overlayCSS, + '-moz-transition': overlayCSS, + '-ms-transition': overlayCSS, + '-o-transition': overlayCSS, }); + } - if (pluginOptions['class']) + if (pluginOptions['class']) { $overlay.addClass(pluginOptions['class']); + } if (pluginOptions.filter) { - if (pluginOptions.filter === 'blur') + if (pluginOptions.filter === 'blur') { $this.css({ - '-webkit-filter': pluginOptions.filter + '(10px)' + '-webkit-filter': pluginOptions.filter + '(10px)' }); - else if (pluginOptions.filter === 'hue-rotate') + } else if (pluginOptions.filter === 'hue-rotate') { $this.css({ - '-webkit-filter': pluginOptions.filter + '(360deg)' + '-webkit-filter': pluginOptions.filter + '(360deg)' }); - else if (pluginOptions.filter === 'opacity') + } else if (pluginOptions.filter === 'opacity') { $this.css({ - '-webkit-filter': pluginOptions.filter + '(0)' + '-webkit-filter': pluginOptions.filter + '(0)' }); - else + } else { $this.css({ - '-webkit-filter': pluginOptions.filter + '(1)' + '-webkit-filter': pluginOptions.filter + '(1)' }); + } - if (pluginOptions.animated) + if (pluginOptions.animated) { $this.css({ - 'transition': '0.6s filter ease', - '-webkit-transition': '0.6s -webkit-filter ease', - '-moz-transition': '0.6s -moz-filter ease', - '-ms-transition': '0.6s -ms-filter ease', - '-o-transition': '0.6s -o-filter ease', + 'transition': '0.6s filter ease', + '-webkit-transition': '0.6s -webkit-filter ease', + '-moz-transition': '0.6s -moz-filter ease', + '-ms-transition': '0.6s -ms-filter ease', + '-o-transition': '0.6s -o-filter ease', }); + } } if (pluginOptions.image) { var bgposition = '100% 0%'; // Left to right animation by default - if (pluginOptions.direction === 'rl') + if (pluginOptions.direction === 'rl') { bgposition = '0% 50%'; // Right to left animation - else if (pluginOptions.direction === 'bt') + } else if (pluginOptions.direction === 'bt') { bgposition = '100% 0%'; // Bottom to top animation - else if (pluginOptions.direction === 'tb') + } else if (pluginOptions.direction === 'tb') { bgposition = '0% 100%'; // Top to bottom animation + } $overlay.css({ - 'background-image': 'url("' + pluginOptions.image + '")', - 'background-repeat': 'no-repeat', - 'background-size': 'cover', - 'background-color': 'none', - 'background-position': bgposition + 'background-image': 'url("' + pluginOptions.image + '")', + 'background-repeat': 'no-repeat', + 'background-size': 'cover', + 'background-color': 'none', + 'background-position': bgposition }); } @@ -114,14 +123,14 @@ if (typeof jQuery === 'undefined') $this.parent().prepend($overlay); // We need to add margins and paddings to set the overlay exactly above our image - var pl = parseFloat($this.css('padding-left')), - pr = parseFloat($this.css('padding-right')), - pt = parseFloat($this.css('padding-top')), - pb = parseFloat($this.css('padding-bottom')), - ml = parseFloat($this.css('margin-left')), - mr = parseFloat($this.css('margin-right')), - mt = parseFloat($this.css('margin-top')), - mb = parseFloat($this.css('margin-bottom')); + var pl = parseFloat($this.css('padding-left')); + var pr = parseFloat($this.css('padding-right')); + var pt = parseFloat($this.css('padding-top')); + var pb = parseFloat($this.css('padding-bottom')); + var ml = parseFloat($this.css('margin-left')); + var mr = parseFloat($this.css('margin-right')); + var mt = parseFloat($this.css('margin-top')); + var mb = parseFloat($this.css('margin-bottom')); if (pluginOptions.direction === 'lr') { // Left to right animation @@ -146,39 +155,46 @@ if (typeof jQuery === 'undefined') $this.data('loadgo', pluginData); // Resize event - if (pluginOptions.resize) + if (pluginOptions.resize) { $(window).on('resize', pluginOptions.resize); + } else { var _this = this; $(window).on('resize', function() { - var $element = $this, data = $element.data('loadgo'), options = $element.data('loadgo-options'); + var $element = $this; + var data = $element.data('loadgo'); + var options = $element.data('loadgo-options'); - if (typeof data === 'undefined') + if (typeof data === 'undefined') { return; + } + + var $overlay = data.overlay; + var progress = data.progress; + var $width = $element.width(); + var $height = $element.height(); - var $overlay = data.overlay, progress = data.progress, - $width = $element.width(), $height = $element.height(), - storedData = { - progress: data.progress, - width: $width, - height: $height - }; + storedData = { + progress: data.progress, + width: $width, + height: $height + }; if ($overlay) { $overlay.css({ - 'width': $width + 'px', - 'height': $height + 'px' + 'width': $width + 'px', + 'height': $height + 'px' }); // We need to add margins and paddings to set the overlay exactly above our image - var pl = parseFloat($element.css('padding-left')), - pr = parseFloat($element.css('padding-right')), - pt = parseFloat($element.css('padding-top')), - pb = parseFloat($element.css('padding-bottom')), - ml = parseFloat($element.css('margin-left')), - mr = parseFloat($element.css('margin-right')), - mt = parseFloat($element.css('margin-top')), - mb = parseFloat($element.css('margin-bottom')); + var pl = parseFloat($element.css('padding-left')); + var pr = parseFloat($element.css('padding-right')); + var pt = parseFloat($element.css('padding-top')); + var pb = parseFloat($element.css('padding-bottom')); + var ml = parseFloat($element.css('margin-left')); + var mr = parseFloat($element.css('margin-right')); + var mt = parseFloat($element.css('margin-top')); + var mb = parseFloat($element.css('margin-bottom')); if (pluginOptions.direction === 'lr') { // Left to right animation @@ -207,41 +223,46 @@ if (typeof jQuery === 'undefined') options: function (useroptions) { - var $this = $(this), - currentOptions = $this.data('loadgo-options'), - options = typeof useroptions !== 'undefined' ? useroptions : {}, - defaults = { - bgcolor: '#FFFFFF', // Overlay color - opacity: 0.5, // Overlay opacity - animated: true, // Overlay smooth animation when setting progress - image: null, // Overlay image - class: null, // Overlay CSS class - resize: null, // Resize functions (optional) - direction: 'lr', // Direction animation (optional) - filter: null // Image filter (optional) - }; + var $this = $(this); + var currentOptions = $this.data('loadgo-options'); + var options = typeof useroptions !== 'undefined' ? useroptions : {}; + var defaults = { + bgcolor: '#FFFFFF', // Overlay color + opacity: 0.5, // Overlay opacity + animated: true, // Overlay smooth animation when setting progress + image: null, // Overlay image + class: null, // Overlay CSS class + resize: null, // Resize functions (optional) + direction: 'lr', // Direction animation (optional) + filter: null // Image filter (optional) + }; // Parse to number the 'opacity' option - if (typeof options.opacity !== 'undefined') + if (typeof options.opacity !== 'undefined') { options.opacity = parseFloat(options.opacity); + } - if (JSON.stringify(currentOptions) === '{}') + if (JSON.stringify(currentOptions) === '{}') { currentOptions = $.extend({}, defaults, options); - else + } + else { currentOptions = $.extend({}, currentOptions, options); + } // Check for valid direction var validDirections = ['lr', 'rl', 'bt', 'tb']; - if ($.inArray(currentOptions.direction.toLowerCase(), validDirections) === -1) + if ($.inArray(currentOptions.direction.toLowerCase(), validDirections) === -1) { // Invalid value for "direction" option. Possible values: blur, grayscale, sepia, hue-rotate, invert, opacity. Using default value: "lr". currentOptions.direction = 'lr'; + } // Check for valid filter if (currentOptions.filter) { var validFilters = ['blur', 'grayscale', 'sepia', 'hue-rotate', 'invert', 'opacity']; - if ($.inArray(currentOptions.filter.toLowerCase(), validFilters) === -1) + if ($.inArray(currentOptions.filter.toLowerCase(), validFilters) === -1) { // Invalid value for "filter" option. Possible values: blur, grayscale, sepia, hue-rotate, invert, opacity. This option will be ignored. currentOptions.filter = null; + } } // Store user options with default options @@ -258,11 +279,17 @@ if (typeof jQuery === 'undefined') setprogress: function (progress) { // LoadGo expects progress number between 0 (0%) and 100 (100%). - if (progress < 0 || progress > 100) + if (progress < 0 || progress > 100) { return; + } - var storedData = { progress: progress }, data = $(this).data('loadgo'), pluginOptions = $(this).loadgo('options'), - $overlay = data.overlay, $width = data.width, $height = data.height, direction = pluginOptions.direction; + var storedData = { progress: progress }; + var data = $(this).data('loadgo'); + var pluginOptions = $(this).loadgo('options'); + var $overlay = data.overlay; + var $width = data.width; + var $height = data.height; + var direction = pluginOptions.direction; if ($overlay) { var overlayWidth, overlayHeight; @@ -292,25 +319,25 @@ if (typeof jQuery === 'undefined') case 'blur': p = (100 - progress) / 10; jQuery(this).css({ - '-webkit-filter': $filter + '(' + p + 'px)' + '-webkit-filter': $filter + '(' + p + 'px)' }); break; case 'hue-rotate': p = progress * 360 / 100; jQuery(this).css({ - '-webkit-filter': $filter + '(' + p + 'deg)' + '-webkit-filter': $filter + '(' + p + 'deg)' }); break; case 'opacity': p = progress / 100; jQuery(this).css({ - '-webkit-filter': $filter + '(' + p + ')' + '-webkit-filter': $filter + '(' + p + ')' }); break; default: p = 1 - progress / 100; $(this).css({ - '-webkit-filter': $filter + '(' + p + ')' + '-webkit-filter': $filter + '(' + p + ')' }); } } @@ -321,8 +348,9 @@ if (typeof jQuery === 'undefined') getprogress: function () { var data = $(this).data('loadgo'); - if (typeof data === 'undefined') + if (typeof data === 'undefined') { return 0; + } return typeof data.progress !== 'undefined' ? data.progress : 0; }, @@ -333,34 +361,40 @@ if (typeof jQuery === 'undefined') // Overlay loops back and forth loop: function (duration) { - var data = $(this).data('loadgo'), toggle = true, image = this; - + var data = $(this).data('loadgo'); + // LoadGo requires you to stop the current loop before modifying it. - if (data.interval) + if (data.interval) { return false; + } + + var toggle = true; + var image = this; // Store interval so we can stop it later data.interval = setInterval(function () { if (toggle) { data.progress += 1; - if (data.progress >= 100) + if (data.progress >= 100) { toggle = false; + } } else { data.progress -= 1; - if (data.progress <= 0) + if (data.progress <= 0) { toggle = true; + } } // Remove transition animation // Can be replaced with animated: false in the initializer data.overlay.css({ - 'transition': 'none', - '-webkit-transition': 'none', - '-moz-transition': 'none', - '-ms-transition': 'none', - '-o-transition': 'none', + 'transition': 'none', + '-webkit-transition': 'none', + '-moz-transition': 'none', + '-ms-transition': 'none', + '-o-transition': 'none', }); image.loadgo('setprogress', data.progress); @@ -376,10 +410,12 @@ if (typeof jQuery === 'undefined') // Remove all plugin properties destroy: function () { - var $this = $(this), options = $this.data('loadgo'); + var $this = $(this); + var options = $this.data('loadgo'); - if (typeof options === 'undefined') + if (typeof options === 'undefined') { return; // element was never initialized + } if (options.overlay) { options.overlay.remove(); // Removes overlay @@ -397,8 +433,9 @@ if (typeof jQuery === 'undefined') $.fn.loadgo = function (methodOrOptions) { if (typeof methods[methodOrOptions] === 'undefined') { - if (typeof methodOrOptions === 'object' || typeof methodOrOptions === 'undefined') + if (typeof methodOrOptions === 'object' || typeof methodOrOptions === 'undefined') { return methods.init.apply( this, arguments ); // Init method by default + } throw new Error('Method ' + methodOrOptions + ' does not exist on $.loadgo'); } @@ -407,4 +444,4 @@ if (typeof jQuery === 'undefined') } -}( jQuery )); +}(jQuery)); diff --git a/loadgo.min.js b/loadgo.min.js index 9e31ce2..7e28926 100644 --- a/loadgo.min.js +++ b/loadgo.min.js @@ -1,6 +1,6 @@ -/* - LoadGo v2.2 (http://franverona.com/loadgo) - 2017 - Fran Verona - Licensed under MIT (https://github.com/franverona/loadgo/blob/master/LICENSE) -*/ -if("undefined"==typeof jQuery)throw new Error("LoadGo requires jQuery. Make sure you are loading jQuery before LoadGo, or try pure Javascript version if needed.");!function(e){var t={init:function(t){var o=e(this);if(0!==o.length){if(!o.is("img"))throw new Error("LoadGo only works on img elements.");if(o.length>1)throw new Error("LoadGo only works on one element at a time. Try with a valid #id.");o.data("loadgo-options",{});var i=o.loadgo("options",t),r=o[0].getBoundingClientRect().width,s=o[0].getBoundingClientRect().height,a='
'.replace("%bgcolor%",i.bgcolor).replace("%opacity%",i.opacity).replace("%width%",r).replace("%height%",s);if($overlay=e(a),i.animated&&$overlay.css({transition:"width 0.6s ease, height 0.6s ease, top 0.6s ease","-webkit-transition":"width 0.6s ease, height 0.6s ease, top 0.6s ease","-moz-transition":"width 0.6s ease, height 0.6s ease, top 0.6s ease","-ms-transition":"width 0.6s ease, height 0.6s ease, top 0.6s ease","-o-transition":"width 0.6s ease, height 0.6s ease, top 0.6s ease"}),i.class&&$overlay.addClass(i.class),i.filter&&("blur"===i.filter?o.css({"-webkit-filter":i.filter+"(10px)"}):"hue-rotate"===i.filter?o.css({"-webkit-filter":i.filter+"(360deg)"}):"opacity"===i.filter?o.css({"-webkit-filter":i.filter+"(0)"}):o.css({"-webkit-filter":i.filter+"(1)"}),i.animated&&o.css({transition:"0.6s filter ease","-webkit-transition":"0.6s -webkit-filter ease","-moz-transition":"0.6s -moz-filter ease","-ms-transition":"0.6s -ms-filter ease","-o-transition":"0.6s -o-filter ease"})),i.image){var n="100% 0%";"rl"===i.direction?n="0% 50%":"bt"===i.direction?n="100% 0%":"tb"===i.direction&&(n="0% 100%"),$overlay.css({"background-image":'url("'+i.image+'")',"background-repeat":"no-repeat","background-size":"cover","background-color":"none","background-position":n})}var l={progress:0};if(null===i.filter){o.wrapAll('
'),o.parent().prepend($overlay);var d=parseFloat(o.css("padding-left")),p=parseFloat(o.css("padding-right")),g=parseFloat(o.css("padding-top")),c=parseFloat(o.css("padding-bottom")),h=parseFloat(o.css("margin-left")),f=parseFloat(o.css("margin-right")),v=parseFloat(o.css("margin-top")),y=parseFloat(o.css("margin-bottom"));"lr"===i.direction?$overlay.css("right",p+f+"px"):"rl"===i.direction?$overlay.css("left",d+h+"px"):"bt"===i.direction?$overlay.css("top",g+v+"px"):"tb"===i.direction&&$overlay.css("bottom",c+y+"px"),l.overlay=$overlay,l.width=$overlay.width(),l.height=$overlay.height()}if(o.data("loadgo",l),i.resize)e(window).on("resize",i.resize);else{var u=this;e(window).on("resize",function(){var t=o,r=t.data("loadgo");t.data("loadgo-options");if(void 0!==r){var s=r.overlay,a=r.progress,n=t.width(),l=t.height(),d={progress:r.progress,width:n,height:l};if(s){s.css({width:n+"px",height:l+"px"});var p=parseFloat(t.css("padding-left")),g=parseFloat(t.css("padding-right")),c=parseFloat(t.css("padding-top")),h=parseFloat(t.css("padding-bottom")),f=parseFloat(t.css("margin-left")),v=parseFloat(t.css("margin-right")),y=parseFloat(t.css("margin-top")),b=parseFloat(t.css("margin-bottom"));"lr"===i.direction?s.css("right",g+v+"px"):"rl"===i.direction?s.css("left",p+f+"px"):"bt"===i.direction?s.css("top",c+y+"px"):"tb"===i.direction&&s.css("bottom",h+b+"px"),d.overlay=s}t.data("loadgo",e.extend({},r,d)),u.loadgo("setprogress",a)}})}}},options:function(t){var o=e(this),i=o.data("loadgo-options"),r=void 0!==t?t:{},s={bgcolor:"#FFFFFF",opacity:.5,animated:!0,image:null,class:null,resize:null,direction:"lr",filter:null};void 0!==r.opacity&&(r.opacity=parseFloat(r.opacity)),i="{}"===JSON.stringify(i)?e.extend({},s,r):e.extend({},i,r);var a=["lr","rl","bt","tb"];if(-1===e.inArray(i.direction.toLowerCase(),a)&&(i.direction="lr"),i.filter){var n=["blur","grayscale","sepia","hue-rotate","invert","opacity"];-1===e.inArray(i.filter.toLowerCase(),n)&&(i.filter=null)}return o.data("loadgo-options",i),i},setprogress:function(t){if(!(t<0||t>100)){var o={progress:t},i=e(this).data("loadgo"),r=e(this).loadgo("options"),s=i.overlay,a=i.width,n=i.height,l=r.direction;if(s){var d,p;"lr"===l?(d=a*(1-t/100),s[0].style.width=d+"px"):"rl"===l?(d=a*(1-t/100),s[0].style.width=d+"px"):"bt"===l?(p=n*(1-t/100),s[0].style.height=p+"px"):"tb"===l&&(p=n*(1-t/100),s[0].style.height=p+"px"),o.overlay=s}else{var g,c=r.filter;switch(c){case"blur":g=(100-t)/10,jQuery(this).css({"-webkit-filter":c+"("+g+"px)"});break;case"hue-rotate":g=360*t/100,jQuery(this).css({"-webkit-filter":c+"("+g+"deg)"});break;case"opacity":g=t/100,jQuery(this).css({"-webkit-filter":c+"("+g+")"});break;default:g=1-t/100,e(this).css({"-webkit-filter":c+"("+g+")"})}}e(this).data("loadgo",e.extend({},i,o))}},getprogress:function(){var t=e(this).data("loadgo");return void 0===t?0:void 0!==t.progress?t.progress:0},resetprogress:function(){e(this).loadgo("setprogress",0)},loop:function(t){var o=e(this).data("loadgo"),i=!0,r=this;if(o.interval)return!1;o.interval=setInterval(function(){i?(o.progress+=1,o.progress>=100&&(i=!1)):(o.progress-=1,o.progress<=0&&(i=!0)),o.overlay.css({transition:"none","-webkit-transition":"none","-moz-transition":"none","-ms-transition":"none","-o-transition":"none"}),r.loadgo("setprogress",o.progress)},t)},stop:function(){var t=e(this).data("loadgo");t.interval=clearInterval(t.interval),this.loadgo("setprogress",100)},destroy:function(){var t=e(this),o=t.data("loadgo");void 0!==o&&(o.overlay&&(o.overlay.remove(),t.insertBefore(t.parent()),t.siblings(".loadgo-container").remove()),e.removeData(t,"loadgo"),e.removeData(t,"loadgo-options"))}};e.fn.loadgo=function(e){if(void 0===t[e]){if("object"==typeof e||void 0===e)return t.init.apply(this,arguments);throw new Error("Method "+e+" does not exist on $.loadgo")}return t[e].apply(this,Array.prototype.slice.call(arguments,1))}}(jQuery); \ No newline at end of file +/** + * @preserve LoadGo v2.2.1 (http://franverona.com/loadgo) + * 2018 - Fran Verona + * Licensed under MIT (https://github.com/franverona/loadgo/blob/master/LICENSE) + */ +if("undefined"==typeof jQuery)throw new Error("LoadGo requires jQuery. Make sure you are loading jQuery before LoadGo, or try pure Javascript version instead.");!function($){var t={init:function(t){var e=$(this);if(0!==e.length){if(!e.is("img"))throw new Error("LoadGo only works on img elements.");if(e.length>1)throw new Error("LoadGo only works on one element at a time. Try with a valid #id.");e.data("loadgo-options",{});var o=e.loadgo("options",t),r=e[0].getBoundingClientRect().width,i=e[0].getBoundingClientRect().height,a='
'.replace("%bgcolor%",o.bgcolor).replace("%opacity%",o.opacity).replace("%width%",r).replace("%height%",i);if($overlay=$(a),o.animated){var s="width 0.6s ease, height 0.6s ease, top 0.6s ease";$overlay.css({transition:s,"-webkit-transition":s,"-moz-transition":s,"-ms-transition":s,"-o-transition":s})}if(o.class&&$overlay.addClass(o.class),o.filter&&("blur"===o.filter?e.css({"-webkit-filter":o.filter+"(10px)"}):"hue-rotate"===o.filter?e.css({"-webkit-filter":o.filter+"(360deg)"}):"opacity"===o.filter?e.css({"-webkit-filter":o.filter+"(0)"}):e.css({"-webkit-filter":o.filter+"(1)"}),o.animated&&e.css({transition:"0.6s filter ease","-webkit-transition":"0.6s -webkit-filter ease","-moz-transition":"0.6s -moz-filter ease","-ms-transition":"0.6s -ms-filter ease","-o-transition":"0.6s -o-filter ease"})),o.image){var n="100% 0%";"rl"===o.direction?n="0% 50%":"bt"===o.direction?n="100% 0%":"tb"===o.direction&&(n="0% 100%"),$overlay.css({"background-image":'url("'+o.image+'")',"background-repeat":"no-repeat","background-size":"cover","background-color":"none","background-position":n})}var l={progress:0};if(null===o.filter){e.wrapAll('
'),e.parent().prepend($overlay);var d=parseFloat(e.css("padding-left")),p=parseFloat(e.css("padding-right")),c=parseFloat(e.css("padding-top")),g=parseFloat(e.css("padding-bottom")),h=parseFloat(e.css("margin-left")),f=parseFloat(e.css("margin-right")),v=parseFloat(e.css("margin-top")),y=parseFloat(e.css("margin-bottom"));"lr"===o.direction?$overlay.css("right",p+f+"px"):"rl"===o.direction?$overlay.css("left",d+h+"px"):"bt"===o.direction?$overlay.css("top",c+v+"px"):"tb"===o.direction&&$overlay.css("bottom",g+y+"px"),l.overlay=$overlay,l.width=$overlay.width(),l.height=$overlay.height()}if(e.data("loadgo",l),o.resize)$(window).on("resize",o.resize);else{var u=this;$(window).on("resize",function(){var t=e,r=t.data("loadgo");t.data("loadgo-options");if(void 0!==r){var i=r.overlay,a=r.progress,s=t.width(),n=t.height();if(storedData={progress:r.progress,width:s,height:n},i){i.css({width:s+"px",height:n+"px"});var l=parseFloat(t.css("padding-left")),d=parseFloat(t.css("padding-right")),p=parseFloat(t.css("padding-top")),c=parseFloat(t.css("padding-bottom")),g=parseFloat(t.css("margin-left")),h=parseFloat(t.css("margin-right")),f=parseFloat(t.css("margin-top")),v=parseFloat(t.css("margin-bottom"));"lr"===o.direction?i.css("right",d+h+"px"):"rl"===o.direction?i.css("left",l+g+"px"):"bt"===o.direction?i.css("top",p+f+"px"):"tb"===o.direction&&i.css("bottom",c+v+"px"),storedData.overlay=i}t.data("loadgo",$.extend({},r,storedData)),u.loadgo("setprogress",a)}})}}},options:function(t){var e=$(this),o=e.data("loadgo-options"),r=void 0!==t?t:{};void 0!==r.opacity&&(r.opacity=parseFloat(r.opacity)),o="{}"===JSON.stringify(o)?$.extend({},{bgcolor:"#FFFFFF",opacity:.5,animated:!0,image:null,class:null,resize:null,direction:"lr",filter:null},r):$.extend({},o,r);if(-1===$.inArray(o.direction.toLowerCase(),["lr","rl","bt","tb"])&&(o.direction="lr"),o.filter){-1===$.inArray(o.filter.toLowerCase(),["blur","grayscale","sepia","hue-rotate","invert","opacity"])&&(o.filter=null)}return e.data("loadgo-options",o),o},setprogress:function(t){if(!(t<0||t>100)){var e={progress:t},o=$(this).data("loadgo"),r=$(this).loadgo("options"),i=o.overlay,a=o.width,s=o.height,n=r.direction;if(i){var l,d;"lr"===n?(l=a*(1-t/100),i[0].style.width=l+"px"):"rl"===n?(l=a*(1-t/100),i[0].style.width=l+"px"):"bt"===n?(d=s*(1-t/100),i[0].style.height=d+"px"):"tb"===n&&(d=s*(1-t/100),i[0].style.height=d+"px"),e.overlay=i}else{var p,c=r.filter;switch(c){case"blur":p=(100-t)/10,jQuery(this).css({"-webkit-filter":c+"("+p+"px)"});break;case"hue-rotate":p=360*t/100,jQuery(this).css({"-webkit-filter":c+"("+p+"deg)"});break;case"opacity":p=t/100,jQuery(this).css({"-webkit-filter":c+"("+p+")"});break;default:p=1-t/100,$(this).css({"-webkit-filter":c+"("+p+")"})}}$(this).data("loadgo",$.extend({},o,e))}},getprogress:function(){var t=$(this).data("loadgo");return void 0===t?0:void 0!==t.progress?t.progress:0},resetprogress:function(){$(this).loadgo("setprogress",0)},loop:function(t){var e=$(this).data("loadgo");if(e.interval)return!1;var o=!0,r=this;e.interval=setInterval(function(){o?(e.progress+=1,e.progress>=100&&(o=!1)):(e.progress-=1,e.progress<=0&&(o=!0)),e.overlay.css({transition:"none","-webkit-transition":"none","-moz-transition":"none","-ms-transition":"none","-o-transition":"none"}),r.loadgo("setprogress",e.progress)},t)},stop:function(){var t=$(this).data("loadgo");t.interval=clearInterval(t.interval),this.loadgo("setprogress",100)},destroy:function(){var t=$(this),e=t.data("loadgo");void 0!==e&&(e.overlay&&(e.overlay.remove(),t.insertBefore(t.parent()),t.siblings(".loadgo-container").remove()),$.removeData(t,"loadgo"),$.removeData(t,"loadgo-options"))}};$.fn.loadgo=function(e){if(void 0===t[e]){if("object"==typeof e||void 0===e)return t.init.apply(this,arguments);throw new Error("Method "+e+" does not exist on $.loadgo")}return t[e].apply(this,Array.prototype.slice.call(arguments,1))}}(jQuery); \ No newline at end of file diff --git a/package-lock.json b/package-lock.json new file mode 100644 index 0000000..7cfc661 --- /dev/null +++ b/package-lock.json @@ -0,0 +1,1042 @@ +{ + "name": "LoadGo", + "version": "2.2.1", + "lockfileVersion": 1, + "requires": true, + "dependencies": { + "abbrev": { + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/abbrev/-/abbrev-1.1.1.tgz", + "integrity": "sha512-nne9/IiQ/hzIhY6pdDnbBtz7DjPTKrY00P/zvPSm5pOFkl6xuGrGnXn/VtTNNfNtAfZ9/1RtehkszU9qcTii0Q==", + "dev": true + }, + "ansi-regex": { + "version": "2.1.1", + "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-2.1.1.tgz", + "integrity": "sha1-w7M6te42DYbg5ijwRorn7yfWVN8=", + "dev": true + }, + "ansi-styles": { + "version": "2.2.1", + "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-2.2.1.tgz", + "integrity": "sha1-tDLdM1i2NM914eRmQ2gkBTPB3b4=", + "dev": true + }, + "argparse": { + "version": "1.0.10", + "resolved": "https://registry.npmjs.org/argparse/-/argparse-1.0.10.tgz", + "integrity": "sha512-o5Roy6tNG4SL/FOkCAN6RzjiakZS25RLYFrcMttJqbdd8BWrnA+fGz57iN5Pb06pvBGvl5gQ0B48dJlslXvoTg==", + "dev": true, + "requires": { + "sprintf-js": "1.0.3" + }, + "dependencies": { + "sprintf-js": { + "version": "1.0.3", + "resolved": "https://registry.npmjs.org/sprintf-js/-/sprintf-js-1.0.3.tgz", + "integrity": "sha1-BOaSb2YolTVPPdAVIDYzuFcpfiw=", + "dev": true + } + } + }, + "array-find-index": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/array-find-index/-/array-find-index-1.0.2.tgz", + "integrity": "sha1-3wEKoSh+Fku9pvlyOwqWoexBh6E=", + "dev": true + }, + "async": { + "version": "1.5.2", + "resolved": "https://registry.npmjs.org/async/-/async-1.5.2.tgz", + "integrity": "sha1-7GphrlZIDAw8skHJVhjiCJL5Zyo=", + "dev": true + }, + "balanced-match": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/balanced-match/-/balanced-match-1.0.0.tgz", + "integrity": "sha1-ibTRmasr7kneFk6gK4nORi1xt2c=", + "dev": true + }, + "brace-expansion": { + "version": "1.1.11", + "resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-1.1.11.tgz", + "integrity": "sha512-iCuPHDFgrHX7H2vEI/5xpz07zSHB00TpugqhmYtVmMO6518mCuRMoOYFldEBl0g187ufozdaHgWKcYFb61qGiA==", + "dev": true, + "requires": { + "balanced-match": "1.0.0", + "concat-map": "0.0.1" + } + }, + "browserify-zlib": { + "version": "0.1.4", + "resolved": "https://registry.npmjs.org/browserify-zlib/-/browserify-zlib-0.1.4.tgz", + "integrity": "sha1-uzX4pRn2AOD6a4SFJByXnQFB+y0=", + "dev": true, + "requires": { + "pako": "0.2.9" + } + }, + "buffer-from": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/buffer-from/-/buffer-from-1.0.0.tgz", + "integrity": "sha512-83apNb8KK0Se60UE1+4Ukbe3HbfELJ6UlI4ldtOGs7So4KD26orJM8hIY9lxdzP+UpItH1Yh/Y8GUvNFWFFRxA==", + "dev": true + }, + "builtin-modules": { + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/builtin-modules/-/builtin-modules-1.1.1.tgz", + "integrity": "sha1-Jw8HbFpywC9bZaR9+Uxf46J4iS8=", + "dev": true + }, + "camelcase": { + "version": "2.1.1", + "resolved": "https://registry.npmjs.org/camelcase/-/camelcase-2.1.1.tgz", + "integrity": "sha1-fB0W1nmhu+WcoCys7PsBHiAfWh8=", + "dev": true + }, + "camelcase-keys": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/camelcase-keys/-/camelcase-keys-2.1.0.tgz", + "integrity": "sha1-MIvur/3ygRkFHvodkyITyRuPkuc=", + "dev": true, + "requires": { + "camelcase": "2.1.1", + "map-obj": "1.0.1" + } + }, + "chalk": { + "version": "1.1.3", + "resolved": "https://registry.npmjs.org/chalk/-/chalk-1.1.3.tgz", + "integrity": "sha1-qBFcVeSnAv5NFQq9OHKCKn4J/Jg=", + "dev": true, + "requires": { + "ansi-styles": "2.2.1", + "escape-string-regexp": "1.0.5", + "has-ansi": "2.0.0", + "strip-ansi": "3.0.1", + "supports-color": "2.0.0" + } + }, + "coffee-script": { + "version": "1.10.0", + "resolved": "https://registry.npmjs.org/coffee-script/-/coffee-script-1.10.0.tgz", + "integrity": "sha1-EpOLz5vhlI+gBvkuDEyegXBRCMA=", + "dev": true + }, + "colors": { + "version": "1.1.2", + "resolved": "https://registry.npmjs.org/colors/-/colors-1.1.2.tgz", + "integrity": "sha1-FopHAXVran9RoSzgyXv6KMCE7WM=", + "dev": true + }, + "commander": { + "version": "2.15.1", + "resolved": "https://registry.npmjs.org/commander/-/commander-2.15.1.tgz", + "integrity": "sha512-VlfT9F3V0v+jr4yxPc5gg9s62/fIVWsd2Bk2iD435um1NlGMYdVCq+MjcXnhYq2icNOizHr1kK+5TI6H0Hy0ag==", + "dev": true + }, + "concat-map": { + "version": "0.0.1", + "resolved": "https://registry.npmjs.org/concat-map/-/concat-map-0.0.1.tgz", + "integrity": "sha1-2Klr13/Wjfd5OnMDajug1UBdR3s=", + "dev": true + }, + "concat-stream": { + "version": "1.6.2", + "resolved": "https://registry.npmjs.org/concat-stream/-/concat-stream-1.6.2.tgz", + "integrity": "sha512-27HBghJxjiZtIk3Ycvn/4kbJk/1uZuJFfuPEns6LaEvpvG1f0hTea8lilrouyo9mVc2GWdcEZ8OLoGmSADlrCw==", + "dev": true, + "requires": { + "buffer-from": "1.0.0", + "inherits": "2.0.3", + "readable-stream": "2.3.6", + "typedarray": "0.0.6" + } + }, + "core-util-is": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/core-util-is/-/core-util-is-1.0.2.tgz", + "integrity": "sha1-tf1UIgqivFq1eqtxQMlAdUUDwac=", + "dev": true + }, + "currently-unhandled": { + "version": "0.4.1", + "resolved": "https://registry.npmjs.org/currently-unhandled/-/currently-unhandled-0.4.1.tgz", + "integrity": "sha1-mI3zP+qxke95mmE2nddsF635V+o=", + "dev": true, + "requires": { + "array-find-index": "1.0.2" + } + }, + "dateformat": { + "version": "1.0.12", + "resolved": "https://registry.npmjs.org/dateformat/-/dateformat-1.0.12.tgz", + "integrity": "sha1-nxJLZ1lMk3/3BpMuSmQsyo27/uk=", + "dev": true, + "requires": { + "get-stdin": "4.0.1", + "meow": "3.7.0" + } + }, + "decamelize": { + "version": "1.2.0", + "resolved": "https://registry.npmjs.org/decamelize/-/decamelize-1.2.0.tgz", + "integrity": "sha1-9lNNFRSCabIDUue+4m9QH5oZEpA=", + "dev": true + }, + "error-ex": { + "version": "1.3.1", + "resolved": "https://registry.npmjs.org/error-ex/-/error-ex-1.3.1.tgz", + "integrity": "sha1-+FWobOYa3E6GIcPNoh56dhLDqNw=", + "dev": true, + "requires": { + "is-arrayish": "0.2.1" + } + }, + "escape-string-regexp": { + "version": "1.0.5", + "resolved": "https://registry.npmjs.org/escape-string-regexp/-/escape-string-regexp-1.0.5.tgz", + "integrity": "sha1-G2HAViGQqN/2rjuyzwIAyhMLhtQ=", + "dev": true + }, + "esprima": { + "version": "2.7.3", + "resolved": "https://registry.npmjs.org/esprima/-/esprima-2.7.3.tgz", + "integrity": "sha1-luO3DVd59q1JzQMmc9HDEnZ7pYE=", + "dev": true + }, + "eventemitter2": { + "version": "0.4.14", + "resolved": "https://registry.npmjs.org/eventemitter2/-/eventemitter2-0.4.14.tgz", + "integrity": "sha1-j2G3XN4BKy6esoTUVFWDtWQ7Yas=", + "dev": true + }, + "exit": { + "version": "0.1.2", + "resolved": "https://registry.npmjs.org/exit/-/exit-0.1.2.tgz", + "integrity": "sha1-BjJjj42HfMghB9MKD/8aF8uhzQw=", + "dev": true + }, + "figures": { + "version": "1.7.0", + "resolved": "https://registry.npmjs.org/figures/-/figures-1.7.0.tgz", + "integrity": "sha1-y+Hjr/zxzUS4DK3+0o3Hk6lwHS4=", + "dev": true, + "requires": { + "escape-string-regexp": "1.0.5", + "object-assign": "4.1.1" + } + }, + "find-up": { + "version": "1.1.2", + "resolved": "https://registry.npmjs.org/find-up/-/find-up-1.1.2.tgz", + "integrity": "sha1-ay6YIrGizgpgq2TWEOzK1TyyTQ8=", + "dev": true, + "requires": { + "path-exists": "2.1.0", + "pinkie-promise": "2.0.1" + } + }, + "findup-sync": { + "version": "0.3.0", + "resolved": "https://registry.npmjs.org/findup-sync/-/findup-sync-0.3.0.tgz", + "integrity": "sha1-N5MKpdgWt3fANEXhlmzGeQpMCxY=", + "dev": true, + "requires": { + "glob": "5.0.15" + }, + "dependencies": { + "glob": { + "version": "5.0.15", + "resolved": "https://registry.npmjs.org/glob/-/glob-5.0.15.tgz", + "integrity": "sha1-G8k2ueAvSmA/zCIuz3Yz0wuLk7E=", + "dev": true, + "requires": { + "inflight": "1.0.6", + "inherits": "2.0.3", + "minimatch": "3.0.4", + "once": "1.4.0", + "path-is-absolute": "1.0.1" + } + } + } + }, + "fs.realpath": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/fs.realpath/-/fs.realpath-1.0.0.tgz", + "integrity": "sha1-FQStJSMVjKpA20onh8sBQRmU6k8=", + "dev": true + }, + "get-stdin": { + "version": "4.0.1", + "resolved": "https://registry.npmjs.org/get-stdin/-/get-stdin-4.0.1.tgz", + "integrity": "sha1-uWjGsKBDhDJJAui/Gl3zJXmkUP4=", + "dev": true + }, + "getobject": { + "version": "0.1.0", + "resolved": "https://registry.npmjs.org/getobject/-/getobject-0.1.0.tgz", + "integrity": "sha1-BHpEl4n6Fg0Bj1SG7ZEyC27HiFw=", + "dev": true + }, + "glob": { + "version": "7.0.6", + "resolved": "https://registry.npmjs.org/glob/-/glob-7.0.6.tgz", + "integrity": "sha1-IRuvr0nlJbjNkyYNFKsTYVKz9Xo=", + "dev": true, + "requires": { + "fs.realpath": "1.0.0", + "inflight": "1.0.6", + "inherits": "2.0.3", + "minimatch": "3.0.4", + "once": "1.4.0", + "path-is-absolute": "1.0.1" + } + }, + "graceful-fs": { + "version": "4.1.11", + "resolved": "https://registry.npmjs.org/graceful-fs/-/graceful-fs-4.1.11.tgz", + "integrity": "sha1-Dovf5NHduIVNZOBOp8AOKgJuVlg=", + "dev": true + }, + "grunt": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/grunt/-/grunt-1.0.1.tgz", + "integrity": "sha1-6HeHZOlEsY8yuw8QuQeEdcnftWs=", + "dev": true, + "requires": { + "coffee-script": "1.10.0", + "dateformat": "1.0.12", + "eventemitter2": "0.4.14", + "exit": "0.1.2", + "findup-sync": "0.3.0", + "glob": "7.0.6", + "grunt-cli": "1.2.0", + "grunt-known-options": "1.1.0", + "grunt-legacy-log": "1.0.1", + "grunt-legacy-util": "1.0.0", + "iconv-lite": "0.4.21", + "js-yaml": "3.5.5", + "minimatch": "3.0.4", + "nopt": "3.0.6", + "path-is-absolute": "1.0.1", + "rimraf": "2.2.8" + }, + "dependencies": { + "grunt-cli": { + "version": "1.2.0", + "resolved": "https://registry.npmjs.org/grunt-cli/-/grunt-cli-1.2.0.tgz", + "integrity": "sha1-VisRnrsGndtGSs4oRVAb6Xs1tqg=", + "dev": true, + "requires": { + "findup-sync": "0.3.0", + "grunt-known-options": "1.1.0", + "nopt": "3.0.6", + "resolve": "1.1.7" + } + } + } + }, + "grunt-contrib-clean": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/grunt-contrib-clean/-/grunt-contrib-clean-1.1.0.tgz", + "integrity": "sha1-Vkq/LQN4qYOhW54/MO51tzjEBjg=", + "dev": true, + "requires": { + "async": "1.5.2", + "rimraf": "2.6.2" + }, + "dependencies": { + "rimraf": { + "version": "2.6.2", + "resolved": "https://registry.npmjs.org/rimraf/-/rimraf-2.6.2.tgz", + "integrity": "sha512-lreewLK/BlghmxtfH36YYVg1i8IAce4TI7oao75I1g245+6BctqTVQiBP3YUJ9C6DQOXJmkYR9X9fCLtCOJc5w==", + "dev": true, + "requires": { + "glob": "7.0.6" + } + } + } + }, + "grunt-contrib-uglify": { + "version": "3.3.0", + "resolved": "https://registry.npmjs.org/grunt-contrib-uglify/-/grunt-contrib-uglify-3.3.0.tgz", + "integrity": "sha512-W9O7lJE3PlD8VCc5fyaf98QV7f5wEDiU4PBIh0+/6UBbk2LhgzEFS0/p+taH5UD3+PlEn7QPN0o06Z0To6SqXw==", + "dev": true, + "requires": { + "chalk": "1.1.3", + "maxmin": "1.1.0", + "uglify-js": "3.3.21", + "uri-path": "1.0.0" + } + }, + "grunt-contrib-uglify-es": { + "version": "git://github.com/gruntjs/grunt-contrib-uglify.git#ccb95a70cad6a4e9e902d3bd5d0e38a4de09a1e1", + "dev": true, + "requires": { + "chalk": "1.1.3", + "maxmin": "1.1.0", + "uglify-es": "3.3.9", + "uri-path": "1.0.0" + }, + "dependencies": { + "commander": { + "version": "2.13.0", + "resolved": "https://registry.npmjs.org/commander/-/commander-2.13.0.tgz", + "integrity": "sha512-MVuS359B+YzaWqjCL/c+22gfryv+mCBPHAv3zyVI2GN8EY6IRP8VwtasXn8jyyhvvq84R4ImN1OKRtcbIasjYA==", + "dev": true + }, + "uglify-es": { + "version": "3.3.9", + "resolved": "https://registry.npmjs.org/uglify-es/-/uglify-es-3.3.9.tgz", + "integrity": "sha512-r+MU0rfv4L/0eeW3xZrd16t4NZfK8Ld4SWVglYBb7ez5uXFWHuVRs6xCTrf1yirs9a4j4Y27nn7SRfO6v67XsQ==", + "dev": true, + "requires": { + "commander": "2.13.0", + "source-map": "0.6.1" + } + } + } + }, + "grunt-known-options": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/grunt-known-options/-/grunt-known-options-1.1.0.tgz", + "integrity": "sha1-pCdO6zL6dl2lp6OxcSYXzjsUQUk=", + "dev": true + }, + "grunt-legacy-log": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/grunt-legacy-log/-/grunt-legacy-log-1.0.1.tgz", + "integrity": "sha512-rwuyqNKlI0IPz0DvxzJjcEiQEBaBNVeb1LFoZKxSmHLETFUwhwUrqOsPIxURTKSwNZHZ4ht1YLBYmVU0YZAzHQ==", + "dev": true, + "requires": { + "colors": "1.1.2", + "grunt-legacy-log-utils": "1.0.0", + "hooker": "0.2.3", + "lodash": "4.17.5", + "underscore.string": "3.3.4" + } + }, + "grunt-legacy-log-utils": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/grunt-legacy-log-utils/-/grunt-legacy-log-utils-1.0.0.tgz", + "integrity": "sha1-p7ji0Ps1taUPSvmG/BEnSevJbz0=", + "dev": true, + "requires": { + "chalk": "1.1.3", + "lodash": "4.3.0" + }, + "dependencies": { + "lodash": { + "version": "4.3.0", + "resolved": "https://registry.npmjs.org/lodash/-/lodash-4.3.0.tgz", + "integrity": "sha1-79nEpuxT87BUEkKZFcPkgk5NJaQ=", + "dev": true + } + } + }, + "grunt-legacy-util": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/grunt-legacy-util/-/grunt-legacy-util-1.0.0.tgz", + "integrity": "sha1-OGqnjcbtUJhsKxiVcmWxtIq7m4Y=", + "dev": true, + "requires": { + "async": "1.5.2", + "exit": "0.1.2", + "getobject": "0.1.0", + "hooker": "0.2.3", + "lodash": "4.3.0", + "underscore.string": "3.2.3", + "which": "1.2.14" + }, + "dependencies": { + "lodash": { + "version": "4.3.0", + "resolved": "https://registry.npmjs.org/lodash/-/lodash-4.3.0.tgz", + "integrity": "sha1-79nEpuxT87BUEkKZFcPkgk5NJaQ=", + "dev": true + }, + "underscore.string": { + "version": "3.2.3", + "resolved": "https://registry.npmjs.org/underscore.string/-/underscore.string-3.2.3.tgz", + "integrity": "sha1-gGmSYzZl1eX8tNsfs6hi62jp5to=", + "dev": true + } + } + }, + "grunt-text-replace": { + "version": "0.4.0", + "resolved": "https://registry.npmjs.org/grunt-text-replace/-/grunt-text-replace-0.4.0.tgz", + "integrity": "sha1-252c5Z4v5J2id+nbwZXD4Rz7FsI=", + "dev": true + }, + "gzip-size": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/gzip-size/-/gzip-size-1.0.0.tgz", + "integrity": "sha1-Zs+LEBBHInuVus5uodoMF37Vwi8=", + "dev": true, + "requires": { + "browserify-zlib": "0.1.4", + "concat-stream": "1.6.2" + } + }, + "has-ansi": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/has-ansi/-/has-ansi-2.0.0.tgz", + "integrity": "sha1-NPUEnOHs3ysGSa8+8k5F7TVBbZE=", + "dev": true, + "requires": { + "ansi-regex": "2.1.1" + } + }, + "hooker": { + "version": "0.2.3", + "resolved": "https://registry.npmjs.org/hooker/-/hooker-0.2.3.tgz", + "integrity": "sha1-uDT3I8xKJCqmWWNFnfbZhMXT2Vk=", + "dev": true + }, + "hosted-git-info": { + "version": "2.6.0", + "resolved": "https://registry.npmjs.org/hosted-git-info/-/hosted-git-info-2.6.0.tgz", + "integrity": "sha512-lIbgIIQA3lz5XaB6vxakj6sDHADJiZadYEJB+FgA+C4nubM1NwcuvUr9EJPmnH1skZqpqUzWborWo8EIUi0Sdw==", + "dev": true + }, + "iconv-lite": { + "version": "0.4.21", + "resolved": "https://registry.npmjs.org/iconv-lite/-/iconv-lite-0.4.21.tgz", + "integrity": "sha512-En5V9za5mBt2oUA03WGD3TwDv0MKAruqsuxstbMUZaj9W9k/m1CV/9py3l0L5kw9Bln8fdHQmzHSYtvpvTLpKw==", + "dev": true, + "requires": { + "safer-buffer": "2.1.2" + } + }, + "indent-string": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/indent-string/-/indent-string-2.1.0.tgz", + "integrity": "sha1-ji1INIdCEhtKghi3oTfppSBJ3IA=", + "dev": true, + "requires": { + "repeating": "2.0.1" + } + }, + "inflight": { + "version": "1.0.6", + "resolved": "https://registry.npmjs.org/inflight/-/inflight-1.0.6.tgz", + "integrity": "sha1-Sb1jMdfQLQwJvJEKEHW6gWW1bfk=", + "dev": true, + "requires": { + "once": "1.4.0", + "wrappy": "1.0.2" + } + }, + "inherits": { + "version": "2.0.3", + "resolved": "https://registry.npmjs.org/inherits/-/inherits-2.0.3.tgz", + "integrity": "sha1-Yzwsg+PaQqUC9SRmAiSA9CCCYd4=", + "dev": true + }, + "is-arrayish": { + "version": "0.2.1", + "resolved": "https://registry.npmjs.org/is-arrayish/-/is-arrayish-0.2.1.tgz", + "integrity": "sha1-d8mYQFJ6qOyxqLppe4BkWnqSap0=", + "dev": true + }, + "is-builtin-module": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/is-builtin-module/-/is-builtin-module-1.0.0.tgz", + "integrity": "sha1-VAVy0096wxGfj3bDDLwbHgN6/74=", + "dev": true, + "requires": { + "builtin-modules": "1.1.1" + } + }, + "is-finite": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/is-finite/-/is-finite-1.0.2.tgz", + "integrity": "sha1-zGZ3aVYCvlUO8R6LSqYwU0K20Ko=", + "dev": true, + "requires": { + "number-is-nan": "1.0.1" + } + }, + "is-utf8": { + "version": "0.2.1", + "resolved": "https://registry.npmjs.org/is-utf8/-/is-utf8-0.2.1.tgz", + "integrity": "sha1-Sw2hRCEE0bM2NA6AeX6GXPOffXI=", + "dev": true + }, + "isarray": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/isarray/-/isarray-1.0.0.tgz", + "integrity": "sha1-u5NdSFgsuhaMBoNJV6VKPgcSTxE=", + "dev": true + }, + "isexe": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/isexe/-/isexe-2.0.0.tgz", + "integrity": "sha1-6PvzdNxVb/iUehDcsFctYz8s+hA=", + "dev": true + }, + "jquery": { + "version": "3.3.1", + "resolved": "https://registry.npmjs.org/jquery/-/jquery-3.3.1.tgz", + "integrity": "sha512-Ubldcmxp5np52/ENotGxlLe6aGMvmF4R8S6tZjsP6Knsaxd/xp3Zrh50cG93lR6nPXyUFwzN3ZSOQI0wRJNdGg==" + }, + "js-yaml": { + "version": "3.5.5", + "resolved": "https://registry.npmjs.org/js-yaml/-/js-yaml-3.5.5.tgz", + "integrity": "sha1-A3fDgBfKvHMisNH7zSWkkWQfL74=", + "dev": true, + "requires": { + "argparse": "1.0.10", + "esprima": "2.7.3" + } + }, + "load-json-file": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/load-json-file/-/load-json-file-1.1.0.tgz", + "integrity": "sha1-lWkFcI1YtLq0wiYbBPWfMcmTdMA=", + "dev": true, + "requires": { + "graceful-fs": "4.1.11", + "parse-json": "2.2.0", + "pify": "2.3.0", + "pinkie-promise": "2.0.1", + "strip-bom": "2.0.0" + } + }, + "lodash": { + "version": "4.17.5", + "resolved": "https://registry.npmjs.org/lodash/-/lodash-4.17.5.tgz", + "integrity": "sha512-svL3uiZf1RwhH+cWrfZn3A4+U58wbP0tGVTLQPbjplZxZ8ROD9VLuNgsRniTlLe7OlSqR79RUehXgpBW/s0IQw==", + "dev": true + }, + "loud-rejection": { + "version": "1.6.0", + "resolved": "https://registry.npmjs.org/loud-rejection/-/loud-rejection-1.6.0.tgz", + "integrity": "sha1-W0b4AUft7leIcPCG0Eghz5mOVR8=", + "dev": true, + "requires": { + "currently-unhandled": "0.4.1", + "signal-exit": "3.0.2" + } + }, + "map-obj": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/map-obj/-/map-obj-1.0.1.tgz", + "integrity": "sha1-2TPOuSBdgr3PSIb2dCvcK03qFG0=", + "dev": true + }, + "maxmin": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/maxmin/-/maxmin-1.1.0.tgz", + "integrity": "sha1-cTZehKmd2Piz99X94vANHn9zvmE=", + "dev": true, + "requires": { + "chalk": "1.1.3", + "figures": "1.7.0", + "gzip-size": "1.0.0", + "pretty-bytes": "1.0.4" + } + }, + "meow": { + "version": "3.7.0", + "resolved": "https://registry.npmjs.org/meow/-/meow-3.7.0.tgz", + "integrity": "sha1-cstmi0JSKCkKu/qFaJJYcwioAfs=", + "dev": true, + "requires": { + "camelcase-keys": "2.1.0", + "decamelize": "1.2.0", + "loud-rejection": "1.6.0", + "map-obj": "1.0.1", + "minimist": "1.2.0", + "normalize-package-data": "2.4.0", + "object-assign": "4.1.1", + "read-pkg-up": "1.0.1", + "redent": "1.0.0", + "trim-newlines": "1.0.0" + } + }, + "minimatch": { + "version": "3.0.4", + "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-3.0.4.tgz", + "integrity": "sha512-yJHVQEhyqPLUTgt9B83PXu6W3rx4MvvHvSUvToogpwoGDOUQ+yDrR0HRot+yOCdCO7u4hX3pWft6kWBBcqh0UA==", + "dev": true, + "requires": { + "brace-expansion": "1.1.11" + } + }, + "minimist": { + "version": "1.2.0", + "resolved": "https://registry.npmjs.org/minimist/-/minimist-1.2.0.tgz", + "integrity": "sha1-o1AIsg9BOD7sH7kU9M1d95omQoQ=", + "dev": true + }, + "nopt": { + "version": "3.0.6", + "resolved": "https://registry.npmjs.org/nopt/-/nopt-3.0.6.tgz", + "integrity": "sha1-xkZdvwirzU2zWTF/eaxopkayj/k=", + "dev": true, + "requires": { + "abbrev": "1.1.1" + } + }, + "normalize-package-data": { + "version": "2.4.0", + "resolved": "https://registry.npmjs.org/normalize-package-data/-/normalize-package-data-2.4.0.tgz", + "integrity": "sha512-9jjUFbTPfEy3R/ad/2oNbKtW9Hgovl5O1FvFWKkKblNXoN/Oou6+9+KKohPK13Yc3/TyunyWhJp6gvRNR/PPAw==", + "dev": true, + "requires": { + "hosted-git-info": "2.6.0", + "is-builtin-module": "1.0.0", + "semver": "5.5.0", + "validate-npm-package-license": "3.0.3" + } + }, + "number-is-nan": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/number-is-nan/-/number-is-nan-1.0.1.tgz", + "integrity": "sha1-CXtgK1NCKlIsGvuHkDGDNpQaAR0=", + "dev": true + }, + "object-assign": { + "version": "4.1.1", + "resolved": "https://registry.npmjs.org/object-assign/-/object-assign-4.1.1.tgz", + "integrity": "sha1-IQmtx5ZYh8/AXLvUQsrIv7s2CGM=", + "dev": true + }, + "once": { + "version": "1.4.0", + "resolved": "https://registry.npmjs.org/once/-/once-1.4.0.tgz", + "integrity": "sha1-WDsap3WWHUsROsF9nFC6753Xa9E=", + "dev": true, + "requires": { + "wrappy": "1.0.2" + } + }, + "pako": { + "version": "0.2.9", + "resolved": "https://registry.npmjs.org/pako/-/pako-0.2.9.tgz", + "integrity": "sha1-8/dSL073gjSNqBYbrZ7P1Rv4OnU=", + "dev": true + }, + "parse-json": { + "version": "2.2.0", + "resolved": "https://registry.npmjs.org/parse-json/-/parse-json-2.2.0.tgz", + "integrity": "sha1-9ID0BDTvgHQfhGkJn43qGPVaTck=", + "dev": true, + "requires": { + "error-ex": "1.3.1" + } + }, + "path-exists": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/path-exists/-/path-exists-2.1.0.tgz", + "integrity": "sha1-D+tsZPD8UY2adU3V77YscCJ2H0s=", + "dev": true, + "requires": { + "pinkie-promise": "2.0.1" + } + }, + "path-is-absolute": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/path-is-absolute/-/path-is-absolute-1.0.1.tgz", + "integrity": "sha1-F0uSaHNVNP+8es5r9TpanhtcX18=", + "dev": true + }, + "path-type": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/path-type/-/path-type-1.1.0.tgz", + "integrity": "sha1-WcRPfuSR2nBNpBXaWkBwuk+P5EE=", + "dev": true, + "requires": { + "graceful-fs": "4.1.11", + "pify": "2.3.0", + "pinkie-promise": "2.0.1" + } + }, + "pify": { + "version": "2.3.0", + "resolved": "https://registry.npmjs.org/pify/-/pify-2.3.0.tgz", + "integrity": "sha1-7RQaasBDqEnqWISY59yosVMw6Qw=", + "dev": true + }, + "pinkie": { + "version": "2.0.4", + "resolved": "https://registry.npmjs.org/pinkie/-/pinkie-2.0.4.tgz", + "integrity": "sha1-clVrgM+g1IqXToDnckjoDtT3+HA=", + "dev": true + }, + "pinkie-promise": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/pinkie-promise/-/pinkie-promise-2.0.1.tgz", + "integrity": "sha1-ITXW36ejWMBprJsXh3YogihFD/o=", + "dev": true, + "requires": { + "pinkie": "2.0.4" + } + }, + "pretty-bytes": { + "version": "1.0.4", + "resolved": "https://registry.npmjs.org/pretty-bytes/-/pretty-bytes-1.0.4.tgz", + "integrity": "sha1-CiLoIQYJrTVUL4yNXSFZr/B1HIQ=", + "dev": true, + "requires": { + "get-stdin": "4.0.1", + "meow": "3.7.0" + } + }, + "process-nextick-args": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/process-nextick-args/-/process-nextick-args-2.0.0.tgz", + "integrity": "sha512-MtEC1TqN0EU5nephaJ4rAtThHtC86dNN9qCuEhtshvpVBkAW5ZO7BASN9REnF9eoXGcRub+pFuKEpOHE+HbEMw==", + "dev": true + }, + "read-pkg": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/read-pkg/-/read-pkg-1.1.0.tgz", + "integrity": "sha1-9f+qXs0pyzHAR0vKfXVra7KePyg=", + "dev": true, + "requires": { + "load-json-file": "1.1.0", + "normalize-package-data": "2.4.0", + "path-type": "1.1.0" + } + }, + "read-pkg-up": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/read-pkg-up/-/read-pkg-up-1.0.1.tgz", + "integrity": "sha1-nWPBMnbAZZGNV/ACpX9AobZD+wI=", + "dev": true, + "requires": { + "find-up": "1.1.2", + "read-pkg": "1.1.0" + } + }, + "readable-stream": { + "version": "2.3.6", + "resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-2.3.6.tgz", + "integrity": "sha512-tQtKA9WIAhBF3+VLAseyMqZeBjW0AHJoxOtYqSUZNJxauErmLbVm2FW1y+J/YA9dUrAC39ITejlZWhVIwawkKw==", + "dev": true, + "requires": { + "core-util-is": "1.0.2", + "inherits": "2.0.3", + "isarray": "1.0.0", + "process-nextick-args": "2.0.0", + "safe-buffer": "5.1.1", + "string_decoder": "1.1.1", + "util-deprecate": "1.0.2" + } + }, + "redent": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/redent/-/redent-1.0.0.tgz", + "integrity": "sha1-z5Fqsf1fHxbfsggi3W7H9zDCr94=", + "dev": true, + "requires": { + "indent-string": "2.1.0", + "strip-indent": "1.0.1" + } + }, + "repeating": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/repeating/-/repeating-2.0.1.tgz", + "integrity": "sha1-UhTFOpJtNVJwdSf7q0FdvAjQbdo=", + "dev": true, + "requires": { + "is-finite": "1.0.2" + } + }, + "resolve": { + "version": "1.1.7", + "resolved": "https://registry.npmjs.org/resolve/-/resolve-1.1.7.tgz", + "integrity": "sha1-IDEU2CrSxe2ejgQRs5ModeiJ6Xs=", + "dev": true + }, + "rimraf": { + "version": "2.2.8", + "resolved": "https://registry.npmjs.org/rimraf/-/rimraf-2.2.8.tgz", + "integrity": "sha1-5Dm+Kq7jJzIZUnMPmaiSnk/FBYI=", + "dev": true + }, + "safe-buffer": { + "version": "5.1.1", + "resolved": "https://registry.npmjs.org/safe-buffer/-/safe-buffer-5.1.1.tgz", + "integrity": "sha512-kKvNJn6Mm93gAczWVJg7wH+wGYWNrDHdWvpUmHyEsgCtIwwo3bqPtV4tR5tuPaUhTOo/kvhVwd8XwwOllGYkbg==", + "dev": true + }, + "safer-buffer": { + "version": "2.1.2", + "resolved": "https://registry.npmjs.org/safer-buffer/-/safer-buffer-2.1.2.tgz", + "integrity": "sha512-YZo3K82SD7Riyi0E1EQPojLz7kpepnSQI9IyPbHHg1XXXevb5dJI7tpyN2ADxGcQbHG7vcyRHk0cbwqcQriUtg==", + "dev": true + }, + "semver": { + "version": "5.5.0", + "resolved": "https://registry.npmjs.org/semver/-/semver-5.5.0.tgz", + "integrity": "sha512-4SJ3dm0WAwWy/NVeioZh5AntkdJoWKxHxcmyP622fOkgHa4z3R0TdBJICINyaSDE6uNwVc8gZr+ZinwZAH4xIA==", + "dev": true + }, + "signal-exit": { + "version": "3.0.2", + "resolved": "https://registry.npmjs.org/signal-exit/-/signal-exit-3.0.2.tgz", + "integrity": "sha1-tf3AjxKH6hF4Yo5BXiUTK3NkbG0=", + "dev": true + }, + "source-map": { + "version": "0.6.1", + "resolved": "https://registry.npmjs.org/source-map/-/source-map-0.6.1.tgz", + "integrity": "sha512-UjgapumWlbMhkBgzT7Ykc5YXUT46F0iKu8SGXq0bcwP5dz/h0Plj6enJqjz1Zbq2l5WaqYnrVbwWOWMyF3F47g==", + "dev": true + }, + "spdx-correct": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/spdx-correct/-/spdx-correct-3.0.0.tgz", + "integrity": "sha512-N19o9z5cEyc8yQQPukRCZ9EUmb4HUpnrmaL/fxS2pBo2jbfcFRVuFZ/oFC+vZz0MNNk0h80iMn5/S6qGZOL5+g==", + "dev": true, + "requires": { + "spdx-expression-parse": "3.0.0", + "spdx-license-ids": "3.0.0" + } + }, + "spdx-exceptions": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/spdx-exceptions/-/spdx-exceptions-2.1.0.tgz", + "integrity": "sha512-4K1NsmrlCU1JJgUrtgEeTVyfx8VaYea9J9LvARxhbHtVtohPs/gFGG5yy49beySjlIMhhXZ4QqujIZEfS4l6Cg==", + "dev": true + }, + "spdx-expression-parse": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/spdx-expression-parse/-/spdx-expression-parse-3.0.0.tgz", + "integrity": "sha512-Yg6D3XpRD4kkOmTpdgbUiEJFKghJH03fiC1OPll5h/0sO6neh2jqRDVHOQ4o/LMea0tgCkbMgea5ip/e+MkWyg==", + "dev": true, + "requires": { + "spdx-exceptions": "2.1.0", + "spdx-license-ids": "3.0.0" + } + }, + "spdx-license-ids": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/spdx-license-ids/-/spdx-license-ids-3.0.0.tgz", + "integrity": "sha512-2+EPwgbnmOIl8HjGBXXMd9NAu02vLjOO1nWw4kmeRDFyHn+M/ETfHxQUK0oXg8ctgVnl9t3rosNVsZ1jG61nDA==", + "dev": true + }, + "sprintf-js": { + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/sprintf-js/-/sprintf-js-1.1.1.tgz", + "integrity": "sha1-Nr54Mgr+WAH2zqPueLblqrlA6gw=", + "dev": true + }, + "string_decoder": { + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/string_decoder/-/string_decoder-1.1.1.tgz", + "integrity": "sha512-n/ShnvDi6FHbbVfviro+WojiFzv+s8MPMHBczVePfUpDJLwoLT0ht1l4YwBCbi8pJAveEEdnkHyPyTP/mzRfwg==", + "dev": true, + "requires": { + "safe-buffer": "5.1.1" + } + }, + "strip-ansi": { + "version": "3.0.1", + "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-3.0.1.tgz", + "integrity": "sha1-ajhfuIU9lS1f8F0Oiq+UJ43GPc8=", + "dev": true, + "requires": { + "ansi-regex": "2.1.1" + } + }, + "strip-bom": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/strip-bom/-/strip-bom-2.0.0.tgz", + "integrity": "sha1-YhmoVhZSBJHzV4i9vxRHqZx+aw4=", + "dev": true, + "requires": { + "is-utf8": "0.2.1" + } + }, + "strip-indent": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/strip-indent/-/strip-indent-1.0.1.tgz", + "integrity": "sha1-DHlipq3vp7vUrDZkYKY4VSrhoKI=", + "dev": true, + "requires": { + "get-stdin": "4.0.1" + } + }, + "supports-color": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-2.0.0.tgz", + "integrity": "sha1-U10EXOa2Nj+kARcIRimZXp3zJMc=", + "dev": true + }, + "trim-newlines": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/trim-newlines/-/trim-newlines-1.0.0.tgz", + "integrity": "sha1-WIeWa7WCpFA6QetST301ARgVphM=", + "dev": true + }, + "typedarray": { + "version": "0.0.6", + "resolved": "https://registry.npmjs.org/typedarray/-/typedarray-0.0.6.tgz", + "integrity": "sha1-hnrHTjhkGHsdPUfZlqeOxciDB3c=", + "dev": true + }, + "uglify-js": { + "version": "3.3.21", + "resolved": "https://registry.npmjs.org/uglify-js/-/uglify-js-3.3.21.tgz", + "integrity": "sha512-uy82472lH8tshK3jS3c5IFb5MmNKd/5qyBd0ih8sM42L3jWvxnE339U9gZU1zufnLVs98Stib9twq8dLm2XYCA==", + "dev": true, + "requires": { + "commander": "2.15.1", + "source-map": "0.6.1" + } + }, + "underscore.string": { + "version": "3.3.4", + "resolved": "https://registry.npmjs.org/underscore.string/-/underscore.string-3.3.4.tgz", + "integrity": "sha1-LCo/n4PmR2L9xF5s6sZRQoZCE9s=", + "dev": true, + "requires": { + "sprintf-js": "1.1.1", + "util-deprecate": "1.0.2" + } + }, + "uri-path": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/uri-path/-/uri-path-1.0.0.tgz", + "integrity": "sha1-l0fwGDWJM8Md4PzP2C0TjmcmLjI=", + "dev": true + }, + "util-deprecate": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/util-deprecate/-/util-deprecate-1.0.2.tgz", + "integrity": "sha1-RQ1Nyfpw3nMnYvvS1KKJgUGaDM8=", + "dev": true + }, + "validate-npm-package-license": { + "version": "3.0.3", + "resolved": "https://registry.npmjs.org/validate-npm-package-license/-/validate-npm-package-license-3.0.3.tgz", + "integrity": "sha512-63ZOUnL4SIXj4L0NixR3L1lcjO38crAbgrTpl28t8jjrfuiOBL5Iygm+60qPs/KsZGzPNg6Smnc/oY16QTjF0g==", + "dev": true, + "requires": { + "spdx-correct": "3.0.0", + "spdx-expression-parse": "3.0.0" + } + }, + "which": { + "version": "1.2.14", + "resolved": "https://registry.npmjs.org/which/-/which-1.2.14.tgz", + "integrity": "sha1-mofEN48D6CfOyvGs31bHNsAcFOU=", + "dev": true, + "requires": { + "isexe": "2.0.0" + } + }, + "wrappy": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/wrappy/-/wrappy-1.0.2.tgz", + "integrity": "sha1-tSQ9jz7BqjXxNkYFvA0QNuMKtp8=", + "dev": true + } + } +} diff --git a/package.json b/package.json index 70dce2a..d744e1c 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "LoadGo", - "version": "2.2.0", + "version": "2.2.1", "description": "LoadGo is a Javascript plugin for using your logo as a progress bar", "author": "Fran Verona ", "homepage": "http://franverona.com/loadgo", @@ -30,5 +30,12 @@ }, "dependencies": { "jquery": ">=1.11.3" + }, + "devDependencies": { + "grunt": "1.0.1", + "grunt-contrib-clean": "1.1.0", + "grunt-contrib-uglify": "3.3.0", + "grunt-contrib-uglify-es": "git://github.com/gruntjs/grunt-contrib-uglify.git#harmony", + "grunt-text-replace": "^0.4.0" } }