]> git.wh0rd.org Git - tt-rss.git/commitdiff
Opera compatibility fixes
authorAndrew Dolgov <fox@bah.spb.su>
Fri, 24 Feb 2006 10:15:30 +0000 (11:15 +0100)
committerAndrew Dolgov <fox@bah.spb.su>
Fri, 24 Feb 2006 10:15:30 +0000 (11:15 +0100)
backend.php
feedlist.js
prefs.js
prefs.php
tt-rss.js
tt-rss.php
viewfeed.js

index 15bb7702c4366f284747a3583a3ea30461adbb2d..4873f35e8345d7fff5b7240248cf2572ba4f6b36 100644 (file)
                        <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\">";
 
 
                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>';
        }
 
 
                                <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) {
                        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>";
                }
index 8495be51279abfbb459679f81c971f392886e19e..7dcb68fa200e4548fbd09394e314c07706410905 100644 (file)
@@ -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);
index f5e5a2ccdb193d0e5d3ce95da08484a82beb98a5..3aa769e5cc98b0934e2c067480b900e2471ef1ee 100644 (file)
--- 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 = 
index 71be40338c65b810c5bde30e2653de9205e99485..75370f9f69b891fdc40afb1c31a52c1cf5967f1e 100644 (file)
--- a/prefs.php
+++ b/prefs.php
        <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')) { ?>
 
 <? 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>
index 0fbced1b945e98c10d694865a8518f01152b7344..7b96bf3854c5962227a5a8fae74a9beb6a268f2e 100644 (file)
--- 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()) 
index 37eed61abed0b8c27295dcddcda42cf7b594f409..89982ca140f71ad06dd0c4a32c9610bc74978755 100644 (file)
@@ -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">
        <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">
 
 <? 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>
index 28b94f167979421c12dca835aa52a017139ecc1e..9500e2251d44f0c72cb60fa561dd7081df479360 100644 (file)
@@ -380,5 +380,7 @@ function catchupPage() {
 
 
 function init() {
+       if (arguments.callee.done) return;
+       arguments.callee.done = true;           
        document.onkeydown = hotkey_handler;
 }