Merge branch 'master' into my-comments-ux

This commit is contained in:
Gabriela Rodríguez Berón
2017-03-22 16:18:45 -07:00
committed by GitHub
2 changed files with 11 additions and 2 deletions
+10 -1
View File
@@ -167,7 +167,16 @@ Talk.render = function (el, opts) {
el.id = `_${Math.random()}`;
}
let asset_url = opts.asset_url || window.location.href.split('#')[0];
let asset_url = opts.asset_url;
if (!asset_url) {
try {
asset_url = document.querySelector('link[rel="canonical"]').href;
} catch (e) {
console.warn('This page does not include a canonical link tag. Talk has inferred this asset_url from the window object. Query params have been stripped, which may cause a single thread to be present across multiple pages.');
asset_url = window.location.origin + window.location.pathname;
}
}
let comment = window.location.hash.slice(1);
let query = {
+1 -1
View File
@@ -27,7 +27,7 @@
<script src="/embed.js" async onload="
Coral.Talk.render(document.getElementById('coralStreamEmbed'), {
talk: '/',
asset: '<%= asset_url ? asset_url : '' %>'
asset_url: '<%= asset_url ? asset_url : '' %>'
})
"></script>
</main>