Tooltips for private-mode

This commit is contained in:
Kasper Rynning-Tønnesen
2017-02-10 16:57:19 +01:00
parent ca659e18e5
commit 86d977bb74
4 changed files with 23 additions and 7 deletions

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

View File

@@ -415,7 +415,6 @@ function initfp(){
} }
//window.channel_list = channel_list; //window.channel_list = channel_list;
if(!localStorage.ok_cookie) if(!localStorage.ok_cookie)
Materialize.toast("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;'> ok</a>", 10000); Materialize.toast("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;'> ok</a>", 10000);
@@ -427,6 +426,12 @@ function initfp(){
window.location.href = 'http://etys.no'; window.location.href = 'http://etys.no';
}); });
$("#offline-mode").tooltip({
delay: 5,
position: "bottom",
tooltip: "Enable private mode"
});
if(!Helper.mobilecheck() && Frontpage.winter) { if(!Helper.mobilecheck() && Frontpage.winter) {
$(".mega").prepend('<div id="snow"></div>'); $(".mega").prepend('<div id="snow"></div>');
//Frontpage.start_snowfall(); //Frontpage.start_snowfall();

View File

@@ -556,6 +556,7 @@ function change_offline(enabled, already_offline){
Crypt.set_offline(enabled); Crypt.set_offline(enabled);
offline = enabled; offline = enabled;
socket.emit("offline", enabled); socket.emit("offline", enabled);
$("#offline-mode").tooltip('remove');
if(enabled){ if(enabled){
if(list_html){ if(list_html){
list_html = $("<div>" + list_html + "</div>"); list_html = $("<div>" + list_html + "</div>");
@@ -574,6 +575,11 @@ function change_offline(enabled, already_offline){
$("#viewers").addClass("hide"); $("#viewers").addClass("hide");
$("#offline-mode").removeClass("waves-cyan"); $("#offline-mode").removeClass("waves-cyan");
$("#offline-mode").addClass("cyan"); $("#offline-mode").addClass("cyan");
$("#offline-mode").tooltip({
delay: 5,
position: "bottom",
tooltip: "Disable private mode"
});
if(full_playlist != undefined && !already_offline){ if(full_playlist != undefined && !already_offline){
for(var x = 0; x < full_playlist.length; x++){ for(var x = 0; x < full_playlist.length; x++){
full_playlist[x].votes = 0; full_playlist[x].votes = 0;
@@ -603,6 +609,11 @@ function change_offline(enabled, already_offline){
} }
$("#offline-mode").addClass("waves-cyan"); $("#offline-mode").addClass("waves-cyan");
$("#offline-mode").removeClass("cyan"); $("#offline-mode").removeClass("cyan");
$("#offline-mode").tooltip({
delay: 5,
position: "bottom",
tooltip: "Enable private mode"
});
if(window.location.pathname != "/"){ if(window.location.pathname != "/"){
socket.emit("pos"); socket.emit("pos");
socket.emit('list', chan.toLowerCase()); socket.emit('list', chan.toLowerCase());