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:
e8c4507
)
Showing previous versions of a publication
author
Aleksander Łukasz
<aleksander.lukasz@nowoczesnapolska.org.pl>
Mon, 17 Jun 2013 09:05:51 +0000
(11:05 +0200)
committer
Aleksander Łukasz
<aleksander.lukasz@nowoczesnapolska.org.pl>
Mon, 17 Jun 2013 09:05:51 +0000
(11:05 +0200)
modules/data/data.js
patch
|
blob
|
history
modules/documentHistory/documentHistory.js
patch
|
blob
|
history
modules/documentHistory/templates/main.html
patch
|
blob
|
history
modules/rng/rng.js
patch
|
blob
|
history
diff --git
a/modules/data/data.js
b/modules/data/data.js
index
8c35436
..
e2cdbb1
100644
(file)
--- a/
modules/data/data.js
+++ b/
modules/data/data.js
@@
-118,6
+118,9
@@
return function(sandbox) {
},
\r
});
\r
}
\r
},
\r
});
\r
}
\r
+ },
\r
+ getDocumentId: function() {
\r
+ return document_id;
\r
}
\r
}
\r
};
\r
}
\r
}
\r
};
\r
diff --git
a/modules/documentHistory/documentHistory.js
b/modules/documentHistory/documentHistory.js
index
9a01f16
..
d435617
100644
(file)
--- a/
modules/documentHistory/documentHistory.js
+++ b/
modules/documentHistory/documentHistory.js
@@
-30,6
+30,10
@@
return function(sandbox) {
});
\r
dialog.show();
\r
});
\r
});
\r
dialog.show();
\r
});
\r
+
\r
+ dom.find('.btn.display').click(function(e) {
\r
+ sandbox.publish('displayVersion', {version: historyItems.getSelected()[0]});
\r
+ });
\r
\r
var addHistoryItem = function(item, options) {
\r
historyItems.add(item);
\r
\r
var addHistoryItem = function(item, options) {
\r
historyItems.add(item);
\r
@@
-80,18
+84,18
@@
return function(sandbox) {
var len = this._selected.length;
\r
if(len === 0) {
\r
toggleButton('compare', false);
\r
var len = this._selected.length;
\r
if(len === 0) {
\r
toggleButton('compare', false);
\r
- toggleButton('
show2
', false);
\r
+ toggleButton('
display
', false);
\r
toggleButton('restore', false);
\r
}
\r
if(len === 1) {
\r
toggleButton('compare', false);
\r
toggleButton('restore', false);
\r
}
\r
if(len === 1) {
\r
toggleButton('compare', false);
\r
- toggleButton('
show2
', true);
\r
+ toggleButton('
display
', true);
\r
toggleButton('restore', true);
\r
}
\r
if(len === 2) {
\r
toggleItemViews(false);
\r
toggleButton('compare', true);
\r
toggleButton('restore', true);
\r
}
\r
if(len === 2) {
\r
toggleItemViews(false);
\r
toggleButton('compare', true);
\r
- toggleButton('
show2
', false);
\r
+ toggleButton('
display
', false);
\r
toggleButton('restore', false);
\r
} else {
\r
toggleItemViews(true);
\r
toggleButton('restore', false);
\r
} else {
\r
toggleItemViews(true);
\r
diff --git
a/modules/documentHistory/templates/main.html
b/modules/documentHistory/templates/main.html
index
ff4ea79
..
0e581f6
100644
(file)
--- a/
modules/documentHistory/templates/main.html
+++ b/
modules/documentHistory/templates/main.html
@@
-3,7
+3,7
@@
<div class="group">
\r
<button class="btn btn-mini compare">Porównaj</button>
\r
<button class="btn btn-mini restore">Przywróć</button>
\r
<div class="group">
\r
<button class="btn btn-mini compare">Porównaj</button>
\r
<button class="btn btn-mini restore">Przywróć</button>
\r
- <button class="btn btn-mini
show2
">Zobacz</button>
\r
+ <button class="btn btn-mini
display
">Zobacz</button>
\r
</div>
\r
</div>
\r
<div style="clear:both;"></div>
\r
</div>
\r
</div>
\r
<div style="clear:both;"></div>
\r
diff --git
a/modules/rng/rng.js
b/modules/rng/rng.js
index
cd7122c
..
3b41394
100644
(file)
--- a/
modules/rng/rng.js
+++ b/
modules/rng/rng.js
@@
-285,6
+285,9
@@
return function(sandbox) {
},
\r
restoreVersion: function(event) {
\r
sandbox.getModule('data').restoreVersion(event);
\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
}
\r
}
\r
\r