Received: from maia.hub.org (maia-3.hub.org [200.46.204.243]) by mail.postgresql.org (Postfix) with ESMTP id 18BCF632191 for ; Fri, 10 Sep 2010 21:35:01 -0300 (ADT) Received: from mail.postgresql.org ([200.46.204.86]) by maia.hub.org (mx1.hub.org [200.46.204.243]) (amavisd-maia, port 10024) with ESMTP id 92402-07 for ; Sat, 11 Sep 2010 00:34:52 +0000 (UTC) X-Greylist: from auto-whitelisted by SQLgrey-1.7.6 Received: from momjian.us (momjian.us [70.90.9.53]) by mail.postgresql.org (Postfix) with ESMTP id BD218630749 for ; Fri, 10 Sep 2010 21:34:53 -0300 (ADT) Received: (from bruce@localhost) by momjian.us (8.11.6/8.11.6) id o8B0Ync19838; Fri, 10 Sep 2010 20:34:49 -0400 (EDT) From: Bruce Momjian Message-Id: <201009110034.o8B0Ync19838@momjian.us> Subject: Re: [DOCS] Doc fixes and improvements In-Reply-To: <201009102121.o8ALLxh20912@momjian.us> To: Bruce Momjian Date: Fri, 10 Sep 2010 20:34:49 -0400 (EDT) CC: Thom Brown , Magnus Hagander , Tom Lane , PostgreSQL www X-Mailer: ELM [version 2.4ME+ PL124 (25)] MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Content-Type: text/plain; charset="US-ASCII" X-Virus-Scanned: Maia Mailguard 1.0.1 X-Spam-Status: No, hits=-1.909 tagged_above=-5 required=5 tests=BAYES_00=-1.9, T_RP_MATCHES_RCVD=-0.01, WEIRD_PORT=0.001 X-Spam-Level: X-Archive-Number: 201009/47 X-Sequence-Number: 19134 Bruce Momjian wrote: > > 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('\n'); > else if (propSize / monoSize >= 1.4) > document.write('\n'); > else if (propSize / monoSize >= 1.2) > document.write('\n'); > else if (propSize / monoSize >= 1.1) > document.write('\n'); Duh, I don't know what I was thinking. This is the way to do it --- create the CSS inline rather than link in a file: if (monoSize != propSize) { document.write(' '); } -- Bruce Momjian http://momjian.us EnterpriseDB http://enterprisedb.com + It's impossible for everything to be true. +