this is the most recant source:
Code:
Code:
// ==UserScript==
// @name test
// @namespace http://use.i.E.your.homepage/
// @version 0.1
// @description enter something useful
// @match http://stackoverflow.com/questions/2744423/javascript-bbcode-parser-recognizes-only-first-list-element
// @copyright 2012+, You
// ==/UserScript==
function parse(str) {
search = new Array(
RegExp('/\[karma\](.*?)\[\/karma\]/gi',"gi"),
RegExp('spud2451',"gi"),
RegExp('KermMartian',"gi"),
RegExp('ComicIdiot',"gi"),
RegExp('tifreak8x',"gi"),
RegExp('LuxenD',"gi"));
replace = new Array(
'<input type="button" value="$1++" onClick="document.getElementById(\'saxtalk\').value = \'$1++\';saxAdd();">',
'Spud',
'Kerm',
'Comic',
'TI-Freak',
'Luxen');
for (i = 0; i < search.length; i++) {
str = str.replace(search[i], replace[i]);
}
return str;}
document.body.innerHTML = parse(document.body.innerHTML);