Info Extension Plugin

General discussion about Celestia that doesn't fit into other forums.

Moderator: selden

Info Extension Plugin

Postby maxim » Wed Jan 28, 2004 5:05 pm

I've written a concept for pluging Info data more closely into Celestia. Here is what it does:

---------------------------------------------------------------------------------
The Info Extension Plugin was created to offer a concept of how to include more, and more extended informations for planets, moons and other objects, than Celestia itself can provide currently.

The plugin uses the Info menu topic together with the 'InfoURL' setting to provide extended information throught a set of HTML/Javascript Files. The plugin is prepared to be used with alternate Info sets for different tasks. Following is a short usage description:

. The plugin adds a new directory 'html' to the Celestia base folder. It is itself contained within the 'info' directory inside 'html'.

. Every information set for an object starts with a HTML document called base[ObjectName].html.

. The object definition has to contain a setting 'InfoURL "html/info/base[ObjectName].html"' inside its defining .ssc.

. For the info set supplied with this base package, which provides extended information for the nine planets, this means you have to add the following lines to each planet definition inside 'solarsys.ssc':
InfoURL "html/info/baseMercury.html"
InfoURL "html/info/baseVenus.html"
InfoURL "html/info/baseEarth.html"
InfoURL "html/info/baseMars.html"
InfoURL "html/info/baseJupiter.html"
...

. The list of information sources (online and offline) provided in the initial window can be extended to your needs.

. Alternative info sets can be switched via 'pluginConfig.js' inside 'html/info/js'.

. A script or activity designer who wants to provide an alternate set of object informations that is suited to his intends, may to so by either providing an alternate 'pluginConfig.js', or by extending the existing one with an alternate value set, defining the start directory and the size and position of the info window. The info set itself goes into a separate directory inside 'html/info'.

. An addon designer who has created his own fictional solarsystem(s) may provide extended information for his planets, moons and stars, by placing the HTML/Javascript files, the styles and the page design graphics into a complete own directory inside 'html/info', and adding 'InfoURL' definitions to his .scc files.

. Any changes done inside the HTML/Javascript files can take effect without restarting Celestia, because they are handled by your local webbrowser and not by Celestia.

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

This is however more a proof of concept than a ready solution.
So you will find the pages design quite simple. Moreover I do really want to have feedback about acceptance, usability, testing with different browsers/OS and startup delay times on different systems.

The download is available here: http://www.nefkom.net/z-bau/celestia/info%20plugin.zip

have fun :D

maxim
maxim
 
Posts: 1036
Joined: Thu Nov 13, 2003 10:45 am
Location: Nürnberg, Germany

Postby maxim » Fri Jan 30, 2004 10:15 am

Oh, come on! It's only a small package!
Someone could have a short look.

maxim
maxim
 
Posts: 1036
Joined: Thu Nov 13, 2003 10:45 am
Location: Nürnberg, Germany

Postby selden » Fri Jan 30, 2004 10:37 am

Maxim,

Patience! Some of us do have day jobs, you know.
I'll try to take a look at this weekend.
Selden
User avatar
selden
 
Posts: 9045
Joined: Tue Sep 03, 2002 7:21 pm
Location: NY, USA

Postby greenwood » Fri Jan 30, 2004 12:34 pm

I suppress pop-ups in my browser (Opera 7.50.3494) so I just get the initial black page.

If I enable pop-ups the base url window opens and the info panel opens in the far right bottom corner of the screen.

You may want to change the cursor to a hand in your css for those javascript hyperlinks in the info panel.

cheers
greenwood
greenwood
 
Posts: 10
Joined: Fri Jan 16, 2004 8:25 pm
Location: England

Postby don » Sat Jan 31, 2004 12:16 am

Howdy Maxim,

Very nice idea! :idea:

However...

1. I too (like most folks) use a pop-up blocker, which requires a special key be pressed during the entire load-time for the initial window.

2. I use Win XP Pro SP1 and IE 6 XPSP2. If one or more browser windows are currently open, your app takes them over, one by one. Not good.

3. When taking over an existing browser window, nothing is displayed except a blank page.

4. Can text size be changed (in my case larger) by the user?

5. Can the window size be made re-sizable? It appeared that the little window was not resizable.

6. Is there any other way, than manually editing the solarsys.ssc file, to get your required lines added? Such as a secondary SSC file?

Like I said above, very nice idea! Would love to see it worked on a bit.

Cheers,

-Don G.
User avatar
don
 
Posts: 1709
Joined: Sat Jul 12, 2003 4:34 pm
Location: Colorado, USA (7000 ft)

Postby maxim » Sat Jan 31, 2004 1:16 am

selden wrote:Patience!

Hihi, sorry - I know I can be very unpatient sometimes. :oops:

greenwood:
- Does Opera give the option to allow popups for local (or intranet) URLs?
- The base URL should resize to 100x100 and go into the background immediately. Does it?
- The Info window should stay 20px from right edge and 100px from bottom edge, regardless of your screen resolution.
- A hand cursor would be worth considering, I think.
- How long is your startup delay?

maxim :D
maxim
 
Posts: 1036
Joined: Thu Nov 13, 2003 10:45 am
Location: Nürnberg, Germany

Postby Mikeydude750 » Sat Jan 31, 2004 1:47 am

What if info could popup in a translucent window inside Celestia? It seems to me that that would be more logical.

Not even having to switch to another app to see information...now if only I was good at coding so I could implement it...
Mikeydude750
 
Posts: 169
Joined: Wed Jan 30, 2002 8:00 pm
Location: Wisconsin

Postby maxim » Sat Jan 31, 2004 3:34 am

Don:

1. Does your popup blocker allow for exclusion of certain URLs (locals or single ones)?

2. Yes, not good. That shouldn't happen. I have to investigate (althought I don't have XP).

3. Related to 2. I think.

4. Yes. Go into html/info/css/styles.css. Everywhere you see those:
Code: Select all
  font-size:   10px;
  font-weight: bold;
  font-family: Tahoma,Arial,sans-serif;

you can change font size, weight and family. This affects all (current and future) documents. Relating font-family: the first is the preferred, the others are fallbacks.

5. Yes. Go into html/info/js/pluginConfig.js:
Code: Select all
/***** Default Value Set ***********************************************************/
var path   = "default/";                  // starting path of actual info deployment
var width  = 300;                         // start width of info window
var height = 200;                         // start height of info window
var xpos   = screen.width-width-20;       // horizontal window position on screen
var ypos   = screen.height-height-100;    // vertical window position on screen
/***** End Of Default Value Set ****************************************************/

/**********************************************************************/
/* Put other value sets here. Only one set may be activ at same time. */
/**********************************************************************/

/***** Creation of the Information Window *****/
function createInfoWindow(page) {
  this.blur();
  this.resizeTo(100,100);
  var options = "width="+width+",height="+height+",left="+xpos+",top="+ypos+
  ",location=no,menubar=no,resizable=no,status=no,scrollbars=yes,toolbar=no";
  var document = path+page;
  textwin = window.open(document,'Textwindow',options);
  this.blur();
}

On the fifth-last line you will see 'resizable=no' somewhere. Change this to 'resizable=yes'.

6. I am afraid not. The InfoURL directive has to be in the initial objects definition AFAIK. One of the developers may know better, but I think it's currently not possible.

maxim :)
maxim
 
Posts: 1036
Joined: Thu Nov 13, 2003 10:45 am
Location: Nürnberg, Germany

Postby selden » Sat Jan 31, 2004 5:47 am

Maxim,

I'd suggest specifying relative font sizes (%) in your stylesheets instead of absolute font sizes. Some people need small fonts and some people need large fonts. Your design also needs to allow for people who have Accessability features enabled -- like "ignore font sizes specified in Web pages".
Selden
User avatar
selden
 
Posts: 9045
Joined: Tue Sep 03, 2002 7:21 pm
Location: NY, USA

Postby greenwood » Sat Jan 31, 2004 7:02 am

- Does Opera give the option to allow popups for local (or intranet) URLs?

not as far as I know, they are just switched off...would an IFRAME be a better alternative to javascript?

- The base URL should resize to 100x100 and go into the background immediately. Does it?

No it is full screen...there is no background as such all pages are tabbed within opera, the info window does receive focus though.

- The Info window should stay 20px from right edge and 100px from bottom edge, regardless of your screen resolution.

Yep, it does that...i cant read anything in the info window I can just see the bullet points and none of the text...the info window comes out at 300px wide by 230px high

- A hand cursor would be worth considering, I think.

style.css add
.jref{cursor:hand}

html files add

<li class="jref"

- How long is your startup delay?

not really measerable, instant.

IE6 takes about 5 seconds
greenwood
 
Posts: 10
Joined: Fri Jan 16, 2004 8:25 pm
Location: England

Postby don » Sat Jan 31, 2004 9:44 am

Howdy Maxim,

Thank you for your answers.

My popup blocker allows entry of domain names, not individual URLs, that are to be allowed.

Cheers,

-Don G.
User avatar
don
 
Posts: 1709
Joined: Sat Jul 12, 2003 4:34 pm
Location: Colorado, USA (7000 ft)

Postby maxim » Sat Jan 31, 2004 3:00 pm

Don:

A domain name 'localhost' should do it (usually).

maxim :)
maxim
 
Posts: 1036
Joined: Thu Nov 13, 2003 10:45 am
Location: Nürnberg, Germany

Postby don » Sat Jan 31, 2004 4:14 pm

Howdy Maxim,

Here's some more info ...

Entering "localhost" or "http://localhost" does not work. However, I looked at the "blocked" list and found entries for "file:///C:/Program%20Files/Celestia2/..." and entering this much of it did the trick.

Related to #2 and #3 above ...
* The browser window that gets "taken over" results with the title "Celestia - Earth Info - Internet Explorer", an Address line of "C:\Program Files\Celestia2\html\info\baseEarth.html", and a blank page about the size of a postage stamp.

* The actual information window (a new pop-up browser window) has the title "Celestia - Earth Info Panel".

* When I click the "close" button in the Information Panel, I get a pop-up message from Microsoft Internet Explorer saying the following, "The Web page you are viewing is trying to close the window. Do you want to close this window? [Yes] [No]"

If I click Yes, BOTH browser windows are closed (the one taken over AND the Info Panel).

If I click No, only the Info Panel is closed.

Your text size and window size fixes work fine. However, I agree with Selden that a variable size font (%) would be better than having to manually change all the font size definitions.

May I also suggest having the default be resize=yes, instead of no?

:idea: Or, maybe a text-based configuration file of some sort would be in order, that can be read and displayed (via Java) for easy user modification?

FYI, I use the "Ignore colors specified on Web pages" Accessibility option and that works fine.

It's too bad that users can't ADD a file that Celestia would automatically append to the solarsys.ssc file, instead of having to make manual changes -- which *always* kicks you in the butt when update time comes along. Maybe this would be a good feature request for Chris?

Thanks for creating this new means of allowing a user to add extra information text to their Celestia versions. :D

Cheers,

-Don G.
User avatar
don
 
Posts: 1709
Joined: Sat Jul 12, 2003 4:34 pm
Location: Colorado, USA (7000 ft)

Postby maxim » Sun Feb 01, 2004 4:30 am

greenwood wrote:...would an IFRAME be a better alternative to javascript

It wouldn't prevend from javascript usage.

At first the 'pluginConfig.js' provides a central plugin and configuration point. If you want to set up your very own set of info panels, you just put them in a separate directory, and set 'pluginConfig.js' to point to that directory instead the default one. Nothing else has to be changed, especially nothing inside solarsys.scc - because you did that before, for one and all times by adding the InfoURLs.

Secondly I don't see any other way to get rid of all the tools-,status-,adress-, and other lines that I don't want to see when the small window pops up inside (on top of) my current celestia window - to give me information of what I'm currently watching, an still want to watch while I'm reading the infos.

greenwood wrote:...there is no background as such all pages are tabbed within opera

Opera can be configured to work in single window and multi windows mode. The plugin is indented do be used for browsers with multi windows mode. There are limitations for single window modes. In this case you are right, and an IFRAME would make more sense.

greenwood wrote:I can just see the bullet points and none of the text

Strange. Can you figure out why? textcolor?

maxim
Last edited by maxim on Sun Feb 01, 2004 5:31 am, edited 1 time in total.
maxim
 
Posts: 1036
Joined: Thu Nov 13, 2003 10:45 am
Location: Nürnberg, Germany

Postby maxim » Sun Feb 01, 2004 5:28 am

don wrote:The browser window that gets "taken over" results with the title "Celestia - Earth Info - Internet Explorer", an Address line of "C:\Program Files\Celestia2\html\info\baseEarth.html", and a blank page about the size of a postage stamp.

Name and size are ok. But it should't take over an existing browser window but instead create his own one. This blind 'controller window' is needed to allow for a central plugin point, from where you can add your own info panels without having to change solarsys.scc ever again. Additionally it allows to create a popup without all those unneccessary adress-,status-, and tool-lines attached.

don wrote:The actual information window (a new pop-up browser window) has the title "Celestia - Earth Info Panel".

That's the only one you should see in front of your running celestia.

don wrote:When I click the "close" button in the Information Panel, I get a pop-up message from Microsoft Internet Explorer saying the following, "The Web page you are viewing is trying to close the window. Do you want to close this window? [Yes] [No]"

If I click Yes, BOTH browser windows are closed (the one taken over AND the Info Panel).

If I click No, only the Info Panel is closed.

That's ok so far. It's an effect of a browsers security constraint. Pressing 'close' starts a javascript routine that closes the Info Panel and his opener (The 'blind' controller window). Due to security considerations browsers will not allow popups to close the window that opened them without confirmation. This should prevent 'bad' popups from taking over, closing its opener and miming its behavior or breaking your current sessions history, while taking you to a complete other server. So this message arises while javascript tries to close the opener window. If you say 'no', only the info panel is closed, not the controller. In our case you can always say 'yes'. This behavior can't be switched off.

don wrote:Your text size and window size fixes work fine. However, I agree with Selden that a variable size font (%) would be better than having to manually change all the font size definitions.

May I also suggest having the default be resize=yes, instead of no?

Or, maybe a text-based configuration file of some sort would be in order, that can be read and displayed (via Java) for easy user modification?

As I said initially, this is at first a proof of concept, not a ready solution.
The primary indention is that is is flexible and pluggable. This inherits that users can make their preffered configuration settings, and these are not to be altered by further plugin addings. So the files 'styles.css' and 'pluginConfig.js' shouldn't be touched by plugin addings. Users can adapt these to their personal needs (regarding windows size, position and options, font-size etc.) and be happy with it without worrying.

Should there be a plugin (as part of a specialized script or an education activity) that needs for any reasons it's own fixed setting, it should put itself into another directory inside info and parallel to default, and use it's own style and window settings without interferring with the default ones.

I suggest that we should destille a set of default values that meets most common requirements and leave the rest to the individual user. I will consider percentage fonts - the use of it would require also automatic button resizing and automatic window resizing, so I first have to check for this.

don wrote:Maybe this would be a good feature request for Chris?

I've seen you've done that already. ;)

maxim :)
maxim
 
Posts: 1036
Joined: Thu Nov 13, 2003 10:45 am
Location: Nürnberg, Germany

Next

Return to Celestia Users

Who is online

Users browsing this forum: No registered users and 0 guests