Page 1 of 2

Info Extension Plugin

Posted: 29.01.2004, 00:05
by maxim
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

Posted: 30.01.2004, 17:15
by maxim
Oh, come on! It's only a small package!
Someone could have a short look.

maxim

Posted: 30.01.2004, 17:37
by selden
Maxim,

Patience! Some of us do have day jobs, you know.
I'll try to take a look at this weekend.

Posted: 30.01.2004, 19:34
by greenwood
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

Posted: 31.01.2004, 07:16
by don
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.

Posted: 31.01.2004, 08:16
by maxim
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

Posted: 31.01.2004, 08:47
by Mikeydude750
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...

Posted: 31.01.2004, 10:34
by maxim
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 :)

Posted: 31.01.2004, 12:47
by selden
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".

Posted: 31.01.2004, 14:02
by greenwood
- 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

Posted: 31.01.2004, 16:44
by don
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.

Posted: 31.01.2004, 22:00
by maxim
Don:

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

maxim :)

Posted: 31.01.2004, 23:14
by don
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.

Posted: 01.02.2004, 11:30
by maxim
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

Posted: 01.02.2004, 12:28
by maxim
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 :)

Posted: 01.02.2004, 21:17
by don
Hi maxim,

Thank you for your answers.


maxim wrote:Name and size are ok. But it should't take over an existing browser window but instead create his own one.
Agreed. Is this a JS problem or IE problem?


maxim wrote:In our case you can always say 'yes'. This behavior can't be switched off.
Actually, in my case, I need to click No, or I lose the browser window it hijacked! When I say No, I can then resize the browser window to where it was and click the Back button to re-display the web page it was on.

maxim wrote:
don wrote: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.
Yes, I fully understand. My writing this was merely to encourage continued development into a product that would not require the *user* to know JavaScript and/or CSS formatting, unless they want to create their own info sheets. Add-on developers would obviously need to know these things if they want to create sheets for their add-ons.

One more thing this add-on provides, that might not be thought of right away ... it allows information to be displayed in ANY LANGUAGE, without modifying Celestia! :D


maxim wrote:I suggest that we should destille a set of default values that meets most common requirements and leave the rest to the individual user.

This is where I think a simple config file or scriptlet would be much more effective, like Celestia uses (celestia.cfg). If a config file is used, it should be a simple plain text file that contains the required setting information, with comments in plain <your language here>, that all users can understand (no knowledge of JS or CSS required) and edit to meet their needs. If a scriptlet is used, it could modify a data file of any format containing the necessary settings.

Thank you for considering percentage fonts. If you provide a way for the user to set font sizes (other than editing the CSS) then this might not be necessary. But, button and window sizes would need to be adjusted accordingly.

Cheers,

-Don G.

Posted: 02.02.2004, 00:16
by greenwood
maxim wrote:Strange. Can you figure out why? textcolor?

Sorry didnt make my self clear...its the offset, it is too small so the info window is only partially visible, I can change the offset to fix this.

cheers
greenwood

Posted: 06.02.2004, 12:23
by maxim
Ok, here I,m back after a few days.

I've released a new version, that includes some improvements.
Resizable is default now. Hand cursor is used. I removed function code from 'pluginConfig.js', so it can be regarded now as something like a plain text configuration file. More configuration settings are available. One of them is font size, which can now be adjusted from a central point.


greenwood:

Was this due to the original settings, or to changes you did?


don:

There is no way of using a 'real' configurations file, because javascript is not allowed to read/write onto your filesystem. Everything (*.html, *.css, *.js) is part of the loading HTML document, and included at load time, even if parts are spread over different files. The solution I provide now, is the nearest to a 'real' configuration file. Remember that we don't have a webserver with cgi scripting in the background. Everything is done directly by the browser.

The hijacking thing seems to be browser configurable, althought I don't know which setting. The initial call is done from within Celestia while opening what you've defined via an 'InfoURL' setting. This openes (in our case) the base background window.

If you try to open another 'InfoURL' that referres directly to a web adress (there should be several inside default Celestia) you should also watch that an existing window is hijacked. Because on my computer IE is always opening InfoURLs inside a separate window without hijacking any existing one, the conclusions is that there should be an option anywhere that controlles this behavior. Please (anybody) give me a short hint if you find it.

Checking for use of % fontsize settings, I found them badly useable. Other than one might expect the % value is not relative to the screen resolution or the windows size but to the parental HTML element that contains the element that want's to use the fontsize setting. It may be useable inside sophisticated, well planned layouts, but not for our needs.

maxim :)

Posted: 06.02.2004, 12:33
by selden
Maxim,

The % resizing must be relative to the parent window's font size. That parent font size was chosen by the user because that's what he needs -- for whatever reason. The Info font sizes should be that way too.

You must not assume that any particular font size is "best". Think of the Info windows as ways to display information, not as pretty pictures that you design down to the last pixel.

Posted: 06.02.2004, 16:04
by maxim
Ah! You didn't mean the buildin CSS percentage font size settings, but a custom version that calculates the actual font size from what is found as browser default settings.
I missunderstood that.

maxim :)