|
|
|
@ -42,7 +42,6 @@
|
|
|
|
|
} |
|
|
|
|
cacheMapping[data.id] = JSON.stringify(data); |
|
|
|
|
window.history.replaceState(data.id, data.title, data.url); |
|
|
|
|
domCache[data.id] = document.body.cloneNode(true); |
|
|
|
|
}; |
|
|
|
|
|
|
|
|
|
var cachePush = function () { |
|
|
|
@ -60,7 +59,7 @@
|
|
|
|
|
delete cacheMapping[cacheBackStack.shift()]; |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
window.history.pushState(null, '', cacheMapping[PUSH.id].url); |
|
|
|
|
window.history.pushState(null, '', getCached(PUSH.id).url); |
|
|
|
|
|
|
|
|
|
cacheMapping.cacheForwardStack = JSON.stringify(cacheForwardStack); |
|
|
|
|
cacheMapping.cacheBackStack = JSON.stringify(cacheBackStack); |
|
|
|
@ -243,6 +242,8 @@
|
|
|
|
|
}); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
cacheCurrentContent(); |
|
|
|
|
|
|
|
|
|
if (options.timeout) { |
|
|
|
|
options._timeout = setTimeout(function () { xhr.abort('timeout'); }, options.timeout); |
|
|
|
|
} |
|
|
|
@ -254,6 +255,10 @@
|
|
|
|
|
} |
|
|
|
|
}; |
|
|
|
|
|
|
|
|
|
function cacheCurrentContent() { |
|
|
|
|
domCache[PUSH.id] = document.body.cloneNode(true); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// Main XHR handlers
|
|
|
|
|
// =================
|
|
|
|
|