How to Display Sky View Café on Your Web Site
A number of people have asked me about how they can put Sky View Café (SVC) on their own
web sites. Directly installing the SVC applet on a web site means not only putting the JAR file for
the applet on the site -- that's the easy part -- but it also entails a lot of not-so-obvious
complications related to cookie handling, server-side CGIs for atlas queries, NetGeo IP-to-location
look-up, a "GIF bounce" service for providing printable web pages when applet printing is
restricted, and other server-side support.
There's an easier way to display SVC from within your own web pages. I've designed my web
site so that the applet's web page is suitable for inclusion within another web page via
IFRAME
mark-up, and further, so that the applet's web page now recognizes a number of customization options
to control colors, layout, and to a limited extent, size. Here's an example:
<iframe
src="http://legacy.skyviewcafe.com/skyview.php?locksize=true
&showtips=false&bgcolor=FFFFFF&qcolor=666666&icolor=888888&ccolor=666666
&home=C071d28m00sW42d45m00sN00000P300N2DNashua%2C%20NH"
width=728
height=614
marginwidth=0
marginheight=0
frameborder=0
scrolling=no>
Your web browser can't display the Sky View Café astronomy applet which
was meant to be visible here on this web page, but you can try going directly to the
<a
href="http://legacy.skyviewcafe.com/">Sky View Café</a>
web site instead.
</iframe>
Note: There should be no spaces or line breaks within the quoted value for
SRC shown above.
The http://legacy.skyviewcafe.com/skyview.php?locksize=true part of
the value for SRC is required. There are further optional parameters
which will be described below.
The values for WIDTH and HEIGHT
will typically be either be 728 by 614, or 918 by 614. The value for height can be adjusted within a
limited range if the vsqueeze parameter, described below, is used.
Optional Parameters
These optional parameters should be appended to the SRC URL, in the format
&name=value . The parameter names must be in lower case as shown.
bgcolor |
The background color for the applet, which will border the applet and
fill the spaces in and around the applet itself, the header, the footer, and the
optional Quick Tips panel. This color, like all other colors used here, should be
in standard
web RGB format -- a six-character hexadecimal number. For instance, if you
wanted the background color to be a medium blue, you'd add
&bgcolor=0000CC to the SVC URL.
Any color parameter that you don't set defaults to the color used in the
original SVC web page. Please note that there should be no #
in front of the hexadecimal color values specified here. |
ccolor |
The background color for the Sky View Café copyright notice.
This color should be dark enough to work well behind white text. |
home |
This parameter allows you to specify a default location -- latitude,
longitude, time zone, and location name. Using the
home parameter defeats SVC's automatic NetGeo
IP-to-location look-up, but if an SVC user chooses to set and save a particular location
himself, that setting will take precedence over your
home parameter.
Using the home parameter is ideal for such
uses as a local astronomy club, where you'd like SVC to default to the club's
home town or favorite viewing site.
To create a properly formatted location string, use the form
at the end of this page. |
icolor |
The background color for the Intro/Reselect link.
This color should be dark enough to work well behind white text. |
locksize |
Required, and must be set to
true. This prevents scrollbars from possibly appearing
within the IFRAME, and removes the user option for enlarging the applet's page
layout, an option to which an IFRAME would be unable to adapt. |
qcolor |
The background color for the Questions/Comments link.
This color should be dark enough to work well behind white text. |
showtips |
Set showtips to
false if you'd like to save 190
pixels-worth of layout width at the expense of hiding the Quick Tips panel to the
right of the applet. When adding
&showtips=false to the SVC URL,
the IFRAME attribute WIDTH should be set to
728. Otherwise, it should be set to
918.
If you hide SVC's Quick Tips panel, you of course have the option of creating your
own tips panel next to the SVC IFRAME. |
sversion |
This stands for "suggested version", with the current versions available
being 3 and 4.
Normally, a first time user of SVC (or a returning user who didn't orginally accept, or
who later deleted, the browser cookies which let SVC know he or she has visited before) will
be presented with an intro page and a choice of different versions of SVC.
If you'd prefer your users to immediately see the SVC applet, first visit or not, cookies
or not, then you can use sversion to pre-select
which version of SVC is shown. An sversion value
of 3 is in some ways the safest bet, but since users
lose out on a lot of SVC features with version 3, and because expecting Java 1.3 or later isn't
that demanding an expectation these days (any installation of Java 1.1 or 1.2 is many years
overdue for an update), an sversion value of
4 is probably the best way to go if you want SVC
to be immediately displayed. |
tcolor |
The background color for the Quick Tips panel. |
tlcolor |
The link color for the Quick Tips panel. |
ttcolor |
The text color for the Quick Tips panel. |
vsqueeze |
For a small amount of control over reducing the vertical size of the applet, you can
set vsqueeze to a value from 1 to 36. The IFRAME's
HEIGHT should be reduced from 614 accordingly. |
Two live examples of IFRAMEing SVC can be found at
http://www.shetline.com/svciframe.html.
(The color scheme of the second example is NOT recommended!
)
While the IFRAME method described here should work well for nearly all recent-vintage web browsers,
a couple of points are work noting:
- IFRAMEs have been supported in Internet Explorer since 3.0, and in Netscape since 6.0. (For more
info, see this
chart.) If you wanted to work at older browser compatibility, a similar effect could be achieved with
FRAMESET mark-up
as is achieved with IFRAME mark-up.
- Whether a visitor uses SVC through your web site, or goes directly to legacy.skyviewcafe.com, they won't
get the benefits of saved version choices and saved locations without accepting cookies. However,
when SVC is IFRAME'ed into your web pages, SVC's cookies are considered third party cookies,
which are more often rejected by users than first party cookies. To mitigate this problem, SVC provides
a "compact privacy policy" indicating that its cookies contain no identifying information, making the
cookies generally acceptable by the default security and cookie settings of most browsers.
|