semi working example

This commit is contained in:
John McLear 2015-01-19 01:45:49 +00:00
parent 73d6030762
commit 63c65f784b
5 changed files with 45 additions and 0 deletions

View file

@ -54,6 +54,20 @@ var chat = (function()
isStuck = false;
}
},
chatAndUsers: function(status){
if(status || $('#options-chatandusers').prop('checked')){
padcookie.setPref("chatAndUsers", true);
chat.stickToScreen(true);
$('#options-stickychat').prop("disabled", "disabled");
$('#users').addClass("chatAndUsers");
$("#chatbox").addClass("chatAndUsersChat");
}else{
chat.stickToScreen(false);
$('#options-stickychat').prop("disabled", false);
$('#users').removeClass("chatAndUsers");
$("#chatbox").removeClass("chatAndUsersChat");
}
},
hide: function ()
{
// decide on hide logic based on chat window being maximized or not

View file

@ -120,6 +120,7 @@ var getParameters = [
{ name: "userColor", checkVal: null, callback: function(val) { settings.globalUserColor = decodeURIComponent(val); } },
{ name: "rtl", checkVal: "true", callback: function(val) { settings.rtlIsTrue = true } },
{ name: "alwaysShowChat", checkVal: "true", callback: function(val) { chat.stickToScreen(); } },
{ name: "chatAndUsers", checkVal: "true", callback: function(val) { chat.chatAndUsers(); } },
{ name: "lang", checkVal: null, callback: function(val) { window.html10n.localize([val, 'en']); } }
];
@ -562,6 +563,10 @@ var pad = {
chat.stickToScreen(true); // stick it to the screen
$('#options-stickychat').prop("checked", true); // set the checkbox to on
}
if(padcookie.getPref("chatAndUsers")){ // if we have a cookie for always showing chat then show it
chat.chatAndUsers(true); // stick it to the screen
$('#options-chatandusers').prop("checked", true); // set the checkbox to on
}
if(padcookie.getPref("showAuthorshipColors") == false){
pad.changeViewOption('showAuthorColors', false);
}
@ -791,6 +796,16 @@ var pad = {
$('#options-stickychat').prop("checked", false); // set the checkbox for off
}
},
determineChatAndUsersVisibility: function(){
var chatAUVisCookie = padcookie.getPref('chatAndUsersVisible');
if(chatAUVisCookie){ // if the cookie is set for chat always visible
chat.chatAndUsers(true); // stick it to the screen
$('#options-chatandusers').prop("checked", true); // set the checkbox to on
}
else{
$('#options-chatandusers').prop("checked", false); // set the checkbox for off
}
},
determineAuthorshipColorsVisibility: function(){
var authColCookie = padcookie.getPref('showAuthorshipColors');
if (authColCookie){