Skip to content

Instantly share code, notes, and snippets.

@jayj
Created December 19, 2011 17:18
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save jayj/1498031 to your computer and use it in GitHub Desktop.
Save jayj/1498031 to your computer and use it in GitHub Desktop.
// 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