Comment out some of the sidebar code that is no longer used and add a cookie set and get for sticky chat view
parent
3ca5a0877b
commit
e68643b67e
|
@ -22,6 +22,7 @@
|
|||
|
||||
var padutils = require('/pad_utils').padutils;
|
||||
var browser = require('/ace2_common').browser;
|
||||
var padcookie = require('/pad_cookie').padcookie;
|
||||
|
||||
var chat = (function()
|
||||
{
|
||||
|
@ -69,16 +70,17 @@ var chat = (function()
|
|||
chatMentions = 0;
|
||||
document.title = title;
|
||||
},
|
||||
stickToScreen: function() // Make chat stick to right hand side of screen
|
||||
stickToScreen: function(fromInitialCall) // Make chat stick to right hand side of screen
|
||||
{
|
||||
console.log(isStuck);
|
||||
chat.show();
|
||||
if(!isStuck) { // Stick it to
|
||||
if(!isStuck || fromInitialCall) { // Stick it to
|
||||
padcookie.setPref("chatAlwaysVisible", true);
|
||||
$('#chatbox').css({"right":"0px", "top":"36px", "border-radius":"0px", "height":"auto", "border-right":"none", "border-left":"1px solid #ccc", "border-top":"none", "background-color":"#f1f1f1", "width":"185px"});
|
||||
$('#chattext').css({"top":"0px"});
|
||||
$('#editorcontainer').css({"right":"192px", "width":"auto"});
|
||||
isStuck = true;
|
||||
} else { // Unstick it
|
||||
padcookie.setPref("chatAlwaysVisible", false);
|
||||
$('#chatbox').css({"right":"20px", "top":"auto", "border-top-left-radius":"5px", "border-top-right-radius":"5px", "border-right":"1px solid #999", "height":"200px", "border-top":"1px solid #999", "background-color":"#f7f7f7"});
|
||||
$('#chattext').css({"top":"25px"});
|
||||
$('#editorcontainer').css({"right":"0px", "width":"100%"});
|
||||
|
|
|
@ -358,7 +358,6 @@ function handshake()
|
|||
}
|
||||
}
|
||||
});
|
||||
|
||||
// Bind the colorpicker
|
||||
var fb = $('#colorpicker').farbtastic({ callback: '#mycolorpickerpreview', width: 220});
|
||||
}
|
||||
|
@ -450,7 +449,7 @@ var pad = {
|
|||
padcookie.init(clientVars.cookiePrefsToSet);
|
||||
|
||||
$("#widthprefcheck").click(pad.toggleWidthPref);
|
||||
$("#sidebarcheck").click(pad.toggleSidebar);
|
||||
// $("#sidebarcheck").click(pad.togglewSidebar);
|
||||
|
||||
pad.myUserInfo = {
|
||||
userId: clientVars.userId,
|
||||
|
@ -775,15 +774,17 @@ var pad = {
|
|||
|
||||
padsavedrevs.handleIsFullyConnected(isConnected);
|
||||
|
||||
pad.determineSidebarVisibility(isConnected && !isInitialConnect);
|
||||
// pad.determineSidebarVisibility(isConnected && !isInitialConnect);
|
||||
pad.determineChatVisibility(isConnected && !isInitialConnect);
|
||||
|
||||
},
|
||||
determineSidebarVisibility: function(asNowConnectedFeedback)
|
||||
/* determineSidebarVisibility: function(asNowConnectedFeedback)
|
||||
{
|
||||
if (pad.isFullyConnected())
|
||||
{
|
||||
var setSidebarVisibility = padutils.getCancellableAction("set-sidebar-visibility", function()
|
||||
{
|
||||
$("body").toggleClass('hidesidebar', !! padcookie.getPref('hideSidebar'));
|
||||
// $("body").toggleClass('hidesidebar', !! padcookie.getPref('hideSidebar'));
|
||||
});
|
||||
window.setTimeout(setSidebarVisibility, asNowConnectedFeedback ? 3000 : 0);
|
||||
}
|
||||
|
@ -793,6 +794,17 @@ var pad = {
|
|||
$("body").removeClass('hidesidebar');
|
||||
}
|
||||
},
|
||||
*/
|
||||
determineChatVisibility: function(asNowConnectedFeedback){
|
||||
var chatVisCookie = padcookie.getPref('chatAlwaysVisible');
|
||||
if(chatVisCookie){ // if the cookie is set for chat always visible
|
||||
chat.stickToScreen(true); // stick it to the screen
|
||||
$('#options-stickychat').prop("checked", true); // set the checkbox to on
|
||||
}
|
||||
else{
|
||||
$('#options-stickychat').prop("checked", false); // set the checkbox for off
|
||||
}
|
||||
},
|
||||
handleCollabAction: function(action)
|
||||
{
|
||||
if (action == "commitPerformed")
|
||||
|
@ -841,6 +853,7 @@ var pad = {
|
|||
$("#widthprefcheck").toggleClass('widthprefchecked', !! newValue).toggleClass('widthprefunchecked', !newValue);
|
||||
pad.handleWidthChange();
|
||||
},
|
||||
/*
|
||||
toggleSidebar: function()
|
||||
{
|
||||
var newValue = !padcookie.getPref('hideSidebar');
|
||||
|
@ -848,6 +861,7 @@ var pad = {
|
|||
$("#sidebarcheck").toggleClass('sidebarchecked', !newValue).toggleClass('sidebarunchecked', !! newValue);
|
||||
pad.determineSidebarVisibility();
|
||||
},
|
||||
*/
|
||||
handleWidthChange: function()
|
||||
{
|
||||
var isFullWidth = padcookie.getPref('fullWidth');
|
||||
|
|
Loading…
Reference in New Issue