summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--backend.php47
-rw-r--r--feedlist.js2
-rw-r--r--prefs.js3
-rw-r--r--prefs.php24
-rw-r--r--tt-rss.js13
-rw-r--r--tt-rss.php26
-rw-r--r--viewfeed.js2
7 files changed, 104 insertions, 13 deletions
diff --git a/backend.php b/backend.php
index 15bb7702c..4873f35e8 100644
--- a/backend.php
+++ b/backend.php
@@ -354,7 +354,13 @@
<script type=\"text/javascript\" src=\"pngfix.js\"></script>
<link rel=\"stylesheet\" type=\"text/css\" href=\"tt-rss-ie.css\">
<![endif]-->
- </head><body onload=\"init()\">";
+ </head><body>
+ <script type=\"text/javascript\">
+ if (document.addEventListener) {
+ document.addEventListener(\"DOMContentLoaded\", init, null);
+ }
+ window.onload = init;
+ </script>";
print "<ul class=\"feedList\" id=\"feedList\">";
@@ -627,6 +633,21 @@
print "</ul>";
+ print '
+ <script type="text/javascript">
+ /* for IE */
+ function statechange() {
+ if (document.readyState == "interactive") init();
+ }
+
+ if (document.readyState) {
+ if (document.readyState == "interactive" || document.readyState == "complete") {
+ init();
+ } else {
+ document.onreadystatechange = statechange;
+ }
+ }
+ </script></body></html>';
}
@@ -1051,7 +1072,13 @@
<script type=\"text/javascript\" src=\"pngfix.js\"></script>
<link rel=\"stylesheet\" type=\"text/css\" href=\"tt-rss-ie.css\">
<![endif]-->
- </head><body onload='init()'>";
+ </head><body>
+ <script type=\"text/javascript\">
+ if (document.addEventListener) {
+ document.addEventListener(\"DOMContentLoaded\", init, null);
+ }
+ window.onload = init;
+ </script>";
}
if ($subop == "ForceUpdate" && sprintf("%d", $feed) > 0) {
@@ -1564,6 +1591,22 @@
update_all_counters('$feed');
</script>";
+ print '
+ <script type="text/javascript">
+ /* for IE */
+ function statechange() {
+ if (document.readyState == "interactive") init();
+ }
+
+ if (document.readyState) {
+ if (document.readyState == "interactive" || document.readyState == "complete") {
+ init();
+ } else {
+ document.onreadystatechange = statechange;
+ }
+ }
+ </script>';
+
if ($addheader) {
print "</body></html>";
}
diff --git a/feedlist.js b/feedlist.js
index 8495be512..7dcb68fa2 100644
--- a/feedlist.js
+++ b/feedlist.js
@@ -197,6 +197,8 @@ function toggleCollapseCat(cat) {
function init() {
try {
+ if (arguments.callee.done) return;
+ arguments.callee.done = true;
hideOrShowFeeds(document, getCookie("ttrss_vf_hreadf") == 1);
document.onkeydown = hotkey_handler;
parent.setTimeout("timeout()", 0);
diff --git a/prefs.js b/prefs.js
index f5e5a2ccd..3aa769e5c 100644
--- a/prefs.js
+++ b/prefs.js
@@ -1264,6 +1264,9 @@ function init() {
try {
+ if (arguments.callee.done) return;
+ arguments.callee.done = true;
+
// IE kludge
if (!xmlhttp) {
document.getElementById("prefContent").innerHTML =
diff --git a/prefs.php b/prefs.php
index 71be40338..75370f9f6 100644
--- a/prefs.php
+++ b/prefs.php
@@ -47,7 +47,14 @@
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
</head>
-<body onload="init()">
+<body>
+
+<script type="text/javascript">
+if (document.addEventListener) {
+ document.addEventListener("DOMContentLoaded", init, null);
+}
+window.onload = init;
+</script>
<table width="100%" height="100%" cellspacing="0" cellpadding="0" class="main">
<? if (get_pref($link, 'DISPLAY_HEADER')) { ?>
@@ -127,5 +134,20 @@
<? db_close($link); ?>
+<script type="text/javascript">
+ /* for IE */
+ function statechange() {
+ if (document.readyState == "interactive") init();
+ }
+
+ if (document.readyState) {
+ if (document.readyState == "interactive" || document.readyState == "complete") {
+ init();
+ } else {
+ document.onreadystatechange = statechange;
+ }
+ }
+</script>
+
</body>
</html>
diff --git a/tt-rss.js b/tt-rss.js
index 0fbced1b9..7b96bf385 100644
--- a/tt-rss.js
+++ b/tt-rss.js
@@ -301,14 +301,6 @@ function localPiggieFunction(enable) {
function localHotkeyHandler(keycode) {
-/* if (keycode == 78) {
- return moveToPost('next');
- }
-
- if (keycode == 80) {
- return moveToPost('prev');
- } */
-
if (keycode == 82) { // r
return scheduleFeedUpdate(true);
}
@@ -383,6 +375,11 @@ function init() {
try {
+ // this whole shebang is based on http://www.birnamdesigns.com/misc/busted2.html
+
+ if (arguments.callee.done) return;
+ arguments.callee.done = true;
+
disableContainerChildren("headlinesToolbar", true);
if (!genericSanityCheck())
diff --git a/tt-rss.php b/tt-rss.php
index 37eed61ab..89982ca14 100644
--- a/tt-rss.php
+++ b/tt-rss.php
@@ -39,8 +39,8 @@
<? } ?>
- <script type="text/javascript" src="functions.js"></script>
<script type="text/javascript" src="tt-rss.js"></script>
+ <script type="text/javascript" src="functions.js"></script>
<!--[if gte IE 5.5000]>
<script type="text/javascript" src="pngfix.js"></script>
<link rel="stylesheet" type="text/css" href="tt-rss-ie.css">
@@ -48,7 +48,14 @@
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
</head>
-<body onload="init()">
+<body>
+
+<script type="text/javascript">
+if (document.addEventListener) {
+ document.addEventListener("DOMContentLoaded", init, null);
+}
+window.onload = init;
+</script>
<? if (ENABLE_UPDATE_DAEMON && !file_is_locked("update_daemon.lock")) { ?>
<div class="warning">
@@ -278,5 +285,20 @@
<? db_close($link); ?>
+<script type="text/javascript">
+ /* for IE */
+ function statechange() {
+ if (document.readyState == "interactive") init();
+ }
+
+ if (document.readyState) {
+ if (document.readyState == "interactive" || document.readyState == "complete") {
+ init();
+ } else {
+ document.onreadystatechange = statechange;
+ }
+ }
+</script>
+
</body>
</html>
diff --git a/viewfeed.js b/viewfeed.js
index 28b94f167..9500e2251 100644
--- a/viewfeed.js
+++ b/viewfeed.js
@@ -380,5 +380,7 @@ function catchupPage() {
function init() {
+ if (arguments.callee.done) return;
+ arguments.callee.done = true;
document.onkeydown = hotkey_handler;
}