"konqueror's javascript support sucks a great deal" fix
authorgc <gc>
Mon, 18 Jul 2005 21:45:15 +0000 (21:45 +0000)
committergc <gc>
Mon, 18 Jul 2005 21:45:15 +0000 (21:45 +0000)
lib/booh/html-merges.rb

index 95ee5a64d481e982314644c78cc1dff9b6154f96..1fd1af7922a1eb60f52383e3d1f1225f019bb6b8 100644 (file)
@@ -95,13 +95,25 @@ function loadcurrent(img) {
     display_current();
 }
 
     display_current();
 }
 
+function browser_href() {
+    all = location.href.split("/");
+    return all[all.length - 1];
+}
+
 /* check URL for changes; allows the URL to reflect currently showed image */
 var currentURL = '';
 function checkURL() {
 /* check URL for changes; allows the URL to reflect currently showed image */
 var currentURL = '';
 function checkURL() {
-    if (window.location.href != currentURL) {
-        currentURL = window.location.href;
-        img = getparam('current');
-        loadcurrent(img);
+    if (currentURL == 'ignore1') {
+        // do nothing
+    } else if (currentURL == 'ignore2') {
+        currentURL = browser_href();
+    } else {
+        href = browser_href();
+        if (href != currentURL) {
+            currentURL = href;
+            img = getparam('current');
+            loadcurrent(img);
+        }
     }
     setTimeout("checkURL()", 100);
 }
     }
     setTimeout("checkURL()", 100);
 }
@@ -252,7 +264,13 @@ function show_current_text() {
 
 function display_current() {
     document.main_img.src = images[current];
 
 function display_current() {
     document.main_img.src = images[current];
-    window.location.href = 'image-~~current_size~~.html#current=' + images[current];
+    oldhref = browser_href();
+    newhref = 'image-~~current_size~~.html#current=' + images[current];
+    if (oldhref != newhref) {
+        currentURL = 'ignore1';
+        location.href = newhref;
+        currentURL = 'ignore2';
+    }
     show_current_text();
     update_sensibilities();
 }
     show_current_text();
     update_sensibilities();
 }