Have slightly less irksome anchor parsing in the JavaScript.
authorSteinar H. Gunderson <sesse@debian.org>
Fri, 25 Jul 2008 10:58:13 +0000 (12:58 +0200)
committerSteinar H. Gunderson <sesse@debian.org>
Fri, 25 Jul 2008 10:58:13 +0000 (12:58 +0200)
files/pr0n-fullscreen.js

index 1d82ebc3280e05631a01c4ee62488479cf689e89..5434a3e30a696b9059bfe9cbf26e91594cca615b 100644 (file)
@@ -41,12 +41,7 @@ function find_width()
 }
 
 function parse_image_num(url, default_value) {
-       var url_array = (window.location.toString().split("#"));
-       if (url_array.length != 2) {
-               return default_value;
-       }
-
-       var num = parseInt(url_array[1]);
+       var num = parseInt(window.location.hash.substr(1));
        if (num > 1 && num <= global_image_list.length) {  // and then num != NaN
                return (num - 1);
        } else {