Last active
September 2, 2017 16:32
-
-
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
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
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