From a554552bedcfca519488151b1c24abefa946dff0 Mon Sep 17 00:00:00 2001 From: "j@mailb.org" Date: Mon, 17 Jun 2013 14:28:04 +0200 Subject: [PATCH 1/3] Simpify CSS for sticky chat --- src/static/css/pad.css | 2 +- src/static/js/chat.js | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/src/static/css/pad.css b/src/static/css/pad.css index dafb77ef4..c69b8d8fd 100644 --- a/src/static/css/pad.css +++ b/src/static/css/pad.css @@ -168,9 +168,9 @@ a img { } #editorcontainer { position: absolute; - width: 100%; top: 37px; /* + 1px border */ left: 0px; + right: 0px; bottom: 0px; z-index: 1; } diff --git a/src/static/js/chat.js b/src/static/js/chat.js index 38d6f38d3..ed9b258f0 100644 --- a/src/static/js/chat.js +++ b/src/static/js/chat.js @@ -42,13 +42,13 @@ var chat = (function() padcookie.setPref("chatAlwaysVisible", true); $('#chatbox').addClass("stickyChat"); $('#chattext').css({"top":"0px"}); - $('#editorcontainer').css({"right":"192px", "width":"auto"}); + $('#editorcontainer').css({"right":"192px"}); isStuck = true; } else { // Unstick it padcookie.setPref("chatAlwaysVisible", false); $('#chatbox').removeClass("stickyChat"); $('#chattext').css({"top":"25px"}); - $('#editorcontainer').css({"right":"0px", "width":"100%"}); + $('#editorcontainer').css({"right":"0px"}); isStuck = false; } }, From bc5dc74f902b40f3a493328f5ca1b120e9b53d30 Mon Sep 17 00:00:00 2001 From: "j@mailb.org" Date: Mon, 17 Jun 2013 14:30:13 +0200 Subject: [PATCH 2/3] pass pad in postAceInit hook no way for plugins to access current pad otherwise. --- doc/api/hooks_client-side.md | 1 + src/static/js/pad.js | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/doc/api/hooks_client-side.md b/doc/api/hooks_client-side.md index 80dcc52ac..c0a4227a4 100644 --- a/doc/api/hooks_client-side.md +++ b/doc/api/hooks_client-side.md @@ -126,6 +126,7 @@ Called from: src/static/js/pad.js Things in context: 1. ace - the ace object that is applied to this editor. +2. pad - the pad object of the current pad. There doesn't appear to be any example available of this particular hook being used, but it gets fired after the editor is all set up. diff --git a/src/static/js/pad.js b/src/static/js/pad.js index 9a42bccce..4d5df7eb1 100644 --- a/src/static/js/pad.js +++ b/src/static/js/pad.js @@ -524,7 +524,7 @@ var pad = { if(padcookie.getPref("showAuthorshipColors") == false){ pad.changeViewOption('showAuthorColors', false); } - hooks.aCallAll("postAceInit", {ace: padeditor.ace}); + hooks.aCallAll("postAceInit", {ace: padeditor.ace, pad: pad}); } }, dispose: function() From 9dd6471921e6e850e6b2b6657270bf0a2c4e390c Mon Sep 17 00:00:00 2001 From: "j@mailb.org" Date: Mon, 17 Jun 2013 14:32:11 +0200 Subject: [PATCH 3/3] Add userLeave hook --- src/static/js/pad_userlist.js | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/static/js/pad_userlist.js b/src/static/js/pad_userlist.js index 77ebb190e..f54b3e540 100644 --- a/src/static/js/pad_userlist.js +++ b/src/static/js/pad_userlist.js @@ -633,6 +633,9 @@ var paduserlist = (function() otherUsersInfo.splice(newExistingIndex, 1); otherUsersData.splice(newExistingIndex, 1); rowManager.removeRow(newExistingIndex); + hooks.callAll('userLeave', { + userInfo: info + }); updateInviteNotice(); } }