How to save zoom settings?

28 views
Skip to first unread message

Hawk

unread,
Oct 25, 2009, 9:41:11 PM10/25/09
to mozilla-labs-prism
I have an app for a webpage that is a bit big. I always use the Ctrl -
key to zoom out three times. But whenever I close it and reopen it, it
reverts back to the original size. I'd like to know how to save the
zoom out setting. I've read somewhere about maybe using css code, but
I'm clueless when it comes to that. What would be the code and where
do I put it? I need help.

Noah Kunin

unread,
Oct 28, 2009, 8:14:31 AM10/28/09
to mozilla-labs-prism
I'm in the same boat - as this is a feature of the current incarnation
of Firefox, one would think it would be supported...

Jason Miller

unread,
Oct 28, 2009, 11:13:53 AM10/28/09
to mozilla-l...@googlegroups.com
Here are two options. Edit your application's webapp.css file to include the following:

html {
/* change 0.75 to your zoom value */
-moz-transform: scale(0.75);
}

body {
position: relative;
/* set this to 100/scale  (ie, 100/0.75=133.33) */
width: 133.33%;
/* set these both to -50(1/scale-1)    (ie, -50(1/0.75-1)=-16.67 */
left: -16.67%;
top: -16.67%;
}

[end code]

Alternatively (and probably easier), here is a webapp.js script to do the work for you:

// set this to your desired scale
var scale = 0.75;

function load() {
document.documentElement.style.MozTransform = "scale("+Math.round(scale,2)+")";
document.body.style.position = "relative";
document.body.style.left = "-" + Math.round((1/scale-1)*50,2) + "%";
document.body.style.top = "-" + Math.round((1/scale-1)*50,2) + "%";
document.body.style.width = Math.round(100/scale,2) + "%";
}

[end code]

Let me know which one worked for you.

- Jason

Hawk

unread,
Oct 28, 2009, 9:15:08 PM10/28/09
to mozilla-labs-prism
I appreciate the help, but I'm not exaclty sure where to find the
webapp.css or webapp.js

Jason Miller

unread,
Oct 28, 2009, 9:55:39 PM10/28/09
to mozilla-l...@googlegroups.com
That varies by Operating System. Are you on Mac, Linux or Windows?

For Mac, the webapp.js and webapp.css files are located in:
/Applications/[appname]/Contents/Resources/webapp/

For Windows, I believe they are in your "Application Data" folder - something similar to:
C:/Documents and Settings/[username]/Application Data/Prism/[appname]/webapp/
(just to be clear, I have no idea if that path is correct, I have not used Prism on Windows)
You might be able to find out where the webapp folder is by right-clicking the shortcut Prism created for the webapp and looking at the target folder it is pointing to.

Finally, I think someone has mentioned previously on this list that the folder for webapp.js and webapp.css on Ubuntu was /home/[username]/.prism/[appname]/webapp/
(though, again, I cannot verify)

Hopefully you are on a Mac, otherwise the above information is patchy at best.

- Jason

Jason Miller
519.872.0797 // developIT // Jason Miller Design
Developer of amoebaOS, Shutterborg, Delitweet & more

On Wed Oct 28 2009 21:15:08 GMT-0400 (EST), Hawk wrote:

I appreciate the help, but I'm not exaclty sure where to find the
webapp.css or webapp.js

Deno Vichas

unread,
Oct 29, 2009, 1:40:12 PM10/29/09
to mozilla-l...@googlegroups.com
all,

we have started using prism for our intern app. we have found the it
(FF does it as well) gets very greedy with its cache. it's been a
common thing for us to have to delete teh cache folder by hand when
upgrade our app. is this normal, how can i avoid this? i'd rather not
set the head expiration to yesterday.


thanks,
deno

Jason Miller

unread,
Oct 29, 2009, 1:48:55 PM10/29/09
to mozilla-l...@googlegroups.com
Try this: add a GET parameter to the resource URLs that are in flux. It will be checked every 2 pageloads.


- Jason

Jason Miller
519.872.0797 // developIT // Jason Miller Design
Developer of amoebaOS, Shutterborg, Delitweet & more

Deno Vichas

unread,
Oct 29, 2009, 1:53:37 PM10/29/09
to mozilla-l...@googlegroups.com
(sorry , didn't mean to hijack this thread - stupid google)

this won't work as my app is a single screen that loads all it's JS with
the first load. i'm using dojo - it's that makes any difference.


Jason Miller wrote:
> Try this: add a GET parameter to the resource URLs that are in flux.
> It will be checked every 2 pageloads.
>
> - Jason
>
> Jason Miller
> 519.872.0797 // developIT <http://developit.ca/> // Jason Miller
> Design <http://jasonmillerdesign.com/>
> /Developer of amoebaOS <https://amoebaos.com/>, Shutterborg
> <http://shutterb.org/>, Delitweet <http://delitweet.com/> & more/
>
>
> On Thu Oct 29 2009 13:40:12 GMT-0400 (EST), Deno Vichas

Jason Miller

unread,
Oct 29, 2009, 2:04:39 PM10/29/09
to mozilla-l...@googlegroups.com
are you not able to change the script locations? if you are using a bootstrap script for loading additional JavaScript files via a single file, you could use:

url += (url.indexOf("?")>-1?"&":"?") + "uncache=" + (new Date()).getTime()

assuming you can inject that line before you append the script elements to the DOM.

Jason Miller

On Thu Oct 29 2009 13:53:37 GMT-0400 (EST), Deno Vichas wrote:

(sorry , didn't mean to hijack this thread - stupid google)

this won't work as my app is a single screen that loads all it's JS with
the first load. i'm using dojo - it's that makes any difference.


Jason Miller wrote:
> Try this: add a GET parameter to the resource URLs that are in flux.
> It will be checked every 2 pageloads.
>
> - Jason
>
> Jason Miller
> 519.872.0797 // developIT <http://developit.ca/> // Jason Miller
> Design <http://jasonmillerdesign.com/>
> /Developer of amoebaOS <https://amoebaos.com/>, Shutterborg
> <http://shutterb.org/>, Delitweet <http://delitweet.com/> & more/
>
>
> On Thu Oct 29 2009 13:40:12 GMT-0400 (EST), Deno Vichas

Bryan Larsen

unread,
Nov 14, 2009, 10:09:43 AM11/14/09
to mozilla-labs-prism
That sort of worked for me. However, the results were less than
satisfactory. I'm trying to set up a GMail prism for my Dad, and I
want it zoomed in once (ctrl-+).

Your webapp.js code had no effect, but I was able to set a
webapp.css. If I set scale to 1.1 and with to 90.91%, that's about
right. However, your left and top equations seem wrong. I just
randomly picked numbers until I found something that worked (2 or 3 %
seemed about right)

However, the biggie is that when I use control+ to zoom, gmail adjusts
the widths of its boxes to fit the screen width. This effect no
longer occurs with the css styling. Any suggestions?

thanks,
Bryan

Jason Miller

unread,
Nov 14, 2009, 1:23:50 PM11/14/09
to mozilla-l...@googlegroups.com
you could use the webapp.css to change the font size. Would that help
your dad to be able to see his email a little better?

Bryan Larsen

unread,
Nov 15, 2009, 9:56:37 PM11/15/09
to mozilla-labs-prism
Yes, that worked great. For anybody who manages to google this post,
I used

* { font-size: 10pt !important; }

thanks,
Bryan

Bryan Larsen

unread,
Nov 15, 2009, 9:57:57 PM11/15/09
to mozilla-labs-prism
Yes, that worked great. For anybody who manages to google this post,
I used

* { font-size: 10pt !important; }

thanks,
Bryan


On Nov 14, 1:23 pm, Jason Miller <ja...@developit.ca> wrote:
Reply all
Reply to author
Forward
0 new messages