var WorkPackage=WorkPackage||{};!function(e){var t;t=function(){e.ajaxAppend({trigger:".action_menu_specific .edit",indicator_class:"ajax-indicator",load_target:"#update",loading_text:I18n.t("js.ajax.loading"),loading_class:"box loading",loading:function(t){e("html, body").animate({scrollTop:e(t).offset().top},200)},loaded:function(t){e("html, body").animate({scrollTop:e(t).offset().top},200),enable_textarea_auto_completion(e("#work_package_notes")),e("#work_package_notes").focus()}}),e.ajaxAppend({trigger:".quote-link",indicator_class:"ajax-indicator",load_target:"#update",loading_text:I18n.t("js.ajax.loading"),loading_class:"box loading",loading:function(t){e("html, body").animate({scrollTop:e(t).offset().top},200)},loaded:function(t,i){var n=e(i.context).parent().siblings(".wikicontent"),r=n.text(),s=n.attr("data-user");r=r.trim().replace(/<pre>((.|\s)*?)<\/pre>/g,"[...]"),r=r.replace(/^\s*$[\n\r]{1,}/gm,"");var o="{{{user}}} wrote:\n> ";o=o.replace("{{{user}}}",s),o+=r.replace(/(\r?\n|\r\n?)/g,"\n> ")+"\n\n",e("#notes").text(o),e("html, body").animate({scrollTop:e(t).offset().top},200),enable_textarea_auto_completion(e("#work_package_notes")),e("#work_package_notes").focus()}}),e.ajaxAppend({trigger:".description-details",indicator_class:"ajax-indicator",loading_class:"text-diff",hide_text:I18n.t("js.ajax.hide")})},e("document").ready(function(){t()})}(jQuery);