PDA

View Full Version : Is this possible? And how?



tracy78
05-04-2006, 03:43 AM
I have a web application that is going to be a small window on the person's computer. I want it to open up immediately on the bottom left of the screen and be a fixed size. I do want them to be able to resize the window if needed, but initially it will be opened in a certain size. I tried using

self.resizeTo(x,x);

but that would not let the window be resizable anymore.

Also, is there a way to make the menu bar in the browser go away as well?
This will be an application launched via an icon on a desktop and opens in a browser. I guess think how Weather Bug works - only example I can think of now - but just a regular browser with a border around it.

djr33
05-04-2006, 04:51 AM
You're not opening it from another page?
That's the trick here.

When you open a popup using javascript, you can set parameters (if your script includes them) for things like scrolling="no", height="494", etc etc.
I'm not sure on the specific commands for what you are asking, but setting size and eliminating the menu bar is possible.

I can't guarantee that you'd then be able to resize the window... not sure how it works. There are scripts (or just code in the popup command) that will set it so it CAN'T be resized... so... surely those that can, right?

If you can't launch from a popup, you really shouldn't have any control over the window. Just a shortcut on the desktop will open in the default state of the browser... big or little, and whereever the user last had it positioned (for most browsers anyway), or, even, perhaps full screen.


Possible things to look into:
1. As above, maybe a popup window.
2. A refresh.... you can resize the window, then have the next command be refreshing the window, and adding a # to the end of the url. It can be set so, *if there is a #*, it will not resize/refresh again. (or just reload to a new page). I have a script like this somewhere... but it's only to reload... I think you could add that extra command in there, though.
3. Assuming your method (whatever it is) will fail in some browsers (those without javascript, for example), you should design your page so it looks like you want.
My suggestion there would be to set a table with height and width 100%. Then set align="right" and valign="bottom" in the <td> of that table. (Just make it a single cell).
Then, place your content in a NEW table, of the height and width you want.
<table width="100%"><tr><td align="right" valign="bottom">
<table width="??px" height="??px"><tr><td>
stuffhere
</td></tr></table>
</td></tr></table>
That will just put your content in the bottom right of whatever size window. The inner table will force to make the larger table grow if the window is squeezed (it won't screw up at low resolutions)

Helpful? right direction, anyway?

tracy78
05-04-2006, 01:53 PM
The last suggestion #3 sounds complicated. I'm still not sure how that would work for what I need though.

This is correct - NO POPUP. Think of this as an application on someone's desktop they click and open up. It's a little console window type of thing. So it should look small , not like a normal webpage. But it's web based because it uses java server pages, asycronhous operations, etc.

sorta like how weather bug does it - how does weather bug get their little window? Did they write it themselves?

Twey
05-04-2006, 02:53 PM
This will be an application launched via an icon on a desktop and opens in a browser.Then you ought to do the right thing and actually make it an application. See Embedding Gecko (http://developer.mozilla.org/en/docs/Mozilla_Embedding_FAQ:Embedding_Gecko). This is the only way to achieve perfect control over how the browser window is displayed.

djr33
05-04-2006, 07:34 PM
Yeah.... really... make a real program. Failing that, know that you're using html, which is, as its point, easy to control by the viewer. Not much you can do.
You could try coding some mockup version of IE (or mozilla, etc) that will do you want, but they'd have to use that.

Maybe you could figure out writing a .exe that will do what you're wanting, then use the html page.

Twey
05-04-2006, 07:36 PM
You could try coding some mockup version of IE (or mozilla, etc) that will do you want, but they'd have to use that.Or, you could try embedding Mozilla (don't use IE, because you'd have to rewrite half the blasted thing to make it work for other platforms).
Maybe you could figure out writing a .exe that will do what you're wanting, then use the html page.And maybe that's what I was suggesting. :)

djr33
05-04-2006, 07:38 PM
Well.. I meant using html to do the code as is now, but house it in an .exe... not just write a whole app.

But... yeah... might just be better to go with an application.

sure, yeah, use mozilla. :)

tracy78
05-05-2006, 04:14 AM
Well, it's not easy to just change it to an application and only use Mozilla considering this is for a customer who will be using Mozilla, Netscape, or IE. They are the contractor. I'm just leaving it in a regular browser for now then. This may be something embedded in another portal style page anyway.

djr33
05-05-2006, 05:37 AM
The problem is that you are wanting to let them use whatever browser they want, and that comes with whatever settings they want. You are unwilling to code an application, so you're left with giving them a webpage.
This is better in some ways, but, yes, you will have less control.
So... make it an application or modified browser, or go with the less compatible, less functional just html (and JS, etc.) version.

Twey
05-05-2006, 11:02 AM
Well, it's not easy to just change it to an application and only use Mozilla considering this is for a customer who will be using Mozilla, Netscape, or IE.You misunderstand me. If you were to embed Gecko in your application, the Gecko engine could be used to display that page, within a frame of your design. It doesn't matter what browser(s) the user uses or has installed; the necessary components would be bundled with your application.