Last active
August 29, 2015 13:55
-
-
Save davidszotten/8738686 to your computer and use it in GitHub Desktop.
neo4j webadmin bookmarklet
This file contains hidden or 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
| // 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