/*!
- * smartbanner.js v1.5.0 <https://github.com/ain/smartbanner.js>
+ * smartbanner.js v1.8.0 <https://github.com/ain/smartbanner.js>
* Copyright © 2017 Ain Tohvri, contributors. Licensed under GPL-3.0.
*/
(function e(t,n,r){function s(o,u){if(!n[o]){if(!t[o]){var a=typeof require=="function"&&require;if(!u&&a)return a(o,!0);if(i)return i(o,!0);var f=new Error("Cannot find module '"+o+"'");throw f.code="MODULE_NOT_FOUND",f}var l=n[o]={exports:{}};t[o][0].call(l.exports,function(e){var n=t[o][1][e];return s(n?n:e)},l,l.exports,e,t,n,r)}return n[o].exports}var i=typeof require=="function"&&require;for(var o=0;o<r.length;o++)s(r[o]);return s})({1:[function(require,module,exports){
}
_createClass(Bakery, null, [{
+ key: 'getCookieExpiresString',
+ value: function getCookieExpiresString(hideTtl) {
+ var now = new Date();
+ var expireTime = new Date(now.getTime() + hideTtl);
+ return 'expires=' + expireTime.toGMTString() + ';';
+ }
+ }, {
key: 'bake',
- value: function bake() {
- document.cookie = 'smartbanner_exited=1';
+ value: function bake(hideTtl) {
+ document.cookie = 'smartbanner_exited=1; ' + (hideTtl ? Bakery.getCookieExpiresString(hideTtl) : '');
}
}, {
key: 'unbake',
}
var banner = document.querySelector('.js_smartbanner');
document.querySelector('body').removeChild(banner);
- _bakery2.default.bake();
+ _bakery2.default.bake(this.hideTtl);
}
}, {
key: 'originalTop',
}, {
key: 'html',
get: function get() {
- return '<div class="smartbanner smartbanner--' + this.platform + ' js_smartbanner">\n <a href="javascript:void();" class="smartbanner__exit js_smartbanner__exit"></a>\n <div class="smartbanner__icon" style="background-image: url(' + this.icon + ');"></div>\n <div class="smartbanner__info">\n <div>\n <div class="smartbanner__info__title">' + this.options.title + '</div>\n <div class="smartbanner__info__author">' + this.options.author + '</div>\n <div class="smartbanner__info__price">' + this.options.price + this.priceSuffix + '</div>\n </div>\n </div>\n <a href="' + this.buttonUrl + '" target="_blank" class="smartbanner__button"><span class="smartbanner__button__label">' + this.options.button + '</span></a>\n </div>';
+ var modifier = !this.options.customDesignModifier ? this.platform : this.options.customDesignModifier;
+ return '<div class="smartbanner smartbanner--' + modifier + ' js_smartbanner">\n <a href="javascript:void();" class="smartbanner__exit js_smartbanner__exit"></a>\n <div class="smartbanner__icon" style="background-image: url(' + this.icon + ');"></div>\n <div class="smartbanner__info">\n <div>\n <div class="smartbanner__info__title">' + this.options.title + '</div>\n <div class="smartbanner__info__author">' + this.options.author + '</div>\n <div class="smartbanner__info__price">' + this.options.price + this.priceSuffix + '</div>\n </div>\n </div>\n <a href="' + this.buttonUrl + '" target="_blank" class="smartbanner__button"><span class="smartbanner__button__label">' + this.options.button + '</span></a>\n </div>';
}
}, {
key: 'height',
}
return _detector2.default.userAgentMatchesRegex(this.options.includeUserAgentRegex);
}
+ }, {
+ key: 'hideTtl',
+ get: function get() {
+ return this.options.hideTtl ? parseInt(this.options.hideTtl) : false;
+ }
}]);
return SmartBanner;