| @@ -135,11 +135,9 @@ | ||
| 135 | 135 | <div class="clear"></div> |
| 136 | 136 | </span> |
| 137 | 137 | <?php |
| 138 | 138 | |
| 139 | - do_action( 'wpbc_hook_settings_page_footer', 'resources' ); | |
| 140 | - | |
| 141 | - $this->enqueue_js(); | |
| 139 | + do_action( 'wpbc_hook_settings_page_footer', 'resources' ); | |
| 142 | 140 | } |
| 143 | 141 | |
| 144 | 142 | |
| 145 | 143 | // <editor-fold defaultstate="collapsed" desc=" CSS & JS " > |
| @@ -178,68 +176,9 @@ | ||
| 178 | 176 | } |
| 179 | 177 | </style> |
| 180 | 178 | <?php |
| 181 | 179 | } |
| 182 | - | |
| 183 | - | |
| 184 | - | |
| 185 | - /** | |
| 186 | - * Add Custom JavaScript - for some specific settings options | |
| 187 | - * Executed After post content, after initial definition of settings, and possible definition after POST request. | |
| 188 | - * | |
| 189 | - * @param type $menu_slug | |
| 190 | - */ | |
| 191 | - private function enqueue_js(){ | |
| 192 | - | |
| 193 | - // JavaScript ////////////////////////////////////////////////////////////// | |
| 194 | - | |
| 195 | - $js_script = ''; | |
| 196 | - | |
| 197 | - /* | |
| 198 | - // Hide|Show on Click Checkbox | |
| 199 | - $js_script .= " jQuery('#bresources_booking_gcal_auto_import_is_active').on( 'change', function(){ | |
| 200 | - if ( this.checked ) { | |
| 201 | - jQuery('.wpbc_tr_auto_import').removeClass('hidden_items'); | |
| 202 | - } else { | |
| 203 | - jQuery('.wpbc_tr_auto_import').addClass('hidden_items'); | |
| 204 | - } | |
| 205 | - } ); "; | |
| 206 | - */ | |
| 207 | - | |
| 208 | - // Open the publish controls when this page is used as the Setup Wizard "Publish" step. | |
| 209 | - // phpcs:ignore WordPress.Security.NonceVerification.Recommended | |
| 210 | - if ( isset( $_GET['wpbc_setup_step'] ) && ( 'wizard_publish' === sanitize_key( wp_unslash( $_GET['wpbc_setup_step'] ) ) ) ) { | |
| 211 | - $js_script .= " | |
| 212 | - jQuery( document ).ready( function() { | |
| 213 | - setTimeout( function() { | |
| 214 | - var publishSelector = '.ui_group__publish_btn:visible'; | |
| 215 | - var tableSelector = '#wpbc_booking_resource_table:visible'; | |
| 216 | - var \$publishTarget = jQuery( publishSelector ).first(); | |
| 217 | - var targetSelector = \$publishTarget.length ? publishSelector : tableSelector; | |
| 218 | - | |
| 219 | - if ( ! jQuery( targetSelector ).length ) { | |
| 220 | - return; | |
| 221 | - } | |
| 222 | - | |
| 223 | - if ( 'function' === typeof wpbc_scroll_to ) { | |
| 224 | - wpbc_scroll_to( targetSelector ); | |
| 225 | - } else { | |
| 226 | - jQuery( 'html, body' ).animate( { scrollTop: jQuery( targetSelector ).first().offset().top - 80 }, 300 ); | |
| 227 | - } | |
| 228 | - | |
| 229 | - if ( 'function' === typeof wpbc_blink_element ) { | |
| 230 | - wpbc_blink_element( targetSelector, 3, 300 ); | |
| 231 | - } | |
| 232 | - }, 350 ); | |
| 233 | - } ); | |
| 234 | - "; | |
| 235 | - } | |
| 236 | - | |
| 237 | - // Enqueue JS to the footer of the page | |
| 238 | - wpbc_enqueue_js( $js_script ); | |
| 239 | - } | |
| 240 | - | |
| 241 | - // </editor-fold> | |
| 180 | + // </editor-fold> | |
| 242 | 181 | |
| 243 | 182 | |
| 244 | 183 | // ----------------------------------------------------------------------------------------------------------------- |
| 245 | 184 | // Toolbar |