Snitz Forums 2000
Snitz Forums 2000
Home | Profile | Register | Active Topics | Members | Search | FAQ
Username:
Password:
Save Password
Forgot your Password?

 All Forums
 Snitz Forums 2000 DEV-Group
 DEV Discussions (General)
 (v3.4.03) inc_code.asp & inc_code.js
 New Topic  Topic Locked
 Printer Friendly
Author Previous Topic Topic Next Topic  

kwhipp
Junior Member

USA
407 Posts

Posted - 19 September 2002 :  18:13:55  Show Profile  Visit kwhipp's Homepage  Send kwhipp an AOL message  Send kwhipp an ICQ Message  Send kwhipp a Yahoo! Message
In both of these files, shouldn't the email function which is:

function email() {
	if (helpstat) {
		alert("E-mail Tag Turns an e-mail address into a mailto hyperlink.\n\nUSE #1: someone\@anywhere.com \nUSE #2: [url=\"someone\@anywhere.com\"]link text[/url]");
		}
	else {
		txt2=prompt("Text to be shown for the link. Leave blank if you want the e-mail address to be shown for the link.","");
		if (txt2!=null) {
			txt=prompt("URL for the link.","mailto:");
			if (txt!=null) {
				if (txt2=="") {
					AddTxt=txt;
					AddText(AddTxt);
				} else {
					AddTxt="[url=\""+txt+"\"]"+txt2+"[/url]";
					AddText(AddTxt);
				}
			}
		}
	}
}


be this?

function email() {
	if (helpstat) {
		alert("E-mail Tag Turns an e-mail address into a mailto hyperlink.\n\nUSE #1: someone\@anywhere.com \nUSE #2: [url=\"someone\@anywhere.com\"]link text[/url]");
	} else if (basic) {
		AddTxt="mailto:";
		AddText(AddTxt);
	} else { 
		txt2=prompt("Text to be shown for the link. Leave blank if you want the e-mail address to be shown for the link.",""); 
		if (txt2!=null) {
			txt=prompt("URL for the link.","mailto:");      
			if (txt!=null) {
				if (txt2=="") {
					AddTxt=txt;
					AddText(AddTxt);
				} else {
					AddTxt="[url=\""+txt+"\"]"+txt2+"[/url]";
					AddText(AddTxt);
				}         
			} 
		}
	}
}


Currently when the format mode is "basic" the function still prompts for input. The code that I suggest just writes the
mailto:
tag.

- Kevin

Edited by - kwhipp on 19 September 2002 23:57:15

RichardKinser
Snitz Forums Admin

USA
16655 Posts

Posted - 19 September 2002 :  19:29:19  Show Profile
The mailto: tag isn't necessary when posting an e-mail address. For Basic and Prompt, it functions the same.
Go to Top of Page

favorini
Starting Member

USA
27 Posts

Posted - 19 September 2002 :  23:50:58  Show Profile
kwhipp,

I think the code you posted is not what you want, and in fact the existing code is misleading. Having "mailto:" before an email address does not produce a clickable link. Just using the email address works fine however.

I think the existing code should not have "mailto:" but rather "someone@anywhere.com" as the second arg to the second prompt(). If the user leaves the "mailto:" in the string they type, "mailto:" will be displayed unless they have also entered some text at the first prompt. Or possibly you could just change the prompt text to be a little more specific. Maybe "Enter the email address" instead of "URL for the link".

The following all produce clickable links (substitute [] for {} and @ for #):

foo#bar.com
{url}foo#bar.com{/url}
{url="foo#bar.com"}{/url}
{url="foo#bar.com"}text{/url}
{url="mailto:foo#bar.com"}text{/url}

generates

foo@bar.com
foo@bar.com
foo@bar.com
text
text

These do not work as expected:

mailto:foo#bar.com
{url="mailto:foo#bar.com"}{/url}

generates

mailto:foo@bar.com
mailto:foo@bar.com

I do agree however that it is inconsistent to have the email button prompt you in Basic mode. None of the other buttons do. However, it's not clear what it should insert instead. Maybe
{url="someone@anywhere.com"}{/url}
or just
{url}{/url}

Alternatively you could make the email address parser recognize "mailto:" and strip it off.

-Fran

P.S. Is there some way to quote square brackets so they don't get translated?
Go to Top of Page

kwhipp
Junior Member

USA
407 Posts

Posted - 19 September 2002 :  23:56:24  Show Profile  Visit kwhipp's Homepage  Send kwhipp an AOL message  Send kwhipp an ICQ Message  Send kwhipp a Yahoo! Message
OK.

This all started because I noticed that when the format mode was "Basic" and I clicked the insert email button, the JS prompt window popped up. This isn't suppose to happen in Basic mode ... correct?

- Kevin
Go to Top of Page

RichardKinser
Snitz Forums Admin

USA
16655 Posts

Posted - 19 September 2002 :  23:57:45  Show Profile
[[b][/b]url] [[b][/b]/url]

produces this:

[url] [/url]
Go to Top of Page

RichardKinser
Snitz Forums Admin

USA
16655 Posts

Posted - 20 September 2002 :  00:02:37  Show Profile
The way these Format Buttons work has been that way since it started out as a MOD about 2 years ago. Everyone up to now hasn't had any problems with it.
Go to Top of Page

kwhipp
Junior Member

USA
407 Posts

Posted - 20 September 2002 :  00:11:56  Show Profile  Visit kwhipp's Homepage  Send kwhipp an AOL message  Send kwhipp an ICQ Message  Send kwhipp a Yahoo! Message
quote:
Originally posted by RichardKinser

The way these Format Buttons work has been that way since it started out as a MOD about 2 years ago. Everyone up to now hasn't had any problems with it.

Don't get me wrong. I do not have a problem with it. I just noticed that that particular button did not behave the same as the rest. When the format mode is "prompt" a JS window pops up for you to complete. When in "basic" mode code is just added to the textarea.

That's all.

- Kevin
Go to Top of Page

favorini
Starting Member

USA
27 Posts

Posted - 20 September 2002 :  01:21:03  Show Profile
Richard,

What is the reasoning for having "mailto:" inserted into the post? It doesn't actually help the link get rendered properly. If this is simply supposed to cue the user to enter an email address to replace "mailto:", I'd just change the prompt to "Enter email address" and not have "mailto:" appear as the default answer.

Obviously this is not a showstopper. But since it is so easy to change it so it works a little better, why not? (OK, maybe we are just being too anal.)

-Fran
Go to Top of Page
  Previous Topic Topic Next Topic  
 New Topic  Topic Locked
 Printer Friendly
Jump To:
Snitz Forums 2000 © 2000-2021 Snitz™ Communications Go To Top Of Page
This page was generated in 0.39 seconds. Powered By: Snitz Forums 2000 Version 3.4.07