Post by Malagrond on Sept 13, 2011 23:44:37 GMT -8
Ever wanted to add <style></style> tags to your post willy-nilly? How about id'd <div>'s? Now you can!
Preview: Click (This particular example uses a WebKit-browser-specific style, so it looks best in Chrome but degrades nicely otherwise.)
Usage:
Global Footer/Board Footer:
EDIT: Fixed bug that would replace ALL <br> tags...
Preview: Click (This particular example uses a WebKit-browser-specific style, so it looks best in Chrome but degrades nicely otherwise.)
Usage:
[styletag]
#dividhere{
width:1px;
}
::-webkit-scrollbar {
width: 12px;
}
::-webkit-scrollbar-track {
-webkit-box-shadow: inset 0 0 6px rgba(0,0,0,0.3);
border-radius: 10px;
}
::-webkit-scrollbar-thumb {
border-radius: 10px;
-webkit-box-shadow: inset 0 0 6px rgba(0,0,0,0.5);
}
[/styletag]
[div=dividhere]
lolololololololololololololol
[/div]
Global Footer/Board Footer:
<script>
<!--
/*
Styletag and Div UBBC
by Malagrond
Open-source... Please leave this header intact unless heavily modifying the following script.
*/
var limitUsers = false; // Set to true to only allow certain users to use this feature; specify them below.
var allowedUsers = /^(admin|malagrond|lolol)$/; // Add names inside the parentheses, separated by the | (pipe) symbol.
if(pb_action.match(/(calendar|pm|pre)view|search2|display/i)){
if((limitUsers==true && allowedUsers.test(pb_username)) || limitUsers==false){
var allTds = document.getElementsByTagName("td");
for(var i=0;i<allTds.length;i++){
if(allTds[i].width=="80%"){
allTds[i].innerHTML = allTds[i].innerHTML.replace(/\[styletag\]/gi, "<style>").replace(/\[\/styletag\]/gi, "</style>").replace(/\[div=(.+?)\]/gi, '<div id="$1">').replace(/\[\/div\]/gi,"</div>");
postTD = allTds[i];
if(!postTD.innerHTML.match(/Topic\:/gi)){
var str = postTD.innerHTML.split("<style>")[1].split("</style>")[0];
postTD.innerHTML = postTD.innerHTML.replace(str,str.replace(/<br>/gi,""));
}
}
}
}
}
-->
</script>
EDIT: Fixed bug that would replace ALL <br> tags...