# HG changeset patch # User Tero Marttila # Date 1263043819 -7200 # Node ID ba9d03e469257bac2a499541d0ec83e6cddef418 # Parent 9dedd0e30b6b1f04a03aeeeffaddfcadc5942d1a ignore invalid #hash values for cx:cy:zl diff -r 9dedd0e30b6b -r ba9d03e46925 bin/dev-server --- a/bin/dev-server Sat Jan 09 15:13:42 2010 +0200 +++ b/bin/dev-server Sat Jan 09 15:30:19 2010 +0200 @@ -13,7 +13,7 @@ }), }) -def main (host='127.0.0.1', port=8000) : +def main (host='0.0.0.0', port=8000) : httpd = wsgiref.simple_server.make_server(host, port, app) print "Listening on %s:%d" % (host, port) diff -r 9dedd0e30b6b -r ba9d03e46925 static/tiles2.js --- a/static/tiles2.js Sat Jan 09 15:13:42 2010 +0200 +++ b/static/tiles2.js Sat Jan 09 15:30:19 2010 +0200 @@ -109,7 +109,9 @@ Event.observe(this.btn_zoom_out, "click", this.zoom_out.bindAsEventListener(this)); // initial view location (centered) - var cx = 0, cy = 0, zl = 0; + var cx = this.source.img_width / 2; + var cy = this.source.img_height / 2; + var zl = 0; // XXX: would need to scale x/y for this: (this.source.zoom_min + this.source.zoom_max) / 2; // from link? if (document.location.hash) { @@ -117,15 +119,9 @@ var pt = document.location.hash.substr(1).split(":"); // unpack - if (pt.length) cx = parseInt(pt.shift()); - if (pt.length) cy = parseInt(pt.shift()); - if (pt.length) zl = parseInt(pt.shift()); - - } else { - // start in the center - cx = this.source.img_width / 2; - cy = this.source.img_height / 2; - zl = 0; // XXX: need to scale x/y for this: (this.source.zoom_min + this.source.zoom_max) / 2; + if (pt.length) cx = parseInt(pt.shift()) || cx; + if (pt.length) cy = parseInt(pt.shift()) || cy; + if (pt.length) zl = parseInt(pt.shift()) || zl; } // initialize zoom state to given zl