var scriptPath = "https://static.advance.net/static/common/js/piano-frame.js";
var script = document.createElement("script");
script.onload = function(e) {
function runPiano() {
var config = {
ourStory: 'true'
};
window.Advance.piano.build(config);
}
window.Advance.piano.start(runPiano);
}
script.type = "text/javascript"; script.src = scriptPath; document.getElementsByTagName("body")[0].appendChild(script);
window.addEventListener("message", function (e) {
// We verify that the error message is coming from Piano, so it must be what we're looking for.
if (typeof e.data.piano !== 'undefined') {
// Get the object with the result.
var result = e.data.piano;
// We know how this object should be structured, so we're checking for the "success" field.
if (result.object.breakpoint) {
// Add the viewport class to the main Our Story element
var container = document.getElementsByClassName('our-story')[0];
var containerClass = 'our-story our-story--' + result.object.breakpoint;
container.setAttribute('class', containerClass);
}
}
return;
}, false);
Check out the eNewspaper
As a service, all readers can enjoy the digital replica of The Republican.
Read For Free Now