Skip to content

Instantly share code, notes, and snippets.

@nbelyh
Last active September 2, 2017 16:32
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 nbelyh/d687b18b07f653843b792a27aef97fba to your computer and use it in GitHub Desktop.
Save nbelyh/d687b18b07f653843b792a27aef97fba to your computer and use it in GitHub Desktop.
SVGPublish: sample script to open ssh:// hyperlinks. Supposed to work with conjunctions with custom script on the client side. Please see starting-putty-from-an-exported-html-diagram for details
diagram.selectionChanged.add(function(shapeId) {
if (shapeId) {
var shape = diagram.shapes[shapeId];
if (shape) {
var ip = shape.Props['IP Address'];
if (ip) {
var url = 'ssh://' + ip;
// make a new link and click it
$("<a>").attr("href", url)[0].click();
}
}
}
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment