]> git.sesse.net Git - pr0n/blobdiff - files/pr0n-fullscreen.js
Unbroke infobox=0 for fullscreen mode.
[pr0n] / files / pr0n-fullscreen.js
index 3cc60558271cebbeb7a0ff89a43cc16a64675575..2a43c07ee0d2332922e776e08a0aa1c6dd0eb7d8 100644 (file)
@@ -40,15 +40,6 @@ function find_width()
        return [null,null];
 }
 
-function parse_image_num(default_value) {
-       var num = parseInt(window.location.hash.substr(1));
-       if (num >= 1 && num <= global_image_list.length) {  // and then num != NaN
-               return (num - 1);
-       } else {
-               return default_value;
-       }
-}
-
 /*
  * pr0n can resize to any size we'd like, but we're much more likely
  * to have this set of fixed-resolution screens cached, so to increase
@@ -144,7 +135,7 @@ function display_image(width, height, evt, filename, element_id)
        var main = document.getElementById("iehack");
        var img = replace_image_element(url, element_id, main);
 
-       if (global_infobox != 'nobox') {
+       if (global_infobox != 'nobox/') {
                var url = "http://" + global_vhost + "/" + evt + "/" + width + "x" + height + "/box/" + filename;
                var boximg = replace_image_element(url, element_id + "_box", main);
 
@@ -176,8 +167,7 @@ function display_image_num(num, element_id)
                center_image(num);
                
                // replace the anchor part (if any) with the image number
-               var baseurl = (window.location.toString().split("#"))[0];
-               window.location = baseurl + "#" + (num+1);
+               window.location.hash = "#" + (num+1);
        }
 
        return img;
@@ -437,12 +427,19 @@ function ie_png_hack()
        }
 }
 
-function check_for_hash_change() {
+function parse_image_num(default_value) {
        var num = parseInt(window.location.hash.substr(1));
        if (num >= 1 && num <= global_image_list.length) {  // and then num != NaN
-               if (--num != global_image_num) {
-                       global_image_num = num;
-                       relayout();
-               }
+               return (num - 1);
+       } else {
+               return default_value;
+       }
+}
+
+function check_for_hash_change() {
+       var num = parse_image_num(-1);
+       if (num != -1 && num != global_image_num) {
+               global_image_num = num;
+               relayout();
        }
 }