+ };\r
+\r
+ eventHandlers.nodePane = {\r
+ ready: function() {\r
+ views.currentNodePaneLayout.appendView(sandbox.getModule('nodePane').getView());\r
+ },\r
+ \r
+ nodeChanged: function(attr, value) {\r
+ sandbox.getModule('documentCanvas').modifyCurrentNode(attr, value);\r
+ }\r
+ };\r
+ \r
+ eventHandlers.metadataEditor = {\r
+ ready: function() {\r
+ sandbox.getModule('metadataEditor').setDocument(sandbox.getModule('data').getDocument());\r
+ views.visualEditingSidebar.addTab({icon: 'info-sign'}, 'metadataEditor', sandbox.getModule('metadataEditor').getView());\r
+ },\r
+ metadataChanged: function(metadata) {\r
+ dirty.metadataEditor = true;\r
+ },\r
+ metadataSet: function() {\r
+ dirty.metadataEditor = false;\r
+ },\r
+ };\r
+ \r
+ eventHandlers.nodeFamilyTree = {\r
+ ready: function() {\r
+ views.currentNodePaneLayout.appendView(sandbox.getModule('nodeFamilyTree').getView());\r
+ },\r
+ nodeEntered: function(wlxmlNode) {\r
+ commands.highlightDocumentNode(wlxmlNode, 'nodeFamilyTree');\r
+ },\r
+ nodeLeft: function(wlxmlNode) {\r
+ commands.dimDocumentNode(wlxmlNode, 'nodeFamilyTree');\r
+ },\r
+ nodeSelected: function(wlxmlNode) {\r
+ commands.selectNode(wlxmlNode);\r
+ }\r
+ };\r
+ \r
+ eventHandlers.documentToolbar = {\r
+ ready: function() {\r
+ views.visualEditing.setView('toolbar', sandbox.getModule('documentToolbar').getView());\r
+ },\r
+ toggleGrid: function(toggle) {\r
+ sandbox.getModule('documentCanvas').toggleGrid(toggle);\r
+ },\r
+ newNodeRequested: function(wlxmlTag, wlxmlClass) {\r
+ if(window.getSelection().isCollapsed) {\r
+ sandbox.getModule('documentCanvas').insertNewNode(wlxmlTag, wlxmlClass);\r
+ } else {\r
+ sandbox.getModule('documentCanvas').wrapSelectionWithNewNode(wlxmlTag, wlxmlClass);\r
+ }\r
+ }\r
+ };\r
+ \r
+ eventHandlers.nodeBreadCrumbs = {\r
+ ready: function() {\r
+ views.visualEditing.setView('statusBar', sandbox.getModule('nodeBreadCrumbs').getView());\r
+ },\r
+ nodeHighlighted: function(wlxmlNode) {\r
+ commands.highlightDocumentNode(wlxmlNode, 'nodeBreadCrumbs');\r
+ },\r
+ nodeDimmed: function(wlxmlNode) {\r
+ commands.dimDocumentNode(wlxmlNode, 'nodeBreadCrumbs');\r
+ },\r
+ nodeSelected: function(wlxmlNode) {\r
+ commands.selectNode(wlxmlNode);\r
+ } \r