From 06ba710dccff087c8546aee7812487693ea7e88c Mon Sep 17 00:00:00 2001 From: Alexander Sulfrian Date: Fri, 5 Feb 2010 01:27:00 +0100 Subject: try to implement headlines --- etherpad/src/static/css/pad2_ejs.css | 1 + etherpad/src/static/js/ace.js | 4 ++-- etherpad/src/templates/pad/pad_body2.ejs | 1 + infrastructure/ace/www/ace2_inner.js | 3 ++- infrastructure/ace/www/contentcollector.js | 3 +++ infrastructure/ace/www/linestylefilter.js | 3 ++- 6 files changed, 11 insertions(+), 4 deletions(-) diff --git a/etherpad/src/static/css/pad2_ejs.css b/etherpad/src/static/css/pad2_ejs.css index eb7b625..54db458 100644 --- a/etherpad/src/static/css/pad2_ejs.css +++ b/etherpad/src/static/css/pad2_ejs.css @@ -203,6 +203,7 @@ a#docbarslider { display: block; height: 0; padding-top: 30px; position: absolut <%= editbarButton('insertunorderedlist', 108) %> <%= editbarButton('indent', 140, 25) %> <%= editbarButton('outdent', 165, 24) %> +<%= editbarButton('h1', 282) %> <%= editbarButton('save', 6, null, true) %> #editbar #syncstatussyncing { position: absolute; height: 26px; width: 26px; diff --git a/etherpad/src/static/js/ace.js b/etherpad/src/static/js/ace.js index 7f19d37..051571a 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 55926d4..d3f061e 100644 --- a/etherpad/src/templates/pad/pad_body2.ejs +++ b/etherpad/src/templates/pad/pad_body2.ejs @@ -377,6 +377,7 @@ limitations under the License. */ %>
<% /* non-floated */ %>
+         diff --git a/infrastructure/ace/www/ace2_inner.js b/infrastructure/ace/www/ace2_inner.js index afd1e35..94aba87 100644 --- a/infrastructure/ace/www/ace2_inner.js +++ b/infrastructure/ace/www/ace2_inner.js @@ -752,6 +752,7 @@ function OUTER(gscope) { italic: function() { toggleAttributeOnSelection('italic'); }, underline: function() { toggleAttributeOnSelection('underline'); }, strikethrough: function() { toggleAttributeOnSelection('strikethrough'); }, + h1: function() { toggleAttributeOnSelection('h1'); }, undo: function() { doUndoRedo('undo'); }, redo: function() { doUndoRedo('redo'); }, clearauthorship: function(prompt) { @@ -1531,7 +1532,7 @@ function OUTER(gscope) { } var STYLE_ATTRIBS = {bold: true, italic: true, underline: true, - strikethrough: true, list: true}; + strikethrough: true, h1: 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 c5d8ddb..41922d7 100644 --- a/infrastructure/ace/www/contentcollector.js +++ b/infrastructure/ace/www/contentcollector.js @@ -340,6 +340,9 @@ function makeContentCollector(collectStyles, browser, apool, domInterface, tname == "del") { doAttrib("strikethrough"); } + if (tname == "h1") { + doAttrib("h1"); + } 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 0ac578b..3514859 100644 --- a/infrastructure/ace/www/linestylefilter.js +++ b/infrastructure/ace/www/linestylefilter.js @@ -25,7 +25,8 @@ linestylefilter.ATTRIB_CLASSES = { 'bold':'tag:b', 'italic':'tag:i', 'underline':'tag:u', - 'strikethrough':'tag:s' + 'strikethrough':'tag:s', + 'h1':'tag:h1' }; linestylefilter.getAuthorClassName = function(author) { -- cgit v1.2.3