Remove calls to Page#last_version, replace with AJAX-lookup of version info.

This commit is contained in:
Dawa Ometto
2016-08-07 20:09:01 +02:00
parent 6316f97c06
commit 435a3e62ba
5 changed files with 27 additions and 24 deletions
@@ -306,6 +306,19 @@ $(document).ready(function() {
$.GollumEditor();
}
if( $("#last-edit").length ) {
$("#page-info-toggle").click ( function () {
$.ajax({
url: '/last-commit-info',
data: {path: $("#page-info-toggle").data('pagepath')},
success: function ( data ) {
$("#last-edit").html('Last edited by <b>' + data.author + '</b>, ' + data.date);
}
});
$("#last-edit").html('<i class="fa fa-spinner fa-spin"></i> Getting commit info...');
})
}
if( $('#wiki-wrapper.create').length ){
$("#gollum-editor-submit").click( function() { window.onbeforeunload = null; } );
$("#gollum-editor-body").one('change', function(){