From 383a216a7d41b8764da590183d5a58b65624b896 Mon Sep 17 00:00:00 2001 From: Grant Woodford Date: Thu, 28 Nov 2013 21:48:08 +0200 Subject: [PATCH 1/3] Added a way to closed the extended chat window --- src/static/js/chat.js | 6 +++--- src/templates/pad.html | 14 +++++++++++++- 2 files changed, 16 insertions(+), 4 deletions(-) diff --git a/src/static/js/chat.js b/src/static/js/chat.js index ed9b258f..2ae72fe3 100644 --- a/src/static/js/chat.js +++ b/src/static/js/chat.js @@ -41,15 +41,15 @@ var chat = (function() if(!isStuck || fromInitialCall) { // Stick it to padcookie.setPref("chatAlwaysVisible", true); $('#chatbox').addClass("stickyChat"); - $('#chattext').css({"top":"0px"}); + $('#titlesticky').hide(); $('#editorcontainer').css({"right":"192px"}); isStuck = true; } else { // Unstick it padcookie.setPref("chatAlwaysVisible", false); $('#chatbox').removeClass("stickyChat"); - $('#chattext').css({"top":"25px"}); + $('#titlesticky').show(); $('#editorcontainer').css({"right":"0px"}); - isStuck = false; + isStuck = false; } }, hide: function () diff --git a/src/templates/pad.html b/src/templates/pad.html index f6adfe9c..eaa949de 100644 --- a/src/templates/pad.html +++ b/src/templates/pad.html @@ -390,7 +390,7 @@
@@ -476,6 +476,18 @@ padeditbar = require('ep_etherpad-lite/static/js/pad_editbar').padeditbar; padimpexp = require('ep_etherpad-lite/static/js/pad_impexp').padimpexp; }()); + + function minimizeChatbox() + { + if ($('#options-stickychat').prop('checked')) { + chat.stickToScreen(); + $('#options-stickychat').prop('checked', false); + } else { + chat.hide(); + } + + return false; + } <% e.end_block(); %> From d1367484e3daa8bec76004dc9e1a827a231857ab Mon Sep 17 00:00:00 2001 From: Grant Woodford Date: Thu, 28 Nov 2013 21:53:00 +0200 Subject: [PATCH 2/3] Added a way to closed the extended chat window --- src/static/js/chat.js | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/static/js/chat.js b/src/static/js/chat.js index 2ae72fe3..ed01600f 100644 --- a/src/static/js/chat.js +++ b/src/static/js/chat.js @@ -41,15 +41,15 @@ var chat = (function() if(!isStuck || fromInitialCall) { // Stick it to padcookie.setPref("chatAlwaysVisible", true); $('#chatbox').addClass("stickyChat"); - $('#titlesticky').hide(); + $('#titlesticky').hide(); $('#editorcontainer').css({"right":"192px"}); isStuck = true; } else { // Unstick it padcookie.setPref("chatAlwaysVisible", false); $('#chatbox').removeClass("stickyChat"); - $('#titlesticky').show(); + $('#titlesticky').show(); $('#editorcontainer').css({"right":"0px"}); - isStuck = false; + isStuck = false; } }, hide: function () From 17666eaef78f1ffab70c446b5bddae2ffdbeefdd Mon Sep 17 00:00:00 2001 From: Grant Woodford Date: Sun, 15 Dec 2013 12:02:43 +0200 Subject: [PATCH 3/3] Changed to not use inline JavaScript --- src/static/js/chat.js | 17 ++++++++++++----- src/templates/pad.html | 14 +------------- 2 files changed, 13 insertions(+), 18 deletions(-) diff --git a/src/static/js/chat.js b/src/static/js/chat.js index ed01600f..74df5fc2 100644 --- a/src/static/js/chat.js +++ b/src/static/js/chat.js @@ -54,11 +54,18 @@ var chat = (function() }, hide: function () { - $("#chatcounter").text("0"); - $("#chaticon").show(); - $("#chatbox").hide(); - $.gritter.removeAll(); - $("#gritter-notice-wrapper").show(); + // decide on hide logic based on chat window being maximized or not + if ($('#options-stickychat').prop('checked')) { + chat.stickToScreen(); + $('#options-stickychat').prop('checked', false); + } + else { + $("#chatcounter").text("0"); + $("#chaticon").show(); + $("#chatbox").hide(); + $.gritter.removeAll(); + $("#gritter-notice-wrapper").show(); + } }, scrollDown: function() { diff --git a/src/templates/pad.html b/src/templates/pad.html index eaa949de..f6adfe9c 100644 --- a/src/templates/pad.html +++ b/src/templates/pad.html @@ -390,7 +390,7 @@
@@ -476,18 +476,6 @@ padeditbar = require('ep_etherpad-lite/static/js/pad_editbar').padeditbar; padimpexp = require('ep_etherpad-lite/static/js/pad_impexp').padimpexp; }()); - - function minimizeChatbox() - { - if ($('#options-stickychat').prop('checked')) { - chat.stickToScreen(); - $('#options-stickychat').prop('checked', false); - } else { - chat.hide(); - } - - return false; - } <% e.end_block(); %>