Skip to content

Commit

Permalink
Add enable-annotation attribute to managed iframes to opt-in to ann…
Browse files Browse the repository at this point in the history
…otation tools

More info:
hypothesis/client#533
  • Loading branch information
jccr committed Sep 11, 2017
1 parent 200521c commit 426f313
Showing 1 changed file with 8 additions and 3 deletions.
11 changes: 8 additions & 3 deletions js/helpers.js
Original file line number Diff line number Diff line change
Expand Up @@ -716,13 +716,18 @@ Helpers.loadTemplate = function (name, params) {
*/
Helpers.loadTemplate.cache = {
"fixed_book_frame": '<div id="fixed-book-frame" class="clearfix book-frame fixed-book-frame"></div>',

"single_page_frame": '<div><div id="scaler"><iframe allowfullscreen="allowfullscreen" scrolling="no" class="iframe-fixed"></iframe></div></div>',
"single_page_frame": '<div><div id="scaler"><iframe enable-annotation="enable-annotation" allowfullscreen="allowfullscreen" scrolling="no" class="iframe-fixed"></iframe></div></div>',
//"single_page_frame" : '<div><iframe scrolling="no" class="iframe-fixed" id="scaler"></iframe></div>',

"scrolled_book_frame": '<div id="reflowable-book-frame" class="clearfix book-frame reflowable-book-frame"><div id="scrolled-content-frame"></div></div>',
"reflowable_book_frame": '<div id="reflowable-book-frame" class="clearfix book-frame reflowable-book-frame"></div>',
"reflowable_book_page_frame": '<div id="reflowable-content-frame" class="reflowable-content-frame"><iframe allowfullscreen="allowfullscreen" scrolling="no" id="epubContentIframe"></iframe></div>'
"reflowable_book_page_frame": '<div id="reflowable-content-frame" class="reflowable-content-frame"><iframe enable-annotation="enable-annotation" allowfullscreen="allowfullscreen" scrolling="no" id="epubContentIframe"></iframe></div>'
/***
* The `enable-annotation` attribute on an iframe helps detect the content frames for annotating tools such as Hypothesis
* See here for more details:
* https://h.readthedocs.io/projects/client/en/latest/publishers/embedding/
* https://github.com/hypothesis/client/pull/533
***/
};

/**
Expand Down

0 comments on commit 426f313

Please sign in to comment.