[annotator-dev] Annotator wrapper setup function
paolo.caminiti at gmail.com
Thu Apr 24 09:25:42 UTC 2014
When calling the annotator on the whole body is there any reason i would go
trough the wrapper function, which detach all scripts and breaks some
pages, instead of just returning the element itself?
I switched from:
@wrapper = $(@html.wrapper)
# We need to remove all scripts within the element before wrapping the
# contents within a div. Otherwise when scripts are reappended to the
# they will re-execute. This is an issue for scripts that call
# document.write() - such as ads - as they will clear the page.
@wrapper = @element.find('.annotator-wrapper')
@wrapper = @element
It seems to work correctly, given we are using the whole body as element,
am i missing something?
Will this fails on some kind of pages?
If not shouldn't it check if the element is the body and eventually skip
the wrapping to be less invasive to pages it is lunched on?
Thank you for the terrific work. Paolo
-------------- next part --------------
An HTML attachment was scrubbed...
More information about the annotator-dev