• Sean Hammond's avatar
    Render YouTube and Vimeo links as video embeds · e5beb610
    Sean Hammond authored
    Client-side, replace any links to YouTube or Vimeo videos in annotation
    body texts with <iframe> video embeds for those same videos.
    
    Behind a new feature flag.
    
    markdown.coffee: after rendering the user's markdown text to HTML and
    sanitizing it, compile the HTML string into a DOM element and insert it into
    the DOM using innerHTML from JavaScript, instead of using Angular's
    ng-bind-html to insert the HTML string into the DOM.
    
    This means that our CoffeeScript code in markdown.coffee has the rendered
    annotation body as a DOM element, and can use the DOM API to modify it before
    inserting it into the DOM.
    
    Take advantage of this to find video links in the HTML and replace them with
    embeds. This is done by a standalone media-embedder.js module that
    markdown.coffee calls.
    
    This module is designed to allow functions for generating embeds for different
    kinds of URLs to be plugged in. So far functions for a few different kinds of
    YouTube and Vimeo URLs are implemented, but further functions for more
    media types can be added.
    e5beb610
Name
Last commit
Last update
..
annotation.html Loading commit data...
auth.html Loading commit data...
dropdown_menu_btn.html Loading commit data...
excerpt.html Loading commit data...
group_list.html Loading commit data...
markdown.html Loading commit data...
publish_annotation_btn.html Loading commit data...
search_status_bar.html Loading commit data...
share_dialog.html Loading commit data...
signin_control.html Loading commit data...
sort_dropdown.html Loading commit data...
thread.html Loading commit data...
top_bar.html Loading commit data...
viewer.html Loading commit data...