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() {
- 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);
}
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();
}