|
Post by Wormopolis on Apr 15, 2012 14:13:46 GMT -8
browsers tested: IE and FF placement: global or board footer (global if you want to work on PMs as well)
This code will allow you to setup some pre-formatted UBBC in posts/quick reply based off username or even ALL users.
<script type="text/javascript"> <!-- // pre-UBBC in posts/QR // based on username // by Wormopolis - www.wormocodes.com
var affectPosts=true; var affectQuickReply=true; var affectPMs=true;
var preUBBCList=[ // ['username','UBBC string start','UBBC string end'] // or // ['ALL','UBBC string start','UBBC string end']
['admin','[b][i]','[/i][/b]'], ['ALL','[blockquote]','[/blockquote]'], ['user3','[size=3][color=red]','[/color][/size]'] //no comma last entry ];
var getPreUBBC=getPostUBBC=''; for (aa=0; aa<preUBBCList.length; aa++) { if (preUBBCList[aa][0]==pb_username || preUBBCList[aa][0]=='ALL') { getPreUBBC=preUBBCList[aa][1] + getPreUBBC; getPostUBBC+=preUBBCList[aa][2]; } } if (affectQuickReply && getPreUBBC && pb_action=='display') { for (ta=document.getElementsByTagName('textarea'), tt=ta.length-1; tt>=0; tt--) { if (ta[tt].name && ta[tt].name=='message' && ta[tt].parentNode.parentNode.innerHTML.match(/Message:/)) { ta[tt].value=getPreUBBC + '\n\n\n' + getPostUBBC; break; } } } if (document.postForm && getPreUBBC && (pb_action.match(/^post$/) && affectPosts || pb_action.match(/pmsend/) && affectPMs)) { document.postForm.message.value=getPreUBBC + '\n\n\n' + getPostUBBC; }
// --> </script>
|
|