Hook up compare revisions selector
This commit is contained in:
@@ -29,26 +29,34 @@ $(document).ready(function() {
|
|||||||
|
|
||||||
$('#wiki-history td.revert-action a').mouseenter(highlightOn);
|
$('#wiki-history td.revert-action a').mouseenter(highlightOn);
|
||||||
$('#wiki-history td.revert-action a').mouseleave(highlightOff);
|
$('#wiki-history td.revert-action a').mouseleave(highlightOff);
|
||||||
|
|
||||||
|
if ($('td.revert-action a').length) {
|
||||||
|
$('td.revert-action a').click(function(e) {
|
||||||
|
e.preventDefault();
|
||||||
|
|
||||||
|
var commitSha = $(this).attr('rel');
|
||||||
|
var truncatedSha = commitSha.toString().substr(0, 7);
|
||||||
|
// revert action
|
||||||
|
$.GollumDialog.init({
|
||||||
|
title: 'Revert to ' + truncatedSha + '?',
|
||||||
|
body: 'Are you sure you wish to revert to commit <code>' +
|
||||||
|
truncatedSha + '</code>' +
|
||||||
|
' ? This will overwrite any previous changes.',
|
||||||
|
OK: function() {
|
||||||
|
// TODO add async endpoint to revert here
|
||||||
|
}
|
||||||
|
});
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
if ($('.history a.action-compare-revision').length) {
|
||||||
|
$('.history a.action-compare-revision').click(function() {
|
||||||
|
$("#version-form").submit();
|
||||||
|
});
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if ($('td.revert-action a').length) {
|
|
||||||
$('td.revert-action a').click(function(e) {
|
|
||||||
e.preventDefault();
|
|
||||||
|
|
||||||
var commitSha = $(this).attr('rel');
|
|
||||||
var truncatedSha = commitSha.toString().substr(0, 7);
|
|
||||||
// revert action
|
|
||||||
$.GollumDialog.init({
|
|
||||||
title: 'Revert to ' + truncatedSha + '?',
|
|
||||||
body: 'Are you sure you wish to revert to commit <code>' +
|
|
||||||
truncatedSha + '</code>' +
|
|
||||||
' ? This will overwrite any previous changes.',
|
|
||||||
OK: function() {
|
|
||||||
// TODO add async endpoint to revert here
|
|
||||||
}
|
|
||||||
});
|
|
||||||
});
|
|
||||||
}
|
|
||||||
|
|
||||||
if ($('#searchbar a#search-submit').length) {
|
if ($('#searchbar a#search-submit').length) {
|
||||||
$.GollumPlaceholder.add($('#searchbar #search-query'));
|
$.GollumPlaceholder.add($('#searchbar #search-query'));
|
||||||
|
|||||||
Reference in New Issue
Block a user