This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| var IMAGE_MIME_REGEX = /^image\/(p?jpeg|gif|png)$/i; | |
| var loadImage = function (file) { | |
| var reader = new FileReader(); | |
| reader.onload = function(e){ | |
| var img = document.createElement('img'); | |
| img.src = e.target.result; | |
| var range = window.getSelection().getRangeAt(0); | |
| range.deleteContents(); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| <iframe class="youtube-player" id="player" type="text/html" src="http://www.youtube.com/embed/EnErifh93hM?autoplay=1" height="400px" width="600px"></iframe> | |
| <!-- 1. The <div> tag will contain the <iframe> (and video player) --> | |
| <div id="player"></div> | |
| <script> // 2. This code loads the IFrame Player API code asynchronously. | |
| var tag = document.createElement('script'); | |
| tag.src = "http://www.youtube.com/player_api"; | |
| var firstScriptTag = document.getElementsByTagName('script')[0]; | |
| firstScriptTag.parentNode.insertBefore(tag, firstScriptTag); |