X-Git-Url: https://git.mdrn.pl/fnpeditor.git/blobdiff_plain/f8b3ddf413bc700b6c640a0da368b3a1a41c09cc..601fd5decd2c36c4612487b8bfeb6df7d94a4ac2:/modules/rng/rng.js diff --git a/modules/rng/rng.js b/modules/rng/rng.js index a48535c..c42b985 100644 --- a/modules/rng/rng.js +++ b/modules/rng/rng.js @@ -22,7 +22,7 @@ return function(sandbox) { } views.visualEditing.setView('rightColumn', views.visualEditingSidebar.getAsView()); - addMainTab('rng2 test', 'rng2test', views.visualEditing.getAsView()); + addMainTab('Edytor', 'editor', views.visualEditing.getAsView()); sandbox.getDOM().append(views.mainLayout.getAsView()); @@ -42,19 +42,11 @@ return function(sandbox) { } }; - eventHandlers.visualEditor = { - ready: function() { - sandbox.getModule('visualEditor').setDocument(sandbox.getModule('data').getDocument()); - addMainTab(gettext('Visual'), 'visual', sandbox.getModule('visualEditor').getView()); - - } - }; - eventHandlers.data = { ready: function() { views.mainLayout.setView('mainView', views.mainTabs.getAsView()); - _.each(['visualEditor', 'sourceEditor', 'documentCanvas', 'documentToolbar', 'nodePane', 'metadataEditor', 'nodeFamilyTree', 'mainBar', 'indicator'], function(moduleName) { + _.each(['sourceEditor', 'documentCanvas', 'documentToolbar', 'nodePane', 'metadataEditor', 'nodeFamilyTree', 'nodeBreadCrumbs', 'mainBar', 'indicator'], function(moduleName) { sandbox.getModule(moduleName).start(); }); }, @@ -105,6 +97,7 @@ return function(sandbox) { nodeSelected: function(node) { sandbox.getModule('nodePane').setNode(node); sandbox.getModule('nodeFamilyTree').setNode(node); + sandbox.getModule('nodeBreadCrumbs').setNode(node); }, contentChanged: function() { @@ -112,11 +105,16 @@ return function(sandbox) { }, nodeHovered: function(node) { + sandbox.getModule('documentCanvas').highlightNode(node.attr('id')); sandbox.getModule('nodeFamilyTree').highlightNode(node.attr('id')); + sandbox.getModule('nodeBreadCrumbs').highlightNode(node.attr('id')); + }, nodeBlured: function(node) { + sandbox.getModule('documentCanvas').dimNode(node.attr('id')); sandbox.getModule('nodeFamilyTree').dimNode(node.attr('id')); + sandbox.getModule('nodeBreadCrumbs').dimNode(node.attr('id')); } }; @@ -166,6 +164,21 @@ return function(sandbox) { sandbox.getModule('documentCanvas').wrapSelectionWithNewNode(wlxmlTag, wlxmlClass); } } + }; + + eventHandlers.nodeBreadCrumbs = { + ready: function() { + views.visualEditing.setView('statusBar', sandbox.getModule('nodeBreadCrumbs').getView()); + }, + nodeHighlighted: function(id) { + sandbox.getModule('documentCanvas').highlightNode(id); + }, + nodeDimmed: function(id) { + sandbox.getModule('documentCanvas').dimNode(id); + }, + nodeSelected: function(id) { + sandbox.getModule('documentCanvas').selectNode(id); + } } /* api */