From e01410c13b0cbb46d177d3602189bce90065cf87 Mon Sep 17 00:00:00 2001 From: Kyle Phillips Date: Sat, 13 Dec 2014 15:51:15 -0500 Subject: [PATCH] Added new page count to submit button. --- assets/js/lib/nestedpages.js | 2 +- assets/js/nestedpages.min.js | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/assets/js/lib/nestedpages.js b/assets/js/lib/nestedpages.js index 239c455b..5a9f025d 100644 --- a/assets/js/lib/nestedpages.js +++ b/assets/js/lib/nestedpages.js @@ -1265,7 +1265,7 @@ jQuery(function($){ var count = $(form).find($('.new-child-row')).length; if ( count > 0 ){ $(form).find('h3 strong').text(nestedpages.add_child_pages); - $(form).find('.np-save-newchild').text(nestedpages.add_pages); + $(form).find('.np-save-newchild').text(nestedpages.add_pages + ' (' + count + ')'); } else { $(form).find('h3 strong').text(nestedpages.add_child); $(form).find('.np-save-newchild').text(nestedpages.add_page); diff --git a/assets/js/nestedpages.min.js b/assets/js/nestedpages.min.js index 1baebca8..acfe2ef9 100644 --- a/assets/js/nestedpages.min.js +++ b/assets/js/nestedpages.min.js @@ -1 +1 @@ -jQuery(function(t){function a(){var a=t(".nplist");t(".page-row").removeClass("no-border"),t.each(a,function(){t(this).find(".page-row:visible:first").addClass("no-border")})}function e(a){var e=t(a.placeholder).parents("ol").length,i=t(".sortable").width(),s=40*e-40,r=i-s;t(a.placeholder).width(r).css("margin-left",s+"px"),n(a)}function n(a){var e=t(a.placeholder).parent("ol");t(e).is(":visible")||t(e).show()}function s(){t(".child-toggle").each(function(){var a=t(this).parent(".row").parent("li");if(t(a).children("ol").length>0){var e=t(a).children("ol:visible").length>0?"np-icon-arrow-down":"np-icon-arrow-right";t(this).html('')}else t(this).empty()})}function r(){t("#np-error").hide(),t("#nested-loading").show();var a=t(".np-sync-menu").is(":checked")?"sync":"nosync";list=t("ol.sortable").nestedSortable("toHierarchy",{startDepthCount:0}),t.ajax({url:ajaxurl,type:"post",datatype:"json",data:{action:"npsort",nonce:nestedpages.np_nonce,list:list,syncmenu:a},success:function(a){"error"===a.status?(t("#np-error").text(a.message).show(),t("#nested-loading").hide()):t("#nested-loading").hide()}})}function d(a){t.ajax({url:ajaxurl,type:"post",datatype:"json",data:{action:"npsyncmenu",nonce:nestedpages.np_nonce,syncmenu:a},success:function(t){"error"===t.status&&alert("There was an error saving the sync setting.")}})}function o(a){var e={id:t(a).attr("data-id"),title:t(a).attr("data-title"),slug:t(a).attr("data-slug"),author:t(a).attr("data-author"),cs:t(a).attr("data-commentstatus"),status:t(a).attr("data-status"),template:t(a).attr("data-template"),month:t(a).attr("data-month"),day:t(a).attr("data-day"),year:t(a).attr("data-year"),hour:t(a).attr("data-hour"),minute:t(a).attr("data-minute"),navstatus:t(a).attr("data-navstatus"),npstatus:t(a).attr("data-np-status"),navtitle:t(a).attr("data-navtitle"),navtitleattr:t(a).attr("data-navtitleattr"),navcss:t(a).attr("data-navcss"),linktarget:t(a).attr("data-linktarget"),password:t(a).attr("data-password")},n=t(a).closest(".row").parent("li");e.h_taxonomies=[],e.f_taxonomies=[];var s=t(n).attr("class").split(/\s+/);for(i=0;i0)var r=t(n).children("ol"),d=t(".quick-edit-form").clone().insertBefore(r);else var d=t(".quick-edit-form").clone().appendTo(n);t(d).siblings(".row").hide();l(d,e)}function l(a,e){if(t(a).find(".page_id").html("Page ID: "+e.id),t(a).find(".np_id").val(e.id),t(a).find(".np_title").val(e.title),t(a).find(".np_slug").val(e.slug),t(a).find(".np_author select").val(e.author),t(a).find(".np_template").val(e.template),t(a).find(".np_status").val(e.status),t(a).find(".np_nav_title").val(e.navtitle),t(a).find(".np_title_attribute").val(e.navtitleattr),t(a).find(".np_nav_css_classes").val(e.navcss),t(a).find(".post_password").val(e.password),"open"===e.cs&&t(a).find(".np_cs").prop("checked","checked"),"private"===e.status&&(t(a).find(".post_password").prop("readonly",!0),t(a).find(".keep_private").prop("checked",!0)),"hide"===e.npstatus?t(a).find(".np_status").prop("checked","checked"):t(a).find(".np_status").removeAttr("checked"),"hide"===e.navstatus?t(a).find(".np_nav_status").prop("checked","checked"):t(a).find(".np_nav_status").removeAttr("checked"),"_blank"===e.linktarget?t(a).find(".link_target").prop("checked","checked"):t(a).find(".link_target").removeAttr("checked"),"private"===e.status&&t(a).find(".np_status").val("publish"),t(a).find('select[name="mm"]').val(e.month),t(a).find('input[name="jj"]').val(e.day),t(a).find('input[name="aa"]').val(e.year),t(a).find('input[name="hh"]').val(e.hour),t(a).find('input[name="mn"]').val(e.minute),e.hasOwnProperty("h_taxonomies")){var n=e.h_taxonomies;for(i=0;i'),setTimeout(function(){t(".np-inline-overlay").addClass("active")},50)}function m(){t(".np-inline-overlay").removeClass("active").remove()}function g(a){t(".np-quickedit-error").hide();var e=t(".np-sync-menu").is(":checked")?"sync":"nosync";t.ajax({url:ajaxurl,type:"post",datatype:"json",data:t(a).serialize()+"&action=npquickedit&nonce="+nestedpages.np_nonce+"&syncmenu="+e,success:function(e){"error"===e.status?(x(a),t(a).find(".np-quickedit-error").text(e.message).show()):(x(a),_(a,e.post_data),C(a))}})}function _(a,e){var n=t(a).parent(".quick-edit").siblings(".row");t(n).find(".title").text(e.post_title);var i=t(n).find(".status");if(t(i).text("publish"!==e._status&&"future"!==e._status?"("+e._status+")":"private"===e.keep_private?"("+e.keep_private+")":""),""!==e.post_password){var s=t(i).text();s+=' ',t(i).html(s)}var r=t(n).find(".nav-status");t(r).text("hide"==e.nav_status?"(Hidden)":"");var d=t(n).parent("li");"hide"==e.np_status?(t(d).addClass("np-hide"),t(n).find(".status").after('')):(t(d).removeClass("np-hide"),t(n).find(".np-icon-eye-blocked").remove());var o=t(n).find(".np-quick-edit");t(o).attr("data-id",e.post_id),t(o).attr("data-template",e.page_template),t(o).attr("data-title",e.post_title),t(o).attr("data-slug",e.post_name),t(o).attr("data-commentstatus",e.comment_status),t(o).attr("data-status",e._status),"private"===e.keep_private&&t(o).attr("data-status","private"),t(o).attr("data-author",e.post_author),t(o).attr("data-np-status",e.np_status),t(o).attr("data-password",e.post_password),t(o).attr("data-navstatus",e.nav_status),t(o).attr("data-navtitle",e.np_nav_title),t(o).attr("data-linktarget",e.link_target),t(o).attr("data-navtitleattr",e.np_title_attribute),t(o).attr("data-navcss",e.np_nav_css_classes),t(o).attr("data-month",e.mm),t(o).attr("data-day",e.jj),t(o).attr("data-year",e.aa),t(o).attr("data-hour",e.hh),t(o).attr("data-minute",e.mn),k(d),w(d,e),b(d,e),y(d,e)}function k(a){taxonomies=[];var e=t(a).attr("class").split(/\s+/);for(i=0;i0)var i=t(n).children("ol"),s=t(".quick-edit-form-redirect").clone().insertBefore(i);else var s=t(".quick-edit-form-redirect").clone().appendTo(n);t(s).siblings(".row").hide();t(s).show(),j(s,e)}function j(a,e){t(a).find(".np_id").val(e.id),t(a).find(".np_title").val(e.title),t(a).find(".np_author select").val(e.author),t(a).find(".np_status").val(e.status),t(a).find(".np_content").val(e.url),t(a).find(".np_parent_id").val(e.parentid),t(a).find(".np_title_attribute").val(e.navtitleattr),t(a).find(".np_nav_css_classes").val(e.navcss),"hide"===e.npstatus?t(a).find(".np_status").prop("checked","checked"):t(a).find(".np_status").removeAttr("checked"),"hide"===e.navstatus?t(a).find(".np_nav_status").prop("checked","checked"):t(a).find(".np_nav_status").removeAttr("checked"),"_blank"===e.linktarget?t(a).find(".link_target").prop("checked","checked"):t(a).find(".link_target").removeAttr("checked"),f(),t(a).show()}function D(a){t(".np-quickedit-error").hide();var e=t(".np-sync-menu").is(":checked")?"sync":"nosync";t.ajax({url:ajaxurl,type:"post",datatype:"json",data:t(a).serialize()+"&action=npquickeditredirect&nonce="+nestedpages.np_nonce+"&syncmenu="+e,success:function(e){"error"===e.status?(x(a),t(a).find(".np-quickedit-error").text(e.message).show()):(x(a),T(a,e.post_data),C(a))},error:function(){x(a),t(a).find(".np-quickedit-error").text("The form could not be saved at this time.").show()}})}function T(a,e){var n=t(a).parent(".quick-edit").siblings(".row");t(n).find(".title").html(e.post_title+' ');var i=t(n).find(".status");t(i).text("publish"!==e._status&&"future"!==e._status?"("+e._status+")":"");var s=t(n).find(".nav-status");t(s).text("hide"==e.nav_status?"(Hidden)":"");var r=t(n).parent("li");"hide"==e.np_status?(t(r).addClass("np-hide"),t(n).find(".status").after('')):(t(r).removeClass("np-hide"),t(n).find(".np-icon-eye-blocked").remove());var d=t(n).find(".np-quick-edit-redirect");t(d).attr("data-id",e.post_id),t(d).attr("data-title",e.post_title),t(d).attr("data-url",e.post_content),t(d).attr("data-status",e._status),t(d).attr("data-navstatus",e.nav_status),t(d).attr("data-np-status",e.np_status),t(d).attr("data-linktarget",e.link_target),t(d).attr("data-navtitleattr",e.np_title_attribute),t(d).attr("data-navcss",e.np_nav_css_classes)}function A(){t(".np-link-loading").hide(),t(".np-save-link").removeAttr("disabled")}function P(){t(".np-new-link-error").hide();var a=t(".np-new-link-form").serialize(),e=t(".np-sync-menu").is(":checked")?"sync":"nosync";t.ajax({url:ajaxurl,type:"post",datatype:"json",data:a+"&action=npnewredirect&nonce="+nestedpages.np_nonce+"&syncmenu="+e,success:function(a){"error"===a.status?(A(),t(".np-new-link-error").text(a.message).show()):(A(),I(a.post_data))}})}function I(a){var e='","0"===a.parent_id?t(".nplist:first li:first").after(e):O(e,a),t("#np-link-modal").modal("hide");var n=t("#menuItem_"+a.id).find(".row");z(n)}function O(a,e){var n=t("#menuItem_"+e.parent_id);0===t(n).children("ol").length?(a='
    '+a+"
",t(n).append(a)):t(n).find("ol:first").prepend(a),s(),B()}function z(e){t(e).addClass("np-updated"),a(),setTimeout(function(){t(e).addClass("np-updated-show")},1500)}function H(){var a=[],e=t(".page-row:visible");return t.each(e,function(){var e=t(this).attr("id");a.push(e.replace("menuItem_",""))}),a}function B(){var a=H();t.ajax({url:ajaxurl,type:"post",datatype:"json",data:{action:"npnesttoggle",nonce:nestedpages.np_nonce,ids:a},success:function(t){"success"!==t.status&&console.log("There was an error saving toggled pages.")}})}function E(){t(".np-newchild-error").hide(),m(),t(".sortable .new-child").remove(),t(".row").show()}function S(a){var e=t(a).closest(".row").parent("li");if(t(e).children("ol").length>0)var n=t(e).children("ol"),i=t(".new-child-form").clone().insertBefore(n);else var i=t(".new-child-form").clone().appendTo(e);t(i).siblings(".row").hide();f(),t(i).find(".parent_name").html("Parent: "+t(a).attr("data-parentname")),t(i).find(".page_parent_id").val(t(a).attr("data-id")),t(i).show()}function Q(a){{var e='
  • ';t(a).siblings(".new-page-titles").append(e)}t(".new-page-titles").sortable({items:"li",handle:".handle"})}function F(a){var e=t(a).find(t(".new-child-row")).length;e>0?(t(a).find("h3 strong").text(nestedpages.add_child_pages),t(a).find(".np-save-newchild").text(nestedpages.add_pages)):(t(a).find("h3 strong").text(nestedpages.add_child),t(a).find(".np-save-newchild").text(nestedpages.add_page))}function G(a){t(".np-quickedit-error").hide();var e=t(".np-sync-menu").is(":checked")?"sync":"nosync";t.ajax({url:ajaxurl,type:"post",datatype:"json",data:t(a).serialize()+"&action=npnewchild&nonce="+nestedpages.np_nonce+"&syncmenu="+e,success:function(e){"error"===e.status?(x(a),t(a).find(".np-quickedit-error").text(e.message).show()):(x(a),J(a,e))},error:function(){x(a),t(a).find(".np-quickedit-error").text("The form could not be saved at this time.").show()}})}function J(a,e){var n=e.new_pages,r=t(a).parent(".new-child").parent(".page-row");0===t(r).children("ol").length&&t(r).append('
      ');var d=t(r).children("ol");for(i=0;i',n+=''+e.title+"",n+="Publish"!==e.status?'('+e.status+")":'',n+='Edit',n+="",n+='",n+="",n+="",t(a).append(n)}t(document).ready(function(){s(),a()}),t(document).on("click",".child-toggle a",function(e){e.preventDefault();var n=t(this).parent(".child-toggle").parent(".row").siblings("ol");t(this).find("i").toggleClass("np-icon-arrow-down").toggleClass("np-icon-arrow-right"),t(n).toggle(),a(),B()}),t(document).on("click",".nestedpages-toggleall a",function(e){e.preventDefault(),"closed"==t(this).attr("data-toggle")?(t(".nestedpages ol li ol").show(),t(this).attr("data-toggle","opened"),t(this).text(nestedpages.collapse_text),t(".child-toggle i").removeClass("np-icon-arrow-right").addClass("np-icon-arrow-down"),v(),a()):(t(".nestedpages ol li ol").hide(),t(this).attr("data-toggle","closed"),t(this).text(nestedpages.expand_text),t(".child-toggle i").removeClass("np-icon-arrow-down").addClass("np-icon-arrow-right"),v(),a()),B()}),t(document).on("click",".np-toggle-hidden",function(e){e.preventDefault();var n=t(this).attr("href");"show"===n?(t(this).attr("href","hide"),t(this).text(nestedpages.show_hidden),t(".np-hide").removeClass("shown").hide(),a()):(t(this).attr("href","show"),t(this).text(nestedpages.hide_hidden),t(".np-hide").addClass("shown").show(),a())}),t(".np-tabs a").on("click",function(a){a.preventDefault(),t(".np-tabs a").removeClass("active"),t(this).addClass("active");var e=t(this).attr("href");t(".np-tabbed-content").hide(),t(e).show()}),t(document).on("click",".np-toggle-publish",function(a){a.preventDefault();var e=t(this).attr("href");t(".np-toggle-publish").removeClass("active"),t(this).addClass("active"),"#published"==e?(t(".nplist .page-row").hide(),t(".nplist .published").show()):t(".nplist .page-row").show()}),t(document).on("click",".np-toggle-edit",function(a){a.preventDefault();var e=t(this).siblings(".action-buttons");t(e).is(":visible")?(t(this).removeClass("active"),t(e).hide()):(t(this).addClass("active"),t(e).show())});var L=function(){var t=0;return function(a,e){clearTimeout(t),t=setTimeout(a,e)}}();t(window).resize(function(){L(function(){t(".action-buttons").removeAttr("style"),t(".np-toggle-edit").removeClass("active")},500)}),t(document).ready(function(){t(".sortable").not(".no-sort").nestedSortable({items:"li",toleranceElement:"> .row",handle:".handle",placeholder:"ui-sortable-placeholder",start:function(t,a){a.placeholder.height(a.item.height())},sort:function(t,a){e(a)},stop:function(){setTimeout(function(){s(),a()},100),r()},update:function(){}})}),t(document).ready(function(){"1"===nestedpages.syncmenu&&d("sync")}),t(".np-sync-menu").on("change",function(){var a=t(this).is(":checked")?"sync":"nosync";d(a)}),t(document).on("click",".np-quick-edit",function(a){a.preventDefault(),v(),o(t(this))}),t(document).on("click",".np-inline-overlay",function(){v(),E()}),t(document).on("click",".np-cancel-quickedit",function(a){var e=t(this).parents(".page-row");v(e),a.preventDefault()}),t(document).on("click",".np-save-quickedit",function(a){a.preventDefault(),t(".row").removeClass("np-updated").removeClass("np-updated-show");var e=t(this).parents("form");t(this).attr("disabled","disabled"),t(e).find(".np-qe-loading").show(),g(e)}),t(document).on("click",".np-toggle-taxonomies",function(a){t(this).parents("form").find(".np-taxonomies").toggle(),a.preventDefault()}),t(document).on("click",".np-toggle-menuoptions",function(a){a.preventDefault(),t(this).parents("form").find(".np-menuoptions").toggle()}),t(document).on("change",".keep_private",function(){this.checked?t(".post_password").val("").prop("readonly",!0):t(".post_password").prop("readonly",!1)}),t(document).on("click",".np-quick-edit-redirect",function(a){a.preventDefault(),v(),q(t(this))}),t(document).on("click",".np-save-quickedit-redirect",function(a){a.preventDefault(),t(".row").removeClass("np-updated").removeClass("np-updated-show");var e=t(this).parents("form");t(this).attr("disabled","disabled"),t(e).find(".np-qe-loading").show(),D(e)}),t(document).on("click",".open-redirect-modal",function(a){a.preventDefault();var e=t(this).attr("data-parentid");t("#np-link-modal").find("input").val(""),t("#np-link-modal .parent_id").val(e),t("#np-add-link-title").text("0"===e?nestedpages.add_link:nestedpages.add_child_link),t("#np-link-modal").modal("show")}),t(document).on("click",".np-save-link",function(a){a.preventDefault(),t(".np-new-link-error").hide(),t(".np-link-loading").show(),t(this).attr("disabled","disabled"),P()}),t(document).on("click",".np-cancel-newchild",function(t){t.preventDefault(),E()}),t(document).on("click",".add-new-child",function(a){a.preventDefault(),S(t(this))}),t(document).on("click",".add-new-child-row",function(a){a.preventDefault(),Q(t(this));var e=t(this).parents("form");F(e)}),t(document).on("click",".np-remove-child",function(a){a.preventDefault();var e=t(this).parents("form");t(this).parents(".new-child-row").parent("li").remove(),F(e)}),t(document).on("click",".np-save-newchild",function(a){a.preventDefault(),t(this).prop("disabled","disabled");var e=t(this).parents("form");t(e).find(".np-qe-loading").show(),G(e)})}); \ No newline at end of file +jQuery(function(t){function a(){var a=t(".nplist");t(".page-row").removeClass("no-border"),t.each(a,function(){t(this).find(".page-row:visible:first").addClass("no-border")})}function e(a){var e=t(a.placeholder).parents("ol").length,i=t(".sortable").width(),s=40*e-40,r=i-s;t(a.placeholder).width(r).css("margin-left",s+"px"),n(a)}function n(a){var e=t(a.placeholder).parent("ol");t(e).is(":visible")||t(e).show()}function s(){t(".child-toggle").each(function(){var a=t(this).parent(".row").parent("li");if(t(a).children("ol").length>0){var e=t(a).children("ol:visible").length>0?"np-icon-arrow-down":"np-icon-arrow-right";t(this).html('')}else t(this).empty()})}function r(){t("#np-error").hide(),t("#nested-loading").show();var a=t(".np-sync-menu").is(":checked")?"sync":"nosync";list=t("ol.sortable").nestedSortable("toHierarchy",{startDepthCount:0}),t.ajax({url:ajaxurl,type:"post",datatype:"json",data:{action:"npsort",nonce:nestedpages.np_nonce,list:list,syncmenu:a},success:function(a){"error"===a.status?(t("#np-error").text(a.message).show(),t("#nested-loading").hide()):t("#nested-loading").hide()}})}function d(a){t.ajax({url:ajaxurl,type:"post",datatype:"json",data:{action:"npsyncmenu",nonce:nestedpages.np_nonce,syncmenu:a},success:function(t){"error"===t.status&&alert("There was an error saving the sync setting.")}})}function o(a){var e={id:t(a).attr("data-id"),title:t(a).attr("data-title"),slug:t(a).attr("data-slug"),author:t(a).attr("data-author"),cs:t(a).attr("data-commentstatus"),status:t(a).attr("data-status"),template:t(a).attr("data-template"),month:t(a).attr("data-month"),day:t(a).attr("data-day"),year:t(a).attr("data-year"),hour:t(a).attr("data-hour"),minute:t(a).attr("data-minute"),navstatus:t(a).attr("data-navstatus"),npstatus:t(a).attr("data-np-status"),navtitle:t(a).attr("data-navtitle"),navtitleattr:t(a).attr("data-navtitleattr"),navcss:t(a).attr("data-navcss"),linktarget:t(a).attr("data-linktarget"),password:t(a).attr("data-password")},n=t(a).closest(".row").parent("li");e.h_taxonomies=[],e.f_taxonomies=[];var s=t(n).attr("class").split(/\s+/);for(i=0;i0)var r=t(n).children("ol"),d=t(".quick-edit-form").clone().insertBefore(r);else var d=t(".quick-edit-form").clone().appendTo(n);t(d).siblings(".row").hide();l(d,e)}function l(a,e){if(t(a).find(".page_id").html("Page ID: "+e.id),t(a).find(".np_id").val(e.id),t(a).find(".np_title").val(e.title),t(a).find(".np_slug").val(e.slug),t(a).find(".np_author select").val(e.author),t(a).find(".np_template").val(e.template),t(a).find(".np_status").val(e.status),t(a).find(".np_nav_title").val(e.navtitle),t(a).find(".np_title_attribute").val(e.navtitleattr),t(a).find(".np_nav_css_classes").val(e.navcss),t(a).find(".post_password").val(e.password),"open"===e.cs&&t(a).find(".np_cs").prop("checked","checked"),"private"===e.status&&(t(a).find(".post_password").prop("readonly",!0),t(a).find(".keep_private").prop("checked",!0)),"hide"===e.npstatus?t(a).find(".np_status").prop("checked","checked"):t(a).find(".np_status").removeAttr("checked"),"hide"===e.navstatus?t(a).find(".np_nav_status").prop("checked","checked"):t(a).find(".np_nav_status").removeAttr("checked"),"_blank"===e.linktarget?t(a).find(".link_target").prop("checked","checked"):t(a).find(".link_target").removeAttr("checked"),"private"===e.status&&t(a).find(".np_status").val("publish"),t(a).find('select[name="mm"]').val(e.month),t(a).find('input[name="jj"]').val(e.day),t(a).find('input[name="aa"]').val(e.year),t(a).find('input[name="hh"]').val(e.hour),t(a).find('input[name="mn"]').val(e.minute),e.hasOwnProperty("h_taxonomies")){var n=e.h_taxonomies;for(i=0;i'),setTimeout(function(){t(".np-inline-overlay").addClass("active")},50)}function m(){t(".np-inline-overlay").removeClass("active").remove()}function g(a){t(".np-quickedit-error").hide();var e=t(".np-sync-menu").is(":checked")?"sync":"nosync";t.ajax({url:ajaxurl,type:"post",datatype:"json",data:t(a).serialize()+"&action=npquickedit&nonce="+nestedpages.np_nonce+"&syncmenu="+e,success:function(e){"error"===e.status?(x(a),t(a).find(".np-quickedit-error").text(e.message).show()):(x(a),_(a,e.post_data),C(a))}})}function _(a,e){var n=t(a).parent(".quick-edit").siblings(".row");t(n).find(".title").text(e.post_title);var i=t(n).find(".status");if(t(i).text("publish"!==e._status&&"future"!==e._status?"("+e._status+")":"private"===e.keep_private?"("+e.keep_private+")":""),""!==e.post_password){var s=t(i).text();s+=' ',t(i).html(s)}var r=t(n).find(".nav-status");t(r).text("hide"==e.nav_status?"(Hidden)":"");var d=t(n).parent("li");"hide"==e.np_status?(t(d).addClass("np-hide"),t(n).find(".status").after('')):(t(d).removeClass("np-hide"),t(n).find(".np-icon-eye-blocked").remove());var o=t(n).find(".np-quick-edit");t(o).attr("data-id",e.post_id),t(o).attr("data-template",e.page_template),t(o).attr("data-title",e.post_title),t(o).attr("data-slug",e.post_name),t(o).attr("data-commentstatus",e.comment_status),t(o).attr("data-status",e._status),"private"===e.keep_private&&t(o).attr("data-status","private"),t(o).attr("data-author",e.post_author),t(o).attr("data-np-status",e.np_status),t(o).attr("data-password",e.post_password),t(o).attr("data-navstatus",e.nav_status),t(o).attr("data-navtitle",e.np_nav_title),t(o).attr("data-linktarget",e.link_target),t(o).attr("data-navtitleattr",e.np_title_attribute),t(o).attr("data-navcss",e.np_nav_css_classes),t(o).attr("data-month",e.mm),t(o).attr("data-day",e.jj),t(o).attr("data-year",e.aa),t(o).attr("data-hour",e.hh),t(o).attr("data-minute",e.mn),k(d),w(d,e),b(d,e),y(d,e)}function k(a){taxonomies=[];var e=t(a).attr("class").split(/\s+/);for(i=0;i0)var i=t(n).children("ol"),s=t(".quick-edit-form-redirect").clone().insertBefore(i);else var s=t(".quick-edit-form-redirect").clone().appendTo(n);t(s).siblings(".row").hide();t(s).show(),j(s,e)}function j(a,e){t(a).find(".np_id").val(e.id),t(a).find(".np_title").val(e.title),t(a).find(".np_author select").val(e.author),t(a).find(".np_status").val(e.status),t(a).find(".np_content").val(e.url),t(a).find(".np_parent_id").val(e.parentid),t(a).find(".np_title_attribute").val(e.navtitleattr),t(a).find(".np_nav_css_classes").val(e.navcss),"hide"===e.npstatus?t(a).find(".np_status").prop("checked","checked"):t(a).find(".np_status").removeAttr("checked"),"hide"===e.navstatus?t(a).find(".np_nav_status").prop("checked","checked"):t(a).find(".np_nav_status").removeAttr("checked"),"_blank"===e.linktarget?t(a).find(".link_target").prop("checked","checked"):t(a).find(".link_target").removeAttr("checked"),f(),t(a).show()}function D(a){t(".np-quickedit-error").hide();var e=t(".np-sync-menu").is(":checked")?"sync":"nosync";t.ajax({url:ajaxurl,type:"post",datatype:"json",data:t(a).serialize()+"&action=npquickeditredirect&nonce="+nestedpages.np_nonce+"&syncmenu="+e,success:function(e){"error"===e.status?(x(a),t(a).find(".np-quickedit-error").text(e.message).show()):(x(a),T(a,e.post_data),C(a))},error:function(){x(a),t(a).find(".np-quickedit-error").text("The form could not be saved at this time.").show()}})}function T(a,e){var n=t(a).parent(".quick-edit").siblings(".row");t(n).find(".title").html(e.post_title+' ');var i=t(n).find(".status");t(i).text("publish"!==e._status&&"future"!==e._status?"("+e._status+")":"");var s=t(n).find(".nav-status");t(s).text("hide"==e.nav_status?"(Hidden)":"");var r=t(n).parent("li");"hide"==e.np_status?(t(r).addClass("np-hide"),t(n).find(".status").after('')):(t(r).removeClass("np-hide"),t(n).find(".np-icon-eye-blocked").remove());var d=t(n).find(".np-quick-edit-redirect");t(d).attr("data-id",e.post_id),t(d).attr("data-title",e.post_title),t(d).attr("data-url",e.post_content),t(d).attr("data-status",e._status),t(d).attr("data-navstatus",e.nav_status),t(d).attr("data-np-status",e.np_status),t(d).attr("data-linktarget",e.link_target),t(d).attr("data-navtitleattr",e.np_title_attribute),t(d).attr("data-navcss",e.np_nav_css_classes)}function A(){t(".np-link-loading").hide(),t(".np-save-link").removeAttr("disabled")}function P(){t(".np-new-link-error").hide();var a=t(".np-new-link-form").serialize(),e=t(".np-sync-menu").is(":checked")?"sync":"nosync";t.ajax({url:ajaxurl,type:"post",datatype:"json",data:a+"&action=npnewredirect&nonce="+nestedpages.np_nonce+"&syncmenu="+e,success:function(a){"error"===a.status?(A(),t(".np-new-link-error").text(a.message).show()):(A(),I(a.post_data))}})}function I(a){var e='","0"===a.parent_id?t(".nplist:first li:first").after(e):O(e,a),t("#np-link-modal").modal("hide");var n=t("#menuItem_"+a.id).find(".row");z(n)}function O(a,e){var n=t("#menuItem_"+e.parent_id);0===t(n).children("ol").length?(a='
        '+a+"
      ",t(n).append(a)):t(n).find("ol:first").prepend(a),s(),B()}function z(e){t(e).addClass("np-updated"),a(),setTimeout(function(){t(e).addClass("np-updated-show")},1500)}function H(){var a=[],e=t(".page-row:visible");return t.each(e,function(){var e=t(this).attr("id");a.push(e.replace("menuItem_",""))}),a}function B(){var a=H();t.ajax({url:ajaxurl,type:"post",datatype:"json",data:{action:"npnesttoggle",nonce:nestedpages.np_nonce,ids:a},success:function(t){"success"!==t.status&&console.log("There was an error saving toggled pages.")}})}function E(){t(".np-newchild-error").hide(),m(),t(".sortable .new-child").remove(),t(".row").show()}function S(a){var e=t(a).closest(".row").parent("li");if(t(e).children("ol").length>0)var n=t(e).children("ol"),i=t(".new-child-form").clone().insertBefore(n);else var i=t(".new-child-form").clone().appendTo(e);t(i).siblings(".row").hide();f(),t(i).find(".parent_name").html("Parent: "+t(a).attr("data-parentname")),t(i).find(".page_parent_id").val(t(a).attr("data-id")),t(i).show()}function Q(a){{var e='
    1. ';t(a).siblings(".new-page-titles").append(e)}t(".new-page-titles").sortable({items:"li",handle:".handle"})}function F(a){var e=t(a).find(t(".new-child-row")).length;e>0?(t(a).find("h3 strong").text(nestedpages.add_child_pages),t(a).find(".np-save-newchild").text(nestedpages.add_pages+" ("+e+")")):(t(a).find("h3 strong").text(nestedpages.add_child),t(a).find(".np-save-newchild").text(nestedpages.add_page))}function G(a){t(".np-quickedit-error").hide();var e=t(".np-sync-menu").is(":checked")?"sync":"nosync";t.ajax({url:ajaxurl,type:"post",datatype:"json",data:t(a).serialize()+"&action=npnewchild&nonce="+nestedpages.np_nonce+"&syncmenu="+e,success:function(e){"error"===e.status?(x(a),t(a).find(".np-quickedit-error").text(e.message).show()):(x(a),J(a,e))},error:function(){x(a),t(a).find(".np-quickedit-error").text("The form could not be saved at this time.").show()}})}function J(a,e){var n=e.new_pages,r=t(a).parent(".new-child").parent(".page-row");0===t(r).children("ol").length&&t(r).append('
        ');var d=t(r).children("ol");for(i=0;i',n+=''+e.title+"",n+="Publish"!==e.status?'('+e.status+")":'',n+='Edit',n+="",n+='",n+="",n+="",t(a).append(n)}t(document).ready(function(){s(),a()}),t(document).on("click",".child-toggle a",function(e){e.preventDefault();var n=t(this).parent(".child-toggle").parent(".row").siblings("ol");t(this).find("i").toggleClass("np-icon-arrow-down").toggleClass("np-icon-arrow-right"),t(n).toggle(),a(),B()}),t(document).on("click",".nestedpages-toggleall a",function(e){e.preventDefault(),"closed"==t(this).attr("data-toggle")?(t(".nestedpages ol li ol").show(),t(this).attr("data-toggle","opened"),t(this).text(nestedpages.collapse_text),t(".child-toggle i").removeClass("np-icon-arrow-right").addClass("np-icon-arrow-down"),v(),a()):(t(".nestedpages ol li ol").hide(),t(this).attr("data-toggle","closed"),t(this).text(nestedpages.expand_text),t(".child-toggle i").removeClass("np-icon-arrow-down").addClass("np-icon-arrow-right"),v(),a()),B()}),t(document).on("click",".np-toggle-hidden",function(e){e.preventDefault();var n=t(this).attr("href");"show"===n?(t(this).attr("href","hide"),t(this).text(nestedpages.show_hidden),t(".np-hide").removeClass("shown").hide(),a()):(t(this).attr("href","show"),t(this).text(nestedpages.hide_hidden),t(".np-hide").addClass("shown").show(),a())}),t(".np-tabs a").on("click",function(a){a.preventDefault(),t(".np-tabs a").removeClass("active"),t(this).addClass("active");var e=t(this).attr("href");t(".np-tabbed-content").hide(),t(e).show()}),t(document).on("click",".np-toggle-publish",function(a){a.preventDefault();var e=t(this).attr("href");t(".np-toggle-publish").removeClass("active"),t(this).addClass("active"),"#published"==e?(t(".nplist .page-row").hide(),t(".nplist .published").show()):t(".nplist .page-row").show()}),t(document).on("click",".np-toggle-edit",function(a){a.preventDefault();var e=t(this).siblings(".action-buttons");t(e).is(":visible")?(t(this).removeClass("active"),t(e).hide()):(t(this).addClass("active"),t(e).show())});var L=function(){var t=0;return function(a,e){clearTimeout(t),t=setTimeout(a,e)}}();t(window).resize(function(){L(function(){t(".action-buttons").removeAttr("style"),t(".np-toggle-edit").removeClass("active")},500)}),t(document).ready(function(){t(".sortable").not(".no-sort").nestedSortable({items:"li",toleranceElement:"> .row",handle:".handle",placeholder:"ui-sortable-placeholder",start:function(t,a){a.placeholder.height(a.item.height())},sort:function(t,a){e(a)},stop:function(){setTimeout(function(){s(),a()},100),r()},update:function(){}})}),t(document).ready(function(){"1"===nestedpages.syncmenu&&d("sync")}),t(".np-sync-menu").on("change",function(){var a=t(this).is(":checked")?"sync":"nosync";d(a)}),t(document).on("click",".np-quick-edit",function(a){a.preventDefault(),v(),o(t(this))}),t(document).on("click",".np-inline-overlay",function(){v(),E()}),t(document).on("click",".np-cancel-quickedit",function(a){var e=t(this).parents(".page-row");v(e),a.preventDefault()}),t(document).on("click",".np-save-quickedit",function(a){a.preventDefault(),t(".row").removeClass("np-updated").removeClass("np-updated-show");var e=t(this).parents("form");t(this).attr("disabled","disabled"),t(e).find(".np-qe-loading").show(),g(e)}),t(document).on("click",".np-toggle-taxonomies",function(a){t(this).parents("form").find(".np-taxonomies").toggle(),a.preventDefault()}),t(document).on("click",".np-toggle-menuoptions",function(a){a.preventDefault(),t(this).parents("form").find(".np-menuoptions").toggle()}),t(document).on("change",".keep_private",function(){this.checked?t(".post_password").val("").prop("readonly",!0):t(".post_password").prop("readonly",!1)}),t(document).on("click",".np-quick-edit-redirect",function(a){a.preventDefault(),v(),q(t(this))}),t(document).on("click",".np-save-quickedit-redirect",function(a){a.preventDefault(),t(".row").removeClass("np-updated").removeClass("np-updated-show");var e=t(this).parents("form");t(this).attr("disabled","disabled"),t(e).find(".np-qe-loading").show(),D(e)}),t(document).on("click",".open-redirect-modal",function(a){a.preventDefault();var e=t(this).attr("data-parentid");t("#np-link-modal").find("input").val(""),t("#np-link-modal .parent_id").val(e),t("#np-add-link-title").text("0"===e?nestedpages.add_link:nestedpages.add_child_link),t("#np-link-modal").modal("show")}),t(document).on("click",".np-save-link",function(a){a.preventDefault(),t(".np-new-link-error").hide(),t(".np-link-loading").show(),t(this).attr("disabled","disabled"),P()}),t(document).on("click",".np-cancel-newchild",function(t){t.preventDefault(),E()}),t(document).on("click",".add-new-child",function(a){a.preventDefault(),S(t(this))}),t(document).on("click",".add-new-child-row",function(a){a.preventDefault(),Q(t(this));var e=t(this).parents("form");F(e)}),t(document).on("click",".np-remove-child",function(a){a.preventDefault();var e=t(this).parents("form");t(this).parents(".new-child-row").parent("li").remove(),F(e)}),t(document).on("click",".np-save-newchild",function(a){a.preventDefault(),t(this).prop("disabled","disabled");var e=t(this).parents("form");t(e).find(".np-qe-loading").show(),G(e)})}); \ No newline at end of file