Created
December 19, 2011 17:18
-
-
Save jayj/1498031 to your computer and use it in GitHub Desktop.
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
// A video button with parameters | |
QTags.VideoButton = function() { | |
QTags.TagButton.call(this, 'Video', 'video', '', '', 'm' ); | |
}; | |
QTags.VideoButton.prototype = new QTags.TagButton(); | |
QTags.VideoButton.prototype.callback = function(e, c, ed) { | |
// The different parameters and their default value | |
var src = prompt( 'Enter URL for video', 'http://' ), | |
width = prompt( 'Enter width for video', 640), | |
height = prompt( 'Enter height for video', 360 ), | |
thumbnail = prompt( 'Enter URL for thumbnail', 'http://' ); | |
if ( src && width && height ) { | |
// Start start | |
this.tagStart = '<video src="' + src + '" width="' + width + '" height="' + height + '">'; | |
// Add thumbnail | |
if ( thumbnail ) | |
this.tagStart = this.tagStart + '<img src="' + thumbnail + '" alt="" />'; | |
// End tag | |
this.tagStart = this.tagStart + '</video>'; | |
QTags.TagButton.prototype.callback.call(this, e, c, ed); | |
} | |
}; | |
edButtons[150] = new QTags.VideoButton(); // 150 is the position |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment