/*=======================================================================*\
|| ###################################################################### ||
|| # vBulletin 5.4.2
|| # ------------------------------------------------------------------ # ||
|| # Copyright 2000-2018 vBulletin Solutions Inc. All Rights Reserved.  # ||
|| # This file may not be redistributed in whole or significant part.   # ||
|| # ----------------- VBULLETIN IS NOT FREE SOFTWARE ----------------- # ||
|| # http://www.vbulletin.com | http://www.vbulletin.com/license.html   # ||
|| ###################################################################### ||
\*========================================================================*/
window.vBulletin=window.vBulletin||{};window.vBulletin.phrase=window.vBulletin.phrase||{};window.vBulletin.phrase.precache=window.vBulletin.phrase.precache||[];window.vBulletin.phrase.precache=$.merge(window.vBulletin.phrase.precache,["cancel","delete_posts","delete_thread","inline_moved","inlinemod_auth","inlinemod_auth_password_empty","loading","login","manage_content","manage_deleted","merge_posts","merge_threads_ginlinemod","move_posts","move_threads_ginlinemod","not_much_would_be_accomplished_by_merging","options","please_select_at_least_one_post","please_select_at_least_two_posts","remove_redirects","this_post_has_been_successfully_approved","this_post_has_been_successfully_unapproved","this_topic_has_been_stuck","this_topic_has_been_successfully_approved","this_topic_has_been_successfully_opened","this_topic_has_been_successfully_unapproved","this_topic_has_been_successfully_unstuck","this_topic_is_closed","this_topic_is_deleted","this_topic_is_undeleted","thread_redirects_removed","unapproved","you_did_not_select_any_valid_threads"]);(function(D){vBulletin.inlinemod=vBulletin.inlinemod||{};vBulletin.inlinemod.delete_form_thread=function(){var K=this,J=F(D(K));if(J.length==0){A("delete_thread");return }var L=openConfirmDialog({title:vBulletin.phrase.get("delete_thread"),message:vBulletin.phrase.get("loading")+"...",width:500,dialogClass:"inlinemod-delete-dialog loading",buttonLabel:{yesLabel:vBulletin.phrase.get("delete_thread"),noLabel:vBulletin.phrase.get("cancel")},onClickYes:function(){var O=L.find(".delete-posts-form"),P=O.find("input:radio[name=deletetype]:checked").val()||1,N;var M={hard:(P==2?1:0),reason:O.find(":input[name=deletereason]").val(),nodeids:J,deleteother:O.find(":input[name=deleteother]").is(":checked")?1:0,report:O.find(":input[name=report]").is(":checked")?1:0,banusers:(O.find("input:radio[name=useraction]:checked").val()=="ban")?1:0};if(M.deleteother||M.banusers||M.report){var Q=function(){var R=openConfirmDialog({title:vBulletin.phrase.get("spam_management"),message:vBulletin.phrase.get("loading")+"...",width:500,dialogClass:"inlinemod-spam-dialog loading",buttonLabel:{yesLabel:vBulletin.phrase.get("proceed_ellipsis"),noLabel:vBulletin.phrase.get("cancel")},onClickYes:function(){var S=R.find(".spam-form");M.userids=new Array();S.find(":input[name='userids[]']:checked").each(function(){M.userids.push(D(this).val())});M.banusergroupid=S.find(":input[name=usergroupid]").val();M.period=S.find(":input[name=period]").val();M.banreason=S.find(":input[name=banreason]").val();M.report=O.find(":input[name=report]").is(":checked")?1:0;vBulletin.AJAX({url:vBulletin.normalizeAjaxUrl(S.attr("action")),cpaction:true,data:M,title_phrase:"spam_management",error_phrase:"error_deleting_posts",success:function(T){D.cookie(B,null,{path:pageData.cookie_path,domain:pageData.cookie_domain});if(H=="thread"&&P==2){location.replace(D("#breadcrumbs .crumb a:last").attr("href"))}else{var U=D(".filter-wrapper",D(K).parents(".conversation-toolbar")).data("object-instance");if(U&&typeof U.applyFilters=="function"){U.forceApplyFilters()}else{location.reload()}}}})}});vBulletin.AJAX({call:"/ajax/render/inlinemod_delete_spam",data:{nodeIds:J,banusers:M.banusers},title_phrase:"spam_management",error_phrase:"error_loading_spam_form",success:function(S){D(".inlinemod-spam-dialog").removeClass("loading");D(".dialog-content .message",R).html(S).find("[placeholder]").placeholder();R.dialog("option","position",{of:window});R.find(".spam-form").off("submit").on("submit",function(T){T.preventDefault()})}})};setTimeout(Q,500)}else{vBulletin.AJAX({url:vBulletin.normalizeAjaxUrl(O.attr("action")),cpaction:true,data:M,title_phrase:"delete_thread",error_phrase:"error_deleting_posts",success:function(R){D.cookie(B,null,{path:pageData.cookie_path,domain:pageData.cookie_domain});if(H=="thread"&&P==2){if(D.inArray(D(K).attr("data-node-id"),R)!=-1||D.inArray(pageData.nodeid,R)!=-1){location.replace(D("#breadcrumbs .crumb a:last").attr("href"))}else{D("input.cb_inlinemod[type=checkbox]:checked",I).each(function(){if(D.inArray(D(this).val(),R)!=-1){D(this).parents(".inlinemod-item").remove()}})}}else{if(D.inArray(D(K).attr("data-node-id"),R)!=-1){D(".conversation-content-widget").addClass("deleted")}var S=D(".filter-wrapper",D(K).parents(".conversation-toolbar")).data("object-instance");if(S&&typeof S.applyFilters=="function"){S.forceApplyFilters()}else{location.reload()}}}})}}});vBulletin.AJAX({call:"/ajax/render/inlinemod_delete_form",data:{postcount:J.length,nodeids:J,deleteposts:1,removeposts:1,firstpost:1},title_phrase:"delete_thread",error_phrase:"error_loading_delete_form",success:function(M){D(".inlinemod-delete-dialog").removeClass("loading");D(".dialog-content .message",L).html(M).find("[placeholder]").placeholder();L.dialog("option","position",{of:window});D("select",L).selectBox()}})};vBulletin.inlinemod.delete_dialog=function(K,J){var L=openConfirmDialog({title:vBulletin.phrase.get("delete_posts"),message:vBulletin.phrase.get("loading")+"...",width:500,dialogClass:"inlinemod-delete-dialog loading",buttonLabel:{yesLabel:vBulletin.phrase.get("delete_posts"),noLabel:vBulletin.phrase.get("cancel")},onClickYes:function(){var O=L.find(".delete-posts-form");var P=O.find("input:radio[name=deletetype]:checked").val()||1;var M={hard:(P==2?1:0),reason:O.find(":input[name=deletereason]").val(),nodeids:K,deleteother:O.find(":input[name=deleteother]").is(":checked")?1:0,report:O.find(":input[name=report]").is(":checked")?1:0,banusers:(O.find("input:radio[name=useraction]:checked").val()=="ban")?1:0};var N;if(M.deleteother||M.banusers||M.report){var Q=function(){var R=openConfirmDialog({title:vBulletin.phrase.get("spam_management"),message:vBulletin.phrase.get("loading")+"...",width:500,dialogClass:"inlinemod-spam-dialog loading",buttonLabel:{yesLabel:vBulletin.phrase.get("proceed_ellipsis"),noLabel:vBulletin.phrase.get("cancel")},onClickYes:function(){var S=R.find(".spam-form");M.userids=new Array();S.find(":input[name='userids[]']:checked").each(function(){M.userids.push(D(this).val())});M.banusergroupid=S.find(":input[name=usergroupid]").val();M.period=S.find(":input[name=period]").val();M.banreason=S.find(":input[name=banreason]").val();M.report=O.find(":input[name=report]").is(":checked")?1:0;vBulletin.AJAX({url:vBulletin.normalizeAjaxUrl(S.attr("action")),cpaction:true,data:M,title_phrase:"spam_management",error_phrase:"error_deleting_posts",success:function(T){if(typeof J=="function"){J(T,M)}vBulletin.inlinemod.clear()}})}});vBulletin.AJAX({call:"/ajax/render/inlinemod_delete_spam",data:{nodeIds:K,banusers:M.banusers},title_phrase:"spam_management",error_phrase:"error_loading_spam_form",success:function(S){vBulletin.inlinemod.clear();D(".inlinemod-spam-dialog").removeClass("loading");D(".dialog-content .message",R).html(S).find("[placeholder]").placeholder();R.dialog("option","position",{of:window});D("select",R).selectBox();R.find(".spam-form").off("submit").on("submit",function(T){T.preventDefault()})}})};setTimeout(Q,500)}else{vBulletin.AJAX({url:vBulletin.normalizeAjaxUrl(O.attr("action")),cpaction:true,data:M,title_phrase:"delete_posts",error_phrase:"error_deleting_posts",success:function(R){if(typeof J=="function"){J(R,M)}vBulletin.inlinemod.clear()}})}}});vBulletin.AJAX({call:"/ajax/render/inlinemod_delete_form",data:({postcount:K.length,nodeids:K,deleteposts:1,removeposts:1,firstpost:1}),success:function(M){D(".inlinemod-delete-dialog").removeClass("loading");D(".dialog-content .message",L).html(M).find("[placeholder]").placeholder();L.dialog("option","position",{of:window});D("select",L).selectBox()}})};vBulletin.inlinemod.delete_form=function(){var K=D(this),J=F(D(el));if(J.length==0){A("delete_posts");return }vBulletin.inlinemod.delete_dialog(J,function(M,N){if(N.nodeids&&D.isArray(N.nodeids)){var L=false;D.each(N.nodeids,function(P,Q){if(D.inArray(Q,M)==-1){L=true}});if(L){vBulletin.warning("delete_posts","error_deleting_one_or_more_posts")}}D.cookie(B,null,{path:pageData.cookie_path,domain:pageData.cookie_domain});if(H&&H=="thread"&&N.hard==1){if(K&&(D.inArray(K.attr("data-node-id"),M)!=-1||D.inArray(pageData.nodeid,M)!=-1)){location.replace(D("#breadcrumbs .crumb a:last").attr("href"))}else{D("input.cb_inlinemod[type=checkbox]:checked",I).each(function(){if(D.inArray(D(this).val(),M)!=-1){D(this).closest(".inlinemod-item").remove()}})}}else{var O=D(".filter-wrapper",K.parents(".conversation-toolbar")).data("object-instance");if(O&&typeof O.applyFilters=="function"){O.forceApplyFilters()}else{location.reload()}}})};vBulletin.inlinemod.moveThreads=function(){var L=this,K=F(D(L));movephrase="move_threads_ginlinemod",movephraserendered=vBulletin.phrase.get(movephrase);if(K.length==0){A(movephrase);return }var J=openConfirmDialog({title:movephraserendered,message:vBulletin.phrase.get("loading")+"...",width:500,dialogClass:"inlinemod-move-dialog loading",buttonLabel:{yesLabel:movephraserendered,noLabel:vBulletin.phrase.get("cancel")},onClickYes:function(){var N=J.find(".move-posts-form");var O={};if(N.find("input[name=enableredirect]").prop("checked")){O.redirect=N.find("#rb_redirect_perm").prop("checked")?"perm":"expires";if(O.redirect=="expires"){O.period=N.find("select[name=period]").val();O.frame=N.find("select[name=frame]").val()}console.log("Redirect data compiled:");console.dir(O)}var M={to_parent:N.find("select[name=destchannelid]").val(),nodeids:K,leaveRedirectData:O};vBulletin.AJAX({url:vBulletin.normalizeAjaxUrl(N.attr("action")),cpaction:true,data:M,type:N.attr("method"),title_phrase:"move_threads_ginlinemod",error_phrase:"error_moving_threads",success:function(P){D.cookie(B,null,{path:pageData.cookie_path,domain:pageData.cookie_domain});vBulletin.alert(movephrase,"inline_moved","",function(){location.reload()})}})}});vBulletin.AJAX({call:"/ajax/render/inlinemod_move_form",data:{postcount:K.length,moveposts:1,removeposts:1,firstpost:1},title_phrase:"move_threads_ginlinemod",error_phrase:"error_loading_move_form",success:function(M){D(".inlinemod-move-dialog").removeClass("loading");D(".dialog-content .message",J).html(M).find("[placeholder]").placeholder();J.dialog("option","position",{of:window});D("select",J).selectBox()}})};vBulletin.inlinemod.movePosts=function(){var L=this,K=F(D(L));if(K.length==0){A("move_posts");return }var J=openConfirmDialog({title:vBulletin.phrase.get("move_posts"),message:vBulletin.phrase.get("loading")+"...",width:500,dialogClass:"inlinemod-moveposts-dialog loading",buttonLabel:{yesLabel:vBulletin.phrase.get("move_posts"),noLabel:vBulletin.phrase.get("cancel")},onClickYes:function(){var N=J.find(".move-posts-form"),O=N.find("input:radio[name=type]:checked").val()||0,M={newtitle:N.find(':input[name="title"]').val(),to_parent:(O==0)?N.find(':input[name="destchannelid"]').val():N.find(':input[name="mergethreadurl"]').val().replace(pageData.baseurl+"/",""),nodeids:K,makeTopic:true};vBulletin.AJAX({call:"/ajax/api/node/moveNodes",cpaction:true,data:M,title_phrase:"move_posts",error_phrase:"error_moving_posts",success:function(P){D.cookie(B,null,{path:pageData.cookie_path,domain:pageData.cookie_domain});if(H=="thread"){if(D.inArray(D(L).attr("data-node-id"),P)!=-1||D.inArray(pageData.nodeid,P)!=-1){location.replace(D("#breadcrumbs .crumb a:last").attr("href"))}else{D("input.cb_inlinemod[type=checkbox]:checked",I).each(function(){if(D.inArray(D(this).val(),P)!=-1){D(this).parents(".inlinemod-item").remove()}})}}else{var Q=D(".filter-wrapper",D(L).parents(".conversation-toolbar")).data("object-instance");if(Q&&typeof Q.applyFilters=="function"){Q.forceApplyFilters()}}vBulletin.AJAX({call:"/ajax/api/route/getNodeUrl",data:{nodeid:P[0]},success:function(R){location.href=pageData.baseurl+R}})}})}});vBulletin.AJAX({call:"/ajax/render/inlinemod_movePosts",data:{postcount:K.length,deleteposts:1,removeposts:1,firstpost:1},title_phrase:"move_posts",error_phrase:"error_loading_move_form",success:function(M){D(".inlinemod-moveposts-dialog").removeClass("loading");D(".dialog-content .message",J).html(M).find("[placeholder]").placeholder();J.dialog("option","position",{of:window});D("select",J).selectBox()}})};vBulletin.inlinemod.stickThreads=function(L){var K=this,J=F(D(K));if(!L){L="stick"}if(J.length==0){A(L+"_threads");return }vBulletin.AJAX({call:"/ajax/api/node/setSticky",cpaction:true,data:{nodeids:J,stick:(L=="stick"?1:0)},title_phrase:L+"_threads",error_phrase:"error_sticking_topics",success:function(M){vBulletin.inlinemod.clear.apply(K);if(H=="thread"){var N;if(L=="stick"){D(".canvas-widget").addClass("sticky");N=vBulletin.phrase.get("this_topic_has_been_stuck")}else{D(".canvas-widget").removeClass("sticky");N=vBulletin.phrase.get("this_topic_has_been_successfully_unstuck")}showStatusMessage(N,"stick")}else{var O=D(".filter-wrapper",D(K).parents(".conversation-toolbar")).data("object-instance");if(O&&typeof O.applyFilters=="function"){if(H=="topic"){O.updatePageNumber(1)}O.forceApplyFilters()}}}});return false};vBulletin.inlinemod.unstickThreads=function(){return vBulletin.inlinemod.stickThreads.apply(this,["unstick"])};vBulletin.inlinemod.openCloseThreads=function(L){var K=this,J=F(D(K));if(!L){L="open"}if(J.length==0){A(L+"_threads");return false}vBulletin.AJAX({call:"/ajax/api/node/"+L+"Node",cpaction:true,data:{nodeid:J},title_phrase:L+"_threads",error_phrase:"error_open_close_topic",success:function(M){vBulletin.inlinemod.clear.apply(K);if(H=="thread"){var N,O=D(".canvas-widget");if(L=="open"){O.removeClass("showclosed");if(D(".canvas-widget #canmoderate").val()=="0"){O.removeClass("closed_content-entry-box")}N=vBulletin.phrase.get("this_topic_has_been_successfully_opened")}else{O.addClass("showclosed");if(D(".canvas-widget #canmoderate").val()=="0"){O.addClass("closed_content-entry-box")}N=vBulletin.phrase.get("this_topic_is_closed")}showStatusMessage(N,"close")}else{var P=D(".filter-wrapper",D(K).parents(".conversation-toolbar")).data("object-instance");if(P&&typeof P.applyFilters=="function"){P.forceApplyFilters()}}}});return false};vBulletin.inlinemod.approvePosts=function(L){var K=this,J=F(D(K));if(!L){L="approve"}if(J.length==0){A(L+"_threads");return }vBulletin.AJAX({call:"/ajax/api/node/setApproved",cpaction:true,data:{nodeids:J,approved:(L=="approve"?1:0)},title_phrase:L+"_threads",error_phrase:"error_un_approving_topics",success:function(M){vBulletin.inlinemod.clear.apply(K);if(H=="thread"){var N;if(L=="approve"){if(D.inArray(D(K).attr("data-node-id"),M)!=-1){D(".canvas-widget").removeClass("unapproved")}D(".inlinemod-item .cb_inlinemod",I).each(function(){if(D.inArray(this.value,M)!=-1){D(this).closest(".js-post").removeClass("unapproved b-post--unapproved");D(this).prev(".js-unapprove-label").remove()}});N=vBulletin.phrase.get("this_post_has_been_successfully_approved")}else{if(D.inArray(D(K).attr("data-node-id"),M)!=-1){D(".canvas-widget").addClass("unapproved")}D(".inlinemod-item .cb_inlinemod",I).each(function(){if(D.inArray(this.value,M)!=-1){D(this).closest(".js-post").addClass("unapproved b-post--unapproved");D('<span class="js-unapprove-label b-post__inlinemod-text">{0}</span>'.format(vBulletin.phrase.get("unapproved"))).insertBefore(this)}});N=vBulletin.phrase.get("this_post_has_been_successfully_unapproved")}showStatusMessage(N,"approve")}else{var O=D(".filter-wrapper",D(K).parents(".conversation-toolbar")).data("object-instance");if(O&&typeof O.applyFilters=="function"){O.forceApplyFilters()}}}});return false};vBulletin.inlinemod.approveThreads=function(L){var K=this,J=F(D(K));if(!L){L="approve"}if(J.length==0){A(L+"_threads");return }vBulletin.AJAX({call:"/ajax/api/node/setApproved",cpaction:true,data:{nodeids:J,approved:(L=="approve"?1:0)},title_phrase:L+"_threads",error_phrase:"error_un_approving_topics",success:function(M){vBulletin.inlinemod.clear.apply(K);if(H=="thread"){var N;if(L=="approve"){if(D.inArray(D(K).attr("data-node-id"),M)!=-1){D(".canvas-widget").removeClass("unapproved")}D(".inlinemod-item .cb_inlinemod",I).each(function(){if(D.inArray(this.value,M)!=-1){D(this).closest(".list-item").removeClass("unapproved");D(this).prev(".js-unapprove-label").remove()}});N=vBulletin.phrase.get("this_topic_has_been_successfully_approved")}else{if(D.inArray(D(K).attr("data-node-id"),M)!=-1){D(".canvas-widget").addClass("unapproved")}D(".inlinemod-item .cb_inlinemod",I).each(function(){if(D.inArray(this.value,M)!=-1){D(this).closest(".list-item").addClass("unapproved");D('<span class="js-unapprove-label b-post__inlinemod-text">{0}</span>'.format(vBulletin.phrase.get("unapproved"))).insertBefore(this)}});N=vBulletin.phrase.get("this_topic_has_been_successfully_unapproved")}showStatusMessage(N,"approve")}else{var O=D(".filter-wrapper",D(K).parents(".conversation-toolbar")).data("object-instance");if(O&&typeof O.applyFilters=="function"){O.forceApplyFilters()}}}});return false};vBulletin.inlinemod.unfeatureThreads=function(){vBulletin.inlinemod.featureThreads.apply(this,["unfeature"])};vBulletin.inlinemod.featureThreads=function(L){var K=this,J=F(D(K));if(!L){L="feature"}if(J.length==0){A(L+"_threads");return }vBulletin.AJAX({call:"/ajax/api/node/setFeatured",cpaction:true,data:{nodeids:J,set:(L=="feature"?1:0)},title_phrase:L+"_threads",error_phrase:"error_featuring_topics",success:function(M){vBulletin.inlinemod.clear.apply(K);if(H=="thread"){var N;if(L=="feature"){if(D.inArray(D(K).attr("data-node-id"),M)!=-1){D(".canvas-widget").addClass("featured")}D(".inlinemod-item .cb_inlinemod",I).each(function(){if(D.inArray(this.value,M)!=-1){D(this).closest(".list-item").removeClass("unfeatured")}});N=vBulletin.phrase.get("this_topic_has_been_featured")}else{if(D.inArray(D(K).attr("data-node-id"),M)!=-1){D(".canvas-widget").removeClass("featured")}D(".inlinemod-item .cb_inlinemod",I).each(function(){if(D.inArray(this.value,M)!=-1){D(this).closest(".list-item").addClass("unfeatured")}});N=vBulletin.phrase.get("this_topic_has_been_unfeatured")}showStatusMessage(N,"feature")}else{var O=D(".filter-wrapper",D(K).parents(".conversation-toolbar")).data("object-instance");if(O&&typeof O.applyFilters=="function"){O.forceApplyFilters()}}}});return false};vBulletin.inlinemod.undelete=function(){var K=this,J=F(D(K));if(J.length==0){A("undelete_threads");return }vBulletin.AJAX({call:"/ajax/api/node/undeleteNodes",cpaction:true,data:{nodeids:J},title_phrase:"undelete_threads",error_phrase:"error_undeleting_topics",success:function(L){vBulletin.inlinemod.clear.apply(K);if(H=="thread"){var M;if(D.inArray(D(K).attr("data-node-id"),L)!=-1){D(".conversation-content-widget").removeClass("deleted")}D(".inlinemod-item .cb_inlinemod",I).each(function(){if(D.inArray(this.value,L)!=-1){D(this).closest(".js-post").removeClass("deleted b-post--deleted")}});M=vBulletin.phrase.get("this_topic_is_undeleted");showStatusMessage(M,"delete")}else{var N=D(".filter-wrapper",D(K).parents(".conversation-toolbar")).data("object-instance");if(N&&typeof N.applyFilters=="function"){N.forceApplyFilters()}}}});return false};vBulletin.inlinemod.unapprovePosts=function(){return vBulletin.inlinemod.approvePosts.apply(this,["unapprove"])};vBulletin.inlinemod.unapproveThreads=function(){return vBulletin.inlinemod.approveThreads.apply(this,["unapprove"])};vBulletin.inlinemod.viewSelectedPosts=function(){window.location=pageData.baseurl+"/search?cookie="+B};vBulletin.inlinemod.mergePosts=function(){var K=this,J=F(D(K));if(J.length<2){vBulletin.warning("merge_posts","please_select_at_least_two_posts");return }var L=openConfirmDialog({title:vBulletin.phrase.get("merge_posts"),message:vBulletin.phrase.get("loading")+"...",width:600,dialogClass:"inlinemod-mergeposts-dialog loading",buttonLabel:{yesLabel:vBulletin.phrase.get("merge_posts"),noLabel:vBulletin.phrase.get("cancel")},onClickYes:function(){var N=L.find("#hiddenVar_mergePosts").closest("form");N.find("[name=securitytoken]").remove();var M=N.serializeArray();M.push({name:"destnodeid",value:L.find(':input[name="destnodeid"]').val()});M.push({name:"destauthorid",value:L.find(':input[name="destauthorid"]').val()});M.push({name:"contenttype",value:N.attr("data-content-type")});vBulletin.AJAX({call:"/ajax/api/node/mergePosts",cpaction:true,data:{input:M},title_phrase:"merge_posts",error_phrase:"error_merging_posts",success:function(O){D.cookie(B,null,{path:pageData.cookie_path,domain:pageData.cookie_domain});var P=D(".filter-wrapper",D(K).parents(".conversation-toolbar")).data("object-instance");if(P&&typeof P.applyFilters=="function"){P.forceApplyFilters()}else{location.reload()}}})}});vBulletin.AJAX({call:"/ajax/render/inlinemod_mergePosts",data:{posts:J.join(","),postcount:J.length},title_phrase:"merge_posts",error_phrase:"error_loading_merge_form",success:function(M){D(".inlinemod-mergeposts-dialog").removeClass("loading");D(".dialog-content .message",L).html(M).find("[placeholder]").placeholder();L.dialog("option","position",{of:window});D("select",L).selectBox();vBulletin.contentEntryBox.init();var N=D(".js-content-entry form",L).data("content-type");D("body").trigger(N+"_editform_onload",[L,function(){}])}})};vBulletin.inlinemod.copyPosts=function(){var K=this,J=F(D(K));if(J.length==0){A("copy_posts");return }var L=openConfirmDialog({title:vBulletin.phrase.get("copy_posts"),message:vBulletin.phrase.get("loading")+"...",width:500,dialogClass:"inlinemod-copyposts-dialog loading",buttonLabel:{yesLabel:vBulletin.phrase.get("copy_posts"),noLabel:vBulletin.phrase.get("cancel")},onClickYes:function(){var N=L.find(".copy-posts-form");var O=N.find("input:radio[name=type]:checked").val()||0;var M={newtitle:N.find(':input[name="title"]').val(),to_parent:(O==0)?N.find(':input[name="destchannelid"]').val():N.find(':input[name="mergethreadurl"]').val().replace(pageData.baseurl+"/",""),nodeids:J};vBulletin.AJAX({url:vBulletin.normalizeAjaxUrl(N.attr("action")),cpaction:true,data:M,type:N.attr("method"),title_phrase:"copy_posts",error_phrase:"error_copying_posts",success:function(P){D.cookie(B,null,{path:pageData.cookie_path,domain:pageData.cookie_domain});if(H=="thread"){if(D.isPlainObject(P)){var Q=0;D.each(P,function(S,T){if(D(".js-post[data-node-id={0}]".format(S)).hasClass("js-conversation-starter")){Q=T;return false}});if(!Q){D.each(P,function(S,T){Q=T;return false})}vBulletin.AJAX({call:"/ajax/api/route/getNodeUrl",data:{nodeid:Q},success:function(S){location.href=pageData.baseurl+S}})}}else{var R=D(".filter-wrapper",D(K).parents(".conversation-toolbar")).data("object-instance");if(R&&typeof R.applyFilters=="function"){R.forceApplyFilters()}else{location.reload()}}}})}});vBulletin.AJAX({call:"/ajax/render/inlinemod_copyPosts",data:{postcount:J.length,deleteposts:1,removeposts:1,firstpost:1},title_phrase:"copy_posts",error_phrase:"error_loading_copy_posts_form",success:function(M){D(".inlinemod-copyposts-dialog").removeClass("loading");D(".dialog-content .message",L).html(M).find("[placeholder]").placeholder();L.dialog("option","position",{of:window});D("select",L).selectBox()}})};vBulletin.inlinemod.mergeThreads=function(){var M=this,L=G(),N="merge_threads_ginlinemod";if(L.length<2){var J=(L.length==1?"not_much_would_be_accomplished_by_merging":"you_did_not_select_any_valid_threads");vBulletin.warning(N,J);return }var K=openConfirmDialog({title:vBulletin.phrase.get(N),message:vBulletin.phrase.get("loading")+"...",width:500,dialogClass:"inlinemod-merge-dialog loading",buttonLabel:{yesLabel:vBulletin.phrase.get("merge_threads_ginlinemod"),noLabel:vBulletin.phrase.get("cancel")},onClickYes:function(){var Q=K.find(".merge-threads-form");var P={};if(Q.find("input[name=enableredirect]").prop("checked")){P.redirect=Q.find("#rb_redirect_perm").prop("checked")?"perm":"expires";if(P.redirect=="expires"){P.period=Q.find("select[name=period]").val();P.frame=Q.find("select[name=frame]").val()}console.log("Redirect data compiled:");console.dir(P)}var O={targetnodeid:Q.find('select[name="targetnodeid"]').val(),nodeids:L,leaveRedirectData:P};vBulletin.AJAX({url:vBulletin.normalizeAjaxUrl(Q.attr("action")),cpaction:true,data:O,type:Q.attr("method"),title_phrase:N,error_phrase:"error_merging_threads",success:function(R){D.cookie(B,null,{path:pageData.cookie_path,domain:pageData.cookie_domain});var S=D(".filter-wrapper",D(M).parents(".conversation-toolbar")).data("object-instance");if(S&&typeof S.applyFilters=="function"){S.forceApplyFilters()}else{location.reload()}}})}});vBulletin.AJAX({call:"/ajax/render/inlinemod_mergeThreads",data:{postcount:L.length,nodeids:L},success:function(O){D(".inlinemod-merge-dialog").removeClass("loading");D(".dialog-content .message",K).html(O).find("[placeholder]").placeholder();K.dialog("option","position",{of:window});D("select",K).selectBox()}})};vBulletin.inlinemod.manage_deleted_form=function(K){var L=D(this),N=(K)?K:L.parents(".js-post").attr("data-node-id");var M=openConfirmDialog({title:(K)?vBulletin.phrase.get("manage_content"):vBulletin.phrase.get("manage_deleted"),message:vBulletin.phrase.get("loading")+"...",width:510,dialogClass:"inlinemod-delete-dialog loading",buttonLabel:{yesLabel:vBulletin.phrase.get("save"),noLabel:vBulletin.phrase.get("cancel")},onClickYes:function(){var O=M.find(".manage-deleted-form");vBulletin.AJAX({url:vBulletin.normalizeAjaxUrl(O.attr("action")),cpaction:true,data:{nodeid:N,params:{deletetype:O.find("input:radio[name=deletetype]:checked").val()||0,reason:O.find(":input[name=deletereason]").val(),prefixid:O.find("select[name=prefixid]").val()||0,topictitle:O.find("input:text[name=topic_title]").val()||"",moderator_notes:O.find("textarea[name=moderator_notes]").val()||"",post_icon:O.find("input:radio[name=iconid]:checked").val()||0,keep_attachments:(O.find("input:checkbox[name=keep_attachments]:checked").val())?1:0,option_open:(O.find("input:checkbox[name=topicopen]:checked").val())?1:0,option_sticky:(O.find("input:checkbox[name=topicsticky]:checked").val())?1:0,option_visible:(O.find("input:checkbox[name=topicvisible]:checked").val())?1:0}},success:function(P){D.cookie(B,null,{path:pageData.cookie_path,domain:pageData.cookie_domain});var Q=D(".conversation-toolbar .filter-wrapper",D(L).parents(".inlinemod-container")).data("object-instance");if(Q&&typeof Q.applyFilters=="function"){Q.forceApplyFilters()}else{location.reload()}},title_phrase:"error",error_phrase:"error_moderating_post",element:L})}});vBulletin.AJAX({call:"/ajax/render/inlinemod_manage_deleted",data:{nodeid:N,isblogcomment:(L.parents(".js-comments--blog").length==1)?1:0,isarticlecomment:(L.parents(".js-comments--article").length==1)?1:0},success:function(O){D(".inlinemod-delete-dialog").removeClass("loading");D(".dialog-content .message",M).html(O).find("[placeholder]").placeholder();M.dialog("option","position",{of:window});D(document).off("click",".manage-deleted-form input:radio[name=deletetype]").on("click",".manage-deleted-form input:radio[name=deletetype]",J);J()}});function J(){var O=D(".manage-deleted-form"),P=D(".manage-deleted-form input:radio[name=deletetype]:checked").val();if(P){D("input:checkbox[name=keep_attachments]",O).prop("disabled",P!=1);D("input:checkbox[name=topicopen]",O).prop("disabled",P!=2);D("input:checkbox[name=topicsticky]",O).prop("disabled",P!=2);D("input:checkbox[name=topicvisible]",O).prop("disabled",P!=2)}O.find("select.prefixid").selectBox()}};vBulletin.inlinemod.editTopic=function(){var J=D(this).attr("data-node-id");vBulletin.inlinemod.manage_deleted_form(J)};vBulletin.inlinemod.removeRedirect=function(){var J=D(this).attr("data-node-id");vBulletin.AJAX({call:"/ajax/api/content_redirect/removeRedirectsFromNode",data:{nodeid:J},success:function(K){vBulletin.alert("remove_redirects","thread_redirects_removed")}})};vBulletin.inlinemod.selectAll=function(){E(D(this),true,"")};vBulletin.inlinemod.selectNone=function(){vBulletin.inlinemod.clear.apply(this)};vBulletin.inlinemod.selectClass=function(J){E(D(this),true,"."+J)};vBulletin.inlinemod.invertSelection=function(){D(".inlinemod-item .cb_inlinemod",D(this).parents(".inlinemod-container")).each(function(){var J=D(this);J.prop("checked",!J.prop("checked"));C(J)})};vBulletin.inlinemod.clear=function(){var J=D(this).parents(".inlinemod-container");D(".inlinemod-item .cb_inlinemod:checked",J).each(function(){D(this).prop("checked",false).closest(".inlinemod-item").removeClass("inlinemod_highlight")});D(".cb_inlinemod_main",J).prop("checked",false);D.cookie(B,null,{path:pageData.cookie_path,domain:pageData.cookie_domain})};var E=function(J,K,L){D(".inlinemod-item"+L+" .cb_inlinemod",J.parents(".inlinemod-container")).each(function(){var M=D(this);M.prop("checked",K);C(M)})};var C=function(K){var N=K.val(),M=G();if(K.prop("checked")){K.closest(".inlinemod-item").addClass("inlinemod_highlight");if(D.inArray(N,M)==-1){M.push(N)}var L=D(".inlinemod-item .cb_inlinemod",I);if(L.length==L.filter(":checked").length){D(".cb_inlinemod_main",I).prop("checked",true)}}else{K.closest(".inlinemod-item").removeClass("inlinemod_highlight");var O=new Array();for(var J=0;J<M.length;J++){if(M[J]!=N){O.push(M[J])}}M=O;D(".cb_inlinemod_main",I).prop("checked",false)}cookie_str=M.join(",");D.cookie(B,cookie_str,{path:pageData.cookie_path,domain:pageData.cookie_domain})};vBulletin.inlinemod.markRead=function(){var J=D(this).closest(".channel-content-widget").attr("data-node-id");vBulletin.markchannelsread(J,{success:function(){location.reload()}})};vBulletin.inlinemod.init=function(J){J=(J instanceof D)?J:D(J);if(J.length==0){J=D("body")}I=J.hasClass("inlinemod-container")?J:D(".inlinemod-container",J);H=D(".moderationmenu_container",I).attr("data-view");B=pageData.cookie_prefix+pageData.inlinemod_cookie_name+"_"+H;var L=G();if(L.length>0){var M=0;var K=D(".inlinemod-item .cb_inlinemod",I).each(function(){if(D.inArray(this.value,L)!=-1){M++;D(this).prop("checked",true);D(this).closest(".inlinemod-item").addClass("inlinemod_highlight")}});D(".cb_inlinemod_main",I).prop("checked",(M>0&&M==K.length))}vBulletin.inlinemod.addAttachClassToPost(J)};vBulletin.inlinemod.addAttachClassToPost=function(J){J=(J instanceof D)?J:D(J);if(J.length==0){J=D("body")}D(".inlinemod-container .inlinemod-item",J).each(function(){var K=D(this);if(K.hasClass("list-item-gallery")){K.addClass("im-attach")}else{var N=D(".conversation-body .post-content",this);var M=D("img",N);var O=D(".bbcode_container img",N);if(M.length>0&&M.length!=O.length){K.addClass("im-attach")}else{var P=D("iframe.restrain",N);var L=D(".bbcode_container iframe.restrain",N);if(P.length>0&&P.length!=L.length){K.addClass("im-attach")}}}})};function A(J){vBulletin.warning(J,"please_select_at_least_one_post")}function F(J){var K=J.attr("data-node-id");if(K){return[K]}return G()}function G(){var K=D.cookie(B),J=[];if(K){J=K.split(",")}return J}var B,H,I;D(document).ready(function(){I=D(".inlinemod-container");if(!B){if(I.is(":visible")){vBulletin.inlinemod.init(I)}else{B=pageData.cookie_prefix+pageData.inlinemod_cookie_name}}D(".inlinemod-container .cb_inlinemod_main").off("click mouseover").on("click",function(){vBulletin.inlinemod[this.checked?"selectAll":"selectNone"].apply(this)}).on("mouseover",function(){this.title=(this.checked)?D(this).attr("data-title-unselect"):D(this).attr("data-title-select")});D(".inlinemod-container").off("click",".inlinemod-item input.cb_inlinemod").on("click",".inlinemod-item input.cb_inlinemod",function(K){C(D(this))});function J(){var K;var L=true;D(".moderationmenu_container .moderation-mainmenu .mainmenu").not(".js-comp-menu-dropdown").off("mouseenter mouseleave").on("mouseenter",function(M){var N=D(this);if(D(".toolbar-filter-overlay",N.closest(".conversation-toolbar-wrapper")).is(":visible")){D(".toolbar-filter",N.closest(".conversation-toolbar")).triggerHandler("click",[0])}K=setTimeout(function(){N.removeClass("pos-top").addClass("hover").closest(".moderation-mainmenu").find(".mainmenu .submenu").hide().css("top","");var T={},Q=D(".submenu",N).show();if(L&&Q.find("li").length>10){L=false;var R=Q.find("li").outerWidth();var U=Q.find("li").outerHeight()+1;var V=Q.find("li.col1").length;Q.addClass("splitmenu");Q.find("li").css("width",R);Q.find("li.col1").css("margin-"+pageData.textDirRight,R);Q.find("li.col2").css("margin-"+pageData.textDirLeft,R+1);var O=-(U*V);Q.find("li.col2").each(function(X,Y){D(Y).css("margin-top",(O+(X*U)))});Q.find("li.col2").first().css("border-top-color","transparent")}if(!vBulletin.isScrolledIntoView(Q,T)){var P=D(document).height()-D(window).height(),W=D(document).scrollTop(),S=Math.abs(T.bottom);if(S<=(P-W)){D("html,body").animate({scrollTop:"+="+(W+S)},"slow")}else{Q.css("top",-(Q.height()+1)).parent().addClass("pos-top");if(!vBulletin.isScrolledIntoView(Q,T)){D("html,body").animate({scrollTop:"-="+Math.abs(T.top)},"slow")}}}},200)}).on("mouseleave",function(M){clearTimeout(K);D(".submenu",this).hide();D(this).removeClass("hover")})}vBulletin.inlinemod.initModMenuHover=J;J();D(".moderationmenu_container .moderation-action a[data-action],.js-markread").off("click").on("click",function(O){O.stopPropagation();D(this).closest(".js-comp-menu-dropdown").removeClass("b-comp-menu-dropdown--open");var M=I.find(".list-item-body-wrapper.edit-post .edit-conversation-container");if(M.length>0){vBulletin.warning("edit_conversation","you_have_a_pending_edit_unsaved",function(){vBulletin.animateScrollTop(M.closest(".list-item").offset().top,{duration:"slow"})});return false}var K=D(this).attr("data-action");if(!K){console.warn("Unable to find the inline moderation function name.");return false}var N=vBulletin.inlinemod[K];if(typeof N=="function"){var L=D(this).attr("data-params");L=L?L.split(","):[];N.apply(this,L)}else{console.warn('Unable to find the inline moderation function "{0}". Please ensure that it is defined in inlinemod.js.'.format("vBulletin.inlinemod."+K))}return false});D(".conversation-content-widget").off("click",".conversation-status-message .close").on("click",".conversation-status-message .close",function(){D(this).parent().fadeOut("slow")});return false})})(jQuery);