Fix JSLint issues in Dialog; add revert dialog on history page

This commit is contained in:
Eston Bond
2010-11-12 14:04:58 -08:00
parent c8f6059abf
commit 42c7058ecc
2 changed files with 39 additions and 6 deletions
@@ -29,7 +29,27 @@ $(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 revision <code>' +
truncatedSha + '</code>' +
' ? This will overwrite any previous changes.',
OK: function() {
// TODO add async endpoint to revert here
}
});
});
}
});