Hook up compare revisions selector

This commit is contained in:
Eston Bond
2010-11-15 13:07:57 -08:00
parent ee8d72a137
commit 01e3f7b4f7
+26 -18
View File
@@ -29,26 +29,34 @@ $(document).ready(function() {
$('#wiki-history td.revert-action a').mouseenter(highlightOn);
$('#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) {
$.GollumPlaceholder.add($('#searchbar #search-query'));