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
DOM
    # they will re-execute. This is an issue for scripts that call
    # document.write() - such as ads - as they will clear the page.
    @element.find('script').remove()
    @element.wrapInner(@wrapper)
    @wrapper = @element.find('.annotator-wrapper')

    this

to simply:

   @wrapper = @element

    this

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
_______________________________________________
annotator-dev mailing list
[email protected]
https://lists.okfn.org/mailman/listinfo/annotator-dev
Unsubscribe: https://lists.okfn.org/mailman/options/annotator-dev

Reply via email to