X-Git-Url: https://git.mdrn.pl/fnpeditor.git/blobdiff_plain/9da575320a658b0f543c8ff4ac0ebe43fdd975e1..82a99e22c8cfc4e50bc15307c818878a261ca1bb:/src/editor/modules/rng/rng.js diff --git a/src/editor/modules/rng/rng.js b/src/editor/modules/rng/rng.js index b6b103f..4a01b7b 100644 --- a/src/editor/modules/rng/rng.js +++ b/src/editor/modules/rng/rng.js @@ -42,6 +42,7 @@ return function(sandbox) { sandbox.getModule('nodePane').setNodeElement(nodeElement); sandbox.getModule('nodeFamilyTree').setElement(nodeElement); sandbox.getModule('nodeBreadCrumbs').setNodeElement(nodeElement); + sandbox.getModule('documentToolbar').setNodeElement(nodeElement); }, updateCurrentTextElement: function(textElement) { sandbox.getModule('nodeFamilyTree').setElement(textElement); @@ -59,9 +60,9 @@ return function(sandbox) { }; views.visualEditing.setView('rightColumn', views.visualEditingSidebar.getAsView()); - addMainTab('Edytor', 'editor', views.visualEditing.getAsView()); + addMainTab(gettext('Editor'), 'editor', views.visualEditing.getAsView()); addMainTab(gettext('Source'), 'sourceEditor', ''); - addMainTab('Historia', 'history', views.diffLayout.getAsView()); + addMainTab(gettext('History'), 'history', views.diffLayout.getAsView()); sandbox.getDOM().append(views.mainLayout.getAsView()); @@ -91,10 +92,11 @@ return function(sandbox) { sandbox.getModule('mainBar').setCommandEnabled('save', false); sandbox.getModule('indicator').showMessage(gettext('Saving...')); }, - savingEnded: function(status) { + savingEnded: function(status, current_version) { void(status); sandbox.getModule('mainBar').setCommandEnabled('save', true); sandbox.getModule('indicator').clearMessage({message:'Dokument zapisany'}); + sandbox.getModule('mainBar').setVersion(current_version); }, restoringStarted: function(event) { sandbox.getModule('mainBar').setCommandEnabled('save', false); @@ -106,10 +108,10 @@ return function(sandbox) { diffFetched: function(diff) { sandbox.getModule('diffViewer').setDiff(diff); }, - documentReverted: function(event) { + documentReverted: function(version) { sandbox.getModule('mainBar').setCommandEnabled('save', true); - sandbox.getModule('indicator').clearMessage({message:'Wersja ' + event.reverted_version + ' przywrócona'}); - sandbox.getModule('mainBar').setVersion(event.current_version); + sandbox.getModule('indicator').clearMessage({message:'Wersja ' + version + ' przywrócona'}); + sandbox.getModule('mainBar').setVersion(version); } }; @@ -222,10 +224,11 @@ return function(sandbox) { compare: function(ver1, ver2) { sandbox.getModule('data').fetchDiff(ver1, ver2); }, - restoreVersion: function(event) { - sandbox.getModule('data').restoreVersion(event); + restoreVersion: function(version) { + sandbox.getModule('data').restoreVersion(version); }, displayVersion: function(event) { + /* globals window */ window.open('/' + gettext('editor') + '/' + sandbox.getModule('data').getDocumentId() + '?version=' + event.version, _.uniqueId()); } };