$(document).ready(function () { $("#view_history").click(function(){ $(this).replaceWith('

...Loading...

'); $.get("/lexeme/ajax/classical-gluonic/history/load/?lexid=" + $("#lexid").html(), function(data){ $("#view_history").replaceWith(data); }); return false; }); $("#revert").click(function(){ var message = "This action will copy this historic version and make it the new current version."; if ($("#draft_exists").length){ message += "\n\nThere is an active draft; if you continue it will be discarded."; } if (!confirm(message + " Are you sure?")) { return false; } else { var reason = prompt("Please give a short reason for the reversion."); if (!reason) { alert("A reason for the change is required. Please try again."); return false; } var href = $(this).attr("href") + "?reason=" + encodeURI(reason) $(this).attr("href", href) return true; } }); // Loading attachments $.get("/lexeme/ajax/classical-gluonic/list/load/?lexid=" + $("#lexid").html(), function(data){ $("#lexeme_attachments").html(data); }); $.get("/lexeme/ajax/classical-gluonic/list/articles/?lexid=" + $("#lexid").html(), function(data){ $("#topic_attachments").html(data); }); });