Skip to content

Commit 6e6d40c

Browse files
Plugin updated to version 4.23
1 parent 755f6dd commit 6e6d40c

14 files changed

+63
-30
lines changed

inc/php/enqueue.php

Lines changed: 45 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,49 @@
55
*/
66
defined( 'ABSPATH' ) or die( "Restricted access!" );
77

8+
/**
9+
* Callback to enqueue the CodeMirror library
10+
*/
11+
function spacexchimp_p001_load_scripts_codemirror() {
12+
13+
// Put value of constants to variables for easier access
14+
$prefix = SPACEXCHIMP_P001_PREFIX;
15+
$url = SPACEXCHIMP_P001_URL;
16+
$version = SPACEXCHIMP_P001_VERSION;
17+
18+
// Enqueue main files of the CodeMirror library
19+
wp_enqueue_style( $prefix . '-codemirror-css', $url . 'inc/lib/codemirror/lib/codemirror.css', array(), $version, 'all' );
20+
wp_enqueue_script( $prefix . '-codemirror-js', $url . 'inc/lib/codemirror/lib/codemirror.js', array(), $version, false );
21+
22+
// Enqueue settings file
23+
wp_enqueue_script( $prefix . '-codemirror-settings-js', $url . 'inc/js/codemirror-settings.js', array(), $version, true );
24+
25+
// Enqueue addons
26+
$addons = array(
27+
'display' => array( 'autorefresh', 'placeholder' ),
28+
'selection' => array( 'active-line' )
29+
);
30+
foreach ( $addons as $addons_group_name => $addons_group ) {
31+
foreach ( $addons_group as $addon ) {
32+
wp_enqueue_script( $prefix . '-codemirror-addon-' . $addon . '-js', $url . 'inc/lib/codemirror/addon/' . $addons_group_name . '/' . $addon . '.js', array(), $version, false );
33+
}
34+
}
35+
36+
// Enqueue modes
37+
$modes = array(
38+
'clike',
39+
'css',
40+
'htmlmixed',
41+
'javascript',
42+
'php',
43+
'xml'
44+
);
45+
foreach ( $modes as $mode ) {
46+
wp_enqueue_script( $prefix . '-codemirror-mode-' . $mode . '-js', $url . 'inc/lib/codemirror/mode/' . $mode . '/' . $mode . '.js', array(), $version, true );
47+
}
48+
49+
}
50+
851
/**
952
* Load scripts and style sheet for settings page
1053
*/
@@ -31,23 +74,8 @@ function spacexchimp_p001_load_scripts_admin( $hook ) {
3174
// Font Awesome library
3275
wp_enqueue_style( $prefix . '-font-awesome-css', $url . 'inc/lib/font-awesome/css/font-awesome.css', array(), $version, 'screen' );
3376

34-
// CodeMirror library
35-
wp_enqueue_style( $prefix . '-codemirror-css', $url . 'inc/lib/codemirror/lib/codemirror.css', array(), $version, 'all' );
36-
wp_enqueue_script( $prefix . '-codemirror-js', $url . 'inc/lib/codemirror/lib/codemirror.js', array(), $version, false );
37-
wp_enqueue_script( $prefix . '-codemirror-settings-js', $url . 'inc/js/codemirror-settings.js', array(), $version, true );
38-
$modes = array( 'clike', 'css', 'htmlmixed', 'javascript', 'php', 'xml' );
39-
foreach ( $modes as $mode ) {
40-
wp_enqueue_script( $prefix . '-codemirror-mode-' . $mode . '-js', $url . 'inc/lib/codemirror/mode/' . $mode . '/' . $mode . '.js', array(), $version, true );
41-
}
42-
$addons = array(
43-
'display' => array( 'autorefresh', 'placeholder' ),
44-
'selection' => array( 'active-line' )
45-
);
46-
foreach ( $addons as $addons_group_name => $addons_group ) {
47-
foreach ( $addons_group as $addon ) {
48-
wp_enqueue_script( $prefix . '-codemirror-addon-' . $addon . '-js', $url . 'inc/lib/codemirror/addon/' . $addons_group_name . '/' . $addon . '.js', array(), $version, false );
49-
}
50-
}
77+
// Call the function that enqueue the CodeMirror library
78+
spacexchimp_p001_load_scripts_codemirror();
5179

5280
// Other libraries
5381
wp_enqueue_script( $prefix . '-bootstrap-checkbox-js', $url . 'inc/lib/bootstrap-checkbox.js', array(), $version, false );
0 Bytes
Binary file not shown.

languages/my-custom-functions-de_DE.po

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,8 @@
33
msgid ""
44
msgstr ""
55
"Project-Id-Version: My Custom Functions\n"
6-
"POT-Creation-Date: 2018-06-30 20:01+0300\n"
7-
"PO-Revision-Date: 2018-06-30 20:01+0300\n"
6+
"POT-Creation-Date: 2018-07-12 01:18+0300\n"
7+
"PO-Revision-Date: 2018-07-12 01:18+0300\n"
88
"Last-Translator: Arthur Gareginyan\n"
99
"Language-Team: German\n"
1010
"Language: de_DE\n"
0 Bytes
Binary file not shown.

languages/my-custom-functions-es_ES.po

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,8 @@
33
msgid ""
44
msgstr ""
55
"Project-Id-Version: My Custom Functions\n"
6-
"POT-Creation-Date: 2018-06-30 20:01+0300\n"
7-
"PO-Revision-Date: 2018-06-30 20:01+0300\n"
6+
"POT-Creation-Date: 2018-07-12 01:18+0300\n"
7+
"PO-Revision-Date: 2018-07-12 01:18+0300\n"
88
"Last-Translator: Arthur Gareginyan\n"
99
"Language-Team: Spanish\n"
1010
"Language: es_ES\n"
0 Bytes
Binary file not shown.

languages/my-custom-functions-fr_FR.po

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,8 @@
33
msgid ""
44
msgstr ""
55
"Project-Id-Version: My Custom Functions\n"
6-
"POT-Creation-Date: 2018-06-30 20:01+0300\n"
7-
"PO-Revision-Date: 2018-06-30 20:01+0300\n"
6+
"POT-Creation-Date: 2018-07-12 01:18+0300\n"
7+
"PO-Revision-Date: 2018-07-12 01:18+0300\n"
88
"Last-Translator: Arthur Gareginyan\n"
99
"Language-Team: French\n"
1010
"Language: fr_FR\n"
0 Bytes
Binary file not shown.

languages/my-custom-functions-ru_RU.po

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,8 @@
33
msgid ""
44
msgstr ""
55
"Project-Id-Version: My Custom Functions\n"
6-
"POT-Creation-Date: 2018-06-30 20:01+0300\n"
7-
"PO-Revision-Date: 2018-06-30 20:01+0300\n"
6+
"POT-Creation-Date: 2018-07-12 01:18+0300\n"
7+
"PO-Revision-Date: 2018-07-12 01:18+0300\n"
88
"Last-Translator: Arthur Gareginyan\n"
99
"Language-Team: Russian\n"
1010
"Language: ru_RU\n"
0 Bytes
Binary file not shown.

0 commit comments

Comments
 (0)