From: Magnus Hagander Date: Thu, 14 Oct 2010 13:03:22 +0000 (+0000) Subject: Replace incorrectly named geckofix.js with properly named and X-Git-Url: http://git.postgresql.org/gitweb/static/gitweb.js?a=commitdiff_plain;h=c67090da83079be8f268564adb63e3f0d3379f29;p=pgweb-old.git Replace incorrectly named geckofix.js with properly named and properly working monospacefix.js, for dealing with size of monospace fonts.. Thom Brown git-svn-id: file:///Users/dpage/pgweb/svn-repo/trunk@2756 8f5c7a92-453e-0410-a47f-ad33c8a6b003 --- diff --git a/portal/layout/js/monospacefix.js b/portal/layout/js/monospacefix.js new file mode 100644 index 00000000..85239326 --- /dev/null +++ b/portal/layout/js/monospacefix.js @@ -0,0 +1,24 @@ +function display_default_font_size(id) +{ + var x = document.getElementById(id); + + if (x.currentStyle) + var y = x.currentStyle['fontSize']; + else if (window.getComputedStyle) + var y = document.defaultView.getComputedStyle(x,null).getPropertyValue('font-size'); + return y; +} + +document.write(''); +document.write(''); +var monoSize = parseInt(display_default_font_size("monotest")); +var propSize = parseInt(display_default_font_size("paratest")); +var newMonoSize = propSize / monoSize; + +if (newMonoSize != 1) +{ + document.write('\n'); +} + diff --git a/portal/template/common-docs.html b/portal/template/common-docs.html index 924e989e..f0c1348e 100644 --- a/portal/template/common-docs.html +++ b/portal/template/common-docs.html @@ -6,7 +6,7 @@ - + diff --git a/portal/template/common.html b/portal/template/common.html index 5d6261a8..225927a9 100644 --- a/portal/template/common.html +++ b/portal/template/common.html @@ -17,7 +17,7 @@ - +