\r
views.visualEditing.setView('rightColumn', views.visualEditingSidebar.getAsView());\r
addMainTab('Edytor', 'editor', views.visualEditing.getAsView());\r
- \r
+ addMainTab(gettext('Source'), 'sourceEditor', '');\r
addMainTab('Historia', 'history', views.diffLayout.getAsView());\r
\r
sandbox.getDOM().append(views.mainLayout.getAsView());\r
},\r
restoringStarted: function(event) {\r
sandbox.getModule('mainBar').setCommandEnabled('save', false);\r
- sandbox.getModule('indicator').showMessage(gettext('Restoring version ' + event.version + '...'));\r
+ sandbox.getModule('indicator').showMessage(gettext('Restoring version ') + event.version + '...');\r
},\r
historyItemAdded: function(item) {\r
sandbox.getModule('documentHistory').addHistory([item], {animate: true});\r
documentReverted: function(event) {\r
commands.resetDocument(event.document, 'revert');\r
sandbox.getModule('mainBar').setCommandEnabled('save', true);\r
- sandbox.getModule('indicator').clearMessage({message:'Wersja ' + event.version + ' przywrócona'});\r
+ sandbox.getModule('indicator').clearMessage({message:'Wersja ' + event.reverted_version + ' przywrócona'});\r
+ sandbox.getModule('mainBar').setVersion(event.current_version);\r
}\r
}\r
\r
eventHandlers.mainBar = {\r
ready: function() {\r
+ sandbox.getModule('mainBar').setVersion(sandbox.getModule('data').getDocumentVersion());\r
views.mainLayout.setView('topPanel', sandbox.getModule('mainBar').getView());\r
},\r
'cmd.save': function() {\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
+ command: function(cmd, meta) {\r
+ sandbox.getModule('documentCanvas').command(cmd, meta);\r
}\r
};\r
\r
},\r
restoreVersion: function(event) {\r
sandbox.getModule('data').restoreVersion(event);\r
+ },\r
+ displayVersion: function(event) {\r
+ window.open('/' + gettext('editor') + '/' + sandbox.getModule('data').getDocumentId() + '?version=' + event.version, _.uniqueId());\r
}\r
}\r
\r