|
@ -6,19 +6,22 @@ |
|
|
{ state.options.text.content } |
|
|
{ state.options.text.content } |
|
|
</p> |
|
|
</p> |
|
|
<div class="tiny-consent__close"> |
|
|
<div class="tiny-consent__close"> |
|
|
<button class="button button--submit tiny-consent__button" onclick={ handleClose }> |
|
|
|
|
|
<span if={ state.hasInitiated === false }>{ state.options.text.button__roger }</span> |
|
|
|
|
|
<span if={ state.hasInitiated === true }>{ state.options.text.button__close }</span> |
|
|
|
|
|
|
|
|
<button if={ state.options.force } class="button tiny-consent__button" onclick={ handleAcceptAll }> |
|
|
|
|
|
{ state.options.text.button__accept_all } |
|
|
|
|
|
</button> |
|
|
|
|
|
<button class="button tiny-consent__button" onclick={ handleClose }> |
|
|
|
|
|
<span if={ !state.options.force && state.hasInitiated === false }>{ state.options.text.button__roger }</span> |
|
|
|
|
|
<span if={ (state.options.force && state.hasInitiated === false) || state.hasInitiated === true }>{ state.options.text.button__close }</span> |
|
|
</button> |
|
|
</button> |
|
|
</div> |
|
|
</div> |
|
|
</div> |
|
|
</div> |
|
|
<div class="tiny-consent__main"> |
|
|
<div class="tiny-consent__main"> |
|
|
<ul class="tiny-consent__cookies"> |
|
|
<ul class="tiny-consent__cookies"> |
|
|
<li class="tiny-consent__cookie-group" each={ group in Object.entries(state.cookies) }> |
|
|
<li class="tiny-consent__cookie-group" each={ group in Object.entries(state.cookies) }> |
|
|
<header class="tiny-consent__cookie-accordion-header" if={ group[0] === 'default' } onclick={ () => { handleToogle() }}> |
|
|
|
|
|
{ state.options.text.title__default } ({ group[1].length }) <span class="tiny-consent__cookie-accordion-header-icon">▲</span> |
|
|
|
|
|
|
|
|
<header class="tiny-consent__cookie-accordion-header" if={ group[0] === 'default' || (group[0] === 'other' && group[0].length > 1) } onclick={ () => { handleToogle() }}> |
|
|
|
|
|
{ state.options.text['title__' + group[0]] } ({ group[1].length }) <span class="tiny-consent__cookie-accordion-header-icon">▲</span> |
|
|
</header> |
|
|
</header> |
|
|
<div class="tiny-consent__cookie-accordion{ group[0] === 'default' ? ' tiny-consent__cookie-accordion--active' : '' }"> |
|
|
|
|
|
|
|
|
<div class="tiny-consent__cookie-accordion{ group[0] === 'default' || (group[0] === 'other' && group[0].length > 1) ? ' tiny-consent__cookie-accordion--active' : '' }"> |
|
|
<div class="tiny-consent__cookie-accordion-inner"> |
|
|
<div class="tiny-consent__cookie-accordion-inner"> |
|
|
<div class="tiny-consent__cookie-wrapper" each={ (cookie, index) in group[1] }> |
|
|
<div class="tiny-consent__cookie-wrapper" each={ (cookie, index) in group[1] }> |
|
|
<div class="tiny-consent__cookie-content"> |
|
|
<div class="tiny-consent__cookie-content"> |
|
@ -64,7 +67,7 @@ |
|
|
|
|
|
|
|
|
/** |
|
|
/** |
|
|
* tiny-consent.riot |
|
|
* tiny-consent.riot |
|
|
* <li class={ state.hasChanged && cookie.hasConsent === true ? 'tiny-consent__cookie' : 'tiny-consent__cookie show' } each={ (group, index) in state.cookies }> |
|
|
|
|
|
|
|
|
* |
|
|
* |
|
|
* |
|
|
* @author Björn Hase |
|
|
* @author Björn Hase |
|
|
* @license http://opensource.org/licenses/MIT The MIT License |
|
|
* @license http://opensource.org/licenses/MIT The MIT License |
|
@ -85,17 +88,21 @@ |
|
|
text: { |
|
|
text: { |
|
|
content : 'We are using Cookies and display that was we use, also there are cookies you can accept or reject', |
|
|
content : 'We are using Cookies and display that was we use, also there are cookies you can accept or reject', |
|
|
title__default : 'Essential', |
|
|
title__default : 'Essential', |
|
|
|
|
|
title__other : 'Optional', |
|
|
button__agree : 'Yes', |
|
|
button__agree : 'Yes', |
|
|
button__reject : 'No', |
|
|
button__reject : 'No', |
|
|
button__ok : 'Ok', |
|
|
button__ok : 'Ok', |
|
|
button__roger : 'Roger that', |
|
|
button__roger : 'Roger that', |
|
|
button__close : 'Close', |
|
|
button__close : 'Close', |
|
|
|
|
|
button__accept_all: 'Accept all', |
|
|
footer__name: 'Cookie Name', |
|
|
footer__name: 'Cookie Name', |
|
|
footer__provider: 'Provider', |
|
|
footer__provider: 'Provider', |
|
|
footer__duration: 'Cookie Duration', |
|
|
footer__duration: 'Cookie Duration', |
|
|
footer__privacy_policy: 'Privacy Policy' |
|
|
footer__privacy_policy: 'Privacy Policy' |
|
|
}, |
|
|
}, |
|
|
offsetLineHeight: 1.15 |
|
|
|
|
|
|
|
|
offsetLineHeight: 1.15, |
|
|
|
|
|
expires: 180, |
|
|
|
|
|
force: false |
|
|
}, |
|
|
}, |
|
|
hasChanged: false, |
|
|
hasChanged: false, |
|
|
hasInitiated: false, |
|
|
hasInitiated: false, |
|
@ -352,7 +359,7 @@ |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
data[cookie.id] = true; |
|
|
data[cookie.id] = true; |
|
|
Cookie.set(this.state.options.cookie_name, data); |
|
|
|
|
|
|
|
|
Cookie.set(this.state.options.cookie_name, data, { expires: this.state.options.expires }); |
|
|
|
|
|
|
|
|
this.beforeUpdate(); |
|
|
this.beforeUpdate(); |
|
|
this.update(); |
|
|
this.update(); |
|
@ -372,7 +379,7 @@ |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
data[cookie.id] = false; |
|
|
data[cookie.id] = false; |
|
|
Cookie.set(this.state.options.cookie_name, data); |
|
|
|
|
|
|
|
|
Cookie.set(this.state.options.cookie_name, data, { expires: this.state.options.expires }); |
|
|
|
|
|
|
|
|
this.beforeUpdate(); |
|
|
this.beforeUpdate(); |
|
|
this.update(); |
|
|
this.update(); |
|
@ -391,7 +398,7 @@ |
|
|
data[cookie.id] = true; |
|
|
data[cookie.id] = true; |
|
|
}); |
|
|
}); |
|
|
|
|
|
|
|
|
Cookie.set(this.state.options.cookie_name, data); |
|
|
|
|
|
|
|
|
Cookie.set(this.state.options.cookie_name, data, { expires: this.state.options.expires }); |
|
|
|
|
|
|
|
|
this.beforeUpdate(); |
|
|
this.beforeUpdate(); |
|
|
this.update(); |
|
|
this.update(); |
|
@ -406,6 +413,26 @@ |
|
|
this.root.firstChild.style.bottom = this.root.firstChild.style.bottom = -(this.root.firstChild.offsetHeight) + 'px'; |
|
|
this.root.firstChild.style.bottom = this.root.firstChild.style.bottom = -(this.root.firstChild.offsetHeight) + 'px'; |
|
|
}, |
|
|
}, |
|
|
|
|
|
|
|
|
|
|
|
/** |
|
|
|
|
|
* |
|
|
|
|
|
* |
|
|
|
|
|
* @return {object} event |
|
|
|
|
|
*/ |
|
|
|
|
|
handleAcceptAll() |
|
|
|
|
|
{ |
|
|
|
|
|
if (this.state.cookies.other) { |
|
|
|
|
|
this.state.cookies.other.forEach((cookie) => { |
|
|
|
|
|
this.handleAgree(cookie); |
|
|
|
|
|
}); |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
this.state.hasInitiated = true; |
|
|
|
|
|
this.handleDefault(); |
|
|
|
|
|
|
|
|
|
|
|
this.close(); |
|
|
|
|
|
this.update(); |
|
|
|
|
|
}, |
|
|
|
|
|
|
|
|
/** |
|
|
/** |
|
|
* change to open |
|
|
* change to open |
|
|
* |
|
|
* |
|
|