Created
July 2, 2011 15:31
-
-
Save ayosec/1060792 to your computer and use it in GitHub Desktop.
Create a button to pop-up the youtube video
This file contains 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
/* | |
* Copy this in ~/.js/youtube.com.js | |
* Tested with dotjs for Firefox: https://addons.mozilla.org/en-US/firefox/addon/dotjs/ | |
*/ | |
if(m = /v=(\w+)/.exec(location.href)) { | |
$("<button>"). | |
text("Open"). | |
css("position", "fixed"). | |
css("top", "1em"). | |
css("left", "1em"). | |
css("padding", "0.5em"). | |
css("border-radius", "0.5em"). | |
css("border", "1px outset #333"). | |
css("font-size", "200%"). | |
css("background", "-moz-linear-gradient(top, #777, #ccc)"). | |
click(function() { window.open("http://www.youtube.com/embed/" + m[1], "_blank", "menubar=no"); }). | |
appendTo(document.body); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment