}\r
\r
views.visualEditing.setView('rightColumn', views.visualEditingSidebar.getAsView());\r
- addMainTab('rng2 test', 'rng2test', views.visualEditing.getAsView());\r
+ addMainTab('Edytor', 'editor', views.visualEditing.getAsView());\r
\r
sandbox.getDOM().append(views.mainLayout.getAsView());\r
\r
}\r
};\r
\r
- eventHandlers.visualEditor = {\r
- ready: function() {\r
- sandbox.getModule('visualEditor').setDocument(sandbox.getModule('data').getDocument());\r
- addMainTab(gettext('Visual'), 'visual', sandbox.getModule('visualEditor').getView());\r
- \r
- }\r
- };\r
- \r
eventHandlers.data = {\r
ready: function() {\r
views.mainLayout.setView('mainView', views.mainTabs.getAsView());\r
\r
- _.each(['visualEditor', 'sourceEditor', 'documentCanvas', 'nodePane', 'metadataEditor', 'nodeFamilyTree', 'mainBar', 'indicator'], function(moduleName) {\r
+ _.each(['sourceEditor', 'documentCanvas', 'documentToolbar', 'nodePane', 'metadataEditor', 'nodeFamilyTree', 'nodeBreadCrumbs', 'mainBar', 'indicator'], function(moduleName) {\r
sandbox.getModule(moduleName).start();\r
});\r
},\r
nodeSelected: function(node) {\r
sandbox.getModule('nodePane').setNode(node);\r
sandbox.getModule('nodeFamilyTree').setNode(node);\r
+ sandbox.getModule('nodeBreadCrumbs').setNode(node);\r
},\r
\r
contentChanged: function() {\r
},\r
\r
nodeHovered: function(node) {\r
+ sandbox.getModule('documentCanvas').highlightNode(node.attr('id'));\r
+ sandbox.getModule('nodeFamilyTree').highlightNode(node.attr('id'));\r
+ sandbox.getModule('nodeBreadCrumbs').highlightNode(node.attr('id'));\r
\r
},\r
\r
nodeBlured: function(node) {\r
- \r
+ sandbox.getModule('documentCanvas').dimNode(node.attr('id'));\r
+ sandbox.getModule('nodeFamilyTree').dimNode(node.attr('id'));\r
+ sandbox.getModule('nodeBreadCrumbs').dimNode(node.attr('id'));\r
}\r
};\r
\r
nodeSelected: function(id) {\r
sandbox.getModule('documentCanvas').selectNode(id);\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(id) {\r
+ sandbox.getModule('documentCanvas').highlightNode(id);\r
+ },\r
+ nodeDimmed: function(id) {\r
+ sandbox.getModule('documentCanvas').dimNode(id);\r
+ },\r
+ nodeSelected: function(id) {\r
+ sandbox.getModule('documentCanvas').selectNode(id);\r
+ } \r
}\r
\r
/* api */\r