diff --git a/static/css/pad.css b/static/css/pad.css index 347d9fdd..362311fc 100644 --- a/static/css/pad.css +++ b/static/css/pad.css @@ -1035,6 +1035,59 @@ background-repeat: no-repeat; margin-left: 1px; margin-top: 1px; } +.buttonicon-bold { + background-position: 0px -116px; +} +.buttonicon-italic { + background-position: 0px 0px; +} +.buttonicon-underline { + background-position: 0px -236px; +} +.buttonicon-strikethrough { + background-position: 0px -200px; +} +.buttonicon-insertorderedlist { + background-position: 0px -477px +} +.buttonicon-insertunorderedlist { + background-position: 0px -34px; +} +.buttonicon-indent { + background-position: 0px -52px; +} +.buttonicon-outdent { + background-position: 0px -134px; +} +.buttonicon-undo { + background-position: 0px -255px; +} +.buttonicon-redo { + background-position :0px -166px; +} +.buttonicon-clearauthorship { + background-position: 0px -86px; +} +.buttonicon-settings { + background-position: 0px -436px; +} +.buttonicon-import_export { + background-position: 0px -68px; +} +.buttonicon-embed { + background-position: 0px -18px; +} +.buttonicon-history { + background-position: 0px -218px; +} +.buttonicon-chat { + background-position: 0px -102px; + display: inline-block; +} +.buttonicon-showusers { + background-position: 0px -183px; + display: inline-block; +} #usericon { @@ -1179,7 +1232,7 @@ label { .popup { font-size: 14px; - width: 400px; + width: 450px; z-index: 500; padding: 10px; border-radius: 6px; @@ -1221,6 +1274,8 @@ label { .right_popup { float: left; + width: 50%; + box-sizing: border-box; padding-left: 10px; } @@ -1231,10 +1286,6 @@ label { display: none; } -#settingsmenu .right_popup { - float:none; -} - .note { color: #ddd; font-size: 11px; diff --git a/static/js/ace2_inner.js b/static/js/ace2_inner.js index e9784772..977c5cdf 100644 --- a/static/js/ace2_inner.js +++ b/static/js/ace2_inner.js @@ -236,12 +236,19 @@ function OUTER(gscope) { bgcolor = fadeColor(bgcolor, info.fade); } - - dynamicCSS.selectorStyle(getAuthorColorClassSelector( - getAuthorClassName(author))).backgroundColor = bgcolor; - dynamicCSSTop.selectorStyle(getAuthorColorClassSelector( - getAuthorClassName(author))).backgroundColor = bgcolor; + // Text color + var txtcolor = (colorutils.luminosity(colorutils.css2triple(bgcolor)) < 0.45) ? '#ffffff' : '#000000'; + + var authorStyle = dynamicCSS.selectorStyle(getAuthorColorClassSelector( + getAuthorClassName(author))); + authorStyle.backgroundColor = bgcolor; + authorStyle.color = txtcolor; + + var authorStyleTop = dynamicCSSTop.selectorStyle(getAuthorColorClassSelector( + getAuthorClassName(author))); + authorStyleTop.backgroundColor = bgcolor; + authorStyleTop.color = txtcolor; } } } @@ -3138,11 +3145,12 @@ function OUTER(gscope) // Such a div is what IE 6 creates naturally when you make a blank line // in a document of divs. However, when copy-and-pasted the div will // contain a space, so we note its emptiness with a property. - lineElem.innerHTML = ""; + lineElem.innerHTML = " "; // Frist we set a value that isnt blank // a primitive-valued property survives copy-and-paste setAssoc(lineElem, "shouldBeEmpty", true); // an object property doesn't setAssoc(lineElem, "unpasted", {}); + lineElem.innerHTML = ""; // Then we make it blank.. New line and no space = Awesome :) }; var lineClass = 'ace-line'; result.appendSpan = function(txt, cls) diff --git a/static/js/chat.js b/static/js/chat.js index 0ff8b398..9b28c333 100644 --- a/static/js/chat.js +++ b/static/js/chat.js @@ -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%"}); diff --git a/static/js/pad2.js b/static/js/pad2.js index 93fb2356..2c7d7e0e 100644 --- a/static/js/pad2.js +++ b/static/js/pad2.js @@ -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'); diff --git a/static/pad.html b/static/pad.html index e66a3d6e..2d8889b1 100644 --- a/static/pad.html +++ b/static/pad.html @@ -23,88 +23,88 @@