From 239742e80cbc5d11218a82416500b5992ab42f49 Mon Sep 17 00:00:00 2001 From: Jean-Tiare Le Bigot Date: Thu, 1 Dec 2011 11:50:17 +0100 Subject: [PATCH 01/17] added internal ordered list support. Numbering increment is not yet handled. small code factorisation. Added related CSS --- static/css/iframe_editor.css | 19 +++++++++++++++++++ static/js/ace2_inner.js | 14 +++++++++++--- 2 files changed, 30 insertions(+), 3 deletions(-) diff --git a/static/css/iframe_editor.css b/static/css/iframe_editor.css index 86ca99117..4385fff0c 100644 --- a/static/css/iframe_editor.css +++ b/static/css/iframe_editor.css @@ -32,6 +32,25 @@ ul.list-bullet6 { list-style-type: square; } ul.list-bullet7 { list-style-type: disc; } ul.list-bullet8 { list-style-type: circle; } +ul.list-number1 { margin-left: 1.5em; } +ul.list-number2 { margin-left: 3em; } +ul.list-number3 { margin-left: 4.5em; } +ul.list-number4 { margin-left: 6em; } +ul.list-number5 { margin-left: 7.5em; } +ul.list-number6 { margin-left: 9em; } +ul.list-number7 { margin-left: 10.5em; } +ul.list-number8 { margin-left: 12em; } + +ul { list-style-type: disc; } +ul.list-number1 { list-style-type: decimal; } +ul.list-number2 { list-style-type: lower-latin; } +ul.list-number3 { list-style-type: lower-roman; } +ul.list-number4 { list-style-type: decimal; } +ul.list-number5 { list-style-type: lower-latin; } +ul.list-number6 { list-style-type: lower-roman; } +ul.list-number7 { list-style-type: decimal; } +ul.list-number8 { list-style-type: lower-latin; } + ul.list-indent1 { margin-left: 1.5em; } ul.list-indent2 { margin-left: 3em; } ul.list-indent3 { margin-left: 4.5em; } diff --git a/static/js/ace2_inner.js b/static/js/ace2_inner.js index 6c8ec60e0..34b43a3cb 100644 --- a/static/js/ace2_inner.js +++ b/static/js/ace2_inner.js @@ -5218,7 +5218,7 @@ function OUTER(gscope) } } - function doInsertUnorderedList() + function doInsertUnorderedList(type) { if (!(rep.selStart && rep.selEnd)) { @@ -5233,7 +5233,7 @@ function OUTER(gscope) for (var n = firstLine; n <= lastLine; n++) { var listType = getLineListType(n); - if (!listType || listType.slice(0, 'bullet'.length) != 'bullet') + if (!listType || listType.slice(0, type.length) != type) { allLinesAreList = false; break; @@ -5252,11 +5252,19 @@ function OUTER(gscope) level = Number(listType[2]); } var t = getLineListType(n); - mods.push([n, allLinesAreList ? 'indent' + level : (t ? 'bullet' + level : 'bullet1')]); + mods.push([n, allLinesAreList ? 'indent' + level : (t ? type + level : type + '1')]); } setLineListTypes(mods); } + + function doInsertUnorderedList(){ + doInsertList('bullet'); + } + function doInsertOrderedList(){ + doInsertList('number'); + } editorInfo.ace_doInsertUnorderedList = doInsertUnorderedList; + editorInfo.ace_doInsertOrderedList = doInsertOrderedList; var mozillaFakeArrows = (browser.mozilla && (function() { From 5027ad4c9218485d3abbd7625a077094d9ce13ff Mon Sep 17 00:00:00 2001 From: Jean-Tiare Le Bigot Date: Thu, 1 Dec 2011 11:59:12 +0100 Subject: [PATCH 02/17] fixed typo, added initial interface with still bullet button --- static/js/ace2_inner.js | 2 +- static/js/pad_editbar.js | 1 + static/pad.html | 5 +++++ 3 files changed, 7 insertions(+), 1 deletion(-) diff --git a/static/js/ace2_inner.js b/static/js/ace2_inner.js index 34b43a3cb..1e2701f21 100644 --- a/static/js/ace2_inner.js +++ b/static/js/ace2_inner.js @@ -5218,7 +5218,7 @@ function OUTER(gscope) } } - function doInsertUnorderedList(type) + function doInsertList(type) { if (!(rep.selStart && rep.selEnd)) { diff --git a/static/js/pad_editbar.js b/static/js/pad_editbar.js index 97bd7f85b..3818db871 100644 --- a/static/js/pad_editbar.js +++ b/static/js/pad_editbar.js @@ -120,6 +120,7 @@ var padeditbar = (function() if (cmd == 'bold' || cmd == 'italic' || cmd == 'underline' || cmd == 'strikethrough') ace.ace_toggleAttributeOnSelection(cmd); else if (cmd == 'undo' || cmd == 'redo') ace.ace_doUndoRedo(cmd); else if (cmd == 'insertunorderedlist') ace.ace_doInsertUnorderedList(); + else if (cmd == 'insertorderedlist') ace.ace_doInsertOrderedList(); else if (cmd == 'indent') { if (!ace.ace_doIndentOutdent(false)) diff --git a/static/pad.html b/static/pad.html index e56e4f169..74ed1dad4 100644 --- a/static/pad.html +++ b/static/pad.html @@ -44,6 +44,11 @@
  • +
  • + +
    +
    +
  • From b8e9131158441aced71f19f1a1c6a86ea6685697 Mon Sep 17 00:00:00 2001 From: Jean-Tiare Le Bigot Date: Thu, 1 Dec 2011 15:09:50 +0100 Subject: [PATCH 03/17] added an icon for ordered list --- static/img/etherpad_lite_icons.png | Bin 2307 -> 2322 bytes static/pad.html | 2 +- 2 files changed, 1 insertion(+), 1 deletion(-) diff --git a/static/img/etherpad_lite_icons.png b/static/img/etherpad_lite_icons.png index 606612313dd64b158a7ad0007a56271346aa53ac..d3fb106698bd4eea630821d92196da7df6ae1be5 100644 GIT binary patch delta 1907 zcmV-(2aNcG5|R>-7a_z50{{R32lZOs0004fP)t-s`}_N=$DzBsyI5_?m6esTNNxcH zL@Yiblez&pe+&T*3NGcw1ZMyM2M$R@K~z}7t!s8cUx-zOHHYm=4Vcufg2f+8lT-64rUZt=_`o+L$x6H)}+{|G<0`vc++% z&)u4_!@3>A^4*<#=!q77Sz`3DPMHE!ACt-`fBTF+7N);Gbz|!J#0@M{A$MClv3_I6 zBBcK_QJ0@sZIKp-Y%b{0%(^1M~-T zx-KKC)q^0w0Q$@YCg|u82JxS+053??AkcZhGZrwkkf}@R7E!a05NsamGA5lovcZv5 ze<`KeD1ZjviMH3WqkA3WoQp#uqV&~evY~du`m95!rGRc4(3Ct(wsDF0Fj&B{kPn3c zVj4++Qqr%KhfoUrXz9StJ;EzOxv8(ShWM+~_%^Ws!+iAja=DZ{ROYn+i$>R_8^q$` zWgEVUnkI&yh(GWrUOV)SwhjV7Jh1@8e?VUo&|sZ5@DV2Iwg6I*xR<;lxN5Z;G7x2< ziUUPSgwXZLq{~n&MMZ)E$0mk81q^yJ6{0)|PNs*dlmV1%J}XepAhw-78bP}pZUACj zwL``4n+m>QT|A|9>-BDOi!6ywLy{VfNH@ZYEd@cj z90ZbG!QVIdkR?Li;2WV$rxQd#f6(b5e`1gT0lE%x9Tw|* zyCDjNWJcSX)-GJ=jE0+jkv^j(r$x_bS5Ka21SFU|&kPhWAtdKDvc{Mre_R*u`{^5) zb+#?}5?LNIJYxEo9ii_+%=Atr4nrc#m69<6=q1{A;y?vT#@Ta?BVoTki zp?nda?aOxjlLtqcp1B-zQkCZ}bzkJ29u>L+C+zGIq({|RPzaGlA}cE^v&3eRem~JP ziTNUUv^c%_Xu8=1=4=52e~XKsR;C{{N5id+SgdR|H=EO=w1*Y2*=#mPn?EGLO7qiZ z^V38EG&hmaL=2!;EOC?3SmLmI>_~g5!BHg{ey`{7SLg(L?z{l-{fIiQj=TgkFW^93 zIC%Q(m3lz)vZemLwfA&+c|mo-->WPIWA z?)vWI!|{c20;mhmw%6Bxd4D&u7*SsxuCKqptB#LEz1)1Zy?v;v>K2XiKvk!vUX7~< zao8l%t#2eR2|#Tk!0cP6BrmCjYYtw?0|8F*rJ{)*J^_5bP&9bHh#nZ=?3P&bc-yOq z1_mUt1!`Q&P-=hxe~N=FuwV-Z6g}Qmc*o`ymnXw_bvRvCltW#ouA&l3jv%L3>a@L-==xN0GjFIiI{YWf7x|z7b8H% zlf>ONBA|VO_l?-%-iH(P-OS1D$j8UY-;vYFCvQJcV0Cixf45)7x090}<6Z{T3nTx# zdRdyu)XUOZre3Z+q(HRRmtJJ*<>*?vURHlRT1}P5wTG(_f`PgHxz(dT_K!kO7+6|* z@o;8!>1gR80q*b55%W3RWM=8lwN%ahvw#1a+Fu6on8CTOqMXKKZG*!$!+ESFw+&>( z4JS6sYRPiDf88E#Q7jg%P_Fd8Z?s#jmdu>zth(oU?0MJVo+T7hh`!OSX^pfbxMW|zxx=-^+H6U5DPW|94E##QWY zJ*P3PG+)#M_K+*{XcWxJ*>ce!Sik^^rZFx+tM1p)JwJP2okwz}+g0A_Lk0lpdv^ZI tPP1Nxd{(cdo%T05zta#%JI$XS>c4JSfa?Yj%o+dy002ovPDHLkV1fvGn5qB( delta 1892 zcmV-q2b=hk5`z+u7csO50{{R34A)m500001b5ch_0Itp)=>Px$fKW_SMfUdgtH+_c zySrFz%9WLs`}_N`IBo$1A#vzald1tZe+Um30VjDzECc`m2JcBkK~z}7iIdWe z?LgwR2TJT;o}Zun{C>6zz?nsoBqIX|P?*mE8q7Bla{v^w^%BgQ95m4==73@&e_OBS zY;q97GPtB-TWL9(JF8Hhjq7|LA%YL2CZ1JIuLtO*dw|n7P^n*UnyB8{z`7ecsOxrA zJjQcuxph$S>*74H>ZrNZsOuVn6Q;^1co^>t!s8cUx-v7u>=gbuBHFTvc}+8lT(64trLt=_=m zIhZrFS8Jqx_n!4CVvFOXK6hiriSl*~%Xhc#peI`R6^W^jbt@F0^)ab}f1=OS$D;5z zrmjsrow$Z&D&lT?C#hfCu?gw_OsdOIH9E4Lsby51+A-42CK_B(7(V!(vYc1 zY8Fv*fDo)6)n!aNMWlm0f2mPQbC3f~z8i0^6<7DW#uqLQiHI_gm+6Mujq!i4b}LnRFS77eY6m0hwy&e;C4JW~@a@eRRNlnl1c50wr$8;^#B$Kctw34wRad9wBAe)zF;S z*(=jL19b6xY8KO^7#QYhna_HrbyPTT&sf3~ARPpyFAF)Kl8+2|{ye+au>WKRrJAVk+8uFC>l z4tNp;s?kgGfEEKrWE)LYr-lJRQA~u?I>4+EtNjY#La~PCULZi&54xflE#`TtNf1A5 zN_afB)Wm$)Y)W+6OhIfqPE!=jbVfUx)-lg@Mx#x?M4$1J)8c2mtEbO10uoH0X9i46 z2pp}rDTi%dWm-2#8H8g zasFK63i*)L^21cJbs1KNP`-%I_7x}j$%CUz&s>fp9xUFrX?@sieV9mr)+SP#NB~sCk~A4jByqdXj zeB9gKf4zG3>UEVg8DDs~yT1GIaC~8$0P4b%?e+Cv-rkNiM${LF>+5fCtK%baFV~-J zZy&0vx<$P_P}Qla7vt(d;x_Sg>l=wn3Q(OGum;vCiA!eTTBon%Qvps2q>_am0RaNu zEEzmsLJtgZPFt+|yyMqJ0|S!S26e7&D0M&pf5k-_Sg?i*NsB;Lx~W z0L^siL`=KHzwEj##5YLqo6UZv_RBD_K+*{XcWxJ+4j&NSik^^rZFZ!yAd?d9zT0u eokucwyZRTvFLx~lYglCf0000
  • -
    +
  • From 68a01cc603473036619305964680117a7bbd3232 Mon Sep 17 00:00:00 2001 From: Jean-Tiare Le Bigot Date: Thu, 1 Dec 2011 18:35:26 +0100 Subject: [PATCH 04/17] added numbrering logic + trigger on style update + visual render --- static/js/ace2_inner.js | 71 +++++++++++++++++++++++++++++++++++- static/js/domline.js | 4 +- static/js/linestylefilter.js | 4 ++ 3 files changed, 77 insertions(+), 2 deletions(-) diff --git a/static/js/ace2_inner.js b/static/js/ace2_inner.js index 1e2701f21..282c42fdc 100644 --- a/static/js/ace2_inner.js +++ b/static/js/ace2_inner.js @@ -5169,7 +5169,74 @@ function OUTER(gscope) [lineNum, listType] ]); } - + + function renumberList(lineNum){ + //1-check we are in a list + if(!getLineListType(lineNum)) + { + return null; + } + + //2-find the first line of the list + while(lineNum-1 >= 0 && getLineListType(lineNum-1)) + { + lineNum--; + } + + //3-renumber every list item of the same level from the beginning, level 1 + //IMPORTANT: never skip a level because there imbrication may be arbitrary + var builder = Changeset.builder(rep.lines.totalWidth()); + loc = [0,0]; + function applyNumberList(line, level) + { + //init + var position = 1; + var curLevel = level; + var listType; + //loop over the lines + while(listType = getLineListType(line)) + { + //apply new num + curLevel = /[a-z]+([12345678])/.exec(listType); + curLevel = Number(curLevel[1]); + if(isNaN(curLevel)) + { + return line; + } + else if(curLevel == level) + { + buildKeepRange(builder, loc, (loc = [line, 0])); + buildKeepRange(builder, loc, (loc = [line, 1]), [ + ['start', position] + ], rep.apool); + + position++; + line++; + } + else if(curLevel < level) + { + return line;//back to parent + } + else + { + line = applyNumberList(line, level+1);//recursive call + } + } + return line; + } + + applyNumberList(lineNum, 1); + var cs = builder.toString(); + if (!Changeset.isIdentity(cs)) + { + performDocumentApplyChangeset(cs); + } + + //4-apply the modifications + + + } + function setLineListTypes(lineNumTypePairsInOrder) { var loc = [0, 0]; @@ -5216,6 +5283,8 @@ function OUTER(gscope) { performDocumentApplyChangeset(cs); } + + renumberList(lineNum); } function doInsertList(type) diff --git a/static/js/domline.js b/static/js/domline.js index 7732805fd..dce45f48a 100644 --- a/static/js/domline.js +++ b/static/js/domline.js @@ -89,12 +89,14 @@ domline.createDomLine = function(nonEmpty, doesWrap, optBrowser, optDocument) if (cls.indexOf('list') >= 0) { var listType = /(?:^| )list:(\S+)/.exec(cls); + var start = /(?:^| )start:(\S+)/.exec(cls); if (listType) { listType = listType[1]; + start = start?'start="'+start[1]+'"':''; if (listType) { - preHtml = '
    • '; + preHtml = '
      • '; postHtml = '
      '; } result.lineMarker += txt.length; diff --git a/static/js/linestylefilter.js b/static/js/linestylefilter.js index f6cf9f357..ace55f38d 100644 --- a/static/js/linestylefilter.js +++ b/static/js/linestylefilter.js @@ -84,6 +84,10 @@ linestylefilter.getLineStyleFilter = function(lineLength, aline, textAndClassFun { classes += ' list:' + value; } + else if (key == 'start') + { + classes += ' start:' + value; + } else if (linestylefilter.ATTRIB_CLASSES[key]) { classes += ' ' + linestylefilter.ATTRIB_CLASSES[key]; From cd15ad24abbb50f8db2a6de42ff537776c8c3a18 Mon Sep 17 00:00:00 2001 From: Jean-Tiare Le Bigot Date: Fri, 2 Dec 2011 09:34:17 +0100 Subject: [PATCH 05/17] trivial, quick and dirty chrome fix --- README.md | 1 - static/css/iframe_editor.css | 34 +++++++++++++++++----------------- static/js/domline.js | 12 ++++++++++-- 3 files changed, 27 insertions(+), 20 deletions(-) diff --git a/README.md b/README.md index 6b4e1e956..b21cd8e82 100644 --- a/README.md +++ b/README.md @@ -67,7 +67,6 @@ Here is the **[FAQ](https://github.com/Pita/etherpad-lite/wiki/FAQ)**
    • Move into the node folder cd node-v0.6* and build node with ./configure && make && make install
    • -
    • Install npm curl http://npmjs.org/install.sh | sh
    • **As any user (we recommend creating a separate user called etherpad-lite):** diff --git a/static/css/iframe_editor.css b/static/css/iframe_editor.css index 4385fff0c..f6366f3b9 100644 --- a/static/css/iframe_editor.css +++ b/static/css/iframe_editor.css @@ -32,24 +32,24 @@ ul.list-bullet6 { list-style-type: square; } ul.list-bullet7 { list-style-type: disc; } ul.list-bullet8 { list-style-type: circle; } -ul.list-number1 { margin-left: 1.5em; } -ul.list-number2 { margin-left: 3em; } -ul.list-number3 { margin-left: 4.5em; } -ul.list-number4 { margin-left: 6em; } -ul.list-number5 { margin-left: 7.5em; } -ul.list-number6 { margin-left: 9em; } -ul.list-number7 { margin-left: 10.5em; } -ul.list-number8 { margin-left: 12em; } +ol.list-number1 { margin-left: 1.5em; } +ol.list-number2 { margin-left: 3em; } +ol.list-number3 { margin-left: 4.5em; } +ol.list-number4 { margin-left: 6em; } +ol.list-number5 { margin-left: 7.5em; } +ol.list-number6 { margin-left: 9em; } +ol.list-number7 { margin-left: 10.5em; } +ol.list-number8 { margin-left: 12em; } -ul { list-style-type: disc; } -ul.list-number1 { list-style-type: decimal; } -ul.list-number2 { list-style-type: lower-latin; } -ul.list-number3 { list-style-type: lower-roman; } -ul.list-number4 { list-style-type: decimal; } -ul.list-number5 { list-style-type: lower-latin; } -ul.list-number6 { list-style-type: lower-roman; } -ul.list-number7 { list-style-type: decimal; } -ul.list-number8 { list-style-type: lower-latin; } +ol { list-style-type: disc; } +ol.list-number1 { list-style-type: decimal; } +ol.list-number2 { list-style-type: lower-latin; } +ol.list-number3 { list-style-type: lower-roman; } +ol.list-number4 { list-style-type: decimal; } +ol.list-number5 { list-style-type: lower-latin; } +ol.list-number6 { list-style-type: lower-roman; } +ol.list-number7 { list-style-type: decimal; } +ol.list-number8 { list-style-type: lower-latin; } ul.list-indent1 { margin-left: 1.5em; } ul.list-indent2 { margin-left: 3em; } diff --git a/static/js/domline.js b/static/js/domline.js index dce45f48a..f081f7df3 100644 --- a/static/js/domline.js +++ b/static/js/domline.js @@ -96,8 +96,16 @@ domline.createDomLine = function(nonEmpty, doesWrap, optBrowser, optDocument) start = start?'start="'+start[1]+'"':''; if (listType) { - preHtml = '
      • '; - postHtml = '
      '; + if(listType.indexOf("number") < 0) + { + preHtml = '
      • '; + postHtml = '
      '; + } + else + { + preHtml = '
      1. '; + postHtml = '
      '; + } } result.lineMarker += txt.length; return; // don't append any text From 308a20bf11e9768f096d2d842a07988642f81c22 Mon Sep 17 00:00:00 2001 From: Jean-Tiare Le Bigot Date: Thu, 8 Dec 2011 16:21:38 +0100 Subject: [PATCH 06/17] bring indentation and ordered list support to timeslider. Still miss numbering :/ --- static/css/timeslider.css | 39 +++++++++++++++++++++++++++++++++++++ static/js/domline_client.js | 21 ++++++++++++++++---- 2 files changed, 56 insertions(+), 4 deletions(-) diff --git a/static/css/timeslider.css b/static/css/timeslider.css index f03f70c92..e84e5bac3 100644 --- a/static/css/timeslider.css +++ b/static/css/timeslider.css @@ -195,6 +195,8 @@ float:right; color: #222; } +ul { margin-left: 1.5em; } +ul ul { margin-left: 0 !important; } ul { margin-left: 1.5em; } ul ul { margin-left: 0 !important; } ul.list-bullet1 { margin-left: 1.5em; } @@ -216,3 +218,40 @@ ul.list-bullet6 { list-style-type: square; } ul.list-bullet7 { list-style-type: disc; } ul.list-bullet8 { list-style-type: circle; } +ol.list-number1 { margin-left: 1.5em; } +ol.list-number2 { margin-left: 3em; } +ol.list-number3 { margin-left: 4.5em; } +ol.list-number4 { margin-left: 6em; } +ol.list-number5 { margin-left: 7.5em; } +ol.list-number6 { margin-left: 9em; } +ol.list-number7 { margin-left: 10.5em; } +ol.list-number8 { margin-left: 12em; } + +ol { list-style-type: disc; } +ol.list-number1 { list-style-type: decimal; } +ol.list-number2 { list-style-type: lower-latin; } +ol.list-number3 { list-style-type: lower-roman; } +ol.list-number4 { list-style-type: decimal; } +ol.list-number5 { list-style-type: lower-latin; } +ol.list-number6 { list-style-type: lower-roman; } +ol.list-number7 { list-style-type: decimal; } +ol.list-number8 { list-style-type: lower-latin; } + +ul.list-indent1 { margin-left: 1.5em; } +ul.list-indent2 { margin-left: 3em; } +ul.list-indent3 { margin-left: 4.5em; } +ul.list-indent4 { margin-left: 6em; } +ul.list-indent5 { margin-left: 7.5em; } +ul.list-indent6 { margin-left: 9em; } +ul.list-indent7 { margin-left: 10.5em; } +ul.list-indent8 { margin-left: 12em; } + +ul.list-indent1 { list-style-type: none; } +ul.list-indent2 { list-style-type: none; } +ul.list-indent3 { list-style-type: none; } +ul.list-indent4 { list-style-type: none; } +ul.list-indent5 { list-style-type: none; } +ul.list-indent6 { list-style-type: none; } +ul.list-indent7 { list-style-type: none; } +ul.list-indent8 { list-style-type: none; } + diff --git a/static/js/domline_client.js b/static/js/domline_client.js index d4dd4606d..b37996d92 100644 --- a/static/js/domline_client.js +++ b/static/js/domline_client.js @@ -88,13 +88,23 @@ domline.createDomLine = function(nonEmpty, doesWrap, optBrowser, optDocument) if (cls.indexOf('list') >= 0) { var listType = /(?:^| )list:(\S+)/.exec(cls); + var start = /(?:^| )start:(\S+)/.exec(cls); if (listType) { listType = listType[1]; + start = start?'start="'+start[1]+'"':''; if (listType) { - preHtml = '
      • '; - postHtml = '
      '; + if(listType.indexOf("number") < 0) + { + preHtml = '
      • '; + postHtml = '
      '; + } + else + { + preHtml = '
      1. '; + postHtml = '
      '; + } } result.lineMarker += txt.length; return; // don't append any text @@ -135,8 +145,7 @@ domline.createDomLine = function(nonEmpty, doesWrap, optBrowser, optDocument) plugins_.callHook("aceCreateDomLine", { domline: domline, - cls: cls, - document: document + cls: cls }).map(function(modifier) { cls = modifier.cls; @@ -152,6 +161,10 @@ domline.createDomLine = function(nonEmpty, doesWrap, optBrowser, optDocument) { if (href) { + if(!~href.indexOf("http")) // if the url doesn't include http or https etc prefix it. + { + href = "http://"+href; + } extraOpenTags = extraOpenTags + ''; extraCloseTags = '' + extraCloseTags; } From 0888bc94e101fd05c1e6eb210d1556cbe403feaa Mon Sep 17 00:00:00 2001 From: Jean-Tiare Le Bigot Date: Thu, 8 Dec 2011 16:28:47 +0100 Subject: [PATCH 07/17] fixed duplicated css rule --- static/css/timeslider.css | 2 -- 1 file changed, 2 deletions(-) diff --git a/static/css/timeslider.css b/static/css/timeslider.css index e84e5bac3..7494c3220 100644 --- a/static/css/timeslider.css +++ b/static/css/timeslider.css @@ -195,8 +195,6 @@ float:right; color: #222; } -ul { margin-left: 1.5em; } -ul ul { margin-left: 0 !important; } ul { margin-left: 1.5em; } ul ul { margin-left: 0 !important; } ul.list-bullet1 { margin-left: 1.5em; } From 226898eff0f444f9e51a5ec9ad7f5b2ffb2836d8 Mon Sep 17 00:00:00 2001 From: Jean-Tiare Le Bigot Date: Thu, 8 Dec 2011 16:31:02 +0100 Subject: [PATCH 08/17] bring back numbering increment --- static/js/linestylefilter_client.js | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/static/js/linestylefilter_client.js b/static/js/linestylefilter_client.js index b1bdae6ef..9c3ae01c9 100644 --- a/static/js/linestylefilter_client.js +++ b/static/js/linestylefilter_client.js @@ -82,6 +82,10 @@ linestylefilter.getLineStyleFilter = function(lineLength, aline, textAndClassFun { classes += ' list:' + value; } + else if (key == 'start') + { + classes += ' start:' + value; + } else if (linestylefilter.ATTRIB_CLASSES[key]) { classes += ' ' + linestylefilter.ATTRIB_CLASSES[key]; @@ -235,7 +239,7 @@ linestylefilter.getRegexpFilter = function(regExp, tag) linestylefilter.REGEX_WORDCHAR = /[\u0030-\u0039\u0041-\u005A\u0061-\u007A\u00C0-\u00D6\u00D8-\u00F6\u00F8-\u00FF\u0100-\u1FFF\u3040-\u9FFF\uF900-\uFDFF\uFE70-\uFEFE\uFF10-\uFF19\uFF21-\uFF3A\uFF41-\uFF5A\uFF66-\uFFDC]/; linestylefilter.REGEX_URLCHAR = new RegExp('(' + /[-:@a-zA-Z0-9_.,~%+\/\\?=&#;()$]/.source + '|' + linestylefilter.REGEX_WORDCHAR.source + ')'); -linestylefilter.REGEX_URL = new RegExp(/(?:(?:https?|s?ftp|ftps|file|smb|afp|nfs|(x-)?man|gopher|txmt):\/\/|mailto:)/.source + linestylefilter.REGEX_URLCHAR.source + '*(?![:.,;])' + linestylefilter.REGEX_URLCHAR.source, 'g'); +linestylefilter.REGEX_URL = new RegExp(/(?:(?:https?|s?ftp|ftps|file|smb|afp|nfs|(x-)?man|gopher|txmt):\/\/|mailto:|www\.)/.source + linestylefilter.REGEX_URLCHAR.source + '*(?![:.,;])' + linestylefilter.REGEX_URLCHAR.source, 'g'); linestylefilter.getURLFilter = linestylefilter.getRegexpFilter( linestylefilter.REGEX_URL, 'url'); From 9fd50b3e9faf2c43952f49a31e2329019fdf1fd5 Mon Sep 17 00:00:00 2001 From: Jean-Tiare Le Bigot Date: Thu, 8 Dec 2011 16:56:23 +0100 Subject: [PATCH 09/17] fix suggestion for the list theming --- static/css/iframe_editor.css | 48 ++++++++++++++++++------------------ static/css/timeslider.css | 48 ++++++++++++++++++------------------ 2 files changed, 48 insertions(+), 48 deletions(-) diff --git a/static/css/iframe_editor.css b/static/css/iframe_editor.css index f6366f3b9..0e986332e 100644 --- a/static/css/iframe_editor.css +++ b/static/css/iframe_editor.css @@ -13,14 +13,14 @@ ul, ol, li { } ul { margin-left: 1.5em; } ul ul { margin-left: 0 !important; } -ul.list-bullet1 { margin-left: 1.5em; } -ul.list-bullet2 { margin-left: 3em; } -ul.list-bullet3 { margin-left: 4.5em; } -ul.list-bullet4 { margin-left: 6em; } -ul.list-bullet5 { margin-left: 7.5em; } -ul.list-bullet6 { margin-left: 9em; } -ul.list-bullet7 { margin-left: 10.5em; } -ul.list-bullet8 { margin-left: 12em; } +ul.list-bullet1 { margin-left: 3em; } +ul.list-bullet2 { margin-left: 4.5em; } +ul.list-bullet3 { margin-left: 6em; } +ul.list-bullet3 { margin-left: 7.5em; } +ul.list-bullet5 { margin-left: 9em; } +ul.list-bullet6 { margin-left: 10.5em; } +ul.list-bullet7 { margin-left: 12em; } +ul.list-bullet8 { margin-left: 13.5em; } ul { list-style-type: disc; } ul.list-bullet1 { list-style-type: disc; } @@ -32,14 +32,14 @@ ul.list-bullet6 { list-style-type: square; } ul.list-bullet7 { list-style-type: disc; } ul.list-bullet8 { list-style-type: circle; } -ol.list-number1 { margin-left: 1.5em; } -ol.list-number2 { margin-left: 3em; } -ol.list-number3 { margin-left: 4.5em; } -ol.list-number4 { margin-left: 6em; } -ol.list-number5 { margin-left: 7.5em; } -ol.list-number6 { margin-left: 9em; } -ol.list-number7 { margin-left: 10.5em; } -ol.list-number8 { margin-left: 12em; } +ol.list-number1 { margin-left: 3em; } +ol.list-number2 { margin-left: 4.5em; } +ol.list-number3 { margin-left: 6em; } +ol.list-number3 { margin-left: 7.5em; } +ol.list-number5 { margin-left: 9em; } +ol.list-number6 { margin-left: 10.5em; } +ol.list-number7 { margin-left: 12em; } +ol.list-number8 { margin-left: 13.5em; } ol { list-style-type: disc; } ol.list-number1 { list-style-type: decimal; } @@ -51,14 +51,14 @@ ol.list-number6 { list-style-type: lower-roman; } ol.list-number7 { list-style-type: decimal; } ol.list-number8 { list-style-type: lower-latin; } -ul.list-indent1 { margin-left: 1.5em; } -ul.list-indent2 { margin-left: 3em; } -ul.list-indent3 { margin-left: 4.5em; } -ul.list-indent4 { margin-left: 6em; } -ul.list-indent5 { margin-left: 7.5em; } -ul.list-indent6 { margin-left: 9em; } -ul.list-indent7 { margin-left: 10.5em; } -ul.list-indent8 { margin-left: 12em; } +ul.list-number1 { margin-left: 3em; } +ul.list-number2 { margin-left: 4.5em; } +ul.list-number3 { margin-left: 6em; } +ul.list-number3 { margin-left: 7.5em; } +ul.list-number5 { margin-left: 9em; } +ul.list-number6 { margin-left: 10.5em; } +ul.list-number7 { margin-left: 12em; } +ul.list-number8 { margin-left: 13.5em; } ul.list-indent1 { list-style-type: none; } ul.list-indent2 { list-style-type: none; } diff --git a/static/css/timeslider.css b/static/css/timeslider.css index 7494c3220..e18169eec 100644 --- a/static/css/timeslider.css +++ b/static/css/timeslider.css @@ -197,14 +197,14 @@ float:right; ul { margin-left: 1.5em; } ul ul { margin-left: 0 !important; } -ul.list-bullet1 { margin-left: 1.5em; } -ul.list-bullet2 { margin-left: 3em; } -ul.list-bullet3 { margin-left: 4.5em; } -ul.list-bullet4 { margin-left: 6em; } -ul.list-bullet5 { margin-left: 7.5em; } -ul.list-bullet6 { margin-left: 9em; } -ul.list-bullet7 { margin-left: 10.5em; } -ul.list-bullet8 { margin-left: 12em; } +ul.list-bullet1 { margin-left: 3em; } +ul.list-bullet2 { margin-left: 4.5em; } +ul.list-bullet3 { margin-left: 6em; } +ul.list-bullet3 { margin-left: 7.5em; } +ul.list-bullet5 { margin-left: 9em; } +ul.list-bullet6 { margin-left: 10.5em; } +ul.list-bullet7 { margin-left: 12em; } +ul.list-bullet8 { margin-left: 13.5em; } ul { list-style-type: disc; } ul.list-bullet1 { list-style-type: disc; } @@ -216,14 +216,14 @@ ul.list-bullet6 { list-style-type: square; } ul.list-bullet7 { list-style-type: disc; } ul.list-bullet8 { list-style-type: circle; } -ol.list-number1 { margin-left: 1.5em; } -ol.list-number2 { margin-left: 3em; } -ol.list-number3 { margin-left: 4.5em; } -ol.list-number4 { margin-left: 6em; } -ol.list-number5 { margin-left: 7.5em; } -ol.list-number6 { margin-left: 9em; } -ol.list-number7 { margin-left: 10.5em; } -ol.list-number8 { margin-left: 12em; } +ol.list-number1 { margin-left: 3em; } +ol.list-number2 { margin-left: 4.5em; } +ol.list-number3 { margin-left: 6em; } +ol.list-number3 { margin-left: 7.5em; } +ol.list-number5 { margin-left: 9em; } +ol.list-number6 { margin-left: 10.5em; } +ol.list-number7 { margin-left: 12em; } +ol.list-number8 { margin-left: 13.5em; } ol { list-style-type: disc; } ol.list-number1 { list-style-type: decimal; } @@ -235,14 +235,14 @@ ol.list-number6 { list-style-type: lower-roman; } ol.list-number7 { list-style-type: decimal; } ol.list-number8 { list-style-type: lower-latin; } -ul.list-indent1 { margin-left: 1.5em; } -ul.list-indent2 { margin-left: 3em; } -ul.list-indent3 { margin-left: 4.5em; } -ul.list-indent4 { margin-left: 6em; } -ul.list-indent5 { margin-left: 7.5em; } -ul.list-indent6 { margin-left: 9em; } -ul.list-indent7 { margin-left: 10.5em; } -ul.list-indent8 { margin-left: 12em; } +ul.list-number1 { margin-left: 3em; } +ul.list-number2 { margin-left: 4.5em; } +ul.list-number3 { margin-left: 6em; } +ul.list-number3 { margin-left: 7.5em; } +ul.list-number5 { margin-left: 9em; } +ul.list-number6 { margin-left: 10.5em; } +ul.list-number7 { margin-left: 12em; } +ul.list-number8 { margin-left: 13.5em; } ul.list-indent1 { list-style-type: none; } ul.list-indent2 { list-style-type: none; } From 06d5e345c0a11cc722d737b2fe33d79fbfa90ece Mon Sep 17 00:00:00 2001 From: Jean-Tiare Le Bigot Date: Thu, 8 Dec 2011 17:48:49 +0100 Subject: [PATCH 10/17] fix renumbering when indented text is mixed with regular lists --- static/js/ace2_inner.js | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/static/js/ace2_inner.js b/static/js/ace2_inner.js index 282c42fdc..3fa494f31 100644 --- a/static/js/ace2_inner.js +++ b/static/js/ace2_inner.js @@ -5178,8 +5178,11 @@ function OUTER(gscope) } //2-find the first line of the list - while(lineNum-1 >= 0 && getLineListType(lineNum-1)) + while(lineNum-1 >= 0 && (type=getLineListType(lineNum-1))) { + type = /([a-z]+)[12345678]/.exec(type); + if(type[1] == "indent") + break; lineNum--; } @@ -5197,9 +5200,9 @@ function OUTER(gscope) while(listType = getLineListType(line)) { //apply new num - curLevel = /[a-z]+([12345678])/.exec(listType); - curLevel = Number(curLevel[1]); - if(isNaN(curLevel)) + listType = /([a-z]+)([12345678])/.exec(listType); + curLevel = Number(listType[2]); + if(isNaN(curLevel) || listType[0] == "indent") { return line; } From ff047146149b55004c3380c5ae53446f5ce23527 Mon Sep 17 00:00:00 2001 From: Jean-Tiare Le Bigot Date: Thu, 8 Dec 2011 17:50:27 +0100 Subject: [PATCH 11/17] fix typo in both CSS --- static/css/iframe_editor.css | 6 +++--- static/css/timeslider.css | 6 +++--- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/static/css/iframe_editor.css b/static/css/iframe_editor.css index 0e986332e..676753051 100644 --- a/static/css/iframe_editor.css +++ b/static/css/iframe_editor.css @@ -16,7 +16,7 @@ ul ul { margin-left: 0 !important; } ul.list-bullet1 { margin-left: 3em; } ul.list-bullet2 { margin-left: 4.5em; } ul.list-bullet3 { margin-left: 6em; } -ul.list-bullet3 { margin-left: 7.5em; } +ul.list-bullet4 { margin-left: 7.5em; } ul.list-bullet5 { margin-left: 9em; } ul.list-bullet6 { margin-left: 10.5em; } ul.list-bullet7 { margin-left: 12em; } @@ -35,7 +35,7 @@ ul.list-bullet8 { list-style-type: circle; } ol.list-number1 { margin-left: 3em; } ol.list-number2 { margin-left: 4.5em; } ol.list-number3 { margin-left: 6em; } -ol.list-number3 { margin-left: 7.5em; } +ol.list-number4 { margin-left: 7.5em; } ol.list-number5 { margin-left: 9em; } ol.list-number6 { margin-left: 10.5em; } ol.list-number7 { margin-left: 12em; } @@ -54,7 +54,7 @@ ol.list-number8 { list-style-type: lower-latin; } ul.list-number1 { margin-left: 3em; } ul.list-number2 { margin-left: 4.5em; } ul.list-number3 { margin-left: 6em; } -ul.list-number3 { margin-left: 7.5em; } +ul.list-number4 { margin-left: 7.5em; } ul.list-number5 { margin-left: 9em; } ul.list-number6 { margin-left: 10.5em; } ul.list-number7 { margin-left: 12em; } diff --git a/static/css/timeslider.css b/static/css/timeslider.css index e18169eec..4d71be6e3 100644 --- a/static/css/timeslider.css +++ b/static/css/timeslider.css @@ -200,7 +200,7 @@ ul ul { margin-left: 0 !important; } ul.list-bullet1 { margin-left: 3em; } ul.list-bullet2 { margin-left: 4.5em; } ul.list-bullet3 { margin-left: 6em; } -ul.list-bullet3 { margin-left: 7.5em; } +ul.list-bullet4 { margin-left: 7.5em; } ul.list-bullet5 { margin-left: 9em; } ul.list-bullet6 { margin-left: 10.5em; } ul.list-bullet7 { margin-left: 12em; } @@ -219,7 +219,7 @@ ul.list-bullet8 { list-style-type: circle; } ol.list-number1 { margin-left: 3em; } ol.list-number2 { margin-left: 4.5em; } ol.list-number3 { margin-left: 6em; } -ol.list-number3 { margin-left: 7.5em; } +ol.list-number4 { margin-left: 7.5em; } ol.list-number5 { margin-left: 9em; } ol.list-number6 { margin-left: 10.5em; } ol.list-number7 { margin-left: 12em; } @@ -238,7 +238,7 @@ ol.list-number8 { list-style-type: lower-latin; } ul.list-number1 { margin-left: 3em; } ul.list-number2 { margin-left: 4.5em; } ul.list-number3 { margin-left: 6em; } -ul.list-number3 { margin-left: 7.5em; } +ul.list-number4 { margin-left: 7.5em; } ul.list-number5 { margin-left: 9em; } ul.list-number6 { margin-left: 10.5em; } ul.list-number7 { margin-left: 12em; } From a5ec736b4c2cd12b90448074ed7bb52a1bea9c4a Mon Sep 17 00:00:00 2001 From: Jean-Tiare Le Bigot Date: Thu, 8 Dec 2011 19:23:21 +0100 Subject: [PATCH 12/17] improved return key behaviour in lists when on empty item --- static/js/ace2_inner.js | 26 +++++++++++++++++++++++--- 1 file changed, 23 insertions(+), 3 deletions(-) diff --git a/static/js/ace2_inner.js b/static/js/ace2_inner.js index 3fa494f31..b7e8055a4 100644 --- a/static/js/ace2_inner.js +++ b/static/js/ace2_inner.js @@ -3518,16 +3518,36 @@ function OUTER(gscope) var lineNum = rep.selStart[0]; var listType = getLineListType(lineNum); - performDocumentReplaceSelection('\n'); if (listType) { - if (lineNum + 1 < rep.lines.length()) + var text = rep.lines.atIndex(lineNum).text; + listType = /([a-z]+)([12345678])/.exec(listType); + var type = listType[1]; + var level = Number(listType[2]); + + //detect empty list item; exclude indentation + if(text === '*' && type !== "indent") { - setLineListType(lineNum + 1, listType); + //if not already on the highest level + if(level > 1) + { + setLineListType(lineNum, type+(level-1));//automatically decrease the level + } + else + { + setLineListType(lineNum, '');//remove the list + renumberList(lineNum + 1);//trigger renumbering of list that may be right after + } + } + else if (lineNum + 1 < rep.lines.length()) + { + performDocumentReplaceSelection('\n'); + setLineListType(lineNum + 1, type+level); } } else { + performDocumentReplaceSelection('\n'); handleReturnIndentation(); } } From 4078ad83da21ae8004a1078eded5f7b2ad2eee5c Mon Sep 17 00:00:00 2001 From: Jean-Tiare Le Bigot Date: Fri, 9 Dec 2011 13:23:05 +0100 Subject: [PATCH 13/17] fixed ordered list disapearing when typing --- node/utils/contentcollector.js | 4 ++-- static/js/contentcollector.js | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/node/utils/contentcollector.js b/node/utils/contentcollector.js index 60bd0a6ef..a7fa940a6 100644 --- a/node/utils/contentcollector.js +++ b/node/utils/contentcollector.js @@ -472,10 +472,10 @@ function makeContentCollector(collectStyles, browser, apool, domInterface, class { cc.doAttrib(state, "strikethrough"); } - if (tname == "ul") + if (tname == "ul" || tname == "ol") { var type; - var rr = cls && /(?:^| )list-(bullet[12345678])\b/.exec(cls); + var rr = cls && /(?:^| )list-([a-z]+[12345678])\b/.exec(cls); type = rr && rr[1] || "bullet" + String(Math.min(_MAX_LIST_LEVEL, (state.listNesting || 0) + 1)); oldListTypeOrNull = (_enterList(state, type) || 'none'); } diff --git a/static/js/contentcollector.js b/static/js/contentcollector.js index 577b24c6c..ac7e34028 100644 --- a/static/js/contentcollector.js +++ b/static/js/contentcollector.js @@ -470,7 +470,7 @@ function makeContentCollector(collectStyles, browser, apool, domInterface, class { cc.doAttrib(state, "strikethrough"); } - if (tname == "ul") + if (tname == "ul" || tname == "ol") { var type; var rr = cls && /(?:^| )list-([a-z]+[12345678])\b/.exec(cls); From 4715900eebf8d54d000079304bb9c2c9e7a29661 Mon Sep 17 00:00:00 2001 From: Jean-Tiare Le Bigot Date: Fri, 9 Dec 2011 17:23:32 +0100 Subject: [PATCH 14/17] renumbering should be OK in most situations now :). It is automatically triggered on delete and return key and executed only when necessary --- static/js/ace2_inner.js | 26 ++++++++++++++++++++++++-- 1 file changed, 24 insertions(+), 2 deletions(-) diff --git a/static/js/ace2_inner.js b/static/js/ace2_inner.js index b7e8055a4..7b0aa89f9 100644 --- a/static/js/ace2_inner.js +++ b/static/js/ace2_inner.js @@ -3691,6 +3691,15 @@ function OUTER(gscope) } } } + //if the list has been removed, it is necessary to renumber + //starting from the *next* line because the list may have been + //separated. If it returns null, it means that the list was not cut, try + //from the current one. + var line = caretLine(); + if(line != -1 && renumberList(line+1)==null) + { + renumberList(line); + } } // set of "letter or digit" chars is based on section 20.5.16 of the original Java Language Spec @@ -5192,7 +5201,13 @@ function OUTER(gscope) function renumberList(lineNum){ //1-check we are in a list - if(!getLineListType(lineNum)) + var type = getLineListType(lineNum); + if(!type) + { + return null; + } + type = /([a-z]+)[12345678]/.exec(type); + if(type[1] == "indent") { return null; } @@ -5307,7 +5322,14 @@ function OUTER(gscope) performDocumentApplyChangeset(cs); } - renumberList(lineNum); + //if the list has been removed, it is necessary to renumber + //starting from the *next* line because the list may have been + //separated. If it returns null, it means that the list was not cut, try + //from the current one. + if(renumberList(lineNum+1)==null) + { + renumberList(lineNum); + } } function doInsertList(type) From 7f34334eaf279a244a9ffbc44515af07f15d82ed Mon Sep 17 00:00:00 2001 From: Jean-Tiare Le Bigot Date: Fri, 9 Dec 2011 19:49:46 +0100 Subject: [PATCH 15/17] added ordered list support to HTML exporter. Was not that easy :). Also added a few comments to help the next guy --- node/utils/ExportHtml.js | 71 +++++++++++++++++++++++++++++++++------- 1 file changed, 60 insertions(+), 11 deletions(-) diff --git a/node/utils/ExportHtml.js b/node/utils/ExportHtml.js index 782bb7016..0d64f6823 100644 --- a/node/utils/ExportHtml.js +++ b/node/utils/ExportHtml.js @@ -306,13 +306,14 @@ function getHTMLFromAtext(pad, atext) // People might use weird indenting, e.g. skip a level, // so we want to do something reasonable there. We also // want to deal gracefully with blank lines. + // => keeps track of the parents level of indentation var lists = []; // e.g. [[1,'bullet'], [3,'bullet'], ...] for (var i = 0; i < textLines.length; i++) { var line = _analyzeLine(textLines[i], attribLines[i], apool); var lineContent = getLineHTML(line.text, line.aline); - - if (line.listLevel || lists.length > 0) + + if (line.listLevel)//If we are inside a list { // do list stuff var whichList = -1; // index into lists or -1 @@ -328,41 +329,89 @@ function getHTMLFromAtext(pad, atext) } } - if (whichList >= lists.length) + if (whichList >= lists.length)//means we are on a deeper level of indentation than the previous line { lists.push([line.listLevel, line.listTypeName]); - pieces.push('
      • ', lineContent || '
        '); + if(line.listTypeName == "number") + { + pieces.push('
        1. ', lineContent || '
          '); + } + else + { + pieces.push('
          • ', lineContent || '
            '); + } } - else if (whichList == -1) + //the following code *seems* dead after my patch. + //I keep it just in case I'm wrong... + /*else if (whichList == -1)//means we are not inside a list { if (line.text) { + console.log('trace 1'); // non-blank line, end all lists - pieces.push(new Array(lists.length + 1).join('
          • ')); + if(line.listTypeName == "number") + { + pieces.push(new Array(lists.length + 1).join('
        ')); + } + else + { + pieces.push(new Array(lists.length + 1).join('
      ')); + } lists.length = 0; pieces.push(lineContent, '
      '); } else { + console.log('trace 2'); pieces.push('

      '); } - } - else + }*/ + else//means we are getting closer to the lowest level of indentation { while (whichList < lists.length - 1) { - pieces.push('
    '); + if(lists[lists.length - 1][1] == "number") + { + pieces.push('
  • '); + } + else + { + pieces.push(''); + } lists.length--; } pieces.push('
  • ', lineContent || '
    '); } } - else + else//outside any list { + while (lists.length > 0)//if was in a list: close it before + { + if(lists[lists.length - 1][1] == "number") + { + pieces.push('
  • '); + } + else + { + pieces.push(''); + } + lists.length--; + } pieces.push(lineContent, '
    '); } } - pieces.push(new Array(lists.length + 1).join('')); + + for (var k = lists.length - 1; k >= 0; k--) + { + if(lists[k][1] == "number") + { + pieces.push(''); + } + else + { + pieces.push(''); + } + } return pieces.join(''); } From 0a513bc1d7c57ce20dfb7ba2be9e1ecbdb85f24a Mon Sep 17 00:00:00 2001 From: Jean-Tiare Le Bigot Date: Sat, 10 Dec 2011 10:33:33 +0100 Subject: [PATCH 16/17] editor CSS proposal --- static/css/iframe_editor.css | 52 ++++++++++++++++++------------------ static/css/timeslider.css | 50 +++++++++++++++++----------------- 2 files changed, 51 insertions(+), 51 deletions(-) diff --git a/static/css/iframe_editor.css b/static/css/iframe_editor.css index 676753051..2faaae065 100644 --- a/static/css/iframe_editor.css +++ b/static/css/iframe_editor.css @@ -13,14 +13,14 @@ ul, ol, li { } ul { margin-left: 1.5em; } ul ul { margin-left: 0 !important; } -ul.list-bullet1 { margin-left: 3em; } -ul.list-bullet2 { margin-left: 4.5em; } -ul.list-bullet3 { margin-left: 6em; } -ul.list-bullet4 { margin-left: 7.5em; } -ul.list-bullet5 { margin-left: 9em; } -ul.list-bullet6 { margin-left: 10.5em; } -ul.list-bullet7 { margin-left: 12em; } -ul.list-bullet8 { margin-left: 13.5em; } +ul.list-bullet1 { margin-left: 1.5em; } +ul.list-bullet2 { margin-left: 3em; } +ul.list-bullet3 { margin-left: 4.5em; } +ul.list-bullet4 { margin-left: 6em; } +ul.list-bullet5 { margin-left: 7.5em; } +ul.list-bullet6 { margin-left: 9em; } +ul.list-bullet7 { margin-left: 10.5em; } +ul.list-bullet8 { margin-left: 12em; } ul { list-style-type: disc; } ul.list-bullet1 { list-style-type: disc; } @@ -32,16 +32,16 @@ ul.list-bullet6 { list-style-type: square; } ul.list-bullet7 { list-style-type: disc; } ul.list-bullet8 { list-style-type: circle; } -ol.list-number1 { margin-left: 3em; } -ol.list-number2 { margin-left: 4.5em; } -ol.list-number3 { margin-left: 6em; } -ol.list-number4 { margin-left: 7.5em; } -ol.list-number5 { margin-left: 9em; } -ol.list-number6 { margin-left: 10.5em; } -ol.list-number7 { margin-left: 12em; } -ol.list-number8 { margin-left: 13.5em; } +ol.list-number1 { margin-left: 1.5em; } +ol.list-number2 { margin-left: 3em; } +ol.list-number3 { margin-left: 4.5em; } +ol.list-number4 { margin-left: 6em; } +ol.list-number5 { margin-left: 7.5em; } +ol.list-number6 { margin-left: 9em; } +ol.list-number7 { margin-left: 10.5em; } +ol.list-number8 { margin-left: 12em; } -ol { list-style-type: disc; } +ol { list-style-type: decimal; } ol.list-number1 { list-style-type: decimal; } ol.list-number2 { list-style-type: lower-latin; } ol.list-number3 { list-style-type: lower-roman; } @@ -51,14 +51,14 @@ ol.list-number6 { list-style-type: lower-roman; } ol.list-number7 { list-style-type: decimal; } ol.list-number8 { list-style-type: lower-latin; } -ul.list-number1 { margin-left: 3em; } -ul.list-number2 { margin-left: 4.5em; } -ul.list-number3 { margin-left: 6em; } -ul.list-number4 { margin-left: 7.5em; } -ul.list-number5 { margin-left: 9em; } -ul.list-number6 { margin-left: 10.5em; } -ul.list-number7 { margin-left: 12em; } -ul.list-number8 { margin-left: 13.5em; } +ul.list-indent1 { margin-left: 1.5em; } +ul.list-indent2 { margin-left: 3em; } +ul.list-indent3 { margin-left: 4.5em; } +ul.list-indent4 { margin-left: 6em; } +ul.list-indent5 { margin-left: 7.5em; } +ul.list-indent6 { margin-left: 9em; } +ul.list-indent7 { margin-left: 10.5em; } +ul.list-indent8 { margin-left: 12em; } ul.list-indent1 { list-style-type: none; } ul.list-indent2 { list-style-type: none; } @@ -93,7 +93,7 @@ body.doesWrap { padding-top: 1px; /* important for some reason? */ padding-right: 10px; padding-bottom: 8px; - padding-left: 1px /* prevents characters from looking chopped off in FF3 */; + padding-left: 10px /* prevents characters from looking chopped off in FF3 */; overflow: hidden; /* blank 1x1 gif, so that IE8 doesn't consider the body transparent */ background-image: url(data:image/gif;base64,R0lGODlhAQABAIAAAP///wAAACH5BAEAAAAALAAAAAABAAEAAAICRAEAOw==); diff --git a/static/css/timeslider.css b/static/css/timeslider.css index 4d71be6e3..c808a65c3 100644 --- a/static/css/timeslider.css +++ b/static/css/timeslider.css @@ -197,14 +197,14 @@ float:right; ul { margin-left: 1.5em; } ul ul { margin-left: 0 !important; } -ul.list-bullet1 { margin-left: 3em; } -ul.list-bullet2 { margin-left: 4.5em; } -ul.list-bullet3 { margin-left: 6em; } -ul.list-bullet4 { margin-left: 7.5em; } -ul.list-bullet5 { margin-left: 9em; } -ul.list-bullet6 { margin-left: 10.5em; } -ul.list-bullet7 { margin-left: 12em; } -ul.list-bullet8 { margin-left: 13.5em; } +ul.list-bullet1 { margin-left: 1.5em; } +ul.list-bullet2 { margin-left: 3em; } +ul.list-bullet3 { margin-left: 4.5em; } +ul.list-bullet4 { margin-left: 6em; } +ul.list-bullet5 { margin-left: 7.5em; } +ul.list-bullet6 { margin-left: 9em; } +ul.list-bullet7 { margin-left: 10.5em; } +ul.list-bullet8 { margin-left: 12em; } ul { list-style-type: disc; } ul.list-bullet1 { list-style-type: disc; } @@ -216,16 +216,16 @@ ul.list-bullet6 { list-style-type: square; } ul.list-bullet7 { list-style-type: disc; } ul.list-bullet8 { list-style-type: circle; } -ol.list-number1 { margin-left: 3em; } -ol.list-number2 { margin-left: 4.5em; } -ol.list-number3 { margin-left: 6em; } -ol.list-number4 { margin-left: 7.5em; } -ol.list-number5 { margin-left: 9em; } -ol.list-number6 { margin-left: 10.5em; } -ol.list-number7 { margin-left: 12em; } -ol.list-number8 { margin-left: 13.5em; } +ol.list-number1 { margin-left: 1.5em; } +ol.list-number2 { margin-left: 3em; } +ol.list-number3 { margin-left: 4.5em; } +ol.list-number4 { margin-left: 6em; } +ol.list-number5 { margin-left: 7.5em; } +ol.list-number6 { margin-left: 9em; } +ol.list-number7 { margin-left: 10.5em; } +ol.list-number8 { margin-left: 12em; } -ol { list-style-type: disc; } +ol { list-style-type: decimal; } ol.list-number1 { list-style-type: decimal; } ol.list-number2 { list-style-type: lower-latin; } ol.list-number3 { list-style-type: lower-roman; } @@ -235,14 +235,14 @@ ol.list-number6 { list-style-type: lower-roman; } ol.list-number7 { list-style-type: decimal; } ol.list-number8 { list-style-type: lower-latin; } -ul.list-number1 { margin-left: 3em; } -ul.list-number2 { margin-left: 4.5em; } -ul.list-number3 { margin-left: 6em; } -ul.list-number4 { margin-left: 7.5em; } -ul.list-number5 { margin-left: 9em; } -ul.list-number6 { margin-left: 10.5em; } -ul.list-number7 { margin-left: 12em; } -ul.list-number8 { margin-left: 13.5em; } +ul.list-indent1 { margin-left: 1.5em; } +ul.list-indent2 { margin-left: 3em; } +ul.list-indent3 { margin-left: 4.5em; } +ul.list-indent4 { margin-left: 6em; } +ul.list-indent5 { margin-left: 7.5em; } +ul.list-indent6 { margin-left: 9em; } +ul.list-indent7 { margin-left: 10.5em; } +ul.list-indent8 { margin-left: 12em; } ul.list-indent1 { list-style-type: none; } ul.list-indent2 { list-style-type: none; } From 3248ca4cbba2d56f186c6e10d4dbbb8b95de04a5 Mon Sep 17 00:00:00 2001 From: Jean-Tiare Le Bigot Date: Sat, 10 Dec 2011 11:01:14 +0100 Subject: [PATCH 17/17] added minimal CSS support to HTMLexport --- node/utils/ExportHtml.js | 23 ++++++++++++++++++++--- 1 file changed, 20 insertions(+), 3 deletions(-) diff --git a/node/utils/ExportHtml.js b/node/utils/ExportHtml.js index 0d64f6823..fe5ee9e46 100644 --- a/node/utils/ExportHtml.js +++ b/node/utils/ExportHtml.js @@ -334,11 +334,11 @@ function getHTMLFromAtext(pad, atext) lists.push([line.listLevel, line.listTypeName]); if(line.listTypeName == "number") { - pieces.push('
    1. ', lineContent || '
      '); + pieces.push('
      1. ', lineContent || '
        '); } else { - pieces.push('
        • ', lineContent || '
          '); + pieces.push('
          • ', lineContent || '
            '); } } //the following code *seems* dead after my patch. @@ -465,7 +465,24 @@ exports.getPadHTMLDocument = function (padId, revNum, noDocType, callback) return; } - var head = (noDocType ? '' : '\n') + '\n' + (noDocType ? '' : '\n' + '\n' + '\n' + '\n') + ''; + var head = + (noDocType ? '' : '\n') + + '\n' + (noDocType ? '' : '\n' + + '\n' + + '\n' + '\n') + + ''; var foot = '\n\n';