function updateOnLoadText(text) {
document.getElementById('on-load').innerHTML = text;
}
function updateNoOpText(text) {
document.getElementById('no-op').innerHTML = text;
}
function isOnLoadPlaceholderTextVisible() {
return document.getElementById('on-load').innerHTML === 'OnLoadText';
}
function isNoOpPlaceholderTextVisible() {
return document.getElementById('no-op').innerHTML === 'NoOpText';
}
function onNoOpTimeout() {
document.getElementById('no-op').innerHTML = 'NoOpText';
}
const gStateParams = {};
function updateStateParams(obj, title, url) {
gStateParams.obj = obj;
gStateParams.title = title;
gStateParams.url = url;
}
function onButtonTapped() {
updateOnLoadText('');
updateNoOpText('');
setTimeout(onNoOpTimeout, 500);
}
function pushStateAction() {
onButtonTapped();
window.history.pushState(gStateParams.obj, gStateParams.title,
gStateParams.url);
}
function replaceStateAction() {
onButtonTapped();
window.history.replaceState(gStateParams.obj, gStateParams.title,
gStateParams.url);
}
window.onload = function() {
updateOnLoadText('OnLoadText');
updateNoOpText('');
};