Post by hpmad on Jul 11, 2008 19:58:17 GMT -8
Description
Basically, the code that you put in [code] tags will be put into a textarea with a highlight all button instead of a table. The spacing will also be intact, so if the code is indented, it will stay indented. There's a css part that you can edit too.
Preview
img202.imageshack.us/img202/3030/codemodprev6wq.png
Global Footers
<style type="text/css">
.codeArea { border: 1px solid black; }
</style>
<script type="text/javascript">
/* Code Tag Modification by hpmad
Do not repost or claim without permission from creator
For more codes like this one go to: talkpark.proboards.com */
var table = document.getElementsByTagName('table');
if(location.href.match(/action=(display|recent|pmview|search2)/i)){
for(i=0;i<table.length;i++){
if(table.className=='code'){
var codeArea = table.firstChild.firstChild.firstChild.firstChild.innerHTML;
codeArea = codeArea.replace(/&nb+sp;/gi,' ');
codeArea = codeArea.replace(/&a+mp;/gi,'&');
codeArea = codeArea.replace(/\t/gi,'&nb+sp;&nb+sp; ')
codeArea = codeArea.replace(/<br\s?\/?>/gi,'\n');
table.parentNode.parentNode.parentNode.parentNode.parentNode.innerHTML = '<font size="1"><b>Code:</b></font><br><center><form><textarea class="codeArea" style="font-size: 8pt;" readonly name="codeArea" cols="90" rows="12">'+codeArea+'</textarea><br><input type="button" value="Highlight Code" onclick="javascript:this.form.codeArea.focus();this.form.codeArea.select();"></form></center>';
i--;
}
}
}
</script>
Basically, the code that you put in [code] tags will be put into a textarea with a highlight all button instead of a table. The spacing will also be intact, so if the code is indented, it will stay indented. There's a css part that you can edit too.
Preview
img202.imageshack.us/img202/3030/codemodprev6wq.png
Global Footers
<style type="text/css">
.codeArea { border: 1px solid black; }
</style>
<script type="text/javascript">
/* Code Tag Modification by hpmad
Do not repost or claim without permission from creator
For more codes like this one go to: talkpark.proboards.com */
var table = document.getElementsByTagName('table');
if(location.href.match(/action=(display|recent|pmview|search2)/i)){
for(i=0;i<table.length;i++){
if(table.className=='code'){
var codeArea = table.firstChild.firstChild.firstChild.firstChild.innerHTML;
codeArea = codeArea.replace(/&nb+sp;/gi,' ');
codeArea = codeArea.replace(/&a+mp;/gi,'&');
codeArea = codeArea.replace(/\t/gi,'&nb+sp;&nb+sp; ')
codeArea = codeArea.replace(/<br\s?\/?>/gi,'\n');
table.parentNode.parentNode.parentNode.parentNode.parentNode.innerHTML = '<font size="1"><b>Code:</b></font><br><center><form><textarea class="codeArea" style="font-size: 8pt;" readonly name="codeArea" cols="90" rows="12">'+codeArea+'</textarea><br><input type="button" value="Highlight Code" onclick="javascript:this.form.codeArea.focus();this.form.codeArea.select();"></form></center>';
i--;
}
}
}
</script>