From: eldy <> Date: Tue, 13 Jul 2004 23:26:13 +0000 (+0000) Subject: Add window size. X-Git-Tag: AWSTATS_6_3_RELEASE~133 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=2447400b66f7685424755d2dfd0d33a78632ad28;p=thirdparty%2FAWStats.git Add window size. --- diff --git a/wwwroot/js/awstats_misc_tracker.js b/wwwroot/js/awstats_misc_tracker.js index ab47c2dc..ef2d49c4 100644 --- a/wwwroot/js/awstats_misc_tracker.js +++ b/wwwroot/js/awstats_misc_tracker.js @@ -1,8 +1,16 @@ // awstats_misc_tracker.js //------------------------------------------------------------------- -// You can add this file onto some of your web pages (main home page -// can be enough) by adding the following HTML code: -// +// You can add this file onto some of your web pages (main home page can +// be enough) by adding the following HTML code to your page body: +// +// +// * This must be added after the tag, not placed within the +// tags, or the resulting tracking tag will not be handled +// correctly by all browsers. Internet explorer will also not report +// screen height and width attributes until it begins to render the +// body. +// + // This allows AWStats to be enhanced with some miscellanous features: // - Screen size detection (TRKscreen) // - Screen color depth detection (TRKcdi) @@ -73,6 +81,14 @@ if (window.location.search == "") { var TRKns = (navigator.appName.indexOf("Netscape") != -1); var TRKwin = ((TRKagt.indexOf("win")!=-1) || (TRKagt.indexOf("32bit")!=-1)); var TRKmac = (TRKagt.indexOf("mac")!=-1); + + // Detect the window internal width and height + if (document.documentElement && document.documentElement.clientWidth) + TRKwinsize = document.documentElement.clientWidth + 'x' + document.documentElement.clientHeight; + else if (document.body) + TRKwinsize = document.body.clientWidth + 'x' + document.body.clientHeight; + else + TRKwinsize = window.innerWidth + 'x' + window.innerHeight; if (TRKie && TRKwin) { var TRKshk = awstats_detectIE("SWCtl.SWCtl.1") @@ -94,6 +110,6 @@ if (window.location.search == "") { var TRKwma = awstats_detectNS("application/x-mplayer2") var TRKpdf = awstats_detectNS("application/pdf"); } - document.write('') + document.write('') }