Welcome Guest [Log In] [Register]
This board has been archived and is no longer accepting new questions. If you have a support question for your ZetaBoard, please visit us at the new support board. Registration is free and easy.


Visit the NEW ZetaBoards Support forum!

Username:   Password:
Add Reply
Size Tag v1.0
Topic Started: Jan 17 2008, 04:20 PM (1,575 Views)
Viral
Member Avatar
i'm stanley nao
[ *  *  *  *  * ]
Safari 3.0: 100%
Firefox 2.0: 100%
Opera: 100%
IE 7.0: 100%


I say v1.0 because it really isn't much extra. It adds a button which if you click, you input the size and text. It then adds it to your post, however, it will not add [size=x], but instead [big][big] etc.. (for whatever the size you chose was.)

Code: HTML
 
<script>
// Size Tag v1.0 by Viral of http://www.zetaresources.com

if(location.href.match('post')){
max=6;
min=-4;
function big(){
texty=document.getElementsByTagName('textarea')[0];
if(lol>max){lol=max}
for(i=0;i<lol;i++){texty.value+="[big]";}
texty.value+=text;
texty.focus();
for(i=0;i<lol;i++){texty.value+="[/big]";}lol=0;}
function small(){
texty=document.getElementsByTagName('textarea')[0];
if(lol<min){lol=min}
lol=parseInt(0-lol);
for(i=0;i<lol;i++){texty.value+="[small]";}
texty.value+=text;
texty.focus();
for(i=0;i<lol;i++){texty.value+="[/small]";}lol=0;}
texty=document.getElementsByTagName('textarea')[0];

function add(){
lol=prompt("[size=???]");
text=prompt("Text to add?");
if(lol<0){small();}
if(lol>0){big();}
}
a=document.getElementById('c_bbcode');
a.innerHTML="<button type=\"button\" name=\"size\" onmouseover=\"ZetaHelp('Size')\" onclick=\"add()\">Size</button>"+a.innerHTML;
}
</script>


http://s1.zetaboards.com/viralcodetest/post/

Preview ^^.


Change max=6 to max=x (where x is the max size).
Change min=-4 to min=y (where y is the min size (under 0))
Edited by Viral, Mar 19 2008, 06:44 PM.
Offline Profile Quote Post Goto Top
 
dark knight
Member Avatar
Member
[ *  *  * ]
Pretty nice code :) Better than typing in all those tags on your own.
Offline Profile Quote Post Goto Top
 
Viral
Member Avatar
i'm stanley nao
[ *  *  *  *  * ]
Thanks dark knight :) .
Offline Profile Quote Post Goto Top
 
FearMyWrench
5 Cups of Ubuntu
[ * ]
Thanks a lot, this is WAY better then typing [big][big][big]blah[/big][/big][/big].
Offline Profile Quote Post Goto Top
 
Viral
Member Avatar
i'm stanley nao
[ *  *  *  *  * ]
Thanks as well Justin. I will try and make it have [size=x][/size] next time, and then when you click 'Post Reply', it will change to all the [big] tags.
Edited by Viral, Jan 18 2008, 03:59 AM.
Offline Profile Quote Post Goto Top
 
Phlip (S)
Member Avatar
Member
[ *  *  *  * ]
dark knight
Jan 17 2008, 04:28 PM
Pretty nice code :) Better than typing in all those tags on your own.
Typing in? What? There are buttons. Anyway, it would be nice if we knew where it was meant to be put. ^o) (btw your preview's a tad ill-thought out.)
Offline Profile Quote Post Goto Top
 
Viral
Member Avatar
i'm stanley nao
[ *  *  *  *  * ]
Below the Board.

Remove /post from the URL. I include a preview with every one of my codes that needs one. If I added a bit extra to the end of the URL, it isn't much for you to remove it..
Offline Profile Quote Post Goto Top
 
Invitation To Hades
Member
[ * ]
FearMyWrench
Jan 17 2008, 04:33 PM
Thanks a lot, this is WAY better then typing [big][big][big]blah[/big][/big][/big].
It sure can't come any sooner.
Offline Profile Quote Post Goto Top
 
.insane
Member Avatar
You think you know....
[ *  * ]
where in the board template does this go?

also the preview isn't working :(
Offline Profile Quote Post Goto Top
 
Viral
Member Avatar
i'm stanley nao
[ *  *  *  *  * ]
I may have removed it from the preview.

Below the board or Above copyright.
Offline Profile Quote Post Goto Top
 
2 users reading this topic (2 Guests and 0 Anonymous)
Go to Next Page
« Previous Topic · User Created Codes · Next Topic »
Add Reply