codemirror
4 years ago
jquery-tiptip
5 years ago
select2
5 years ago
how-to.js
8 years ago
how-to.min.js
6 years ago
jquery.colorbox.js
8 years ago
jquery.colorbox.min.js
6 years ago
metabox.js
4 years ago
metabox.min.js
4 years ago
multisite-updater.js
2 years ago
multisite-updater.min.js
6 years ago
welcome-modal.js
3 years ago
welcome-modal.min.js
3 years ago
wp-pages.js
3 years ago
wp-pages.min.js
3 years ago
yit-cpt-unlimited.js
6 years ago
yit-cpt-unlimited.min.js
6 years ago
yit-plugin-panel.js
1 year ago
yit-plugin-panel.min.js
1 year ago
yit-wp-pointer.js
5 years ago
yit-wp-pointer.min.js
5 years ago
yith-bh-onboarding.js
3 years ago
yith-bh-onboarding.min.js
3 years ago
yith-colorpicker.min.js
5 years ago
yith-dashboard.js
7 years ago
yith-dashboard.min.js
6 years ago
yith-date-format.js
5 years ago
yith-date-format.min.js
5 years ago
yith-enhanced-select-wc-2.6.js
5 years ago
yith-enhanced-select-wc-2.6.min.js
5 years ago
yith-enhanced-select.js
2 years ago
yith-enhanced-select.min.js
2 years ago
yith-fields.js
2 years ago
yith-fields.min.js
2 years ago
yith-promo.js
7 years ago
yith-promo.min.js
6 years ago
yith-system-info.js
2 years ago
yith-system-info.min.js
2 years ago
yith-ui.js
1 year ago
yith-ui.min.js
1 year ago
yith-update-plugins.js
7 years ago
yith-update-plugins.min.js
6 years ago
wp-pages.js
94 lines
| 1 | /* global yith_plugin_fw_wp_pages, yith */ |
| 2 | jQuery( function ( $ ) { |
| 3 | // prevents the WC message for changes when leaving the panel page |
| 4 | $( '.yith-plugin-fw-wp-page-wrapper .woo-nav-tab-wrapper' ).removeClass( 'woo-nav-tab-wrapper' ).addClass( 'yith-nav-tab-wrapper' ); |
| 5 | |
| 6 | var isTaxEdit = 'term-php' === window.adminpage; |
| 7 | |
| 8 | // Update message animation. |
| 9 | ( function () { |
| 10 | var message; |
| 11 | if ( isTaxEdit ) { |
| 12 | message = $( 'div#message' ); |
| 13 | var ajaxResponseElement = $( '#ajax-response' ); |
| 14 | if ( message.length ) { |
| 15 | if ( ajaxResponseElement.length ) { |
| 16 | message.insertAfter( ajaxResponseElement ); |
| 17 | message.addClass( 'inline' ); |
| 18 | message.addClass( 'yith-plugin-fw-animate__appear-from-top' ).show(); |
| 19 | } |
| 20 | } |
| 21 | } else { |
| 22 | message = $( 'div#message.updated' ); |
| 23 | if ( message.length ) { |
| 24 | message.addClass( 'inline' ); |
| 25 | message.addClass( 'yith-plugin-fw-animate__appear-from-top' ).show(); |
| 26 | message.on( 'click', '.notice-dismiss', function ( e ) { |
| 27 | e.stopPropagation(); |
| 28 | message.removeClass( 'yith-plugin-fw-animate__appear-from-top' ).slideUp( 200 ); |
| 29 | } ); |
| 30 | } |
| 31 | } |
| 32 | } )(); |
| 33 | |
| 34 | // Confirmation window when deleting custom post types and custom terms through Bulk Actions. |
| 35 | if ( yith_plugin_fw_wp_pages.bulk_delete_confirmation_enabled ) { |
| 36 | var bulkDeleteConfirmed = false; |
| 37 | |
| 38 | $( document ).on( 'click', '#doaction, #doaction2', function ( e ) { |
| 39 | var doActionButton = $( this ), |
| 40 | bulkActionSelector = doActionButton.siblings( '#bulk-action-selector-top, #bulk-action-selector-bottom' ); |
| 41 | |
| 42 | if ( 'yith' in window && 'ui' in yith ) { |
| 43 | if ( bulkDeleteConfirmed ) { |
| 44 | bulkDeleteConfirmed = false; |
| 45 | } else { |
| 46 | var confirmOptions = {}, |
| 47 | selectedItems = $( '#the-list .check-column input[type=checkbox]:checked' ); |
| 48 | |
| 49 | if ( selectedItems.length ) { |
| 50 | switch ( bulkActionSelector.val() ) { |
| 51 | case 'trash': |
| 52 | confirmOptions.title = yith_plugin_fw_wp_pages.i18n.bulk_trash_confirm_title; |
| 53 | confirmOptions.message = yith_plugin_fw_wp_pages.i18n.bulk_trash_confirm_message; |
| 54 | confirmOptions.cancelButton = yith_plugin_fw_wp_pages.i18n.bulk_trash_cancel_button; |
| 55 | confirmOptions.confirmButton = yith_plugin_fw_wp_pages.i18n.bulk_trash_confirm_button; |
| 56 | confirmOptions.confirmButtonType = 'delete'; |
| 57 | break; |
| 58 | case 'delete': |
| 59 | confirmOptions.title = yith_plugin_fw_wp_pages.i18n.bulk_delete_confirm_title; |
| 60 | confirmOptions.message = yith_plugin_fw_wp_pages.i18n.bulk_delete_confirm_message; |
| 61 | confirmOptions.cancelButton = yith_plugin_fw_wp_pages.i18n.bulk_delete_cancel_button; |
| 62 | confirmOptions.confirmButton = yith_plugin_fw_wp_pages.i18n.bulk_delete_confirm_button; |
| 63 | confirmOptions.confirmButtonType = 'delete'; |
| 64 | break; |
| 65 | } |
| 66 | |
| 67 | if ( !$.isEmptyObject( confirmOptions ) ) { |
| 68 | e.preventDefault(); |
| 69 | |
| 70 | confirmOptions.closeAfterConfirm = false; |
| 71 | confirmOptions.onConfirm = function () { |
| 72 | bulkDeleteConfirmed = true; |
| 73 | doActionButton.trigger( 'click' ); |
| 74 | }; |
| 75 | |
| 76 | yith.ui.confirm( confirmOptions ); |
| 77 | } |
| 78 | } |
| 79 | } |
| 80 | |
| 81 | } |
| 82 | } ); |
| 83 | } |
| 84 | |
| 85 | // Fix the WP footer |
| 86 | ( function () { |
| 87 | var wrongWpFooter = $( '#wpbody #wpfooter' ), |
| 88 | wpContent = $( '#wpcontent' ); |
| 89 | |
| 90 | if ( wrongWpFooter.length && wpContent.length ) { |
| 91 | wpContent.append( wrongWpFooter ); |
| 92 | } |
| 93 | } )(); |
| 94 | } ); |