cvs: pres2 / getwidth.php keyboard.js.php
| From: | Christian Wenz | Date: | Sun, 27 Apr 2003 20:45:05 +0000 |
| Subject: | cvs: pres2 / getwidth.php keyboard.js.php | ||
| Groups: | php.pres | ||
| Request: | Send a blank email to pres+get-665@lists.php.net to get a copy of this message | ||
wenz Sun Apr 27 16:45:05 2003 EDT
Modified files:
/pres2 getwidth.php keyboard.js.php
Log:
+ removed one more nasty IE JScript error message. IE obviously somtimes fails to read window
dimensions before document has been fully loaded. Thus, moved "get_dims()" call if
"dims" cookie not set to function that is executed after the document has been completely
loaded.
+ note: maybe we should some day save the dimension information in a session variable so that the
presentation system is cookie-independent.
Index: pres2/getwidth.php
diff -u pres2/getwidth.php:1.4 pres2/getwidth.php:1.5
--- pres2/getwidth.php:1.4 Sun Apr 27 11:58:04 2003
+++ pres2/getwidth.php Sun Apr 27 16:45:05 2003
@@ -6,7 +6,7 @@
function is called if we don't have the dimensions already, or on a
resize event to fetch the new window dimensions.
*/?>
-<script language="JavaScript1.2" defer="defer">
+<script language="JavaScript" defer="defer">
<!--
function get_dims() {
var winW = 1024;
@@ -16,14 +16,11 @@
winW = window.innerWidth;
winH = window.innerHeight;
} else if (document.all) {
- winW = document.body.clientWidth;
- winH = document.body.clientHeight;
+ winW = document.body.clientWidth;
+ winH = document.body.clientHeight;
}
document.cookie="dims="+winW+"_"+winH;
- top.location=top.location.href;
+ location.reload(false);
}
-<?if(!isset($_COOKIE['dims'])) {?>
-get_dims();
-<? } ?>
//-->
</script>
Index: pres2/keyboard.js.php
diff -u pres2/keyboard.js.php:1.11 pres2/keyboard.js.php:1.12
--- pres2/keyboard.js.php:1.11 Sun Apr 27 12:41:49 2003
+++ pres2/keyboard.js.php Sun Apr 27 16:45:05 2003
@@ -41,6 +41,10 @@
var currentEffect = 0;
onload = function() {
+ <?if(!isset($_COOKIE['dims'])) {?>
+ get_dims();
+ <? } ?>
+
// make banner sticky on old Windows IEs
<?php
if (!$css_supports_fixed) {