"+code.substring(i,code.indexOf("\n",i))+"\n";
i=code.indexOf("\n",i);
break;
case '/':
if (code.charAt(i+1)=='*') {
tagged+=""+code.substring(i,code.indexOf("*/",i)+1)+"";
i=code.indexOf("*/",i)+1;
} else {
tagged+=c;
}
break;
case '<':
if (code.charAt(i+1)=='a' && code.charAt(i+2)==' ') {
tagged+=code.substring(i-1,code.indexOf("",i))+"";
i=code.indexOf("",i)+2;
} else {
if (code.charAt(i+1)=='b' && code.charAt(i+2)=='>') {
tagged+="";
i+=2;
} else {
if (code.charAt(i+1)=='/' && code.charAt(i+2)=='b') {
tagged+="";
i+=3;
} else {
//tagged+=c;
tagged+="<";
}
}
}
break;
case '"':
tagged+=""+code.substring(i,code.indexOf('"',i+1)+1)+"";
if (code.indexOf('"',i+1) > -1) i=code.indexOf('"',i+1);
break;
case "'":
tagged+=""+code.substring(i,code.indexOf("'",i+1)+1)+"";
if (code.indexOf("'",i+1) > -1) i=code.indexOf("'",i+1);
break;
case '$':
var _var = code.substring(i).match(/\$[a-zA-Z0-9_!]*/);
tagged+="" + _var[0] + "";
i+= (_var[0].length) - 1;
break;
case '@':
var _var = code.substring(i).match(/\@[a-zA-Z0-9_!]*/);
if (-1 < macro.indexOf(_var[0].toUpperCase())) {
tagged+="" + _var[0] + "";
} else {
tagged+="" + _var[0] + "";
}
i+= (_var[0].length) - 1;
break;
case '0': case '1': case '2': case '3': case '4': case '5': case '6': case '7': case '8': case '9':
// var _var = code.substring(i).match(/\d/);
var _var = code.substring(i).match(/[0-9\.]+/);
tagged+="" + _var[0] + "";
i+= (_var[0].length) - 1;
break;
default:
var _var = c.match(/\w/);
if (_var == c) {
_var = code.substring(i).match(/[a-zA-Z0-9_!]*/);
if (-1 < comma.indexOf(_var[0].toLowerCase())) {
tagged+="" + _var[0] + "";
} else if (-1 < funcs.indexOf(_var[0].toLowerCase())) {
tagged+="" + _var[0] + "";
} else if (-1 < ops.indexOf(_var[0].toLowerCase())) {
tagged+="" + _var[0] + "";
} else {
tagged+="" + _var[0] + "";
}
i+= (_var[0].length) - 1;
} else {
tagged+="" + c + "";
}
}
}
return tagged;
}
var codes = document.getElementsByClassName("ubbcode-body");
var heads = document.getElementsByClassName("ubbcode-header");
for (var i=0; i < codes.length; i++) {
// if (codes[i].innerHTML.indexOf("[postprep") ==-1) {
if (heads[i].innerHTML.indexOf("Code:") !=-1) {
// heads[i].innerHTML=heads[i].innerHTML + ' ';
// }
// } else {
heads[i].innerHTML=heads[i].innerHTML + ' ';
}
}
for (var i=0, maxi = codes.length; i < maxi; i++) {
var tempah = codes[i].innerHTML;
if (tempah.indexOf("") !=-1) {
tempah=tempah.substring(tempah.indexOf("")+5,tempah.indexOf("
"));
codes[i].innerHTML="" + dotag(tempah.substring()) + "
";
}
}
//var pres = document.getElementsByTagName("pre");
//for (var i=0, maxi = pres.length; i < maxi; i++) {
// var tempah = pres[i].innerHTML;
// if (tempah.indexOf("[postprep") !=-1) {
// tempah=tempah.substring((tempah.indexOf("]",tempah.indexOf("[postprep"))+1));
// pres[i].innerHTML=dotag(tempah);
// }
//}
function ytag(which_one) {
var codes = document.getElementsByClassName("ubbcode-body");
var thisone = codes[which_one].innerHTML;
codes[which_one].innerHTML = "" + dotag(thisone.substring(5+thisone.indexOf(""),thisone.indexOf("
"))) + "
";
var heads = document.getElementsByClassName("ubbcode-header");
heads[which_one].innerHTML = "Code:" + ' ';
}
function ttag(which_one) {
var codes = document.getElementsByClassName("ubbcode-body");
var thisone = "";
if (codes[which_one].innerText != undefined) {
thisone += codes[which_one].innerText;
} else {
thisone += codes[which_one].textContent;
}
codes[which_one].innerHTML = thisone + "
";
var heads = document.getElementsByClassName("ubbcode-header");
heads[which_one].innerHTML = "Code:" + ' ';
}