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
Pages: [1]   Go Down
Print
Author Topic: popup  (Read 1042 times)
0 Members and 1 Guest are viewing this topic.
JSartori21367
New Member
*

Karma: 0
Offline Offline

Posts: 0

Student


WWW
« on: August 14, 2002, 01:04:00 AM »

Check out this:  http://www.sheltoncma.org/  (ssi) http://www.sheltoncma.org/cgi-bin/calendar/calendar.pl?calendar=default  (month calendar)

Notice that when you click on the event, it pops up a confirm notice with a standard description (this was a seperate field than the detailed description field so that you don't run into html/link problems).  I like it, so that people with a slow connection don't have to always open a new page.  It works as long as you don't use quotes ("), unless you put a back slash in front of it (i.e. \"Joe's Quote\")  If you use \n, it add's a new line to the popup.  Ask questions!  Leave comments!  Check it out!!!
http://www.sheltoncma.org/
webmaster@sheltoncma.org
Joe Sartori

[This message has been edited by JSartori21367 (edited November 15, 2003).]

Logged

-------------------------
webmaster@sheltoncma.org
Joe Sartori
http://www.sheltoncma.org/
Denise
New Member
*

Karma: 0
Offline Offline

Posts: 0


WWW
« Reply #1 on: August 14, 2002, 07:45:00 AM »

That's pretty neat!

------------------
Denise M. Godfrey

Logged

Denise M. Godfrey
cindyt
New Member
*

Karma: 0
Offline Offline

Posts: 0

production mgr


WWW
« Reply #2 on: August 15, 2002, 12:50:00 AM »

that is a interesting feature.  Can you post your code changes for adding that extra step? - thanks....c

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

Logged
JSartori21367
New Member
*

Karma: 0
Offline Offline

Posts: 0

Student


WWW
« Reply #3 on: August 15, 2002, 12:40:00 PM »

IMPORTANT: MAKE SURE YOU READ ALL OF THIS!!!
Here are two files you have to edit:


  • SSI.html  (found under: templates\calendars\{the calendar template\ssi.html)
  • DEFAULT.html  (found in the same place)

Editing SSI:
Add this underneath "<%FOREACH EVENT%>" :

<script language="JavaScript"><!--
var desc1 = "Description: "
var event<%=$EVENT->{'details'}->{'id'}%> = "<% if ($EVENT->{'details'}->{'description'}) { %><%=$EVENT->{'details'}->{'description2'} %> <% } %> \n \n"
var desc3 = "For more detailed information, click OK. \n"
var desc4 = "If this was enough information, click CANCEL."
// -->
</script>

Also, add this link before the code that lists the events (it should be right after the bullet {& #149; without the space})
As shown below, make sure that the title is in the link, but not the dates or bullet:

<a title="Description: <% if ($EVENT->{'details'}->{'description2'}) { %><%= $EVENT->{'details'}->{'description2'} %> <% } %>" href="JavaScript:showDetails(<%=$EVENT->{'details'}->{'id'}%> );" onClick="javascript:return confirm(desc1 + event<%=$EVENT->{'details'}->{'id'}%> + desc3 + desc4)">
         <%= $EVENT->{'details'}->{'title'} %></a>

Here are the changes for default.html:


  • Replace the all of the hrefs like this:

    <A HREF="<%=$CGI_URL_QUERYSTRING%>popup=0&template=event_detail.html&event_id=<%=$EVENT->{'details'}->{'id'}%>" onClick="showDetails('<%=$EVENT->{'details'}->{'id'}%>');return false;">

    with this:

<A HREF="JavaScript:showDetails('<%=$EVENT->{'details'}->{'id'}%>')" onClick="javascript:return confirm('Description: ' + event<%=$EVENT->{'details'}->{'id'}%> + '\n Click OK for more information. \n Click CANCEL if you do not need more information');" title="Description: <%= $EVENT->{'details'}->{'description2'} %>"

You have to replace the link in two places:


  • Grid Style
  • List Style
    (you might also have to change it in day view)

    + Make sure you have the href before the title code, but after the time code.
    ++ Also, MAKE SURE that there is a </a> tag after the title.

    IMPORTANT: If you use these script changes, make sure you go in the the Admin interface, then to Customize Event Fields, and add a field called: "description2" (without the quotes).  This field will be the place you add the description for the popup, whereas the description field is for the popup window (If the person chooses to click OK).  This is so you can have HTML in the description, without ruining your popup confirm box.

    If you find bugs, have questions or comments, reply back!  Or email me at webmaster@sheltoncma.org

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

http://www.sheltoncma.org/  
webmaster@sheltoncma.org
Joe Sartori

[This message has been edited by JSartori21367 (edited November 15, 2003).]

Logged

-------------------------
webmaster@sheltoncma.org
Joe Sartori
http://www.sheltoncma.org/
JSartori21367
New Member
*

Karma: 0
Offline Offline

Posts: 0

Student


WWW
« Reply #4 on: August 15, 2002, 01:06:00 PM »

If you need to use quotes or apostrophes, put a back-slash (\) befor it.  Also, to make a line break (new line) put \n before it.  Here is a sample

Type this into your address bar and hit return:

javascript:alert("\"Title\"\nFirst Line\nSecond Line");

This is what you see if you use this string:

\"title\"\nFirst Line\nSecond Line


Cool, huh?

[This message has been edited by JSartori21367 (edited August 15, 2002).]

Logged

-------------------------
webmaster@sheltoncma.org
Joe Sartori
http://www.sheltoncma.org/
cindyt
New Member
*

Karma: 0
Offline Offline

Posts: 0

production mgr


WWW
« Reply #5 on: August 15, 2002, 11:42:00 PM »

Thanks for posting that Joe.  I will implement that into my calendar tomorrow (Fri) and let you know how it goes....thanks for the code....cindy

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

Logged
Prucham
Guest
« Reply #6 on: October 08, 2003, 07:00:00 PM »

I tried installing the pop-up module - and I can not get it to work correctly.  What I am looking for is to display the normal event view - but utilize that description pop-up that shows when you move your mouse over a selection.  

Like this one -
http://www.sheltoncma.org/cgi-bin/calendar/calendar.pl

But without it doing a dialog box with description - just the mouse over description.

thanks

Logged
DanO
Moderator
Full Member
*****

Karma: 13
Offline Offline

Posts: 230

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


WWW
« Reply #7 on: October 08, 2003, 08:24:00 PM »

** just the mouse over description. **

Like the one described in the previous forum message "Show description when you hover the mouse over the title"?

Dan O.

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

Logged
JSartori21367
New Member
*

Karma: 0
Offline Offline

Posts: 0

Student


WWW
« Reply #8 on: December 28, 2003, 04:12:00 PM »

Update:
========

I updated this code.  The links correspond the javascript msgbox or confirm box or neither with the existance of either 1 desription box or the other or both or neither.  If someone would like me to make a plug-in of this, I think I can (I'd have to put a copy of an edited template in the plugin directory).  Here is the updated code:

Description: This hack will help those who don't like popup browser windows. This works in all calendar templates.  This just pops up a JavaScript box with a basic event description (the viewer can also hover over the link to see the popup description). This gives the viewer the option of either choosing to go to a browser popup to see the detailed event description in html version or not. There have to be two descriptions so that you don't run into any HTML errors (just incase you put links or other html codes into your detailed descriptions). This is also useful for those visitors you have with slow internet connections. Go to http://www.sheltoncma.org/  for the SSI example, or go to http://www.sheltoncma.org/cgi-bin/calendar/calendar.pl  for the grid example.

===**  Keep Backups of the changes or put old codes inside <!--   (old code)   -->  **===

Installation:

   Files you need to Edit:
   * SSI.html (calendarscript\templates\calendars\{THE CALENDAR TEMPLATE}\ssi.html
   * DEFAULT.html (calendarscript\templates\calendars\{THE CALENDAR TEMPLATE}\default.html


I.)

Go in the the Admin interface, then to Customize Event Fields, and add a field called: "description2" (without the quotes). This field will be the place you add the description for the popup, whereas the description field is for the popup window (If the person chooses to click OK). This is so you can have HTML in the description, without ruining your popup confirm box.


II.)  SSI.html Changes

   Look underneath "<%FOREACH EVENT%>"; find the bullet ( • ); add this right before the code that prints the title ( <%= $EVENT->{'details'}->{'title'} %> ):

<% if ($EVENT->{details}->{description2} ne "") { %>
<% if ($EVENT->{details}->{description} ne "") { %>

<script language="JavaScript">
var event<%=$EVENT->{'details'}->{'id'}%> = "<%=$EVENT->{'details'}->{'description2'} %> \n \n"
</script>

<A HREF="JavaScript:showDetails('<%=$EVENT->{'details'}->{'id'}%>')" oldHREF="<%=$CGI_URL_QUERYSTRING%>popup=0&template=event_detail.html&event_id=<%=$EVENT->{'details'}->{'id'}%>" onClick="javascript:return confirm('Description: ' + event<%=$EVENT->{'details'}->{'id'}%> + '\n Click OK for more information. \n Click CANCEL if you do not need more information');" title="Description: <%= $EVENT->{'details'}->{'description2'} %>"> <% } %> <% } %>

<% if ($EVENT->{details}->{description2} ne "") { %>
<% if ($EVENT->{details}->{description} eq "") { %>

<script language="JavaScript">
var event<%=$EVENT->{'details'}->{'id'}%> = "<%=$EVENT->{'details'}->{'description2'} %> \n \n"
</script>

<A HREF="#" onClick="javascript:alert('Description: ' + event<%=$EVENT->{'details'}->{'id'}%> ); return false" title="Description: <%= $EVENT->{'details'}->{'description2'} %>"> <% } %> <% } %>

<% if ($EVENT->{details}->{description} ne "") { %>
<% if ($EVENT->{details}->{description2} eq "") { %>
<A HREF="<%=$CGI_URL_QUERYSTRING%>popup=0&template=event_detail.html&event_id=<%=$EVENT->{'details'}->{'id'}%>" onClick="showDetails('<%=$EVENT->{'details'}->{'id'}%>');return false;">
<% } %> <% } %>


III.)  DEFAULT.html Changes

   Replace all of the event links that look like this (right before the code for printing the event title):

<A HREF="<%=$CGI_URL_QUERYSTRING%>popup=0&template=event_detail.html&event_id=<%=$EVENT->{'details'}->{'id'}%>" onClick="showDetails('<%=$EVENT->{'details'}->{'id'}%>');return false;">

   With This:

<% if ($EVENT->{details}->{description2} ne "") { %>
<% if ($EVENT->{details}->{description} ne "") { %>

<script language="JavaScript">
var event<%=$EVENT->{'details'}->{'id'}%> = "<%=$EVENT->{'details'}->{'description2'} %> \n \n"
</script>

<A HREF="JavaScript:showDetails('<%=$EVENT->{'details'}->{'id'}%>')" oldHREF="<%=$CGI_URL_QUERYSTRING%>popup=0&template=event_detail.html&event_id=<%=$EVENT->{'details'}->{'id'}%>" onClick="javascript:return confirm('Description: ' + event<%=$EVENT->{'details'}->{'id'}%> + '\n Click OK for more information. \n Click CANCEL if you do not need more information');" title="Description: <%= $EVENT->{'details'}->{'description2'} %>"> <% } %> <% } %>

<% if ($EVENT->{details}->{description2} ne "") { %>
<% if ($EVENT->{details}->{description} eq "") { %>

<script language="JavaScript">
var event<%=$EVENT->{'details'}->{'id'}%> = "<%=$EVENT->{'details'}->{'description2'} %> \n \n"
</script>

<A HREF="#" onClick="javascript:alert('Description: ' + event<%=$EVENT->{'details'}->{'id'}%> ); return false" title="Description: <%= $EVENT->{'details'}->{'description2'} %>"> <% } %> <% } %>

<% if ($EVENT->{details}->{description} ne "") { %>
<% if ($EVENT->{details}->{description2} eq "") { %>
<A HREF="<%=$CGI_URL_QUERYSTRING%>popup=0&template=event_detail.html&event_id=<%=$EVENT->{'details'}->{'id'}%>" onClick="showDetails('<%=$EVENT->{'details'}->{'id'}%>');return false;">
<% } %> <% } %>

   You should have had to replace it in the List format area and the Grid format area.

+ Make sure you have the href before the title code, but after the time code.
++ Also, MAKE SURE that there is a </a> tag after the title.


IV.) !IMPORTANT INSTRUCTIONS!

If you need to use quotes or apostrophes, put a back-slash (\) before it. Also, to make a line break (new line) put \n before it. Here is a sample
Type this into your address bar and hit return:

javascript:alert("\"Title\"\nFirst Line\n\'Second Line\'\nThird Line");

What you see there is what you get if you use this string in your descript2 field:

\"Title\"\nFirst Line\n\'Second Line\'\nThird Line


V.) TRY OUT YOUR HACK AND MAKE SURE IT WORKS PROPERLY.

If you find bugs, have questions or comments, reply back! Or email me at webmaster@sheltoncma.org

Thanks for trying this hack!

============
Joe Sartori
cal@sheltoncma.org
http://www.sheltoncma.org/

[This message has been edited by JSartori21367 (edited December 28, 2003).]

Logged

-------------------------
webmaster@sheltoncma.org
Joe Sartori
http://www.sheltoncma.org/
JSartori21367
New Member
*

Karma: 0
Offline Offline

Posts: 0

Student


WWW
« Reply #9 on: January 04, 2004, 10:01:00 PM »

Anyone tried this?  If so, does it work okay/were the instructions simple enough?  Thanks.

------------------
-------------------------
webmaster@sheltoncma.org
Joe Sartori
http://www.sheltoncma.org/

Logged

-------------------------
webmaster@sheltoncma.org
Joe Sartori
http://www.sheltoncma.org/
March Hare
Guest
« Reply #10 on: November 16, 2004, 12:21:00 AM »

I've tried to implement this change in version 3.21, but can't find the lines that need to be replaced in default.html

Help!?!

-MH

Logged
JSartori21367
New Member
*

Karma: 0
Offline Offline

Posts: 0

Student


WWW
« Reply #11 on: November 16, 2004, 12:41:00 AM »

The instructions above are for the OldStyle template.. if you need instructions on how to impliment them on other templates, just let me know and I can try to help you out.

============
Joe Sartori
webmaster@sheltoncma.org

Logged

-------------------------
webmaster@sheltoncma.org
Joe Sartori
http://www.sheltoncma.org/
March Hare
Guest
« Reply #12 on: November 16, 2004, 10:04:00 PM »


Thanks, I'm trying to use the default\default.html template.
Any help would be GREATLY appreciated!

Thanks,

-MH

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