Skip to content

Commit

Permalink
Hypothes.is embed code added
Browse files Browse the repository at this point in the history
Includes the (sadly) necessary rel=canonical
change to the viewer.js code also.
  • Loading branch information
BigBlueHat committed Sep 19, 2014
1 parent be4e47b commit f9f0900
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 0 deletions.
3 changes: 3 additions & 0 deletions viewer/web/viewer.html
Original file line number Diff line number Diff line change
Expand Up @@ -405,6 +405,9 @@
</div>
</div>
</div>

<script src="//hypothes.is/embed.js"></script>

</body>
</html>

5 changes: 5 additions & 0 deletions viewer/web/viewer.js
Original file line number Diff line number Diff line change
Expand Up @@ -3032,6 +3032,11 @@ var PDFView = {
setTitleUsingUrl: function pdfViewSetTitleUsingUrl(url) {
this.url = url;

var rel_canonical = document.createElement('link');
rel_canonical.href = url;
rel_canonical.rel = "canonical";
document.head.appendChild(rel_canonical);

try {
this.setTitle(decodeURIComponent(getFileName(url)) || url);
} catch (e) {
Expand Down

0 comments on commit f9f0900

Please sign in to comment.