\r
var doc = sandbox.getBootstrappedData().document;\r
var document_id = sandbox.getBootstrappedData().document_id;\r
+ var document_version = sandbox.getBootstrappedData().version\r
var history = sandbox.getBootstrappedData().history;\r
\r
\r
data: JSON.stringify(options),\r
success: function(data) {\r
doc = data.document;\r
+ document_version = data.version;\r
reloadHistory();\r
- sandbox.publish('documentReverted', {document: data.document, version: data.version});\r
+ sandbox.publish('documentReverted', data);\r
},\r
}); \r
}\r
},\r
getDocumentId: function() {\r
return document_id;\r
+ },\r
+ getDocumentVersion: function() {\r
+ return document_version;\r
}\r
}\r
};\r
getView: function() {return view;},\r
setCommandEnabled: function(cmd, enabled) {\r
view.find('[data-cmd='+cmd+']').toggleClass('disabled', !enabled);\r
+ },\r
+ setVersion: function(version) {\r
+ view.find('.version').text(version);\r
}\r
}\r
\r
}*/\r
\r
.rng-module-mainBar {\r
+\r
+ font-size: 10px;\r
+\r
li {\r
display: inline;\r
+ border-width: 0 1px 0 0;\r
+ border-color: #ddd;\r
+ border-style: solid;\r
+ margin: 0 5px 0 0;\r
+ padding: 0 5px 0 0;\r
}\r
\r
ul {\r
<div class="rng-module-mainBar">\r
<ul>\r
+ <li>wersja: <span class="version"></span></li>\r
<li><button class="btn btn-mini btn-info" data-cmd="save">Zapisz</button></li>\r
<li><a class="btn btn-mini btn-danger" href="/">Wyjdź</a></li>\r
</ul>\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