Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add enable-annotation attribute to managed iframes to opt-in to annotation tools #404

Merged
merged 1 commit into from
Sep 11, 2017

Conversation

jccr
Copy link
Contributor

@jccr jccr commented Sep 8, 2017

More info:
hypothesis/client#533

Due to possible timing issues this attribute must be added as soon as the iframe element hits the DOM. The easiest way to do that was to add the attribute to the template markup.

@jccr jccr requested a review from danielweck September 8, 2017 15:11
@jccr
Copy link
Contributor Author

jccr commented Sep 8, 2017

@danielweck
Pinging you here to see if you have any feedback on this

js/helpers.js Outdated
@@ -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 allowfullscreen="allowfullscreen" scrolling="no" class="iframe-fixed"></iframe></div></div>',
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can we please use the XHTML convention for no-value "boolean" attributes, i.e. enable-annotation="enable-annotation" (to be consistent with our existing allowfullscreen="allowfullscreen" attribute)

js/helpers.js Outdated
//"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 allowfullscreen="allowfullscreen" scrolling="no" id="epubContentIframe"></iframe></div>'
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Same as above. Copied here:
Can we please use the XHTML convention for no-value "boolean" attributes, i.e. enable-annotation="enable-annotation" (to be consistent with our existing allowfullscreen="allowfullscreen" attribute)

@danielweck
Copy link
Member

I think that's fine. Please just consider using the appropriate XHTML syntax, or at least use a consistent syntax for all attributes on the iframe element. :)

@jccr jccr force-pushed the feature/iframe-annotation-opt-in branch from f4a9d31 to c57d8e7 Compare September 11, 2017 18:41
@jccr
Copy link
Contributor Author

jccr commented Sep 11, 2017

@danielweck
Right, thanks for that.

@jccr jccr merged commit 426f313 into develop Sep 11, 2017
@jccr jccr deleted the feature/iframe-annotation-opt-in branch September 28, 2017 15:33
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants