Skip to content

Instantly share code, notes, and snippets.

@diegof79
Created May 8, 2009 14:12
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 diegof79/108793 to your computer and use it in GitHub Desktop.
Save diegof79/108793 to your computer and use it in GitHub Desktop.
CmdUtils.CreateCommand({
name: "insert-uml-class",
_umlText: function(){
return CmdUtils.getSelection();
},
_umlImageHtml: function() {
var msg = '<img src="http://yuml.me/diagram/class/${umlText}" />';
return CmdUtils.renderTemplate( msg, {umlText: this._umlText()} );
},
preview: function( pblock ) {
pblock.innerHTML = this._umlImageHtml();
},
execute: function() {
var imageHtml = this._umlImageHtml();
CmdUtils.setSelection(imageHtml, {text:imageHtml});
CmdUtils.setLastResult(imageHtml);
},
icon: 'http://www.epidataconsulting.com/favicon.ico',
license: 'GPL',
homepage: "http://www.epidataconsulting.com/",
author: { name: "Diego Fernandez", email: "diegof@epidataconsulting.com"},
description: 'Inserts a class diagram using yuml.me'
});
CmdUtils.CreateCommand({
name: "insert-uml-usecase",
_umlText: function(){
return CmdUtils.getSelection();
},
_umlImageHtml: function() {
var msg = '<img src="http://yuml.me/diagram/usecase/${umlText}" />';
return CmdUtils.renderTemplate( msg, {umlText: this._umlText()} );
},
preview: function( pblock ) {
pblock.innerHTML = this._umlImageHtml();
},
execute: function() {
var imageHtml = this._umlImageHtml();
CmdUtils.setSelection(imageHtml, {text:imageHtml});
CmdUtils.setLastResult(imageHtml);
},
icon: 'http://www.epidataconsulting.com/favicon.ico',
license: 'GPL',
homepage: "http://www.epidataconsulting.com/",
author: { name: "Diego Fernandez", email: "diegof@epidataconsulting.com"},
description: 'Inserts an UML usecase diagram using yuml.me'
})
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment