fixed issue with remove-button not hiding on switching from private mode to online-mode, and added help function in chat2

This commit is contained in:
Kasper Rynning-Tønnesen
2017-02-12 15:50:25 +01:00
parent 86d977bb74
commit 480b3b040d
7 changed files with 84 additions and 36 deletions

View File

@@ -1257,8 +1257,15 @@ ul #chat-log{
#search_loader {
height: 64px;
padding: 0 15px;
margin-top:15px;
display: flex;
justify-content: center;
/* padding: 15px 15px; */
/* margin-top: 15px; */
align-items: center;
}
#search_loader_inner{
display: flex;
}
.playlist_loader_padding{
@@ -1323,8 +1330,6 @@ ul #chat-log{
position: fixed;
top: 0;
right: 0;
height: 64px;
overflow: hidden;
}
.title-container{

File diff suppressed because one or more lines are too long

View File

@@ -2,6 +2,7 @@ var Chat = {
channel_received: 0,
all_received: 0,
chat_help: ["/name <new name> to change name", "/removename to remove name"],
namechange: function(newName)
{
@@ -21,6 +22,46 @@ var Chat = {
return;
if(data.value.startsWith("/name ")){
Chat.namechange(data.value.substring(6));
} else if(data.value.startsWith("/help")){
if($(".chat-tab-li a.active").attr("href") == "#all_chat"){
if($("#chatall").children().length > 100){
$("#chatall").children()[0].remove()
}
for(var x = 0; x < Chat.chat_help.length; x++){
var color = Helper.intToARGB(Helper.hashCode("System"));
if(color.length < 6) {
for(x = color.length; x < 6; x++){
color = "0" + color;
}
}
color = Helper.hexToRgb(color.substring(0,6));
var color_temp = Helper.rgbToHsl([color.r, color.g, color.b], false);
$("#chatall").append("<li title='Zöff''><span style='color:"+color_temp+";'>System</span>: </li>");
var in_text = document.createTextNode(Chat.chat_help[x]);
$("#chatall li:last")[0].appendChild(in_text);
document.getElementById("chatall").scrollTop = document.getElementById("chatall").scrollHeight;
}
} else {
if($("#chatchannel").children().length > 100){
$("#chatchannel").children()[0].remove()
}
for(var x = 0; x < Chat.chat_help.length; x++){
var color = Helper.intToARGB(Helper.hashCode("System"));
if(color.length < 6) {
for(x = color.length; x < 6; x++){
color = "0" + color;
}
}
color = Helper.hexToRgb(color.substring(0,6));
var color_temp = Helper.rgbToHsl([color.r, color.g, color.b], false);
$("#chatchannel").append("<li><span style='color:"+color_temp+";'>System</span>: </li>");
var in_text = document.createTextNode(Chat.chat_help[x]);
$("#chatchannel li:last")[0].appendChild(in_text);
document.getElementById("chatchannel").scrollTop = document.getElementById("chatchannel").scrollHeight;
}
}
} else if(data.value.startsWith("/removename")){
Chat.removename();
}
@@ -55,6 +96,10 @@ var Chat = {
{
$("#favicon").attr("href", "public/images/highlogo.png");
}
if($("#chatall").children().length > 100){
$("#chatall").children()[0].remove()
}
var color = Helper.intToARGB(Helper.hashCode(inp.from));
if(color.length < 6) {
for(x = color.length; x < 6; x++){
@@ -85,6 +130,10 @@ var Chat = {
$("span.badge.new.white").html(to_display);
}
if($("#chatchannel").children().length > 100){
$("#chatchannel").children()[0].remove()
}
var color = Helper.intToARGB(Helper.hashCode(data.from));
if(color.length < 6) {
for(x = color.length; x < 6; x++){

View File

@@ -426,12 +426,6 @@ function initfp(){
window.location.href = 'http://etys.no';
});
$("#offline-mode").tooltip({
delay: 5,
position: "bottom",
tooltip: "Enable private mode"
});
if(!Helper.mobilecheck() && Frontpage.winter) {
$(".mega").prepend('<div id="snow"></div>');
//Frontpage.start_snowfall();

View File

@@ -594,7 +594,7 @@ function change_offline(enabled, already_offline){
//list_html.find(".card-content").css("height", "initial");
//list_html.find(".list-title").css("align-self", "center");
//list_html.find(".vote-span").removeClass("hide");
if((!hasadmin || !w_p)){
if(hasadmin && w_p){
list_html.find(".list-remove").addClass("hide");
}
list_html = list_html.html();
@@ -604,7 +604,7 @@ function change_offline(enabled, already_offline){
//$(".list-title").css("align-self", "center");
//$(".vote-span").removeClass("hide");
$("#viewers").removeClass("hide");
if((!hasadmin || !w_p)){
if(hasadmin && w_p){
$(".list-remove").addClass("hide");
}
$("#offline-mode").addClass("waves-cyan");

View File

@@ -29,7 +29,7 @@
<ul class="right control-list noselect">
<li id="search_loader" class="valign-wrapper">
<div class="valign">
<div id="search_loader_inner">
<div class="preloader-wrapper small search_loader_spinner">
<div class="spinner-layer spinner-white-only">
<div class="circle-clipper left">

View File

@@ -22,7 +22,7 @@ if(isset($_GET['chan'])){
<div id="frontpage-viewer-counter" data-position="bottom" data-delay="5" data-tooltip="Total viewers" class="noselect tooltipped" title="Divided among all channels. Hidden or not"></div>
<!--<a href="//zoff.no" class="brand-logo brand-mobile hide-on-med-and-up">Zöff</a>-->
<ul class="right hide-on-med-and-down">
<li><a class="header-buttons waves-effect waves-cyan" id="offline-mode" title="Offline mode" href="#">Private</a></li>
<li><a class="header-buttons waves-effect waves-cyan" id="offline-mode" title="Private mode" href="#">Private</a></li>
<li><a class="header-buttons waves-effect waves-green" title="Remote control a Zöff player" href="https://remote.zoff.no">Remote</a></li>
<li><a class="header-buttons modal-trigger waves-effect waves-orange" onclick="$('#about').modal('open')">About</a></li>
</ul>