diff --git a/README.md b/README.md index 3e4762e..f95f3ef 100644 --- a/README.md +++ b/README.md @@ -55,6 +55,10 @@ Based on 'jQuery Smart Banner' by Arnold Daniels https://gith // , theme: '' // put platform type ('ios', 'android', etc.) here to force single theme on all device // , icon: '' // full path to icon image if not using website icon image // , force: 'ios' // Uncomment for platform emulation + hookInstall: function(type){}, // this hook is called after install button is clicked + hookShow: function(type){}, // this hook is called after the banner is displayed + hookHide: function(type){}, // this hook is called after the banner is hided + hookClose: function(type){}, // this hook is called after close button is closed }); diff --git a/dist/smart-app-banner.js b/dist/smart-app-banner.js index 39bc538..b510670 100644 --- a/dist/smart-app-banner.js +++ b/dist/smart-app-banner.js @@ -1,59 +1,51 @@ -/* - UAParser.js v0.7.18 - Lightweight JavaScript-based User-Agent string parser - https://github.com/faisalman/ua-parser-js - - Copyright ? 2012-2016 Faisal Salman - Dual licensed under GPLv2 or MIT -*/ -var $jscomp=$jscomp||{};$jscomp.scope={};$jscomp.ASSUME_ES5=!1;$jscomp.ASSUME_NO_NATIVE_MAP=!1;$jscomp.ASSUME_NO_NATIVE_SET=!1;$jscomp.defineProperty=$jscomp.ASSUME_ES5||"function"==typeof Object.defineProperties?Object.defineProperty:function(a,d,b){a!=Array.prototype&&a!=Object.prototype&&(a[d]=b.value)};$jscomp.getGlobal=function(a){return"undefined"!=typeof window&&window===a?a:"undefined"!=typeof global&&null!=global?global:a};$jscomp.global=$jscomp.getGlobal(this); -$jscomp.polyfill=function(a,d,b,e){if(d){b=$jscomp.global;a=a.split(".");for(e=0;e
'+this.options.title+"
"+this.options.author+"
"+e+'
'+this.options.button+"";m.body?m.body.appendChild(t):m&&m.addEventListener("DOMContentLoaded",function(){m.body.appendChild(t)});c(".smartbanner-button",t).addEventListener("click",this.install.bind(this),!1);c(".smartbanner-close",t).addEventListener("click", -this.close.bind(this),!1)},hide:function(){r.classList.remove("smartbanner-show");if("function"===typeof this.options.close)return this.options.close()},show:function(){r.classList.add("smartbanner-show");if("function"===typeof this.options.show)return this.options.show()},close:function(){this.hide();f.set(this.appId+"-smartbanner-closed","true",{path:"/",expires:new Date(Number(new Date)+864E5*this.options.daysHidden)});if("function"===typeof this.options.close)return this.options.close()},install:function(){this.hide(); -f.set(this.appId+"-smartbanner-installed","true",{path:"/",expires:new Date(Number(new Date)+864E5*this.options.daysReminder)});if("function"===typeof this.options.close)return this.options.close()},parseAppId:function(){var a=c('meta[name="'+this.appMeta+'"]');if(a)return this.appId="windows"===this.type?a.getAttribute("content"):/app-id=([^\s,]+)/.exec(a.getAttribute("content"))[1]}};d.exports=a},{"component-query":2,"cookie-cutter":3,"get-doc":4,"object-assign":6,"ua-parser-js":7}],2:[function(a, -d,b){function e(a,e){return e.querySelector(a)}b=d.exports=function(a,b){b=b||document;return e(a,b)};b.all=function(a,e){e=e||document;return e.querySelectorAll(a)};b.engine=function(a){if(!a.one)throw Error(".one callback required");if(!a.all)throw Error(".all callback required");e=a.one;b.all=a.all;return b}},{}],3:[function(a,d,b){b=d.exports=function(a){a||(a={});"string"===typeof a&&(a={cookie:a});void 0===a.cookie&&(a.cookie="");return{get:function(c){for(var b=a.cookie.split(/;\s*/),f=0;f< -b.length;f++){var e=b[f].split("=");if(unescape(e[0])===c)return unescape(e[1])}},set:function(c,b,f){f||(f={});c=escape(c)+"="+escape(b);f.expires&&(c+="; expires="+f.expires);f.path&&(c+="; path="+escape(f.path));f.domain&&(c+="; domain="+escape(f.domain));f.secure&&(c+="; secure");return a.cookie=c}}};"undefined"!==typeof document&&(a=b(document),b.get=a.get,b.set=a.set)},{}],4:[function(a,d,b){a=a("has-dom");d.exports=a()?document:null},{"has-dom":5}],5:[function(a,d,b){d.exports=function(){return"undefined"!== -typeof window&&"undefined"!==typeof document&&"function"===typeof document.createElement}},{}],6:[function(a,d,b){var e=Object.getOwnPropertySymbols,c=Object.prototype.hasOwnProperty,m=Object.prototype.propertyIsEnumerable;d.exports=function(){try{if(!Object.assign)return!1;var a=new String("abc");a[5]="de";if("5"===Object.getOwnPropertyNames(a)[0])return!1;var c={};for(a=0;10>a;a++)c["_"+String.fromCharCode(a)]=a;if("0123456789"!==Object.getOwnPropertyNames(c).map(function(a){return c[a]}).join(""))return!1; -var b={};"abcdefghijklmnopqrst".split("").forEach(function(a){b[a]=a});return"abcdefghijklmnopqrst"!==Object.keys(Object.assign({},b)).join("")?!1:!0}catch(r){return!1}}()?Object.assign:function(a,b){if(null===a||void 0===a)throw new TypeError("Object.assign cannot be called with null or undefined");var d=Object(a);for(var f,g=1;g
'+this.options.title+"
"+this.options.author+"
"+f+'
'+ +this.options.button+"";h.body?h.body.appendChild(t):h&&h.addEventListener("DOMContentLoaded",function(){h.body.appendChild(t)});g(".smartbanner-button",t).addEventListener("click",this.install.bind(this),!1);g(".smartbanner-close",t).addEventListener("click",this.close.bind(this),!1)},hide:function(){r.classList.remove("smartbanner-show");if("function"===typeof this.options.hookHide)return this.options.hookHide(this.type);if("function"===typeof this.options.hookClose)return this.options.hookClose(this.type)}, +show:function(){r.classList.add("smartbanner-show");if("function"===typeof this.options.hookShow)return this.options.hookShow(this.type)},close:function(){this.hide();f.set(this.appId+"-smartbanner-closed","true",{path:"/",expires:new Date(Number(new Date)+864E5*this.options.daysHidden)});if("function"===typeof this.options.hookClose)return this.options.hookClose(this.type)},install:function(){this.hide();f.set(this.appId+"-smartbanner-installed","true",{path:"/",expires:new Date(Number(new Date)+ +864E5*this.options.daysReminder)});if("function"===typeof this.options.hookInstall)return this.options.hookInstall(this.type);if("function"===typeof this.options.hookClose)return this.options.hookClose(this.type)},parseAppId:function(){var a=g('meta[name="'+this.appMeta+'"]');if(a)return this.appId="windows"===this.type?a.getAttribute("content"):/app-id=([^\s,]+)/.exec(a.getAttribute("content"))[1]}};c.exports=a},{"component-query":2,"cookie-cutter":3,"get-doc":4,"object-assign":6,"ua-parser-js":7}], +2:[function(a,c,b){function d(a,d){return d.querySelector(a)}b=c.exports=function(a,b){b=b||document;return d(a,b)};b.all=function(a,d){d=d||document;return d.querySelectorAll(a)};b.engine=function(a){if(!a.one)throw Error(".one callback required");if(!a.all)throw Error(".all callback required");d=a.one;b.all=a.all;return b}},{}],3:[function(a,c,b){b=c.exports=function(a){a||(a={});"string"===typeof a&&(a={cookie:a});void 0===a.cookie&&(a.cookie="");return{get:function(b){for(var d=a.cookie.split(/;\s*/), +f=0;fa;a++)b["_"+String.fromCharCode(a)]=a;if("0123456789"!==Object.getOwnPropertyNames(b).map(function(a){return b[a]}).join(""))return!1;var d={};"abcdefghijklmnopqrst".split("").forEach(function(a){d[a]= +a});return"abcdefghijklmnopqrst"!==Object.keys(Object.assign({},d)).join("")?!1:!0}catch(r){return!1}}()?Object.assign:function(a,b){if(null===a||void 0===a)throw new TypeError("Object.assign cannot be called with null or undefined");var c=Object(a);for(var f,k=1;k