bring indentation and ordered list support to timeslider. Still miss numbering :/

This commit is contained in:
Jean-Tiare Le Bigot 2011-12-08 16:21:38 +01:00
parent cd15ad24ab
commit 308a20bf11
2 changed files with 56 additions and 4 deletions

View file

@ -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;
}