Skip to content

Instantly share code, notes, and snippets.

@davidszotten
Last active August 29, 2015 13:55
Show Gist options
  • Select an option

  • Save davidszotten/8738686 to your computer and use it in GitHub Desktop.

Select an option

Save davidszotten/8738686 to your computer and use it in GitHub Desktop.
neo4j webadmin bookmarklet
// js to add shortcut to go directly to node view from graph browser
// use: got to graph view, and run bookmarklet. once enabled,
// hold down cmd and click a node to go to its edit view
javascript: (function(){
require('webadmin').modules.browser.view.visualizedView.viz.sys.renderer.bind("node:click", function(node, ev) {
var data = node.data;
if (typeof data.neoNode === "undefined") {
return;
}
if (!ev.metaKey) {
return
}
var urlParts = data.neoNode._self.split('/');
var nodeId = urlParts[urlParts.length - 1];
$('.CodeMirror').get(0).CodeMirror.setValue(nodeId);
location.hash = "/data/search/" + nodeId + "/";
require('webadmin').modules.browser.view.switchView();
});
})();
// "minified" for copying into bookmarklet
javascript: (function(){ require('webadmin').modules.browser.view.visualizedView.viz.sys.renderer.bind("node:click", function(node, ev) { var data = node.data; if (typeof data.neoNode === "undefined") { return; } if (!ev.metaKey) { return } var urlParts = data.neoNode._self.split('/'); var nodeId = urlParts[urlParts.length - 1]; $('.CodeMirror').get(0).CodeMirror.setValue(nodeId); location.hash = "/data/search/" + nodeId + "/"; require('webadmin').modules.browser.view.switchView(); }); })();
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment