Created
May 8, 2009 14:12
-
-
Save diegof79/108793 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
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