updated Markup.js to parse [span] in prepartion for titles and general better display of infoboxes

yes, it's rather rudimentary..
yes, i should really dig into the new Markup-System... :/
This commit is contained in:
Sarjuuk
2013-01-19 22:16:15 +01:00
parent be055cd8a4
commit bfc0a684f0

View File

@@ -140,6 +140,20 @@ var Markup = {
return (E || "") + "<t" + (Markup.nTags++) + ">" return (E || "") + "<t" + (Markup.nTags++) + ">"
} }
}); });
D = D.replace(/(.)?\[span\s*[\s+=:]\s*(.+?)\]/gi,
function(F, E, H) {
if (E == "\\") {
return F.substr(1)
} else {
var G = Markup._yank(H, [["class", "\\S+"]]);
Markup.tags.push({
name: "span",
close: false,
other: G
});
return (E || "") + "<t" + (Markup.nTags++) + ">"
}
});
B += "|pad|span"; B += "|pad|span";
A += "|color|span|icon"; A += "|color|span|icon";
case Markup.MODE_COMMENT: case Markup.MODE_COMMENT:
@@ -391,9 +405,6 @@ var Markup = {
case "s": case "s":
G += "<del>" + Markup._htmlmize(B[D][1]) + "</del>"; G += "<del>" + Markup._htmlmize(B[D][1]) + "</del>";
break; break;
case "span":
G += "<span>" + Markup._htmlmize(B[D][1]) + "</span>";
break;
case "pad": case "pad":
G += '<div class="pad">' + Markup._htmlmize(B[D][1]) + "</div>"; G += '<div class="pad">' + Markup._htmlmize(B[D][1]) + "</div>";
break; break;
@@ -428,7 +439,14 @@ var Markup = {
G += '" />' + Markup._htmlmize(B[D][1]) + '</span>' G += '" />' + Markup._htmlmize(B[D][1]) + '</span>'
} }
break; break;
case "img": case "span":
var F = B[D][2];
if (F.name != "" && Markup._isUrlSafe(F.name)) {
G += '<span class="' + F.class + '" />'
G += Markup._htmlmize(B[D][1]) + '</span>'
}
break;
case "img":
var F = B[D][2]; var F = B[D][2];
if (F.src != "" && Markup._isUrlSafe(F.src)) { if (F.src != "" && Markup._isUrlSafe(F.src)) {
G += '<img src="' + F.src + '" alt="" class="border"'; G += '<img src="' + F.src + '" alt="" class="border"';