fnp
/
fnpeditor.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (from parent 1:
73a6ba2
)
Displaying current version of the publication
author
Aleksander Łukasz
<aleksander.lukasz@nowoczesnapolska.org.pl>
Mon, 17 Jun 2013 12:38:40 +0000
(14:38 +0200)
committer
Aleksander Łukasz
<aleksander.lukasz@nowoczesnapolska.org.pl>
Mon, 17 Jun 2013 12:38:40 +0000
(14:38 +0200)
modules/data/data.js
patch
|
blob
|
history
modules/mainBar/mainBar.js
patch
|
blob
|
history
modules/mainBar/mainBar.less
patch
|
blob
|
history
modules/mainBar/template.html
patch
|
blob
|
history
modules/rng/rng.js
patch
|
blob
|
history
diff --git
a/modules/data/data.js
b/modules/data/data.js
index
e2cdbb1
..
108f2ea
100644
(file)
--- a/
modules/data/data.js
+++ b/
modules/data/data.js
@@
-6,6
+6,7
@@
return function(sandbox) {
\r
var doc = sandbox.getBootstrappedData().document;
\r
var document_id = sandbox.getBootstrappedData().document_id;
\r
\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
var history = sandbox.getBootstrappedData().history;
\r
\r
\r
@@
-113,14
+114,18
@@
return function(sandbox) {
data: JSON.stringify(options),
\r
success: function(data) {
\r
doc = data.document;
\r
data: JSON.stringify(options),
\r
success: function(data) {
\r
doc = data.document;
\r
+ document_version = data.version;
\r
reloadHistory();
\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
});
\r
}
\r
},
\r
getDocumentId: function() {
\r
return document_id;
\r
+ },
\r
+ getDocumentVersion: function() {
\r
+ return document_version;
\r
}
\r
}
\r
};
\r
}
\r
}
\r
};
\r
diff --git
a/modules/mainBar/mainBar.js
b/modules/mainBar/mainBar.js
index
75fd599
..
084f675
100644
(file)
--- a/
modules/mainBar/mainBar.js
+++ b/
modules/mainBar/mainBar.js
@@
-18,6
+18,9
@@
return function(sandbox) {
getView: function() {return view;},
\r
setCommandEnabled: function(cmd, enabled) {
\r
view.find('[data-cmd='+cmd+']').toggleClass('disabled', !enabled);
\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
\r
diff --git
a/modules/mainBar/mainBar.less
b/modules/mainBar/mainBar.less
index
12bdd35
..
327fa56
100644
(file)
--- a/
modules/mainBar/mainBar.less
+++ b/
modules/mainBar/mainBar.less
@@
-3,8
+3,16
@@
}*/
\r
\r
.rng-module-mainBar {
\r
}*/
\r
\r
.rng-module-mainBar {
\r
+
\r
+ font-size: 10px;
\r
+
\r
li {
\r
display: inline;
\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
}
\r
\r
ul {
\r
diff --git
a/modules/mainBar/template.html
b/modules/mainBar/template.html
index
0696053
..
f8d4641
100644
(file)
--- a/
modules/mainBar/template.html
+++ b/
modules/mainBar/template.html
@@
-1,5
+1,6
@@
<div class="rng-module-mainBar">
\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
<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
diff --git
a/modules/rng/rng.js
b/modules/rng/rng.js
index
3b41394
..
276b0db
100644
(file)
--- a/
modules/rng/rng.js
+++ b/
modules/rng/rng.js
@@
-158,12
+158,14
@@
return function(sandbox) {
documentReverted: function(event) {
\r
commands.resetDocument(event.document, 'revert');
\r
sandbox.getModule('mainBar').setCommandEnabled('save', 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
}
\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
views.mainLayout.setView('topPanel', sandbox.getModule('mainBar').getView());
\r
},
\r
'cmd.save': function() {
\r