From 6cbe634cc3c8d71b7b837327e0f7916cb6c024be Mon Sep 17 00:00:00 2001 From: Helen Hou-Sandi Date: Tue, 30 Jul 2019 11:26:21 -0600 Subject: [PATCH] Use a more robust method of disabling collapsing the publish box --- assets/js/scripts.js | 4 ++-- assets/js/scripts.min.js | 2 +- assets/js/src/scripts.js | 4 ++-- package-lock.json | 2 +- 4 files changed, 6 insertions(+), 6 deletions(-) diff --git a/assets/js/scripts.js b/assets/js/scripts.js index 4556ca7..6184857 100644 --- a/assets/js/scripts.js +++ b/assets/js/scripts.js @@ -846,8 +846,8 @@ }, ready: function() { var $submitdiv = $('#submitdiv'); - $submitdiv.removeClass('postbox'); - $submitdiv.children('.hndle').children('span').text('Issue Date'); + $submitdiv.children('.handlediv').hide(); + $submitdiv.children('.hndle').off( 'click.postboxes' ).children('span').text('Issue Date'); var $mpa = $('#major-publishing-actions'); $mpa.wrapInner('
'); $mpa.prepend('

Actions

'); diff --git a/assets/js/scripts.min.js b/assets/js/scripts.min.js index f2309e7..2b7295a 100644 --- a/assets/js/scripts.min.js +++ b/assets/js/scripts.min.js @@ -1 +1 @@ -!function(a,o){"use strict";var r,t,e,s={_data:{_ajax_nonce:EDW_Vars.nonce},_send:wp.ajax.send,_post:wp.ajax.post,post:function(t,e,i,n){o.extend(e,this._data);var s=this._post(t,e);return this.locker(s,i,n),this.suhcurity(s),s},locker:function(t,e,i){r.lock_input(e,i),t.always(function(){r.release_input(e,i)})},suhcurity:function(t){var e=this;t.always(function(t){"object"==typeof t&&void 0!==t._ajax_nonce?e.set_nonce(t._ajax_nonce):r.flash_error("Whoops! Looks like this page has been sitting for a while. Try refreshing!")})},set_nonce:function(t){this._data._ajax_nonce=t},send_get:function(t,e,i,n){o.extend(e,this._data);var s={type:"GET",data:e},a=this._send(t,s);return this.locker(a,i,n),this.suhcurity(a),a}};(r={$error_msg:o("#pi-section-error"),$metabox_wrap:o(".meta-box-sortables"),$postbox_wrap:o("#postbox-container-2"),add_progress_indicator:function(t){t.after(EDW_Vars.progress_img)},remove_progress_indicator:function(){o(".edw-loading").remove()},handlers:function(){this.$postbox_wrap.on("keypress",'input[type="text"]',this.submit_to_buttons)},get_inputs:function(t,e){var i,n={button:!1,input:!1};return void 0!==(i=void 0===e&&void 0!==t?t.siblings(".button"):e instanceof o?o(e):e)&&i.length&&(n.button=i),void 0!==t&&t.length&&(n.input=t),n},lock_input:function(t,e){var i=this.get_inputs(t,e);i.button&&i.button.hide(),i.input&&(i.input.attr("disabled","disabled"),i.input.addClass("locked"),r.add_progress_indicator(i.input)),!i.input&&i.button&&r.add_progress_indicator(i.button)},release_input:function(t,e){var i=this.get_inputs(t,e);i.input&&(r.remove_progress_indicator(i.input),i.input.removeAttr("disabled"),i.input.removeClass("locked")),!i.input&&i.button&&r.remove_progress_indicator(i.button),i.button&&i.button.show()},submit_to_buttons:function(t){if(13===t.which){t.preventDefault();var e=o(this).siblings("button");return e.length&&e.click(),!1}},flash_error:function(t){this.$error_msg.text(t),this.$error_msg.show().delay(4500).fadeOut()}}).handlers(),(t={$section_ids:o("#pi-section-ids"),$titles:o('[id^="pi-sections-box"].postbox .hndle span'),$pi_section_name:o("#pi-section-name"),print_issue_id:o("#post_ID").val(),init:function(){var t=this;this.handlers(),o(document).ready(function(){o.proxy(t.ready,t)()})},ready:function(){this.$titles.attr("contenteditable","true"),this.$titles.attr("title","Click to edit section name"),r.$metabox_wrap.sortable({cancel:":input,button,[contenteditable]"}),o('[id^="pi-sections-box"].postbox .hndle').unbind(),this.set_initial_title_data()},handlers:function(){var e=this;o("#pi-section-add").on("click",function(t){t.preventDefault(),o.proxy(e.toggle_section_add_inputs,e)()}),o("#pi-section-add-confirm").on("click",function(t){t.preventDefault(),o.proxy(e.add_section,e)()}),r.$metabox_wrap.on("click",".postbox.js .handlediv",this.toggle_handler),r.$metabox_wrap.on("blur",".postbox .hndle span",function(){o.proxy(e.check_title_change,e,o(this))()}),r.$metabox_wrap.on("keypress",".postbox .hndle span",e.map_enter_to_blur),r.$metabox_wrap.on("click",".pi-section-delete a",function(t){t.preventDefault(),o.proxy(e.delete_section,e,o(this))()})},destroy_sortable:function(){r.$metabox_wrap.sortable("destroy")},set_initial_title_data:function(){this.$titles.each(this.set_title_data)},check_title_change:function(t){var e=this.get_existing_title(t),i=this.get_new_title(t);e!==i&&this.title_changed(t,i)},map_enter_to_blur:function(t){13===t.which&&(t.preventDefault(),t.stopImmediatePropagation(),o(this).blur())},title_changed:function(e,t){var i=this,n=e.parents(".postbox").find(".section_id").val(),s=this.save_section_title(t,n,e);this.set_title_lock(e),s.fail(function(t){o.proxy(i.reset_title,i,e)(),r.flash_error(t.message)}),s.done(function(t){o.proxy(i.set_title_data,i,e)()}),s.always(function(){o.proxy(i.release_title_lock,i,e)()})},release_title_lock:function(t){t.attr("contenteditable",!0)},set_title_lock:function(t){t.attr("contenteditable",!1)},reset_title:function(t){t.text(t.data("title"))},save_section_title:function(t,e,i,n){return s.post("pp-update-section-title",{title:t,post_id:e},i,n)},get_new_title:function(t){return t[0].textContent},get_existing_title:function(t){return t.data("title")},set_title_data:function(){o(this).data("title",o(this)[0].textContent)},delete_section:function(t){if(a.confirm("Are you sure you want to delete this section?")){var e=t.parents(".postbox"),i=e.find(".section_id").val(),n=this.$section_ids.val().split(","),s=n.indexOf(i);-1 span").text(t).attr("contenteditable","true"),i.addClass("js"),i.removeClass("hide-if-js"),i.find(".section_id").val(e),i.find(".pi-article-ids").attr("name","pi-article-ids["+e+"]"),o("#normal-sortables").append(i),this.append_section_id(e),i},append_section_id:function(t){var e=this.$section_ids.val();e.length&&(e+=","),e+=t,this.$section_ids.val(e)},toggle_handler:function(){if("undefined"!=typeof postboxes){var t=o(this).parent(".postbox"),e=t.attr("id");t.toggleClass("closed"),postboxes.save_state("print-issue"),e&&(!t.hasClass("closed")&&o.isFunction(postboxes.pbshow)?postboxes.pbshow(e):t.hasClass("closed")&&o.isFunction(postboxes.pbhide)&&postboxes.pbhide(e)),o(document).trigger("postbox-toggled",t)}},toggle_section_add_inputs:function(){this.toggle_add_info(),this.toggle_add_section()},toggle_add_info:function(){o("#pi-section-add-info").toggle()},toggle_add_section:function(){o("#pi-section-add").toggle()},clear_add_input:function(){o("#pi-section-name").val("")}}).init(),(e={sortable_container:"#postbox-container-2",$bulk_article_status_select:o("#bulk-action-selector-top"),article_search_cache:{},init:function(){var t=this;this.handlers(),o(document).ready(function(){o.proxy(t.ready,t)()})},handlers:function(){var i=this;r.$metabox_wrap.on("click",".pi-article-add",function(t){t.preventDefault(),o.proxy(i.toggle_article_add_inputs,i,o(this))()}),r.$metabox_wrap.on("click",".pi-article-search",function(t){t.preventDefault(),o.proxy(i.search_for_articles,i,o(this))()}),r.$metabox_wrap.on("click",".pi-article-result-confirm",function(t){t.preventDefault(),o.proxy(i.add_article,i,o(this))()}),r.$metabox_wrap.on("click",".pi-article-remove",function(t){t.preventDefault(),o.proxy(i.remove_article,i,o(this))()}),o("#bulk-edit-article-status-submit").click(function(t){t.preventDefault(),o.proxy(i.edit_checked_article_status,i,o(this))()}),o("#bulk-edit-article-status-apply-all").click(function(t){t.preventDefault(),o.proxy(i.edit_all_article_status,i,o(this))()}),r.$postbox_wrap.on("pp-section-added",function(t,e){o.proxy(i.refresh_autocomplete,i,e)()})},ready:function(){this.init_sortable(),this.init_autocomplete()},init_autocomplete:function(){var s=this;o(".pi-article-title").autocomplete({source:function(t,i){var n=t.term;if(n in s.article_search_cache)i(s.article_search_cache[n]);else{var e=s.get_articles(n);e.done(function(t){var e=o.makeArray(t.articles);s.article_search_cache[n]=e,i(e)}),e.fail(function(t){i([])})}},select:function(t,e){t.preventDefault(),s.add_article(o(this),e.item.value),o(this).autocomplete("close"),o(this).val("")}})},refresh_autocomplete:function(t){o('[id^="pi-sections-box"].postbox').not(t).children(".pi-article-title").autocomplete("destroy"),this.init_autocomplete()},init_sortable:function(){var i=this,t=o(this.sortable_container);void 0===t.sortable("instance")&&t.length?t.sortable({placeholder:"sortable-placeholder",items:'.postbox[id^="pi-sections-box"] tr',containment:"parent",cursor:"move",tolerance:"pointer",forcePlaceholderSize:!0,helper:"clone",opacity:.65,update:function(t,e){o.proxy(i.update_sortable,i,t,e)()}}):t.length&&t.sortable("refresh")},update_sortable:function(t,e){var i=e.item,n=i.parents(".postbox"),s=i.siblings("tr").addBack().map(function(){return o(this).data("article-id")}).get();this.set_article_ids(n,s)},refresh_sortable:function(t){void 0!==o(this.sortable_container).sortable("instance")&&this.destroy_sortable(),this.init_sortable()},destroy_sortable:function(){o(this.sortable_container).sortable("destroy")},set_article_ids:function(t,e,i){(i||t.find(".pi-article-ids")).val(e.join(","))},flash_error:function(t,e){t.find(".pi-error-msg").text(e),t.find(".pi-error-msg").show().delay(4500).fadeOut()},toggle_article_add_inputs:function(t){t.parents(".postbox"),t.siblings(".pi-articles");var e=t.siblings(".pi-article-add-info");t.toggle(),e.toggle()},get_articles:function(t,e,i){return s.send_get("pp-get-articles",{title:t},e,i)},add_article:function(t,e){var i=this,n=t.parents(".postbox");if(e)if(this.article_exists_in_section(e,"",n))i.flash_error(n,"Whoops! You've already added that article to this section.");else{var s=this.get_article_row(e,t);s.done(function(t){i.$insert_article(n,t),i.add_article_id(n,e)}),s.fail(function(t){i.flash_error(n,t.message)})}},$insert_article:function(t,e){var i=t.find(".wp-list-table tbody"),n=o(e.html);i.append(n),this.refresh_sortable(t)},edit_article_meta:function(t,e){for(var i in e){var n=t.children("td.column-"+i);n.length&&(this.is_html(e[i])?n.html(e[i]):n.text(e[i]))}},is_html:function(t){var e=o.parseHTML(t),i=!1;for(var n in e)if("#text"!==e[n].nodeName){i=!0;break}return i},add_article_id:function(t,e){var i=t.find(".pi-article-ids"),n=this.get_article_ids(i,t)||[];-1'),e.prepend('

Actions

')},rov_view:function(){!EDW_Vars.rov&&EDW_Vars.cuc_edit_print_issue||(e.destroy_sortable(),t.destroy_sortable(),o("#title").attr("disabled","disabled"))}}.init(),{$export_checked_button:o("#article-export-checked"),$export_all_button:o("#article-export-all"),init:function(){this.handlers()},handlers:function(){var e=this;this.$export_checked_button.click(function(t){o.proxy(e.handle_article_export_checked,e,o(this),t)()}),this.$export_all_button.click(function(t){o.proxy(e.handle_article_export_all,e,o(this),t)()})},handle_article_export_checked:function(t,e){e.preventDefault();var i=o("input.article-status:checked");this.export_supplied_articles(i,t)},handle_article_export_all:function(t,e){e.preventDefault();var i=o('tr[data-article-id!="0"] input.article-status');this.export_supplied_articles(i,t)},update_export_meta:function(t,e){return s.post("pp-article-export-update",{article_ids:t},void 0,e)},$update_export_meta:function(t,i){var n=e;t.map(function(){return o(this).parents("tr")}).each(function(t,e){n.edit_article_meta(e,i)})},export_supplied_articles:function(e,t){var i=this,n=e.map(function(){return this.value}).get();if(n.length){n=n.join(","),this.update_export_meta(n,t).done(function(t){i.$update_export_meta(e,t)});var s=o("
",{action:wp.ajax.settings.url,method:"post"});s.append(o("",{type:"hidden",name:"article_ids",value:n})),s.append(o("",{type:"hidden",name:"print_issue_id",value:o("#post_ID").val()})),s.append(o("",{type:"hidden",name:"print_issue_title",value:o("#title").val()})),s.append(o("",{type:"hidden",name:"_ajax_nonce",value:EDW_Vars.nonce})),s.append(o("",{name:"action",type:"hidden",value:"pp-article-export"})),o("body").append(s),s.submit(),s.remove()}else r.flash_error("Check some article boxes first!")}}.init()}(this,jQuery); \ No newline at end of file +!function(a,o){"use strict";var r,t,e,s={_data:{_ajax_nonce:EDW_Vars.nonce},_send:wp.ajax.send,_post:wp.ajax.post,post:function(t,e,i,n){o.extend(e,this._data);var s=this._post(t,e);return this.locker(s,i,n),this.suhcurity(s),s},locker:function(t,e,i){r.lock_input(e,i),t.always(function(){r.release_input(e,i)})},suhcurity:function(t){var e=this;t.always(function(t){"object"==typeof t&&void 0!==t._ajax_nonce?e.set_nonce(t._ajax_nonce):r.flash_error("Whoops! Looks like this page has been sitting for a while. Try refreshing!")})},set_nonce:function(t){this._data._ajax_nonce=t},send_get:function(t,e,i,n){o.extend(e,this._data);var s={type:"GET",data:e},a=this._send(t,s);return this.locker(a,i,n),this.suhcurity(a),a}};(r={$error_msg:o("#pi-section-error"),$metabox_wrap:o(".meta-box-sortables"),$postbox_wrap:o("#postbox-container-2"),add_progress_indicator:function(t){t.after(EDW_Vars.progress_img)},remove_progress_indicator:function(){o(".edw-loading").remove()},handlers:function(){this.$postbox_wrap.on("keypress",'input[type="text"]',this.submit_to_buttons)},get_inputs:function(t,e){var i,n={button:!1,input:!1};return void 0!==(i=void 0===e&&void 0!==t?t.siblings(".button"):e instanceof o?o(e):e)&&i.length&&(n.button=i),void 0!==t&&t.length&&(n.input=t),n},lock_input:function(t,e){var i=this.get_inputs(t,e);i.button&&i.button.hide(),i.input&&(i.input.attr("disabled","disabled"),i.input.addClass("locked"),r.add_progress_indicator(i.input)),!i.input&&i.button&&r.add_progress_indicator(i.button)},release_input:function(t,e){var i=this.get_inputs(t,e);i.input&&(r.remove_progress_indicator(i.input),i.input.removeAttr("disabled"),i.input.removeClass("locked")),!i.input&&i.button&&r.remove_progress_indicator(i.button),i.button&&i.button.show()},submit_to_buttons:function(t){if(13===t.which){t.preventDefault();var e=o(this).siblings("button");return e.length&&e.click(),!1}},flash_error:function(t){this.$error_msg.text(t),this.$error_msg.show().delay(4500).fadeOut()}}).handlers(),(t={$section_ids:o("#pi-section-ids"),$titles:o('[id^="pi-sections-box"].postbox .hndle span'),$pi_section_name:o("#pi-section-name"),print_issue_id:o("#post_ID").val(),init:function(){var t=this;this.handlers(),o(document).ready(function(){o.proxy(t.ready,t)()})},ready:function(){this.$titles.attr("contenteditable","true"),this.$titles.attr("title","Click to edit section name"),r.$metabox_wrap.sortable({cancel:":input,button,[contenteditable]"}),o('[id^="pi-sections-box"].postbox .hndle').unbind(),this.set_initial_title_data()},handlers:function(){var e=this;o("#pi-section-add").on("click",function(t){t.preventDefault(),o.proxy(e.toggle_section_add_inputs,e)()}),o("#pi-section-add-confirm").on("click",function(t){t.preventDefault(),o.proxy(e.add_section,e)()}),r.$metabox_wrap.on("click",".postbox.js .handlediv",this.toggle_handler),r.$metabox_wrap.on("blur",".postbox .hndle span",function(){o.proxy(e.check_title_change,e,o(this))()}),r.$metabox_wrap.on("keypress",".postbox .hndle span",e.map_enter_to_blur),r.$metabox_wrap.on("click",".pi-section-delete a",function(t){t.preventDefault(),o.proxy(e.delete_section,e,o(this))()})},destroy_sortable:function(){r.$metabox_wrap.sortable("destroy")},set_initial_title_data:function(){this.$titles.each(this.set_title_data)},check_title_change:function(t){var e=this.get_existing_title(t),i=this.get_new_title(t);e!==i&&this.title_changed(t,i)},map_enter_to_blur:function(t){13===t.which&&(t.preventDefault(),t.stopImmediatePropagation(),o(this).blur())},title_changed:function(e,t){var i=this,n=e.parents(".postbox").find(".section_id").val(),s=this.save_section_title(t,n,e);this.set_title_lock(e),s.fail(function(t){o.proxy(i.reset_title,i,e)(),r.flash_error(t.message)}),s.done(function(t){o.proxy(i.set_title_data,i,e)()}),s.always(function(){o.proxy(i.release_title_lock,i,e)()})},release_title_lock:function(t){t.attr("contenteditable",!0)},set_title_lock:function(t){t.attr("contenteditable",!1)},reset_title:function(t){t.text(t.data("title"))},save_section_title:function(t,e,i,n){return s.post("pp-update-section-title",{title:t,post_id:e},i,n)},get_new_title:function(t){return t[0].textContent},get_existing_title:function(t){return t.data("title")},set_title_data:function(){o(this).data("title",o(this)[0].textContent)},delete_section:function(t){if(a.confirm("Are you sure you want to delete this section?")){var e=t.parents(".postbox"),i=e.find(".section_id").val(),n=this.$section_ids.val().split(","),s=n.indexOf(i);-1 span").text(t).attr("contenteditable","true"),i.addClass("js"),i.removeClass("hide-if-js"),i.find(".section_id").val(e),i.find(".pi-article-ids").attr("name","pi-article-ids["+e+"]"),o("#normal-sortables").append(i),this.append_section_id(e),i},append_section_id:function(t){var e=this.$section_ids.val();e.length&&(e+=","),e+=t,this.$section_ids.val(e)},toggle_handler:function(){if("undefined"!=typeof postboxes){var t=o(this).parent(".postbox"),e=t.attr("id");t.toggleClass("closed"),postboxes.save_state("print-issue"),e&&(!t.hasClass("closed")&&o.isFunction(postboxes.pbshow)?postboxes.pbshow(e):t.hasClass("closed")&&o.isFunction(postboxes.pbhide)&&postboxes.pbhide(e)),o(document).trigger("postbox-toggled",t)}},toggle_section_add_inputs:function(){this.toggle_add_info(),this.toggle_add_section()},toggle_add_info:function(){o("#pi-section-add-info").toggle()},toggle_add_section:function(){o("#pi-section-add").toggle()},clear_add_input:function(){o("#pi-section-name").val("")}}).init(),(e={sortable_container:"#postbox-container-2",$bulk_article_status_select:o("#bulk-action-selector-top"),article_search_cache:{},init:function(){var t=this;this.handlers(),o(document).ready(function(){o.proxy(t.ready,t)()})},handlers:function(){var i=this;r.$metabox_wrap.on("click",".pi-article-add",function(t){t.preventDefault(),o.proxy(i.toggle_article_add_inputs,i,o(this))()}),r.$metabox_wrap.on("click",".pi-article-search",function(t){t.preventDefault(),o.proxy(i.search_for_articles,i,o(this))()}),r.$metabox_wrap.on("click",".pi-article-result-confirm",function(t){t.preventDefault(),o.proxy(i.add_article,i,o(this))()}),r.$metabox_wrap.on("click",".pi-article-remove",function(t){t.preventDefault(),o.proxy(i.remove_article,i,o(this))()}),o("#bulk-edit-article-status-submit").click(function(t){t.preventDefault(),o.proxy(i.edit_checked_article_status,i,o(this))()}),o("#bulk-edit-article-status-apply-all").click(function(t){t.preventDefault(),o.proxy(i.edit_all_article_status,i,o(this))()}),r.$postbox_wrap.on("pp-section-added",function(t,e){o.proxy(i.refresh_autocomplete,i,e)()})},ready:function(){this.init_sortable(),this.init_autocomplete()},init_autocomplete:function(){var s=this;o(".pi-article-title").autocomplete({source:function(t,i){var n=t.term;if(n in s.article_search_cache)i(s.article_search_cache[n]);else{var e=s.get_articles(n);e.done(function(t){var e=o.makeArray(t.articles);s.article_search_cache[n]=e,i(e)}),e.fail(function(t){i([])})}},select:function(t,e){t.preventDefault(),s.add_article(o(this),e.item.value),o(this).autocomplete("close"),o(this).val("")}})},refresh_autocomplete:function(t){o('[id^="pi-sections-box"].postbox').not(t).children(".pi-article-title").autocomplete("destroy"),this.init_autocomplete()},init_sortable:function(){var i=this,t=o(this.sortable_container);void 0===t.sortable("instance")&&t.length?t.sortable({placeholder:"sortable-placeholder",items:'.postbox[id^="pi-sections-box"] tr',containment:"parent",cursor:"move",tolerance:"pointer",forcePlaceholderSize:!0,helper:"clone",opacity:.65,update:function(t,e){o.proxy(i.update_sortable,i,t,e)()}}):t.length&&t.sortable("refresh")},update_sortable:function(t,e){var i=e.item,n=i.parents(".postbox"),s=i.siblings("tr").addBack().map(function(){return o(this).data("article-id")}).get();this.set_article_ids(n,s)},refresh_sortable:function(t){void 0!==o(this.sortable_container).sortable("instance")&&this.destroy_sortable(),this.init_sortable()},destroy_sortable:function(){o(this.sortable_container).sortable("destroy")},set_article_ids:function(t,e,i){(i||t.find(".pi-article-ids")).val(e.join(","))},flash_error:function(t,e){t.find(".pi-error-msg").text(e),t.find(".pi-error-msg").show().delay(4500).fadeOut()},toggle_article_add_inputs:function(t){t.parents(".postbox"),t.siblings(".pi-articles");var e=t.siblings(".pi-article-add-info");t.toggle(),e.toggle()},get_articles:function(t,e,i){return s.send_get("pp-get-articles",{title:t},e,i)},add_article:function(t,e){var i=this,n=t.parents(".postbox");if(e)if(this.article_exists_in_section(e,"",n))i.flash_error(n,"Whoops! You've already added that article to this section.");else{var s=this.get_article_row(e,t);s.done(function(t){i.$insert_article(n,t),i.add_article_id(n,e)}),s.fail(function(t){i.flash_error(n,t.message)})}},$insert_article:function(t,e){var i=t.find(".wp-list-table tbody"),n=o(e.html);i.append(n),this.refresh_sortable(t)},edit_article_meta:function(t,e){for(var i in e){var n=t.children("td.column-"+i);n.length&&(this.is_html(e[i])?n.html(e[i]):n.text(e[i]))}},is_html:function(t){var e=o.parseHTML(t),i=!1;for(var n in e)if("#text"!==e[n].nodeName){i=!0;break}return i},add_article_id:function(t,e){var i=t.find(".pi-article-ids"),n=this.get_article_ids(i,t)||[];-1'),e.prepend('

Actions

')},rov_view:function(){!EDW_Vars.rov&&EDW_Vars.cuc_edit_print_issue||(e.destroy_sortable(),t.destroy_sortable(),o("#title").attr("disabled","disabled"))}}.init(),{$export_checked_button:o("#article-export-checked"),$export_all_button:o("#article-export-all"),init:function(){this.handlers()},handlers:function(){var e=this;this.$export_checked_button.click(function(t){o.proxy(e.handle_article_export_checked,e,o(this),t)()}),this.$export_all_button.click(function(t){o.proxy(e.handle_article_export_all,e,o(this),t)()})},handle_article_export_checked:function(t,e){e.preventDefault();var i=o("input.article-status:checked");this.export_supplied_articles(i,t)},handle_article_export_all:function(t,e){e.preventDefault();var i=o('tr[data-article-id!="0"] input.article-status');this.export_supplied_articles(i,t)},update_export_meta:function(t,e){return s.post("pp-article-export-update",{article_ids:t},void 0,e)},$update_export_meta:function(t,i){var n=e;t.map(function(){return o(this).parents("tr")}).each(function(t,e){n.edit_article_meta(e,i)})},export_supplied_articles:function(e,t){var i=this,n=e.map(function(){return this.value}).get();if(n.length){n=n.join(","),this.update_export_meta(n,t).done(function(t){i.$update_export_meta(e,t)});var s=o("",{action:wp.ajax.settings.url,method:"post"});s.append(o("",{type:"hidden",name:"article_ids",value:n})),s.append(o("",{type:"hidden",name:"print_issue_id",value:o("#post_ID").val()})),s.append(o("",{type:"hidden",name:"print_issue_title",value:o("#title").val()})),s.append(o("",{type:"hidden",name:"_ajax_nonce",value:EDW_Vars.nonce})),s.append(o("",{name:"action",type:"hidden",value:"pp-article-export"})),o("body").append(s),s.submit(),s.remove()}else r.flash_error("Check some article boxes first!")}}.init()}(this,jQuery); \ No newline at end of file diff --git a/assets/js/src/scripts.js b/assets/js/src/scripts.js index 1b3260e..40b9f25 100644 --- a/assets/js/src/scripts.js +++ b/assets/js/src/scripts.js @@ -853,8 +853,8 @@ }, ready: function() { var $submitdiv = $('#submitdiv'); - $submitdiv.removeClass('postbox'); - $submitdiv.children('.hndle').children('span').text('Issue Date'); + $submitdiv.children('.handlediv').hide(); + $submitdiv.children('.hndle').off( 'click.postboxes' ).children('span').text('Issue Date'); var $mpa = $('#major-publishing-actions'); $mpa.wrapInner('
'); $mpa.prepend('

Actions

'); diff --git a/package-lock.json b/package-lock.json index 8a0577b..010aeda 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,6 +1,6 @@ { "name": "eight-day-week", - "version": "1.0.0", + "version": "1.1.0", "lockfileVersion": 1, "requires": true, "dependencies": {