From: Steinar H. Gunderson Date: Fri, 25 Jul 2008 10:58:13 +0000 (+0200) Subject: Have slightly less irksome anchor parsing in the JavaScript. X-Git-Url: https://git.sesse.net/?p=pr0n;a=commitdiff_plain;h=e284d5daf153717f15ddfdcee6edf56232d3d16e Have slightly less irksome anchor parsing in the JavaScript. --- diff --git a/files/pr0n-fullscreen.js b/files/pr0n-fullscreen.js index 1d82ebc..5434a3e 100644 --- a/files/pr0n-fullscreen.js +++ b/files/pr0n-fullscreen.js @@ -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 {