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] 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 = ''; + if(listType.indexOf("number") < 0) + { + preHtml = ''; + } + 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; }