bugfixed potential self ddos :/

This commit is contained in:
Bala Clark 2011-08-28 20:47:52 +02:00
parent 9f684a7b68
commit 6981172789

View file

@ -86,14 +86,9 @@ function ComicBook(id, srcs, opts) {
return parseInt(location.hash.substring(1),10) - 1 || 0;
}
function setHash() {
var pageNo = pointer + 1;
if (getHash() !== '#'+pageNo) {
location.hash = pageNo;
if (options.savePosition === true) { setLastPage(pageNo); };
}
function setHash(pageNo) {
location.hash = pageNo;
if (options.savePosition === true) { setLastPage(pageNo); };
}
/**
@ -330,7 +325,9 @@ function ComicBook(id, srcs, opts) {
context.drawImage(page, offsetW, offsetH, page_width, page_height);
if (options.displayMode === "double" && typeof page2 === "object") { context.drawImage(page2, page_width + offsetW, offsetH, page_width, page_height); }
setHash(pointer + 1);
if (getHash() !== pointer) {
setHash(pointer + 1);
}
// apply any image enhancements previously defined
$.each(options.enhance, function(action, options) {