PluginProbe
WP Coder – Insert & Manage Code Snippets / 3.4
WP Coder – Insert & Manage Code Snippets v3.4
4.5.1 1.1 2.3.1 2.3.2 2.4.1 2.5.1 2.5.2 2.5.3 2.5.4 2.5.5 2.5.6 3.0 3.0.1 3.0.2 3.0.3 3.0.4 3.0.5 3.1 3.1.1 3.2 3.2.1 3.3 3.4 3.5 3.5.1 All 39 releases
← All changes | includes/settings/3.js-code.php +20 -33 3.0.53.4 View file →
@@ -1,15 +1,17 @@
1 1 <?php
2 2 /*
3 - * Page Name: JS Code
3 + * Page Name: JS
4 4 */
5 5
6 6 use WPCoder\Dashboard\Field;
7 7 use WPCoder\Dashboard\FolderManager;
8 +use WPCoder\Dashboard\Option;
8 9
9 10 defined( 'ABSPATH' ) || exit;
10 11
11 12 $default = Field::getDefault();
13 +$opt = include( 'options/js-code.php' );
12 14
13 15 $js_link = '';
14 16 if ( ! empty( $default['js_code'] ) ) {
15 17 $js_link = FolderManager::path_upload_url() . 'script-' . $default['id'] . '.js';
@@ -16,9 +18,9 @@
16 18 }
17 19
18 20 ?>
19 21 <h4>
20 - <span class="wowp-icon wowp-icon-js"></span>
22 + <span class="codericon codericon-filetype-js"></span>
21 23 <?php esc_html_e( 'JavaScript Code', 'wpcoder' ); ?>
22 24 </h4>
23 25
24 26 <fieldset>
@@ -23,42 +25,29 @@
23 25
24 26 <fieldset>
25 27 <legend><?php esc_html_e( 'Settings', 'wpcoder' ); ?></legend>
26 28
27 - <div class="wowp-field has-chackbox">
28 - <span class="label"><?php esc_html_e( 'JQuery Dependency', 'wpcoder' ); ?></span>
29 - <?php Field::checkbox( '[jquery_dependency]' ); ?>
30 - <label for="jquery_dependency">Disable</label>
31 - </div>
29 + <?php Option::init( [
30 + $opt['jquery'],
31 + $opt['inline'],
32 + $opt['minified'],
33 + $opt['attributes'],
34 + ] ); ?>
32 35
33 - <div class="wowp-field has-chackbox">
34 - <span class="label"><?php esc_html_e( 'Inline', 'wpcoder' ); ?></span>
35 - <?php Field::checkbox( '[inline_js]' ); ?>
36 - <label for="inline_js">Enable</label>
37 - </div>
36 + </fieldset>
38 37
39 - <div class="wowp-field">
40 - <label for="js_attributes" class="label"><?php esc_html_e( 'Minified', 'wpcoder' ); ?></label>
41 - <?php Field::select( '[minified_js]', 'obfuscate', [
42 - 'none' => 'none',
43 - 'minify' => 'Minify',
44 - 'obfuscate' => 'Obfuscate'
45 - ] ); ?>
38 + <fieldset>
39 + <div class="wowp-field is-full">
40 + <ol id="jsNavigationMenu" class="wowp-php-nav-menu"></ol>
41 + <button class="button-editor button" id="jsnav">Add NAV Comment</button>
46 42 </div>
47 -
48 - <div class="wowp-field">
49 - <label for="js_attributes" class="label"><?php esc_html_e( 'Attribute', 'wpcoder' ); ?></label>
50 - <?php Field::select( '[js_attributes]', null, [
51 - 0 => 'none',
52 - 'defer' => 'defer',
53 - 'async' => 'async'
54 - ] ); ?>
55 - </div>
56 -
57 43 </fieldset>
58 44
45 +<?php Option::init( [ $opt['js_code'] ] ); ?>
59 46
60 -<?php Field::textarea( 'js_code' ); ?>
47 + <div class="wowp-notification -warning">
48 + Please input only the JavaScript content, omitting the <code>script</code> tag
49 + </div>
61 50
62 51 <?php if ( ! empty( $js_link ) ): ?>
63 52 <div class="wowp-fields-group has-mt">
64 53 <div class="wowp-field is-full has-addon border-default">
@@ -68,8 +57,6 @@
68 57 <input type="url" id="url-css-file" readonly="readonly" value="<?php echo esc_url( $js_link ); ?>">
69 58 <span class="label"><?php esc_html_e( 'URL to the JS file', 'wpcoder' ); ?></span>
70 59 </div>
71 60 </div>
72 -<?php endif; ?>
61 +<?php endif;
73 62
74 -
75 -<?php