Welcome, Guest. Please login or register.
Did you miss your activation email?


Login with username, password and session length

Search

 
Advanced search

8043 Posts in 1856 Topics- by 2099 Members - Latest Member: roi
Calendar Script CommunityCustomizationPlugins (Moderators: scott, DanO, Marty)javascript in event details window with Metacalendar
Pages: [1]   Go Down
Print
Author Topic: javascript in event details window with Metacalendar  (Read 386 times)
0 Members and 1 Guest are viewing this topic.
Terry
New Member
*

Karma: 0
Offline Offline

Posts: 0


« on: October 20, 2003, 11:42:00 PM »

I've got CalendarScript with Metacalendar and Split Recurring Event going -- and it's working great, Matt and Dan ... thanks!

I'd like to do one more customization, using a javascript to mask e-mail addresses in the pop-up detail window.

Could tell me (1) if this is possible; (2) if so, exactly where do I insert the script? and (3) if so, can I just use the call-up in the description field as is?

I was going to copy the script and the call-up into the message, but it doesn't show up. Maybe someone could tell me how to accomplish that, too?

Thanks much --
 Terry

[This message has been edited by terry (edited October 20, 2003).]

Logged
DanO
Moderator
Full Member
*****

Karma: 13
Offline Offline

Posts: 230

Please don't PM me. Post in the open forum.


WWW
« Reply #1 on: October 21, 2003, 01:32:00 PM »

** Could tell me (1) if this is possible **

Maybe but without seeing what you're trying to do...

** (2) if so, exactly where do I insert the script? **

Again, without seeing what you're trying to do... but the previous forum message "Break apart event title and description" may give you some ideas if needing to act on a single Event field? The key line being "if ($db->{'properties'}->{$_}->{'name'} eg "title") { "

** it doesn't show up. Maybe someone could tell me how to accomplish that, too? **

This 'Plugins' forum (and only this forum) allows posting of HTML code. Any HTML code posted here will be included into the message's HTML code and not seen by users but istead will be acted upon by the browser.

Try wrapping any HTML code you want shown in between <textarea> ... </textarea> tags or converting all HTML < and > tags to their HTML entities (&lt; and &gt; respectively).

Dan O.

[This message has been edited by DanO (edited October 21, 2003).]

Logged
Terry
New Member
*

Karma: 0
Offline Offline

Posts: 0


« Reply #2 on: October 21, 2003, 05:07:00 PM »

Thanks, DanO --

Here's the code (substituting the > and < that I use to mask e-mail addresses on the site:

----------------

<script type="text/javascript"><!--

function ShowEmail(address,userdomain,tld)
{
   var atsign = '@';
   var dot = '.';
   document.write('<a href=mailto:' + address + atsign + userdomain + dot + tld + '>');
   document.write(address + atsign + userdomain + dot + tld + '</a>');
}
// --></script>

------------------

and here's the code that creates the clickable e-mail address on the page itself:

------------------

<script language="javascript" type="text/javascript" language="JavaScript1.2" name="ShowEmail"> ShowEmail ('office', 'firstuustlouis', 'org');</script>

------------------

Does this give you enough information to be able to answer my original questions 1, 2, and 3?

Many thanks,
 Terry


------------------


[This message has been edited by terry (edited October 21, 2003).]

[This message has been edited by terry (edited October 21, 2003).]

Logged
DanO
Moderator
Full Member
*****

Karma: 13
Offline Offline

Posts: 230

Please don't PM me. Post in the open forum.


WWW
« Reply #3 on: October 22, 2003, 12:19:00 PM »

** (1) if this is possible **

Probably.

** (2) if so, exactly where do I insert the script?  **

The ShowEmail JavaScript function would usually go between the <head> and </head> tags on the page using the code. The rest of the code would usually go where you want the link to appear on the page.

You would have to do some Perl coding in the template which displays the email address to split up a standard email address (office@firstuustlouis.org)into the individual parts ('office', 'firstuustlouis', 'org') needed for the JS function

** 3) if so, can I just use the call-up in the description field as is? **

No, you can not just add that code to an event database's record. To use it will require Perl coding of the template it is being used on.

Dan O.


[This message has been edited by DanO (edited October 22, 2003).]

Logged
Terry
New Member
*

Karma: 0
Offline Offline

Posts: 0


« Reply #4 on: October 22, 2003, 01:22:00 PM »

Thanks, DanO --

It helps to know what *is* and is not possible. Now I have an idea about how to get going with it, at least.

Terry

------------------

Logged
Pages: [1]   Go Up
Print
Jump to: