Ross
eCreations Staff
Posts: 1,768
|
Post by Ross on Aug 12, 2005 19:09:22 GMT
Global FooterThis will change the & buttons so that when you click them, prompt boxes will appear letting you enter the URLs or Text to be added to your post <script type="text/javascript"> <!-- /* image and URL prompt boxes by elindir - 101 Support */ if(document.postForm){ function url() { var a=window.prompt('What URL do you want to link to?',''); var b=window.prompt('What text should be clickable?',''); document.postForm.message.value+='\[url\='+a+'\]'+b+'\[\/url\]'; } function image() { var a=window.prompt('What is the URL of the image you would like displayed?',''); document.postForm.message.value+='\[img\]'+a+'[\/img\]'; } var a=document.getElementsByTagName("a"); for(e=0;e<a.length;e++) if(a[e].href=='javascript:add("\[url\]","\[\/url\]")') { a[e].href='javascript:add("")'; a[e].onclick=url; a[e+2].href='javascript:add("")'; a[e+2].onclick=image; } } //--> </script>
|
|
Richie
Veteran
^ Yes, That's me V_V
Posts: 624
|
Post by Richie on Jan 23, 2006 18:25:53 GMT
1st of all great code Ross, beautiful!
anyway, could you slightly modify it so the text links will be underlined like this?
[url=URL HERE][u]TEXT HERE[/u][/url]
EDIT: I'm sure it's very simple to do, but i don't wanna take the chance that I'll screw it up!
EDIT #2: could you make it so a prompt will appear to link the image too?
|
|
|
Post by George® on Jan 23, 2006 18:35:19 GMT
document.postForm.message.value+='\[url\='+a+'\]'+b+'\[\/url\]';
find this and edit it to look like this document.postForm.message.value+='\[url\='+a+'\][u]'+b+'\[/u][\/url\]';
what do you mean with #2?
also if you want me to test it before you use it let me know via PM
|
|
Richie
Veteran
^ Yes, That's me V_V
Posts: 624
|
Post by Richie on Jan 23, 2006 18:46:39 GMT
document.postForm.message.value+='\[url\='+a+'\]'+b+'\[\/url\]';find this and edit it to look like this document.postForm.message.value+='\[url\='+a+'\][u]'+b+'\[/u][\/url\]'; what do you mean with #2? also if you want me to test it before you use it let me know via PM thanks, although i assumed i would just need to make that minor change. for Number 2, i want a prompt to appear to ask " What is the URL of the image you would like displayed?", & THEN another one to ask " What is the URL you want the image to link to?", get it?
|
|
|
Post by George® on Jan 23, 2006 18:51:44 GMT
oh Ok
Here are both modifications
<script type="text/javascript"> <!-- /* image and URL prompt boxes by elindir - 101 Support */ if(document.postForm){ function url() { var a=window.prompt('What URL do you want to link to?',''); var b=window.prompt('What text should be clickable?',''); document.postForm.message.value+='\[url\='+a+'\][u]'+b+'\[/u][\/url\]'; } function image() { var a=window.prompt('What is the URL of the image you would like displayed?',''); var b=window.prompt('What is the Link to the image being displayed?',''); var c=window.prompt('What Text should be clickable?',''); document.postForm.message.value+='\[img\]'+a+'[\/img\]'; document.postForm.message.value+='\[url\='+b+'\][u]'+c+'\[/u][\/url\]'; } var a=document.getElementsByTagName("a"); for(e=0;e<a.length;e++) if(a[e].href=='javascript:add("\[url\]","\[\/url\]")') { a[e].href='javascript:add("")'; a[e].onclick=url; a[e+2].href='javascript:add("")'; a[e+2].onclick=image; } } //--> </script>
|
|
|
Post by ender17 on Feb 17, 2006 6:11:58 GMT
I'm gonna feel stupid for this, but...where does this go? I can't get it to work.
|
|
|
Post by deadlyassassin on Feb 17, 2006 10:38:19 GMT
The code goes in the Global Footer. And do you have a board link so we can see what he problem is?
|
|
|
Post by ender17 on Feb 19, 2006 8:29:41 GMT
Here.I still can't get it to do anything.
|
|
Ross
eCreations Staff
Posts: 1,768
|
Post by Ross on Feb 19, 2006 11:58:45 GMT
It needs to be in the footer and only the footer. At the moment it is in the Header too
|
|
|
Post by ender17 on Feb 20, 2006 5:58:45 GMT
Ahhhh. Thank you! I thought I got rid of that in the Header. Guess I was wrong. Works now.
|
|