forked from teppokoivula/VersionControl
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathHistoryTab.min.js
1 lines (1 loc) · 1.76 KB
/
HistoryTab.min.js
1
$(function(){var a=config.VersionControl;$(".InputfieldWrapper#VersionControlHistory").on("click",".edit-comment",function(){var b=$(this).parent("td").prev("td"),c=$(this).data("revision"),d=prompt(a.i18n.commentPrompt,b.text());return null!==d&&$.post(a.processPage+"comment",{revision:c,comment:d},function(a){b.text(a).effect("highlight",{},500)}),!1}),$(".InputfieldWrapper#VersionControlHistory").on("change","#history_filters select",function(a){var b="";$(this).parents("#history_filters:first").find("input, select").each(function(){b&&(b+="&"),b+=$(this).attr("name")+"="+$(this).val(),a.stopPropagation()}),window.location.search=b});var b=$("#VersionControlHistory");b.length&&b.children("ul:first").data("active")&&$("a#_"+b.attr("id")).trigger("click"),$("form#ProcessPageEdit").on("submit",function(){$(this).find("#history_filters").remove()}),b.on("click","a.preview",function(){var a=$(this);return $("body").append('<div id="preview-overlay"></div>').append('<div id="preview"><iframe src="'+a.attr("href")+'" seamless></iframe></div>'),$("#preview iframe").on("load",function(){$("#preview").addClass("loaded")}),$("#preview-overlay").fadeIn(),$("#preview").show().animate({right:0},500,function(){$("body").addClass("preview")}),$(window).on("blur.preview",function(){c(a)}),$(document).on("keyup.preview",function(){c(a)}).on("click.preview",function(){c(a)}),!1});var c=function(a){return $(window).off("blur.preview"),$(document).off("keyup.preview"),$(document).off("click.preview"),$("body").removeClass("preview"),$("#preview-overlay").fadeOut(function(){$(this).remove()}),$("#preview").animate({right:"-80%"},500,function(){$(this).remove()}),a.parents("tr:first").effect("highlight",{},1500),!1};b.on("click","a.restore",function(){return confirm(a.i18n.confirmRestore)})});