function array_unique(arrayName) {
var newArray = new Array();
label:for(var i=0; i<arrayName.length;i++ ) {
for(var j=0; j<newArray.length;j++ ) {
if(newArray == arrayName)
continue label;
}
newArray = arrayName;
}
return newArray;
}
function findtest() {
var text = document.editform.wpTextbox1.value;
var finalarray = new Array();
var countindex = 0;
var Ausdruck = /{3}+\.\d{1,3}?(\.\d{1,2})?{3}/g;
var Ergebnis;
while (Ergebnis = Ausdruck.exec(text)) {
finalarray = Ergebnis;
countindex++;
}
finalarray = array_unique(finalarray);
document.editform.wpTextbox1.value = "";
for(i=0;i<finalarray.length;i++){
document.editform.wpTextbox1.value += finalarray.replace(/\/g,'\\]').replace(/\(/g,'\\(').replace(/\)/g,'\\)').replace(/\{/g,'\\}').replace(/\[/g,'\\}')+"\n";
document.editform.wpTextbox1.value += finalarray.replace(/^.{3}/,'').replace(/.{3}$/,'')+'" \\f "Polybios\n';
}
}
mw.util.addPortletLink( 'p-Mitmachen', 'javascript:findtest()', 'Test', 't-test', 'test', '', '' );