Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Ordered list support #257

Closed
wants to merge 18 commits into from
Closed
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
bring indentation and ordered list support to timeslider. Still miss …
…numbering :/
Jean-Tiare Le Bigot committed Dec 8, 2011
commit 308a20bf11e9768f096d2d842a07988642f81c22
39 changes: 39 additions & 0 deletions static/css/timeslider.css
Original file line number Diff line number Diff line change
@@ -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; }

21 changes: 17 additions & 4 deletions static/js/domline_client.js
Original file line number Diff line number Diff line change
@@ -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 = '<ul class="list-' + listType + '"><li>';
postHtml = '</li></ul>';
if(listType.indexOf("number") < 0)
{
preHtml = '<ul class="list-' + listType + '"><li>';
postHtml = '</li></ul>';
}
else
{
preHtml = '<ol '+start+' class="list-' + listType + '"><li>';
postHtml = '</li></ol>';
}
}
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 + '<a href="' + href.replace(/\"/g, '&quot;') + '">';
extraCloseTags = '</a>' + extraCloseTags;
}