|
|
@ -43,7 +43,6 @@ |
|
|
|
} |
|
|
|
} |
|
|
|
cacheMapping[data.id] = JSON.stringify(data); |
|
|
|
cacheMapping[data.id] = JSON.stringify(data); |
|
|
|
window.history.replaceState(data.id, data.title, data.url); |
|
|
|
window.history.replaceState(data.id, data.title, data.url); |
|
|
|
domCache[data.id] = document.body.cloneNode(true); |
|
|
|
|
|
|
|
}; |
|
|
|
}; |
|
|
|
|
|
|
|
|
|
|
|
var cachePush = function () { |
|
|
|
var cachePush = function () { |
|
|
@ -61,7 +60,7 @@ |
|
|
|
delete cacheMapping[cacheBackStack.shift()]; |
|
|
|
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.cacheForwardStack = JSON.stringify(cacheForwardStack); |
|
|
|
cacheMapping.cacheBackStack = JSON.stringify(cacheBackStack); |
|
|
|
cacheMapping.cacheBackStack = JSON.stringify(cacheBackStack); |
|
|
@ -244,6 +243,8 @@ |
|
|
|
}); |
|
|
|
}); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
cacheCurrentContent(); |
|
|
|
|
|
|
|
|
|
|
|
if (options.timeout) { |
|
|
|
if (options.timeout) { |
|
|
|
options._timeout = setTimeout(function () { xhr.abort('timeout'); }, options.timeout); |
|
|
|
options._timeout = setTimeout(function () { xhr.abort('timeout'); }, options.timeout); |
|
|
|
} |
|
|
|
} |
|
|
@ -255,6 +256,10 @@ |
|
|
|
} |
|
|
|
} |
|
|
|
}; |
|
|
|
}; |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
function cacheCurrentContent() { |
|
|
|
|
|
|
|
domCache[PUSH.id] = document.body.cloneNode(true); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// Main XHR handlers
|
|
|
|
// Main XHR handlers
|
|
|
|
// =================
|
|
|
|
// =================
|
|
|
|