Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>change shortname</title>
</head>
<body>
<h1>Disqus y u no work </h1>
<button onClick="btnClicked();">Change within on-point</button>
<button onClick="btnClickedHN();">Change to Here and Now</button>
<div id="disqus_thread"></div>
<script type="text/javascript">
function btnClicked() {
console.log("Now Gardening", DISQUS)
DISQUS.reset({
reload: true,
config: function config() {
this.page.url = "http://onpoint.wbur.org/2016/05/27/gardening-tips-2016-planting-gardens";
}
});
}
function btnClickedHN() {
DISQUS.reset({
reload: true,
config: function config() {
this.page.url = "http://hereandnow.wbur.org/2016/05/27/thiel-gawker-lawsuit";
disqus_shortname = 'herenow';
}
});
}
function btnClickedHNold() {
let elem = document.getElementById('disqusscript');
if (elem) {
elem.parentNode.removeChild(elem)
}
console.log(window.disqus_config)
var disqus_url = 'http://hereandnow.wbur.org/2016/05/27/thiel-gawker-lawsuit';
var disqus_container_id = 'disqus_thread';
var disqus_shortname = 'herenow';
var disqus_config_custom = window.disqus_config;
var disqus_config = function () {
/*
All currently supported events:
onReady: fires when everything is ready,
onNewComment: fires when a new comment is posted,
onIdentify: fires when user is authenticated
*/
this.language = '';
this.callbacks.onReady.push(function () {
// sync comments in the background so we don't block the page
var script = document.createElement('script');
script.async = true;
script.src = '?cf_action=sync_comments&post_id=108173';
var firstScript = document.getElementsByTagName('script')[0];
firstScript.parentNode.insertBefore(script, firstScript);
});
if (disqus_config_custom) {
disqus_config_custom.call(this);
}
};
(function() {
var dsq = document.createElement('script'); dsq.type = 'text/javascript';
dsq.async = true;
dsq.src = '//' + disqus_shortname + '.disqus.com/embed.js';
(document.getElementsByTagName('head')[0] || document.getElementsByTagName('body')[0]).appendChild(dsq);
})();
}
var disqus_url = 'http://onpoint.wbur.org/2016/05/27/clinton-trump-sanders-g7-2016-election';
var disqus_container_id = 'disqus_thread';
var disqus_shortname = 'on-point';
var disqus_config_custom = window.disqus_config;
var disqus_config = function () {
/*
All currently supported events:
onReady: fires when everything is ready,
onNewComment: fires when a new comment is posted,
onIdentify: fires when user is authenticated
*/
this.language = '';
if (disqus_config_custom) {
disqus_config_custom.call(this);
}
};
(function() {
var dsq = document.createElement('script'); dsq.type = 'text/javascript';
dsq.async = true;
dsq.src = '//' + disqus_shortname + '.disqus.com/embed.js';
dsq.setAttribute("id", "disqusscript");
(document.getElementsByTagName('head')[0] || document.getElementsByTagName('body')[0]).appendChild(dsq);
})();
</script>
</body>
</html>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.