pg.ddx.io  pgsql-docs@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Bruce Momjian <bruce@momjian.us>
To: Thom Brown <thom@linux.com>
Cc: Magnus Hagander <magnus@hagander.net>
Cc: Tom Lane <tgl@sss.pgh.pa.us>
Cc: PostgreSQL www <pgsql-www@postgresql.org>
Subject: Re: [DOCS] Doc fixes and improvements
Date: Fri, 10 Sep 2010 17:21:59 -0400 (EDT)
Message-ID: <201009102121.o8ALLxh20912@momjian.us> (raw)
In-Reply-To: <AANLkTintD0Qjfv8TV4qCKw0k1oxcGAKTptGpigK30Xfq@mail.gmail.com>

Thom Brown wrote:
> >> That javascript checked whether the values were the same, and if they
> >> weren't, it introduced a stylesheet which made an adjustment, which is
> >> pretty much what the current site does, except we don't bother
> >> checking the rendering engine, just the default font settings.
> >>
> >> It seems that I'm a lot further off than I thought I was. :/ ?Back to
> >> the drawing board.
> >
> > I think the original adjustment was flawed because it just set a
> > percentage change. ?I think we can just assign them to match, rather
> > than trying to figure out what percentage to use. ?Where is the
> > javascript file?
> 
> It wasn't introduced for the existing site, but you can grab it from here:
> 
> http://pgweb.darkixion.com:8081/media/js/monospacefix.js
> http://pgweb.darkixion.com:8081/media/css/monospacefixes.css

OK, that helps, and I see the issue now.  You basically have no way to
push the calculation up into the style sheet.  There are several
options:

1.  Use document.styleSheet[] to push changes into the style sheet
2.  Use javascript to set a computed "style" string for every item with
    a specific class.
3.  Use a single monospacefixes.css file
4.  Use one of several monospacefixes.css files based on a computed value

#1 and #2 are overkill, I think.  #3 is what we have now, and is
obviously deficient.  #4 seems good to me;  using
http://pgweb.darkixion.com:8081/media/js/monospacefix.js I would add:
	
	if (propSize / monoSize >= 1.8)
	      document.write('<style type="text/css" media="screen">@import "/media/css/monospacefixes1_8.css";</style>\n');
	else if (propSize / monoSize >= 1.4)
	      document.write('<style type="text/css" media="screen">@import "/media/css/monospacefixes1_4.css";</style>\n');
	else if (propSize / monoSize >= 1.2)
	      document.write('<style type="text/css" media="screen">@import "/media/css/monospacefixes1_2.css";</style>\n');
	else if (propSize / monoSize >= 1.1)
	      document.write('<style type="text/css" media="screen">@import "/media/css/monospacefixes1_1.css";</style>\n');

That requires the creation of four small style sheets, and should cover
most of the common ratios.

-- 
  Bruce Momjian  <bruce@momjian.us>        http://momjian.us
  EnterpriseDB                             http://enterprisedb.com

  + It's impossible for everything to be true. +



view thread (76+ messages)  latest in thread

Message-ID: <201009102121.o8ALLxh20912@momjian.us>
Permalink:  ../201009102121.o8ALLxh20912@momjian.us/
Also on:    postgresql.org/message-id/201009102121.o8ALLxh20912@momjian.us

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients using the --to and --cc options:
  reply via email

  To: pgsql-docs@postgresql.org
  Cc: bruce@momjian.us, thom@linux.com, magnus@hagander.net, tgl@sss.pgh.pa.us, pgsql-www@postgresql.org
  Subject: Re: [DOCS] Doc fixes and improvements
  In-Reply-To: <201009102121.o8ALLxh20912@momjian.us>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox