| 1 |
<?php |
| 2 |
/* |
| 3 |
* Page Name: JS |
| 4 |
*/ |
| 5 |
|
| 6 |
use WPCoder\Dashboard\Field; |
| 7 |
use WPCoder\Dashboard\FolderManager; |
| 8 |
use WPCoder\Dashboard\Option; |
| 9 |
|
| 10 |
defined( 'ABSPATH' ) || exit; |
| 11 |
|
| 12 |
$default = Field::getDefault(); |
| 13 |
$opt = include( 'options/js-code.php' ); |
| 14 |
|
| 15 |
$js_link = ''; |
| 16 |
if ( ! empty( $default['js_code'] ) ) { |
| 17 |
$js_link = FolderManager::path_upload_url() . 'script-' . $default['id'] . '.js'; |
| 18 |
} |
| 19 |
|
| 20 |
?> |
| 21 |
|
| 22 |
<div class="wowp-settings__page"> |
| 23 |
<div class="wowp-settings__page-sidebar"> |
| 24 |
|
| 25 |
<?php Option::init( [ |
| 26 |
$opt['jquery'], |
| 27 |
$opt['inline'], |
| 28 |
$opt['minified'], |
| 29 |
$opt['attributes'], |
| 30 |
] ); ?> |
| 31 |
|
| 32 |
<button class="button-editor button" id="jsnav"><?php esc_html_e( 'Add NAV Comment', 'wp-coder' ); ?></button> |
| 33 |
<ol id="jsNavigationMenu" class="wowp-php-nav-menu"></ol> |
| 34 |
|
| 35 |
</div> |
| 36 |
<div class="wowp-settings__page-content"> |
| 37 |
<?php Field::textarea( 'js_code' ); ?> |
| 38 |
|
| 39 |
<div class="wowp-notification notification-info"> |
| 40 |
Just enter the JavaScript content. You don’t need to include <code><script></code> — it's already on the page. |
| 41 |
</div> |
| 42 |
|
| 43 |
<?php if ( ! empty( $js_link ) ): ?> |
| 44 |
<div class="wowp-field has-addon"> |
| 45 |
<span class="label"><?php esc_html_e( 'JS File URL', 'wp-coder' ); ?></span> |
| 46 |
<label for="tag" class="label is-addon"><span |
| 47 |
class="dashicons dashicons-admin-links"></span></label> |
| 48 |
<input type="url" id="url-js-file" readonly="readonly" value="<?php echo esc_url( $js_link ); ?>"> |
| 49 |
</div> |
| 50 |
<?php endif; ?> |
| 51 |
|
| 52 |
|
| 53 |
</div> |
| 54 |
</div> |
| 55 |
|
| 56 |
<?php |
| 57 |
|
| 58 |
|
| 59 |
|