mirror of
https://github.com/KevinMidboe/zoff.git
synced 2025-10-29 18:00:23 +00:00
Changed cookie-toast and added a cookie-modal
This commit is contained in:
@@ -513,11 +513,6 @@ var Frontpage = {
|
||||
M.Modal.getInstance(document.getElementById("donation")).open();
|
||||
}
|
||||
|
||||
if(!localStorage.ok_cookie){
|
||||
before_toast();
|
||||
//M.toast({html: "We're using cookies to enhance your experience! <a class='waves-effect waves-light btn light-green' href='#' id='cookieok' style='cursor:pointer;pointer-events:all;margin-left:10px;'> ok</a>", displayLength: 10000});
|
||||
}
|
||||
|
||||
//var pad = 0;
|
||||
|
||||
/*$(".zicon").on("click", function(e) {
|
||||
|
||||
@@ -544,7 +544,7 @@ function loadChromecastVideo() {
|
||||
} catch(event){
|
||||
_seekTo = seekTo;
|
||||
}
|
||||
var mediaInfo = new chrome.cast.media.MediaInfo(video_id, videoSource);
|
||||
var mediaInfo = new chrome.cast.media.MediaInfo(video_id, "video");
|
||||
var image = {url:'https://img.youtube.com/vi/'+video_id+'/mqdefault.jpg', heigth: 180, width: 320};
|
||||
if(Player.np.thumbnail) image.url = Player.np.thumbnail;
|
||||
mediaInfo.metadata = new chrome.cast.media.GenericMediaMetadata();
|
||||
@@ -557,6 +557,7 @@ function loadChromecastVideo() {
|
||||
end: Player.np.end,
|
||||
seekTo: _seekTo,
|
||||
channel: chan.toLowerCase(),
|
||||
source: videoSource,
|
||||
thumbnail: Player.np.thumbnail != undefined ? Player.np.thumbnail : 'https://img.youtube.com/vi/'+video_id+'/mqdefault.jpg',
|
||||
};
|
||||
castSession.loadMedia(request).then(function() {
|
||||
|
||||
@@ -209,6 +209,14 @@ window.addEventListener("DOMContentLoaded", function() {
|
||||
else if(!fromChannel && window.location.pathname == "/"){
|
||||
Frontpage.init();
|
||||
}
|
||||
if(!localStorage.ok_cookie){
|
||||
before_toast();
|
||||
M.toast({html: "This website uses cookies! <a class='waves-effect waves-light btn light-green' href='#' id='cookieok' style='cursor:pointer;pointer-events:all;margin-left:10px;'> ok</a><a class='waves-effect waves-light btn orange lighten' href='#cookies' id='cookieinfo' style='cursor:pointer;pointer-events:all;margin-left:10px;'> info</a>", displayLength: 10000000});
|
||||
}
|
||||
if(window.location.hash == "#cookies") {
|
||||
M.Modal.init(document.getElementById("cookie"));
|
||||
M.Modal.getInstance(document.getElementById("cookie")).open();
|
||||
}
|
||||
if(window.location.pathname == "/" && !client) {
|
||||
if(document.querySelectorAll("script[src='https://www.youtube.com/iframe_api']").length == 1){
|
||||
|
||||
@@ -511,6 +519,12 @@ addListener("click", '#cookieok', function(e) {
|
||||
localStorage.ok_cookie = true;
|
||||
});
|
||||
|
||||
addListener("click", "#cookieinfo", function(e) {
|
||||
this.preventDefault();
|
||||
M.Modal.init(document.getElementById("cookie"));
|
||||
M.Modal.getInstance(document.getElementById("cookie")).open();
|
||||
});
|
||||
|
||||
addListener("click", ".connect_error", function(event){
|
||||
this.preventDefault();
|
||||
M.Toast.getInstance(this.parentElement).dismiss();
|
||||
|
||||
@@ -60,6 +60,7 @@
|
||||
</div>
|
||||
</div>
|
||||
{{/unless}}
|
||||
{{> modal/cookie}}
|
||||
{{> contact}}
|
||||
{{> donate}}
|
||||
{{> footer}}
|
||||
|
||||
11
server/public/partials/modal/cookie.handlebars
Normal file
11
server/public/partials/modal/cookie.handlebars
Normal file
@@ -0,0 +1,11 @@
|
||||
<div id="cookie" class="modal">
|
||||
<div class="modal-content">
|
||||
<h4>Cookies</h4>
|
||||
<p>We're using Google Analytics to track page-visits, and better understand how users navigate through the page. </p>
|
||||
<p>We're also using cookies to store your sessions, to enable for a much more seamless interaction with the app, allowing for a more persistent chat- and authenticated-session.</p>
|
||||
<p>By using this site, you're allowing us to both use the Google Analytics and our own cookies, and save them on your computer. None of these cookies can be used to identify, so don't worry.</p>
|
||||
</div>
|
||||
<div class="modal-footer">
|
||||
<a href="#!" class=" modal-action modal-close waves-effect waves-green btn-flat">Close</a>
|
||||
</div>
|
||||
</div>
|
||||
Reference in New Issue
Block a user