This commit is contained in:
booo 2012-01-30 01:04:29 +01:00
commit d4e677cc00
6 changed files with 112 additions and 37 deletions

View File

@ -1035,6 +1035,59 @@ background-repeat: no-repeat;
margin-left: 1px; margin-left: 1px;
margin-top: 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 #usericon
{ {
@ -1179,7 +1232,7 @@ label {
.popup { .popup {
font-size: 14px; font-size: 14px;
width: 400px; width: 450px;
z-index: 500; z-index: 500;
padding: 10px; padding: 10px;
border-radius: 6px; border-radius: 6px;
@ -1221,6 +1274,8 @@ label {
.right_popup { .right_popup {
float: left; float: left;
width: 50%;
box-sizing: border-box;
padding-left: 10px; padding-left: 10px;
} }
@ -1231,10 +1286,6 @@ label {
display: none; display: none;
} }
#settingsmenu .right_popup {
float:none;
}
.note { .note {
color: #ddd; color: #ddd;
font-size: 11px; font-size: 11px;

View File

@ -237,11 +237,18 @@ function OUTER(gscope)
bgcolor = fadeColor(bgcolor, info.fade); bgcolor = fadeColor(bgcolor, info.fade);
} }
dynamicCSS.selectorStyle(getAuthorColorClassSelector( // Text color
getAuthorClassName(author))).backgroundColor = bgcolor; var txtcolor = (colorutils.luminosity(colorutils.css2triple(bgcolor)) < 0.45) ? '#ffffff' : '#000000';
dynamicCSSTop.selectorStyle(getAuthorColorClassSelector( var authorStyle = dynamicCSS.selectorStyle(getAuthorColorClassSelector(
getAuthorClassName(author))).backgroundColor = bgcolor; 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 // 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 // in a document of divs. However, when copy-and-pasted the div will
// contain a space, so we note its emptiness with a property. // 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 // a primitive-valued property survives copy-and-paste
setAssoc(lineElem, "shouldBeEmpty", true); setAssoc(lineElem, "shouldBeEmpty", true);
// an object property doesn't // an object property doesn't
setAssoc(lineElem, "unpasted", {}); setAssoc(lineElem, "unpasted", {});
lineElem.innerHTML = ""; // Then we make it blank.. New line and no space = Awesome :)
}; };
var lineClass = 'ace-line'; var lineClass = 'ace-line';
result.appendSpan = function(txt, cls) result.appendSpan = function(txt, cls)

View File

@ -22,6 +22,7 @@
var padutils = require('/pad_utils').padutils; var padutils = require('/pad_utils').padutils;
var browser = require('/ace2_common').browser; var browser = require('/ace2_common').browser;
var padcookie = require('/pad_cookie').padcookie;
var chat = (function() var chat = (function()
{ {
@ -69,16 +70,17 @@ var chat = (function()
chatMentions = 0; chatMentions = 0;
document.title = title; 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(); 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"}); $('#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"}); $('#chattext').css({"top":"0px"});
$('#editorcontainer').css({"right":"192px", "width":"auto"}); $('#editorcontainer').css({"right":"192px", "width":"auto"});
isStuck = true; isStuck = true;
} else { // Unstick it } 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"}); $('#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"}); $('#chattext').css({"top":"25px"});
$('#editorcontainer').css({"right":"0px", "width":"100%"}); $('#editorcontainer').css({"right":"0px", "width":"100%"});

View File

@ -358,7 +358,6 @@ function handshake()
} }
} }
}); });
// Bind the colorpicker // Bind the colorpicker
var fb = $('#colorpicker').farbtastic({ callback: '#mycolorpickerpreview', width: 220}); var fb = $('#colorpicker').farbtastic({ callback: '#mycolorpickerpreview', width: 220});
} }
@ -450,7 +449,7 @@ var pad = {
padcookie.init(clientVars.cookiePrefsToSet); padcookie.init(clientVars.cookiePrefsToSet);
$("#widthprefcheck").click(pad.toggleWidthPref); $("#widthprefcheck").click(pad.toggleWidthPref);
$("#sidebarcheck").click(pad.toggleSidebar); // $("#sidebarcheck").click(pad.togglewSidebar);
pad.myUserInfo = { pad.myUserInfo = {
userId: clientVars.userId, userId: clientVars.userId,
@ -775,15 +774,17 @@ var pad = {
padsavedrevs.handleIsFullyConnected(isConnected); padsavedrevs.handleIsFullyConnected(isConnected);
pad.determineSidebarVisibility(isConnected && !isInitialConnect); // pad.determineSidebarVisibility(isConnected && !isInitialConnect);
pad.determineChatVisibility(isConnected && !isInitialConnect);
}, },
determineSidebarVisibility: function(asNowConnectedFeedback) /* determineSidebarVisibility: function(asNowConnectedFeedback)
{ {
if (pad.isFullyConnected()) if (pad.isFullyConnected())
{ {
var setSidebarVisibility = padutils.getCancellableAction("set-sidebar-visibility", function() 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); window.setTimeout(setSidebarVisibility, asNowConnectedFeedback ? 3000 : 0);
} }
@ -793,6 +794,17 @@ var pad = {
$("body").removeClass('hidesidebar'); $("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) handleCollabAction: function(action)
{ {
if (action == "commitPerformed") if (action == "commitPerformed")
@ -841,6 +853,7 @@ var pad = {
$("#widthprefcheck").toggleClass('widthprefchecked', !! newValue).toggleClass('widthprefunchecked', !newValue); $("#widthprefcheck").toggleClass('widthprefchecked', !! newValue).toggleClass('widthprefunchecked', !newValue);
pad.handleWidthChange(); pad.handleWidthChange();
}, },
/*
toggleSidebar: function() toggleSidebar: function()
{ {
var newValue = !padcookie.getPref('hideSidebar'); var newValue = !padcookie.getPref('hideSidebar');
@ -848,6 +861,7 @@ var pad = {
$("#sidebarcheck").toggleClass('sidebarchecked', !newValue).toggleClass('sidebarunchecked', !! newValue); $("#sidebarcheck").toggleClass('sidebarchecked', !newValue).toggleClass('sidebarunchecked', !! newValue);
pad.determineSidebarVisibility(); pad.determineSidebarVisibility();
}, },
*/
handleWidthChange: function() handleWidthChange: function()
{ {
var isFullWidth = padcookie.getPref('fullWidth'); var isFullWidth = padcookie.getPref('fullWidth');

View File

@ -23,88 +23,88 @@
<ul id="menu_left"> <ul id="menu_left">
<li onClick="window.pad&amp;&amp;pad.editbarClick('bold');return false" > <li onClick="window.pad&amp;&amp;pad.editbarClick('bold');return false" >
<a title="Bold (ctrl-B)"> <a title="Bold (ctrl-B)">
<div class="buttonicon" style="background-position:0px -116px"></div> <div class="buttonicon buttonicon-bold"></div>
</a> </a>
</li> </li>
<li onClick="window.pad&amp;&amp;pad.editbarClick('italic'); return false;" > <li onClick="window.pad&amp;&amp;pad.editbarClick('italic'); return false;" >
<a title="Italics (ctrl-I)"> <a title="Italics (ctrl-I)">
<div class="buttonicon" style="background-position:0px 0px"></div> <div class="buttonicon buttonicon-italic"></div>
</a> </a>
</li> </li>
<li onClick="window.pad&amp;&amp;pad.editbarClick('underline');return false;" > <li onClick="window.pad&amp;&amp;pad.editbarClick('underline');return false;" >
<a title="Underline (ctrl-U)"> <a title="Underline (ctrl-U)">
<div class="buttonicon" style="background-position:0px -236px;margin-top:1px;"></div> <div class="buttonicon buttonicon-underline"></div>
</a> </a>
</li> </li>
<li onClick="window.pad&amp;&amp;pad.editbarClick('strikethrough');return false;" > <li onClick="window.pad&amp;&amp;pad.editbarClick('strikethrough');return false;" >
<a title="Strikethrough"> <a title="Strikethrough">
<div class="buttonicon" style="background-position:0px -200px"></div> <div class="buttonicon buttonicon-strikethrough"></div>
</a> </a>
</li> </li>
<li class="separator"></li> <li class="separator"></li>
<li onClick="window.pad&amp;&amp;pad.editbarClick('insertorderedlist');return false;" > <li onClick="window.pad&amp;&amp;pad.editbarClick('insertorderedlist');return false;" >
<a title="Toggle Ordered List"> <a title="Toggle Ordered List">
<div class="buttonicon" style="background-position:0px -477px"></div> <div class="buttonicon buttonicon-insertorderedlist"></div>
</a> </a>
</li> </li>
<li onClick="window.pad&amp;&amp;pad.editbarClick('insertunorderedlist');return false;" > <li onClick="window.pad&amp;&amp;pad.editbarClick('insertunorderedlist');return false;" >
<a title="Toggle Bullet List"> <a title="Toggle Bullet List">
<div class="buttonicon" style="background-position:0px -34px"></div> <div class="buttonicon buttonicon-insertunorderedlist"></div>
</a> </a>
</li> </li>
<li onClick="window.pad&amp;&amp;pad.editbarClick('indent');return false;" > <li onClick="window.pad&amp;&amp;pad.editbarClick('indent');return false;" >
<a title="Indent"> <a title="Indent">
<div class="buttonicon" style="background-position:0px -52px"></div> <div class="buttonicon buttonicon-indent"></div>
</a> </a>
</li> </li>
<li onClick="window.pad&amp;&amp;pad.editbarClick('outdent');return false;" > <li onClick="window.pad&amp;&amp;pad.editbarClick('outdent');return false;" >
<a title="Unindent"> <a title="Unindent">
<div class="buttonicon" style="background-position:0px -134px"></div> <div class="buttonicon buttonicon-outdent"></div>
</a> </a>
</li> </li>
<li class="separator"></li> <li class="separator"></li>
<li onClick="window.pad&amp;&amp;pad.editbarClick('undo');return false;" > <li onClick="window.pad&amp;&amp;pad.editbarClick('undo');return false;" >
<a title="Undo (ctrl-Z)"> <a title="Undo (ctrl-Z)">
<div class="buttonicon" style="background-position:0px -255px"></div> <div class="buttonicon buttonicon-undo"></div>
</a> </a>
</li> </li>
<li onClick="window.pad&amp;&amp;pad.editbarClick('redo');return false;" > <li onClick="window.pad&amp;&amp;pad.editbarClick('redo');return false;" >
<a title="Redo (ctrl-Y)"> <a title="Redo (ctrl-Y)">
<div class="buttonicon" style="background-position:0px -166px"></div> <div class="buttonicon buttonicon-redo"></div>
</a> </a>
</li> </li>
<li class="separator"></li> <li class="separator"></li>
<li id="clearAuthorship" onClick="window.pad&amp;&amp;pad.editbarClick('clearauthorship');return false;" > <li id="clearAuthorship" onClick="window.pad&amp;&amp;pad.editbarClick('clearauthorship');return false;" >
<a title="Clear Authorship Colors"> <a title="Clear Authorship Colors">
<div class="buttonicon" style="background-position:0px -86px"></div> <div class="buttonicon buttonicon-clearauthorship"></div>
</a> </a>
</li> </li>
</ul> </ul>
<ul id="menu_right"> <ul id="menu_right">
<li onClick="window.pad&amp;&amp;pad.editbarClick('settings');return false;"> <li onClick="window.pad&amp;&amp;pad.editbarClick('settings');return false;">
<a id="settingslink" title="Settings of this pad"> <a id="settingslink" title="Settings of this pad">
<div class="buttonicon" style="background-position:0px -436px"></div> <div class="buttonicon buttonicon-settings"></div>
</a> </a>
</li> </li>
<li onClick="window.pad&amp;&amp;pad.editbarClick('import_export');return false;"> <li onClick="window.pad&amp;&amp;pad.editbarClick('import_export');return false;">
<a id="exportlink" title="Import/Export from/to different document formats"> <a id="exportlink" title="Import/Export from/to different document formats">
<div class="buttonicon" style="background-position:0px -68px"></div> <div class="buttonicon buttonicon-import_export"></div>
</a> </a>
</li> </li>
<li onClick="window.pad&amp;&amp;pad.editbarClick('embed');return false;" > <li onClick="window.pad&amp;&amp;pad.editbarClick('embed');return false;" >
<a id="embedlink" title="Share and Embed this pad"> <a id="embedlink" title="Share and Embed this pad">
<div class="buttonicon" style="background-position:0px -18px"></div> <div class="buttonicon buttonicon-embed"></div>
</a> </a>
</li> </li>
<li class="separator"></li> <li class="separator"></li>
<li id="timesliderlink" onClick="document.location = document.location.pathname+ '/timeslider'"> <li id="timesliderlink" onClick="document.location = document.location.pathname+ '/timeslider'">
<a title="Show the history of this pad"> <a title="Show the history of this pad">
<div class="buttonicon" style="background-position:0px -218px"></div> <div class="buttonicon buttonicon-history"></div>
</a> </a>
</li> </li>
<li id="usericon" onClick="window.pad&amp;&amp;pad.editbarClick('showusers');return false;" > <li id="usericon" onClick="window.pad&amp;&amp;pad.editbarClick('showusers');return false;" >
<a title="Show connected users"> <a title="Show connected users">
<div class="buttonicon" id="usericonback" style="background-position:0px -183px;display:inline-block;"></div> <div class="buttonicon buttonicon-showusers" id="usericonback"></div>
<span id="online_count">1</span> <span id="online_count">1</span>
</a> </a>
</li> </li>
@ -228,7 +228,7 @@
<div id="chaticon"> <div id="chaticon">
<a onClick="chat.show();return false;" title="Open the chat for this pad"> <a onClick="chat.show();return false;" title="Open the chat for this pad">
<span id="chatlabel">Chat</span> <span id="chatlabel">Chat</span>
<div class="buttonicon" style="background-position:0px -102px;display:inline-block;"></div> <div class="buttonicon buttonicon-chat"></div>
</a> </a>
<span id="chatcounter">0</span> <span id="chatcounter">0</span>
</div> </div>

View File

@ -293,7 +293,7 @@
<ul> <ul>
<li onClick="window.padeditbar.toolbarClick('import_export');return false;"> <li onClick="window.padeditbar.toolbarClick('import_export');return false;">
<a id="exportlink" title="Export to different document formats"> <a id="exportlink" title="Export to different document formats">
<div class="buttonicon" style="background-position:0px -68px"></div> <div class="buttonicon buttonicon-import_export"></div>
</a> </a>
</li> </li>
</ul> </ul>