From 1199878005d6980e6f3631f419778927147bd639 Mon Sep 17 00:00:00 2001 From: Alexander Sulfrian Date: Fri, 5 Feb 2010 01:58:02 +0100 Subject: added header buttons and used backend functionality --- etherpad/src/static/css/pad2_ejs.css | 29 +++++++++++++++---------- etherpad/src/static/img/jun09/pad/editbar3.gif | Bin 9587 -> 0 bytes etherpad/src/static/img/jun09/pad/editbar3.png | Bin 0 -> 16869 bytes etherpad/src/static/img/jun09/pad/editbar3.xcf | Bin 0 -> 79212 bytes etherpad/src/static/js/ace.js | 4 ++-- etherpad/src/templates/pad/pad_body2.ejs | 7 +++++- infrastructure/ace/www/ace2_inner.js | 9 +++++++- infrastructure/ace/www/contentcollector.js | 15 +++++++++++++ infrastructure/ace/www/linestylefilter.js | 7 +++++- 9 files changed, 54 insertions(+), 17 deletions(-) delete mode 100644 etherpad/src/static/img/jun09/pad/editbar3.gif create mode 100644 etherpad/src/static/img/jun09/pad/editbar3.png create mode 100644 etherpad/src/static/img/jun09/pad/editbar3.xcf diff --git a/etherpad/src/static/css/pad2_ejs.css b/etherpad/src/static/css/pad2_ejs.css index 54db458..9da45a7 100644 --- a/etherpad/src/static/css/pad2_ejs.css +++ b/etherpad/src/static/css/pad2_ejs.css @@ -153,19 +153,19 @@ a#docbarslider { display: block; height: 0; padding-top: 30px; position: absolut .hidesidebar #padeditor { margin-right: 0; } #editbar { height: 36px; - background: #a5bfe2 url(/static/img/jun09/pad/editbar3.gif) repeat-x left -36px; position: relative; } + background: #a5bfe2 url(/static/img/jun09/pad/editbar3.png) repeat-x left -36px; position: relative; } #editbarleft { float: left; height: 100%; overflow: hidden; - background: url(/static/img/jun09/pad/editbar3.gif) no-repeat left top; width: 3px; } + background: url(/static/img/jun09/pad/editbar3.png) no-repeat left top; width: 3px; } #editbarright { float: right; height: 100%; overflow: hidden; - background: url(/static/img/jun09/pad/editbar3.gif) no-repeat right top; width: 3px; } + background: url(/static/img/jun09/pad/editbar3.png) no-repeat right top; width: 3px; } #editbar a.editbarbutton { display: block; position: absolute; height: 26px; width: 26px; - background-image: url(/static/img/jun09/pad/editbar3.gif); + background-image: url(/static/img/jun09/pad/editbar3.png); background-color: transparent; background-repeat: no-repeat; text-decoration: none; @@ -178,7 +178,7 @@ a#docbarslider { display: block; height: 0; padding-top: 30px; position: absolut cursor: auto; } /*#editbar .divider { position: absolute; width: 4px; height: 15px; - background-image: url(/static/img/jun09/pad/editbar3.gif); + background-image: url(/static/img/jun09/pad/editbar3.png); background-color: transparent; background-repeat: no-repeat; } #editbar .divider1 { left: 137px; top: 11px; background-position: -137px -11px; } #editbar .divider2 { left: 188px; top: 11px; background-position: -188px -11px; }*/ @@ -197,13 +197,18 @@ a#docbarslider { display: block; height: 0; padding-top: 30px; position: absolut <%= editbarButton('italic', 32, 23) %> <%= editbarButton('underline', 55, 23) %> <%= editbarButton('strikethrough', 78, 24) %> -<%= editbarButton('clearauthorship', 195) %> -<%= editbarButton('undo', 227, 25) %> -<%= editbarButton('redo', 252, 24) %> -<%= editbarButton('insertunorderedlist', 108) %> -<%= editbarButton('indent', 140, 25) %> -<%= editbarButton('outdent', 165, 24) %> -<%= editbarButton('h1', 282) %> +<%= editbarButton('h1', 108, 25) %> +<%= editbarButton('h2', 133, 23) %> +<%= editbarButton('h3', 156, 23) %> +<%= editbarButton('h4', 179, 23) %> +<%= editbarButton('h5', 202, 23) %> +<%= editbarButton('h6', 225, 24) %> +<%= editbarButton('clearauthorship', 342) %> +<%= editbarButton('undo', 374, 25) %> +<%= editbarButton('redo', 399, 24) %> +<%= editbarButton('insertunorderedlist', 255) %> +<%= editbarButton('indent', 287, 25) %> +<%= editbarButton('outdent', 312, 24) %> <%= editbarButton('save', 6, null, true) %> #editbar #syncstatussyncing { position: absolute; height: 26px; width: 26px; diff --git a/etherpad/src/static/img/jun09/pad/editbar3.gif b/etherpad/src/static/img/jun09/pad/editbar3.gif deleted file mode 100644 index e73c505..0000000 Binary files a/etherpad/src/static/img/jun09/pad/editbar3.gif and /dev/null differ diff --git a/etherpad/src/static/img/jun09/pad/editbar3.png b/etherpad/src/static/img/jun09/pad/editbar3.png new file mode 100644 index 0000000..ff65146 Binary files /dev/null and b/etherpad/src/static/img/jun09/pad/editbar3.png differ diff --git a/etherpad/src/static/img/jun09/pad/editbar3.xcf b/etherpad/src/static/img/jun09/pad/editbar3.xcf new file mode 100644 index 0000000..91cae20 Binary files /dev/null and b/etherpad/src/static/img/jun09/pad/editbar3.xcf differ diff --git a/etherpad/src/static/js/ace.js b/etherpad/src/static/js/ace.js index 051571a..6976945 100644 --- a/etherpad/src/static/js/ace.js +++ b/etherpad/src/static/js/ace.js @@ -19,8 +19,8 @@ var L=function(Q){return'\''"];T.push(("('\\n\'');T.push('\' \''); var X='editorId = "'+A.id+'"; editorInfo = parent.'+K+'.registry[editorId]; window.onload = function() { window.onload = null; setTimeout(function() { var iframe = document.createElement("IFRAME"); iframe.scrolling = "no"; var outerdocbody = document.getElementById("outerdocbody"); iframe.frameBorder = 0; iframe.allowTransparency = true; outerdocbody.insertBefore(iframe, outerdocbody.firstChild); iframe.ace_outerWin = window; readyFunc = function() { editorInfo.onEditorReady(); readyFunc = null; editorInfo = null; }; var doc = iframe.contentWindow.document; doc.open(); doc.write('+T.join("+")+"); doc.close(); }, 0); }"; var Y=[W,"",(''),'',"\x3cscript>",X,"\x3c/script>",'
x
']; diff --git a/etherpad/src/templates/pad/pad_body2.ejs b/etherpad/src/templates/pad/pad_body2.ejs index d3f061e..5e3ea97 100644 --- a/etherpad/src/templates/pad/pad_body2.ejs +++ b/etherpad/src/templates/pad/pad_body2.ejs @@ -377,11 +377,16 @@ limitations under the License. */ %>
<% /* non-floated */ %>
-           +   +   +   +   +   +         diff --git a/infrastructure/ace/www/ace2_inner.js b/infrastructure/ace/www/ace2_inner.js index 94aba87..6723cef 100644 --- a/infrastructure/ace/www/ace2_inner.js +++ b/infrastructure/ace/www/ace2_inner.js @@ -753,6 +753,11 @@ function OUTER(gscope) { underline: function() { toggleAttributeOnSelection('underline'); }, strikethrough: function() { toggleAttributeOnSelection('strikethrough'); }, h1: function() { toggleAttributeOnSelection('h1'); }, + h2: function() { toggleAttributeOnSelection('h2'); }, + h3: function() { toggleAttributeOnSelection('h3'); }, + h4: function() { toggleAttributeOnSelection('h4'); }, + h5: function() { toggleAttributeOnSelection('h5'); }, + h6: function() { toggleAttributeOnSelection('h6'); }, undo: function() { doUndoRedo('undo'); }, redo: function() { doUndoRedo('redo'); }, clearauthorship: function(prompt) { @@ -1532,7 +1537,9 @@ function OUTER(gscope) { } var STYLE_ATTRIBS = {bold: true, italic: true, underline: true, - strikethrough: true, h1: true, list: true}; + strikethrough: true, h1: true, h2: true, + h3: true, h4: true, h5: true, h6: true, + list: true}; var OTHER_INCORPED_ATTRIBS = {insertorder: true, author: true}; function isStyleAttribute(aname) { diff --git a/infrastructure/ace/www/contentcollector.js b/infrastructure/ace/www/contentcollector.js index 41922d7..573672e 100644 --- a/infrastructure/ace/www/contentcollector.js +++ b/infrastructure/ace/www/contentcollector.js @@ -343,6 +343,21 @@ function makeContentCollector(collectStyles, browser, apool, domInterface, if (tname == "h1") { doAttrib("h1"); } + if (tname == "h2") { + doAttrib("h2"); + } + if (tname == "h3") { + doAttrib("h3"); + } + if (tname == "h4") { + doAttrib("h4"); + } + if (tname == "h5") { + doAttrib("h5"); + } + if (tname == "h6") { + doAttrib("h6"); + } if (tname == "ul") { var type; var rr = cls && /(?:^| )list-(bullet[12345678])\b/.exec(cls); diff --git a/infrastructure/ace/www/linestylefilter.js b/infrastructure/ace/www/linestylefilter.js index 3514859..ef824cc 100644 --- a/infrastructure/ace/www/linestylefilter.js +++ b/infrastructure/ace/www/linestylefilter.js @@ -26,7 +26,12 @@ linestylefilter.ATTRIB_CLASSES = { 'italic':'tag:i', 'underline':'tag:u', 'strikethrough':'tag:s', - 'h1':'tag:h1' + 'h1':'tag:h1', + 'h2':'tag:h2', + 'h3':'tag:h3', + 'h4':'tag:h4', + 'h5':'tag:h5', + 'h6':'tag:h6' }; linestylefilter.getAuthorClassName = function(author) { -- cgit v1.2.3-1-g7c22