| 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 |
<h4> |
| 22 |
<span class="codericon codericon-filetype-js"></span> |
| 23 |
<?php esc_html_e( 'JavaScript Code', 'wpcoder' ); ?> |
| 24 |
</h4> |
| 25 |
|
| 26 |
<fieldset> |
| 27 |
<legend><?php esc_html_e( 'Settings', 'wpcoder' ); ?></legend> |
| 28 |
|
| 29 |
<?php Option::init( [ |
| 30 |
$opt['jquery'], |
| 31 |
$opt['inline'], |
| 32 |
$opt['minified'], |
| 33 |
$opt['attributes'], |
| 34 |
] ); ?> |
| 35 |
|
| 36 |
</fieldset> |
| 37 |
|
| 38 |
<div class="wowp-field is-full wowp-code-nav "> |
| 39 |
<ol id="jsNavigationMenu" class="wowp-php-nav-menu"></ol> |
| 40 |
<span class="button-editor" id="jsnav">Add NAV Comment</span> |
| 41 |
</div> |
| 42 |
|
| 43 |
<?php Option::init( [ $opt['js_code'] ] ); ?> |
| 44 |
|
| 45 |
<div class="wowp-notification -warning"> |
| 46 |
Please input only the JavaScript content, omitting the <code>script</code> tag |
| 47 |
</div> |
| 48 |
|
| 49 |
<?php if ( ! empty( $js_link ) ): ?> |
| 50 |
<div class="wowp-fields-group has-mt"> |
| 51 |
<div class="wowp-field is-full has-addon border-default"> |
| 52 |
<label for="url-css-file" class="is-addon"> |
| 53 |
<span class="dashicons dashicons-admin-links"></span> |
| 54 |
</label> |
| 55 |
<input type="url" id="url-css-file" readonly="readonly" value="<?php echo esc_url( $js_link ); ?>"> |
| 56 |
<span class="label"><?php esc_html_e( 'URL to the JS file', 'wpcoder' ); ?></span> |
| 57 |
</div> |
| 58 |
</div> |
| 59 |
<?php endif; |
| 60 |
|
| 61 |
|