Version Description
- Added ability to share network snippets to individual sites on WordPress multisite
- Improved code directory and class structure
- Remove legacy code for pre-3.6 compatibility
- Improved code for printing admin messages
- Updated German translation (Joerg Knoerchen)
- Added
code_snippets/after_execute_snippet
filter - Added class for individual snippets
- Updated
get_snippets()
function to retrieve individual snippets - Removed scope statuses and added fixed tags to indicate scope
- Changed admin page headers to use
<h1>
tags instead of<h2>
tags - Updated CodeMirror to version 5.6
- Removed snippet settings page from network admin
Download this release
Release Info
Developer | bungeshea |
Plugin | Code Snippets |
Version | 2.4.0 |
Comparing to | |
See all releases |
Code changes from version 2.2.3 to 2.4.0
- admin/help/import.php +0 -41
- admin/help/manage.php +0 -42
- admin/help/single.php +0 -47
- admin/messages/import.php +0 -34
- admin/messages/manage.php +0 -42
- admin/messages/single.php +0 -36
- admin/views/import.php +0 -47
- admin/views/manage.php +0 -51
- admin/views/single.php +0 -122
- assets/css/admin-single.css +0 -1
- assets/css/menu-icon.css +0 -1
- assets/css/screen-icon.css +0 -1
- assets/css/table-legacy.css +0 -1
- assets/css/table.css +0 -1
- assets/font/code-snippets.eot +0 -0
- assets/font/code-snippets.svg +0 -11
- assets/font/code-snippets.ttf +0 -0
- assets/font/code-snippets.woff +0 -0
- assets/images/menu-icon.png +0 -0
- assets/images/screen-icon.png +0 -0
- assets/js/admin-single.js +0 -19
- assets/scss/admin-single.scss +0 -45
- assets/scss/menu-icon.scss +0 -19
- assets/scss/screen-icon.scss +0 -7
- assets/scss/table-legacy.scss +0 -51
- assets/scss/table.scss +0 -80
- code-snippets.php +13 -16
- css/build/edit-snippet.css +0 -53
- css/build/manage-snippets.css +0 -80
- css/build/menu-icon.css +0 -16
- css/edit-snippet.scss +0 -51
- css/manage-snippets.scss +0 -84
- css/menu-icon.scss +0 -19
- css/min/cmthemes/3024-day.css +1 -1
- css/min/cmthemes/3024-night.css +1 -1
- css/min/cmthemes/abcdef.css +1 -0
- css/min/cmthemes/ambiance.css +1 -1
- css/min/cmthemes/base16-dark.css +1 -1
- css/min/cmthemes/base16-light.css +1 -1
- css/min/cmthemes/blackboard.css +1 -1
- css/min/cmthemes/cobalt.css +1 -1
- css/min/cmthemes/colorforth.css +1 -1
- css/min/cmthemes/dracula.css +1 -0
- css/min/cmthemes/eclipse.css +1 -1
- css/min/cmthemes/elegant.css +1 -1
- css/min/cmthemes/erlang-dark.css +1 -1
- css/min/cmthemes/icecoder.css +1 -0
- css/min/cmthemes/lesser-dark.css +1 -1
- css/min/cmthemes/liquibyte.css +1 -1
- css/min/cmthemes/material.css +1 -0
- css/min/cmthemes/mbo.css +1 -1
- css/min/cmthemes/mdn-like.css +1 -1
- css/min/cmthemes/midnight.css +1 -1
- css/min/cmthemes/monokai.css +1 -1
- css/min/cmthemes/neat.css +1 -1
- css/min/cmthemes/neo.css +1 -1
- css/min/cmthemes/night.css +1 -1
- css/min/cmthemes/paraiso-dark.css +1 -1
- css/min/cmthemes/paraiso-light.css +1 -1
- css/min/cmthemes/pastel-on-dark.css +1 -1
- css/min/cmthemes/rubyblue.css +1 -1
- css/min/cmthemes/seti.css +1 -0
- css/min/cmthemes/solarized.css +1 -1
- css/min/cmthemes/the-matrix.css +1 -1
- css/min/cmthemes/tomorrow-night-bright.css +1 -1
- css/min/cmthemes/tomorrow-night-eighties.css +1 -1
- css/min/cmthemes/ttcn.css +1 -0
- css/min/cmthemes/twilight.css +1 -1
- css/min/cmthemes/vibrant-ink.css +1 -1
- css/min/cmthemes/xq-dark.css +1 -1
- css/min/cmthemes/xq-light.css +1 -1
- css/min/cmthemes/yeti.css +1 -0
- css/min/cmthemes/zenburn.css +1 -1
- css/min/codemirror.css +1 -1
- css/min/edit-snippet.css +0 -1
- css/min/edit.css +1 -1
- css/min/manage-snippets.css +0 -1
- css/min/manage.css +1 -1
- includes/admin-menus/class-admin-menu.php +96 -0
- includes/admin-menus/class-edit-menu.php +340 -0
- includes/admin-menus/class-import-menu.php +105 -0
- includes/admin-menus/class-manage-menu.php +106 -0
- includes/admin-menus/class-settings-menu.php +50 -0
- includes/admin.php +43 -96
- includes/caps.php +3 -3
- includes/class-admin.php +0 -777
- includes/class-export-php.php +0 -78
- includes/class-export.php +48 -53
- includes/class-list-table.php +993 -708
- includes/class-snippet.php +241 -0
- includes/contextual-help.php +124 -0
- includes/db.php +21 -27
- includes/edit/admin-help.php +0 -47
- includes/edit/admin-messages.php +0 -36
- includes/edit/edit.php +0 -313
- includes/editor.php +45 -4
- includes/functions.php +72 -23
- includes/import/admin-help.php +0 -41
- includes/import/admin-messages.php +0 -32
- includes/import/import.php +0 -112
- includes/manage/admin-help.php +0 -41
- includes/manage/admin-messages.php +0 -42
- includes/manage/admin.php +0 -51
- includes/manage/class-list-table.php +0 -815
- includes/manage/manage.php +0 -99
- includes/settings/admin.php +0 -52
- includes/settings/class-settings.php +19 -12
- includes/settings/editor-preview.php +16 -1
- includes/settings/settings-fields.php +7 -1
- includes/settings/settings.php +34 -40
- includes/snippet-ops.php +170 -205
- includes/upgrade.php +4 -0
- includes/{edit/admin.php → views/edit.php} +29 -19
- includes/{import/admin.php → views/import.php} +2 -4
- includes/views/manage.php +45 -0
- js/min/codemirror.js +6 -6
- js/vendor/jquery.tagit.css +0 -67
- js/vendor/tag-it.min.js +0 -16
- js/vendor/tagit.ui-zendesk.css +0 -56
- languages/code-snippets-de_DE.mo +0 -0
- languages/code-snippets-de_DE.po +196 -109
- languages/code-snippets-fr_FR.mo +0 -0
- languages/code-snippets-fr_FR.po +1 -1
- languages/code-snippets-ja.mo +0 -0
- languages/code-snippets-ja.po +0 -569
- languages/code-snippets-ru_RU.mo +0 -0
- languages/code-snippets-ru_RU.po +623 -359
- languages/code-snippets.pot +412 -382
- license.txt +1 -1
- readme.txt +32 -3
- vendor/codemirror/addon/edit/matchbrackets.js +0 -120
- vendor/codemirror/addon/search/search.js +0 -167
- vendor/codemirror/addon/search/searchcursor.js +0 -189
- vendor/codemirror/lib/codemirror.css +0 -325
- vendor/codemirror/lib/codemirror.js +0 -1194
admin/help/import.php
DELETED
@@ -1,41 +0,0 @@
|
|
1 |
-
<?php
|
2 |
-
|
3 |
-
/**
|
4 |
-
* Register and handle the help tabs for the
|
5 |
-
* import snippets admin page
|
6 |
-
*
|
7 |
-
* @package Code_Snippets
|
8 |
-
* @subpackage Contextual_Help
|
9 |
-
*/
|
10 |
-
|
11 |
-
global $code_snippets;
|
12 |
-
$screen = get_current_screen();
|
13 |
-
|
14 |
-
$screen->add_help_tab( array(
|
15 |
-
'id' => 'overview',
|
16 |
-
'title' => __( 'Overview', 'code-snippets' ),
|
17 |
-
'content' =>
|
18 |
-
'<p>' . __( 'Snippets are similar to plugins - they both extend and expand the functionality of WordPress. Snippets are more light-weight, just a few lines of code, and do not put as much load on your server. Here you can load snippets from a Code Snippets (.xml) import file into the database with your existing snippets.', 'code-snippets' ) . '</p>'
|
19 |
-
) );
|
20 |
-
|
21 |
-
$screen->add_help_tab( array(
|
22 |
-
'id' => 'import',
|
23 |
-
'title' => __( 'Importing', 'code-snippets' ),
|
24 |
-
'content' =>
|
25 |
-
'<p>' . __( 'You can load your snippets from a code snippets (.xml) export file using this page.', 'code-snippets' ) .
|
26 |
-
sprintf( __( 'Snippets will be added to the database along with your existing snippets. Regardless of whether the snippets were active on the previous site, imported snippets are always inactive until activated using the <a href="%s">Manage Snippets</a> page.</p>', 'code-snippets' ), $code_snippets->admin->manage_url ) . '</p>'
|
27 |
-
) );
|
28 |
-
|
29 |
-
$screen->add_help_tab( array(
|
30 |
-
'id' => 'export',
|
31 |
-
'title' => __( 'Exporting', 'code-snippets' ),
|
32 |
-
'content' =>
|
33 |
-
'<p>' . sprintf( __( 'You can save your snippets to a Code Snippets (.xml) export file using the <a href="%s">Manage Snippets</a> page.', 'code-snippets' ), $code_snippets->admin->manage_url ) . '</p>'
|
34 |
-
) );
|
35 |
-
|
36 |
-
$screen->set_help_sidebar(
|
37 |
-
'<p><strong>' . __( 'For more information:', 'code-snippets' ) . '</strong></p>' .
|
38 |
-
'<p>' . __( '<a href="http://wordpress.org/plugins/code-snippets" target="_blank">WordPress Extend</a>', 'code-snippets' ) . '</p>' .
|
39 |
-
'<p>' . __( '<a href="http://wordpress.org/support/plugin/code-snippets" target="_blank">Support Forums</a>', 'code-snippets' ) . '</p>' .
|
40 |
-
'<p>' . __( '<a href="http://code-snippets.bungeshea.com/" target="_blank">Project Website</a>', 'code-snippets' ) . '</p>'
|
41 |
-
);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
admin/help/manage.php
DELETED
@@ -1,42 +0,0 @@
|
|
1 |
-
<?php
|
2 |
-
|
3 |
-
/**
|
4 |
-
* Register and handle the help tabs for the
|
5 |
-
* manage snippets admin page
|
6 |
-
*
|
7 |
-
* @package Code_Snippets
|
8 |
-
* @subpackage Contextual_Help
|
9 |
-
*/
|
10 |
-
|
11 |
-
global $code_snippets;
|
12 |
-
$screen = get_current_screen();
|
13 |
-
|
14 |
-
$screen->add_help_tab( array(
|
15 |
-
'id' => 'overview',
|
16 |
-
'title' => __( 'Overview', 'code-snippets' ),
|
17 |
-
'content' =>
|
18 |
-
'<p>' . __( 'Snippets are similar to plugins - they both extend and expand the functionality of WordPress. Snippets are more light-weight, just a few lines of code, and do not put as much load on your server. Here you can manage your existing snippets and preform tasks on them such as activating, deactivating, deleting and exporting.', 'code-snippets' ) . '</p>'
|
19 |
-
) );
|
20 |
-
|
21 |
-
$screen->add_help_tab( array(
|
22 |
-
'id' => 'safe-mode',
|
23 |
-
'title' => __( 'Safe Mode', 'code-snippets' ),
|
24 |
-
'content' =>
|
25 |
-
'<p>' . __( 'Be sure to check your snippets for errors before you activate them, as a faulty snippet could bring your whole blog down. If your site starts doing strange things, deactivate all your snippets and activate them one at a time.', 'code-snippets' ) . '</p>' .
|
26 |
-
'<p>' . __("If something goes wrong with a snippet and you can't use WordPress, you can cause all snippets to stop executing by adding <code>define('CODE_SNIPPETS_SAFE_MODE', true);</code> to your <code>wp-config.php</code> file. After you have deactivated the offending snippet, you can turn off safe mode by removing this line or replacing <strong>true</strong> with <strong>false</strong>.", 'code-snippets' ) . '</p>'
|
27 |
-
) );
|
28 |
-
|
29 |
-
$screen->add_help_tab( array(
|
30 |
-
'id' => 'uninstall',
|
31 |
-
'title' => __( 'Uninstall', 'code-snippets' ),
|
32 |
-
'content' =>
|
33 |
-
'<p>' . sprintf( __( 'When you delete Code Snippets through the Plugins menu in WordPress it will clear up the <code>%1$s</code> table and a few other bits of data stored in the database. If you want to keep this data (ie: you are only temporally uninstalling Code Snippets) then remove the <code>%2$s</code> folder using FTP.', 'code-snippets' ), $code_snippets->get_table_name(), $code_snippets->plugin_dir ) .
|
34 |
-
'<p>' . __("Even if you're sure that you don't want to use Code Snippets ever again on this WordPress installation, you may want to use the export feature to back up your snippets.", 'code-snippets' ) . '</p>'
|
35 |
-
) );
|
36 |
-
|
37 |
-
$screen->set_help_sidebar(
|
38 |
-
'<p><strong>' . __( 'For more information:', 'code-snippets' ) . '</strong></p>' .
|
39 |
-
'<p>' . __( '<a href="http://wordpress.org/plugins/code-snippets" target="_blank">WordPress Extend</a></p>', 'code-snippets' ) . '</p>' .
|
40 |
-
'<p>' . __( '<a href="http://wordpress.org/support/plugin/code-snippets" target="_blank">Support Forums</a>', 'code-snippets' ) . '</p>' .
|
41 |
-
'<p>' . __( '<a href="http://code-snippets.bungeshea.com/" target="_blank">Project Website</a>', 'code-snippets' ) . '</p>'
|
42 |
-
);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
admin/help/single.php
DELETED
@@ -1,47 +0,0 @@
|
|
1 |
-
<?php
|
2 |
-
|
3 |
-
/**
|
4 |
-
* Register and handle the help tabs for the
|
5 |
-
* single snippet admin page
|
6 |
-
*
|
7 |
-
* @package Code_Snippets
|
8 |
-
* @subpackage Contextual_Help
|
9 |
-
*/
|
10 |
-
|
11 |
-
$screen = get_current_screen();
|
12 |
-
|
13 |
-
$screen->add_help_tab( array(
|
14 |
-
'id' => 'overview',
|
15 |
-
'title' => __( 'Overview', 'code-snippets' ),
|
16 |
-
'content' =>
|
17 |
-
'<p>' . __( 'Snippets are similar to plugins - they both extend and expand the functionality of WordPress. Snippets are more light-weight, just a few lines of code, and do not put as much load on your server. Here you can add a new snippet, or edit an existing one.', 'code-snippets' ) . '</p>',
|
18 |
-
) );
|
19 |
-
|
20 |
-
$screen->add_help_tab( array(
|
21 |
-
'id' => 'finding',
|
22 |
-
'title' => __( 'Finding Snippets', 'code-snippets' ),
|
23 |
-
'content' =>
|
24 |
-
'<p>' . __( 'Here are some links to websites which host a large number of snippets that you can add to your site.
|
25 |
-
<ul>
|
26 |
-
<li><a href="http://wp-snippets.com" title="WordPress Snippets">WP-Snippets</a></li>
|
27 |
-
<li><a href="http://wpsnipp.com" title="WP Snipp">WP Snipp</a></li>
|
28 |
-
<li><a href="http://www.catswhocode.com/blog/snippets" title="Cats Who Code Snippet Library">Cats Who Code</a></li>
|
29 |
-
<li><a href="http://www.wpfunction.me">WP Function Me</a></li>
|
30 |
-
</ul>', 'code-snippets' ) .
|
31 |
-
__( 'More places to find snippets, as well as a selection of example snippets, can be found in the <a href="http://code-snippets.bungeshea.com/docs/finding-snippets/">plugin documentation</a>', 'code-snippets' ) . '</p>'
|
32 |
-
) );
|
33 |
-
|
34 |
-
$screen->add_help_tab( array(
|
35 |
-
'id' => 'adding',
|
36 |
-
'title' => __( 'Adding Snippets', 'code-snippets' ),
|
37 |
-
'content' =>
|
38 |
-
'<p>' . __( 'You need to fill out the name and code fields for your snippet to be added. While the description field will add more information about how your snippet works, what is does and where you found it, it is completely optional.', 'code-snippets' ) . '</p>' .
|
39 |
-
'<p>' . __( 'Please be sure to check that your snippet is valid PHP code and will not produce errors before adding it through this page. While doing so will not become active straight away, it will help to minimise the chance of a faulty snippet becoming active on your site.', 'code-snippets' ) . '</p>'
|
40 |
-
) );
|
41 |
-
|
42 |
-
$screen->set_help_sidebar(
|
43 |
-
'<p><strong>' . __( 'For more information:', 'code-snippets' ) . '</strong></p>' .
|
44 |
-
'<p>' . __( '<a href="http://wordpress.org/plugins/code-snippets" target="_blank">WordPress Extend</a>', 'code-snippets' ) . '</p>' .
|
45 |
-
'<p>' . __( '<a href="http://wordpress.org/support/plugin/code-snippets" target="_blank">Support Forums</a>', 'code-snippets' ) . '</p>' .
|
46 |
-
'<p>' . __( '<a href="http://code-snippets.bungeshea.com/" target="_blank">Project Website</a>', 'code-snippets' ) . '</p>'
|
47 |
-
);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
admin/messages/import.php
DELETED
@@ -1,34 +0,0 @@
|
|
1 |
-
<?php
|
2 |
-
|
3 |
-
/**
|
4 |
-
* Status and error messages for the import snippets page
|
5 |
-
*
|
6 |
-
* @package Code_Snippets
|
7 |
-
* @subpackage Admin_Messages
|
8 |
-
*/
|
9 |
-
|
10 |
-
global $code_snippets;
|
11 |
-
|
12 |
-
if ( isset( $_REQUEST['imported'] ) && 0 !== intval( $_REQUEST['imported'] ) ) {
|
13 |
-
|
14 |
-
echo '<div id="message" class="updated fade"><p>';
|
15 |
-
|
16 |
-
printf(
|
17 |
-
_n(
|
18 |
-
'Successfully imported <strong>%d</strong> snippet. <a href="%s">Have fun!</a>',
|
19 |
-
'Successfully imported <strong>%d</strong> snippets. <a href="%s">Have fun!</a>',
|
20 |
-
$_REQUEST['imported'],
|
21 |
-
'code-snippets'
|
22 |
-
),
|
23 |
-
$_REQUEST['imported'],
|
24 |
-
$code_snippets->admin->manage_url
|
25 |
-
);
|
26 |
-
|
27 |
-
echo '</p></div>';
|
28 |
-
}
|
29 |
-
elseif ( isset( $_REQUEST['error'] ) && $_REQUEST['error'] ) {
|
30 |
-
printf (
|
31 |
-
'<div id="message" class="error fade"><p>%s</p></div>',
|
32 |
-
__( 'An error occurred when processing the import file.', 'code-snippets' )
|
33 |
-
);
|
34 |
-
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
admin/messages/manage.php
DELETED
@@ -1,42 +0,0 @@
|
|
1 |
-
<?php
|
2 |
-
|
3 |
-
/**
|
4 |
-
* Status and error messages for the manage snippets page
|
5 |
-
*
|
6 |
-
* @package Code_Snippets
|
7 |
-
* @subpackage Admin_Messages
|
8 |
-
*/
|
9 |
-
|
10 |
-
$_f = '<div id="message" class="%2$s fade"><p>%1$s</p></div>';
|
11 |
-
|
12 |
-
if ( defined( 'CODE_SNIPPETS_SAFE_MODE' ) && CODE_SNIPPETS_SAFE_MODE ) :
|
13 |
-
|
14 |
-
printf ( $_f, __( '<strong>Warning:</strong> Safe mode is active and snippets will not execute! Remove the <code>CODE_SNIPPETS_SAFE_MODE</code> constant from <code>wp-config.php</code> to turn off safe mode. <a href="http://code-snippets.bungeshea.com/docs/safe-mode/" target="_blank">Help</a>', 'code-snippets' ), 'error' );
|
15 |
-
|
16 |
-
endif;
|
17 |
-
|
18 |
-
if ( isset( $_REQUEST['activate'] ) ) :
|
19 |
-
|
20 |
-
printf ( $_f, __( 'Snippet <strong>activated</strong>.', 'code-snippets' ), 'updated' );
|
21 |
-
|
22 |
-
elseif ( isset( $_REQUEST['activate-multi'] ) ) :
|
23 |
-
|
24 |
-
printf ( $_f, __( 'Selected snippets <strong>activated</strong>.', 'code-snippets' ), 'updated' );
|
25 |
-
|
26 |
-
elseif ( isset( $_REQUEST['deactivate'] ) ) :
|
27 |
-
|
28 |
-
printf ( $_f, __( 'Snippet <strong>deactivated</strong>.', 'code-snippets' ), 'updated' );
|
29 |
-
|
30 |
-
elseif ( isset( $_REQUEST['deactivate-multi'] ) ) :
|
31 |
-
|
32 |
-
printf ( $_f, __( 'Selected snippets <strong>deactivated</strong>.', 'code-snippets' ), 'updated' );
|
33 |
-
|
34 |
-
elseif ( isset( $_REQUEST['delete'] ) ) :
|
35 |
-
|
36 |
-
printf ( $_f, __( 'Snippet <strong>deleted</strong>.', 'code-snippets' ), 'updated' );
|
37 |
-
|
38 |
-
elseif ( isset( $_REQUEST['delete-multi'] ) ) :
|
39 |
-
|
40 |
-
printf ( $_f, __( 'Selected snippets <strong>deleted</strong>.', 'code-snippets' ), 'updated' );
|
41 |
-
|
42 |
-
endif;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
admin/messages/single.php
DELETED
@@ -1,36 +0,0 @@
|
|
1 |
-
<?php
|
2 |
-
|
3 |
-
/**
|
4 |
-
* Status and error messages for the single snippet page
|
5 |
-
*
|
6 |
-
* @package Code_Snippets
|
7 |
-
* @subpackage Admin_Messages
|
8 |
-
*/
|
9 |
-
|
10 |
-
$_f = '<div id="message" class="%2$s fade"><p>%1$s</p></div>';
|
11 |
-
|
12 |
-
if ( isset( $_REQUEST['invalid'] ) && $_REQUEST['invalid'] ) :
|
13 |
-
|
14 |
-
printf ( $_f, __( 'An error occurred when saving the snippet.', 'code-snippets' ), 'error' );
|
15 |
-
|
16 |
-
elseif ( isset( $_REQUEST['activated'], $_REQUEST['updated'] ) && $_REQUEST['activated'] && $_REQUEST['updated'] ) :
|
17 |
-
|
18 |
-
printf ( $_f, __( 'Snippet <strong>updated</strong> and <strong>activated</strong>.', 'code-snippets' ), 'updated' );
|
19 |
-
|
20 |
-
elseif ( isset( $_REQUEST['activated'], $_REQUEST['added'] ) && $_REQUEST['activated'] && $_REQUEST['added'] ) :
|
21 |
-
|
22 |
-
printf ( $_f, __( 'Snippet <strong>added</strong> and <strong>activated</strong>.', 'code-snippets' ), 'updated' );
|
23 |
-
|
24 |
-
elseif ( isset( $_REQUEST['deactivated'], $_REQUEST['updated'] ) && $_REQUEST['deactivated'] && $_REQUEST['updated'] ) :
|
25 |
-
|
26 |
-
printf ( $_f, __( 'Snippet <strong>updated</strong> and <strong>deactivated</strong>.', 'code-snippets' ), 'updated' );
|
27 |
-
|
28 |
-
elseif ( isset( $_REQUEST['updated'] ) && $_REQUEST['updated'] ) :
|
29 |
-
|
30 |
-
printf ( $_f, __( 'Snippet <strong>updated</strong>.', 'code-snippets' ), 'updated' );
|
31 |
-
|
32 |
-
elseif ( isset( $_REQUEST['added'] ) && $_REQUEST['added'] ) :
|
33 |
-
|
34 |
-
printf ( $_f, __( 'Snippet <strong>added</strong>.', 'code-snippets' ), 'updated' );
|
35 |
-
|
36 |
-
endif;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
admin/views/import.php
DELETED
@@ -1,47 +0,0 @@
|
|
1 |
-
<?php
|
2 |
-
|
3 |
-
/**
|
4 |
-
* HTML code for the Import Snippets page
|
5 |
-
*
|
6 |
-
* @package Code_Snippets
|
7 |
-
* @subpackage Admin_Views
|
8 |
-
*/
|
9 |
-
|
10 |
-
if ( ! class_exists( 'Code_Snippets' ) )
|
11 |
-
exit;
|
12 |
-
|
13 |
-
global $code_snippets;
|
14 |
-
|
15 |
-
$code_snippets->admin->get_messages( 'import' );
|
16 |
-
|
17 |
-
?>
|
18 |
-
<div class="wrap">
|
19 |
-
<?php screen_icon(); ?>
|
20 |
-
<h2><?php _e( 'Import Snippets', 'code-snippets' ); ?></h2>
|
21 |
-
|
22 |
-
<div class="narrow">
|
23 |
-
|
24 |
-
<p><?php _e( 'Howdy! Upload your Code Snippets export file and we’ll import the snippets to this site.', 'code-snippets' ); ?></p>
|
25 |
-
|
26 |
-
<p><?php printf( __( 'You will need to go to the <a href="%s">Manage Snippets</a> page to activate the imported snippets.', 'code-snippets' ), $code_snippets->admin->manage_url ); ?></p>
|
27 |
-
|
28 |
-
<p><?php _e( 'Choose a Code Snippets (.xml) file to upload, then click Upload file and import.', 'code-snippets' ); ?></p>
|
29 |
-
|
30 |
-
<form enctype="multipart/form-data" method="post" action="" id="import-upload-form" name="code_snippets_import">
|
31 |
-
<p>
|
32 |
-
<input type="hidden" name="action" value="save" />
|
33 |
-
<input type="hidden" name="max_file_size" value="8388608" />
|
34 |
-
|
35 |
-
<label for="upload"><?php _e( 'Choose a file from your computer:', 'code-snippets' ); ?></label>
|
36 |
-
<?php _e( '(Maximum size: 8MB)', 'code-snippets' ); ?>
|
37 |
-
<input type="file" id="upload" name="code_snippets_import_file" size="25" accept="text/xml" />
|
38 |
-
</p>
|
39 |
-
|
40 |
-
<?php
|
41 |
-
do_action( 'code_snippets/admin/import_form' );
|
42 |
-
submit_button( __( 'Upload file and import', 'code-snippets' ) );
|
43 |
-
?>
|
44 |
-
|
45 |
-
</form>
|
46 |
-
</div>
|
47 |
-
</div>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
admin/views/manage.php
DELETED
@@ -1,51 +0,0 @@
|
|
1 |
-
<?php
|
2 |
-
|
3 |
-
/**
|
4 |
-
* HTML code for the Manage Snippets page
|
5 |
-
*
|
6 |
-
* @package Code_Snippets
|
7 |
-
* @subpackage Admin_Views
|
8 |
-
*/
|
9 |
-
|
10 |
-
if ( ! class_exists( 'Code_Snippets' ) )
|
11 |
-
exit;
|
12 |
-
|
13 |
-
global $code_snippets;
|
14 |
-
$screen = get_current_screen();
|
15 |
-
$code_snippets->admin->get_messages( 'manage' );
|
16 |
-
?>
|
17 |
-
|
18 |
-
<div class="wrap">
|
19 |
-
<?php screen_icon(); ?>
|
20 |
-
<h2><?php
|
21 |
-
esc_html_e( 'Snippets', 'code-snippets' );
|
22 |
-
|
23 |
-
if ( $code_snippets->user_can( 'install' ) ) {
|
24 |
-
|
25 |
-
printf ( '<a href="%2$s" class="add-new-h2">%1$s</a>',
|
26 |
-
esc_html_x( 'Add New', 'snippet', 'code-snippets' ),
|
27 |
-
$code_snippets->admin->single_url
|
28 |
-
);
|
29 |
-
}
|
30 |
-
|
31 |
-
$code_snippets->list_table->search_notice();
|
32 |
-
?></h2>
|
33 |
-
|
34 |
-
<?php $code_snippets->list_table->views(); ?>
|
35 |
-
|
36 |
-
<form method="get" action="">
|
37 |
-
<?php
|
38 |
-
$code_snippets->list_table->required_form_fields( 'search_box' );
|
39 |
-
$code_snippets->list_table->search_box( __( 'Search Installed Snippets', 'code-snippets' ), 'search_id' );
|
40 |
-
?>
|
41 |
-
</form>
|
42 |
-
<form method="post" action="">
|
43 |
-
<?php
|
44 |
-
$code_snippets->list_table->required_form_fields();
|
45 |
-
$code_snippets->list_table->display();
|
46 |
-
?>
|
47 |
-
</form>
|
48 |
-
|
49 |
-
<?php do_action( 'code_snippets/admin/manage' ); ?>
|
50 |
-
|
51 |
-
</div>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
admin/views/single.php
DELETED
@@ -1,122 +0,0 @@
|
|
1 |
-
<?php
|
2 |
-
|
3 |
-
/**
|
4 |
-
* HTML code for the Add New/Edit Snippet page
|
5 |
-
*
|
6 |
-
* @package Code_Snippets
|
7 |
-
* @subpackage Admin_Views
|
8 |
-
*/
|
9 |
-
|
10 |
-
if ( ! class_exists( 'Code_Snippets' ) )
|
11 |
-
exit;
|
12 |
-
|
13 |
-
global $code_snippets;
|
14 |
-
|
15 |
-
$table = $code_snippets->get_table_name();
|
16 |
-
$screen = get_current_screen();
|
17 |
-
|
18 |
-
$edit_id = ( isset( $_REQUEST['edit'] ) ? absint( $_REQUEST['edit'] ) : 0 );
|
19 |
-
$snippet = $code_snippets->get_snippet( $edit_id );
|
20 |
-
|
21 |
-
$code_snippets->admin->get_messages( 'single' );
|
22 |
-
|
23 |
-
?>
|
24 |
-
|
25 |
-
<div class="wrap">
|
26 |
-
<?php screen_icon(); ?>
|
27 |
-
<h2><?php
|
28 |
-
if ( $edit_id ) {
|
29 |
-
esc_html_e( 'Edit Snippet', 'code-snippets' );
|
30 |
-
|
31 |
-
if ( $code_snippets->user_can( 'install' ) )
|
32 |
-
printf( ' <a href="%1$s" class="add-new-h2">%2$s</a>',
|
33 |
-
$code_snippets->admin->single_url,
|
34 |
-
esc_html_x( 'Add New', 'snippet', 'code-snippets' )
|
35 |
-
);
|
36 |
-
} else {
|
37 |
-
esc_html_e( 'Add New Snippet', 'code-snippets' );
|
38 |
-
}
|
39 |
-
?></h2>
|
40 |
-
|
41 |
-
<form method="post" action="" style="margin-top: 10px;">
|
42 |
-
<?php
|
43 |
-
|
44 |
-
/* Output the hidden fields */
|
45 |
-
|
46 |
-
if ( 0 !== $snippet->id )
|
47 |
-
printf ( '<input type="hidden" name="snippet_id" value="%d" />', $snippet->id );
|
48 |
-
|
49 |
-
printf ( '<input type="hidden" name="snippet_active" value="%d" />', $snippet->active );
|
50 |
-
?>
|
51 |
-
<div id="titlediv">
|
52 |
-
<div id="titlewrap">
|
53 |
-
<label for="title" style="display: none;"><?php _e( 'Name (short title)', 'code-snippets' ); ?></label>
|
54 |
-
<input id="title" type="text" autocomplete="off" name="snippet_name" value="<?php echo $snippet->name; ?>" placeholder="<?php _e( 'Name (short title)', 'code-snippets' ); ?>" />
|
55 |
-
</div>
|
56 |
-
</div>
|
57 |
-
|
58 |
-
<label for="snippet_code">
|
59 |
-
<h3><?php _e( 'Code', 'code-snippets' ); ?></h3>
|
60 |
-
</label>
|
61 |
-
|
62 |
-
<textarea id="snippet_code" name="snippet_code" rows="20" spellcheck="false" style="font-family: monospace; width: 100%;"><?php echo esc_textarea( $snippet->code ); ?></textarea>
|
63 |
-
|
64 |
-
<?php
|
65 |
-
|
66 |
-
/* Allow addon plugins (and us!) to add fields and content to this page */
|
67 |
-
do_action( 'code_snippets/admin/single', $snippet );
|
68 |
-
|
69 |
-
/* Add a nonce for security */
|
70 |
-
wp_nonce_field( 'save_snippet' );
|
71 |
-
|
72 |
-
?>
|
73 |
-
|
74 |
-
<p class="submit">
|
75 |
-
<?php
|
76 |
-
|
77 |
-
/* Save Snippet button */
|
78 |
-
|
79 |
-
submit_button( null, 'primary', 'save_snippet', false );
|
80 |
-
|
81 |
-
/* Save Snippet & Activate/Deactivate button */
|
82 |
-
|
83 |
-
if ( ! $snippet->active ) {
|
84 |
-
submit_button(
|
85 |
-
__( 'Save Changes & Activate', 'code-snippets' ),
|
86 |
-
'secondary', 'save_snippet_activate', false
|
87 |
-
);
|
88 |
-
|
89 |
-
} else {
|
90 |
-
submit_button(
|
91 |
-
__( 'Save Changes & Deactivate', 'code-snippets' ),
|
92 |
-
'secondary', 'save_snippet_deactivate', false
|
93 |
-
);
|
94 |
-
}
|
95 |
-
|
96 |
-
if ( 0 !== $snippet->id ) {
|
97 |
-
|
98 |
-
/* Export button */
|
99 |
-
|
100 |
-
submit_button( __( 'Export', 'code-snippets' ), 'secondary', 'export_snippet', false );
|
101 |
-
|
102 |
-
/* Delete button */
|
103 |
-
|
104 |
-
$confirm_delete_js = esc_js(
|
105 |
-
sprintf (
|
106 |
-
'return confirm("%s");',
|
107 |
-
__( "You are about to permanently delete this snippet.\n'Cancel' to stop, 'OK' to delete.", 'code-snippets' )
|
108 |
-
)
|
109 |
-
);
|
110 |
-
|
111 |
-
submit_button(
|
112 |
-
__( 'Delete', 'code-snippets' ),
|
113 |
-
'secondary', 'delete_snippet', false,
|
114 |
-
sprintf ( 'onclick="%s"', $confirm_delete_js )
|
115 |
-
);
|
116 |
-
}
|
117 |
-
|
118 |
-
?>
|
119 |
-
</p>
|
120 |
-
|
121 |
-
</form>
|
122 |
-
</div>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
assets/css/admin-single.css
DELETED
@@ -1 +0,0 @@
|
|
1 |
-
h3{margin:1em 0}label{cursor:auto}label[for="snippet_description"] h3 div{position:absolute}.submit .button{margin-right:.5em}.CodeMirror{min-height:300px;width:100%;height:auto;border:1px solid #dfdfdf;border-radius:3px;background-color:#fff}.CodeMirror-scroll{overflow-x:auto;overflow-y:hidden}.CodeMirror-sizer{min-height:300px!important}
|
|
assets/css/menu-icon.css
DELETED
@@ -1 +0,0 @@
|
|
1 |
-
@font-face{font-family:'code-snippets';src:url('../font/code-snippets.eot');src:url('../font/code-snippets.eot?#iefix') format('embedded-opentype'),url('../font/code-snippets.ttf') format('truetype'),url('../font/code-snippets.woff') format('woff'),url('../font/code-snippets.svg#code-snippets') format('svg');font-weight:400;font-style:normal}#toplevel_page_snippets div.wp-menu-image:before{font-family:'code-snippets'!important;content:'\e600'}
|
|
assets/css/screen-icon.css
DELETED
@@ -1 +0,0 @@
|
|
1 |
-
#icon-snippets.icon32{background:url('../images/screen-icon.png') no-repeat}
|
|
assets/css/table-legacy.css
DELETED
@@ -1 +0,0 @@
|
|
1 |
-
.snippets .delete a{color:#21759b}.snippets .inactive th,.snippets .inactive td{background-color:#f4f4f4}.snippets .inactive a{color:#579}.snippets .inactive a:hover,#all-snippets-table .snippets .inactive a:hover,#search-snippets-table .snippets .inactive a:hover{color:#d54e21}.snippets .active th,.snippets .active td{color:#000}#wpbody-content .snippets tr{background-color:#fcfcfc}#wpbody-content .snippets .column-name{white-space:nowrap}#wpbody-content .snippets .manage-column.column-id.sortable{min-width:44px}
|
|
assets/css/table.css
DELETED
@@ -1 +0,0 @@
|
|
1 |
-
.snippets th,.snippets td{color:#000}.snippets tr{background:#fff}.snippets .row-actions{color:#ddd}.snippets tfoot th{border-top:none!important}.snippets tfoot th.check-column{padding:13px 0 0 3px}.snippets thead th.check-column,.snippets tfoot th.check-column,.snippets .inactive th.check-column{padding-left:5px}.snippets .column-description p{color:#333}.snippets .inactive a{color:#579}.snippets .inactive td,.snippets .inactive th,.snippets .active td,.snippets .active th{padding:10px 9px;border:none;-webkit-box-shadow:inset 0 -1px 0 rgba(0,0,0,.1);box-shadow:inset 0 -1px 0 rgba(0,0,0,.1)}.snippets .active td,.snippets .active th{background-color:rgba(120,200,230,.06)}.snippets .active th.check-column{border-left:2px solid #2ea2cc}.snippets tr.active+tr.inactive th,.snippets tr.active+tr.inactive td{border-top:1px solid rgba(0,0,0,.03);-webkit-box-shadow:inset 0 1px 0 rgba(0,0,0,.02),inset 0 -1px 0 #e1e1e1;box-shadow:inset 0 1px 0 rgba(0,0,0,.02),inset 0 -1px 0 #e1e1e1}.snippets a.delete:hover,.snippets #all-snippets-table a.delete:hover,.snippets #search-snippets-table a.delete:hover{border-bottom:1px solid red;color:red}#wpbody-content .snippets .column-name{white-space:nowrap}
|
|
assets/font/code-snippets.eot
DELETED
Binary file
|
assets/font/code-snippets.svg
DELETED
@@ -1,11 +0,0 @@
|
|
1 |
-
<?xml version="1.0" standalone="no"?>
|
2 |
-
<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd" >
|
3 |
-
<svg xmlns="http://www.w3.org/2000/svg">
|
4 |
-
<metadata>Generated by IcoMoon</metadata>
|
5 |
-
<defs>
|
6 |
-
<font id="code-snippets" horiz-adv-x="1024">
|
7 |
-
<font-face units-per-em="1024" ascent="960" descent="-64" />
|
8 |
-
<missing-glyph horiz-adv-x="1024" />
|
9 |
-
<glyph unicode=" " d="" horiz-adv-x="512" />
|
10 |
-
<glyph unicode="" d="M191.968 495.776h158.912c23.68 0 42.656-19.2 42.656-42.656 0-11.488-4.48-21.984-11.968-29.632l0.192-0.448-108.768-108.736c-75.104-75.136-75.104-196.512 0-271.584 74.88-74.848 196.448-74.848 271.552 0 74.88 75.104 74.88 196.48 0 271.584-21.76 21.504-47.36 37.12-74.464 46.272l28.608 28.576h365.248c87.040 0 157.856 74.016 159.968 166.4 0 1.472 0.224 2.752 0 4.256-2.112 23.904-22.368 42.656-46.912 42.656h-264.96l191.328 191.328c17.504 17.504 18.56 45.024 3.2 63.36-1.024 1.28-2.080 2.144-3.2 3.2-66.528 63.552-169.152 65.92-230.56 4.48l-262.368-262.368h-46.528c12.8 25.6 20.032 54.624 20.032 85.344 0 106.016-85.952 192-192 192-106.016 0-191.968-85.984-191.968-192 0.032-106.080 85.984-192.032 192-192.032zM277.312 687.744c0-47.136-38.176-85.344-85.344-85.344-47.136 0-85.312 38.176-85.312 85.344s38.176 85.344 85.312 85.344c47.168 0 85.344-38.208 85.344-85.344zM469.088 238.688c33.28-33.248 33.28-87.264 0-120.512-33.28-33.472-87.264-33.472-120.736 0-33.28 33.248-33.28 87.264 0 120.512 33.472 33.504 87.456 33.504 120.736 0z" />
|
11 |
-
</font></defs></svg>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
assets/font/code-snippets.ttf
DELETED
Binary file
|
assets/font/code-snippets.woff
DELETED
Binary file
|
assets/images/menu-icon.png
DELETED
Binary file
|
assets/images/screen-icon.png
DELETED
Binary file
|
assets/js/admin-single.js
DELETED
@@ -1,19 +0,0 @@
|
|
1 |
-
/**
|
2 |
-
* Loads CodeMirror on the snippet editor
|
3 |
-
*/
|
4 |
-
(function() {
|
5 |
-
|
6 |
-
var atts = {
|
7 |
-
lineNumbers: true,
|
8 |
-
matchBrackets: true,
|
9 |
-
lineWrapping: true,
|
10 |
-
mode: "text/x-php",
|
11 |
-
indentUnit: 4,
|
12 |
-
indentWithTabs: true,
|
13 |
-
enterMode: "keep",
|
14 |
-
tabMode: "shift"
|
15 |
-
};
|
16 |
-
|
17 |
-
var editor = CodeMirror.fromTextArea(document.getElementById("snippet_code"), atts);
|
18 |
-
|
19 |
-
})();
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
assets/scss/admin-single.scss
DELETED
@@ -1,45 +0,0 @@
|
|
1 |
-
/**
|
2 |
-
* Custom styling for the single snippet admin page
|
3 |
-
*/
|
4 |
-
|
5 |
-
h3 {
|
6 |
-
/* Provide some decent space between the fields and titles */
|
7 |
-
margin: 1em 0;
|
8 |
-
}
|
9 |
-
|
10 |
-
label {
|
11 |
-
/* What's with the pointer mouse on labels? */
|
12 |
-
cursor: auto;
|
13 |
-
}
|
14 |
-
|
15 |
-
/* Position the description heading on the same level as the editor buttons */
|
16 |
-
label[for="snippet_description"] h3 div {
|
17 |
-
position: absolute;
|
18 |
-
}
|
19 |
-
|
20 |
-
/* Add spacing in between the action buttons */
|
21 |
-
.submit .button {
|
22 |
-
margin-right: .5em;
|
23 |
-
}
|
24 |
-
|
25 |
-
/**
|
26 |
-
* Customize the CodeMirror editor
|
27 |
-
* to look pretty and support auto-resizing
|
28 |
-
*/
|
29 |
-
.CodeMirror {
|
30 |
-
min-height: 300px;
|
31 |
-
width: 100%;
|
32 |
-
height: auto;
|
33 |
-
border: 1px solid #dfdfdf;
|
34 |
-
border-radius: 3px;
|
35 |
-
background-color: #fff;;
|
36 |
-
}
|
37 |
-
|
38 |
-
.CodeMirror-scroll {
|
39 |
-
overflow-x: auto;
|
40 |
-
overflow-y: hidden;
|
41 |
-
}
|
42 |
-
|
43 |
-
.CodeMirror-sizer {
|
44 |
-
min-height: 300px !important;
|
45 |
-
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
assets/scss/menu-icon.scss
DELETED
@@ -1,19 +0,0 @@
|
|
1 |
-
/**
|
2 |
-
* Add the snippets icon to the admin menu
|
3 |
-
*/
|
4 |
-
|
5 |
-
@font-face {
|
6 |
-
font-family: 'code-snippets';
|
7 |
-
src: url('../font/code-snippets.eot');
|
8 |
-
src: url('../font/code-snippets.eot?#iefix') format('embedded-opentype'),
|
9 |
-
url('../font/code-snippets.ttf') format('truetype'),
|
10 |
-
url('../font/code-snippets.woff') format('woff'),
|
11 |
-
url('../font/code-snippets.svg#code-snippets') format('svg');
|
12 |
-
font-weight: normal;
|
13 |
-
font-style: normal;
|
14 |
-
}
|
15 |
-
|
16 |
-
#toplevel_page_snippets div.wp-menu-image:before {
|
17 |
-
font-family: 'code-snippets' !important;
|
18 |
-
content: '\e600';
|
19 |
-
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
assets/scss/screen-icon.scss
DELETED
@@ -1,7 +0,0 @@
|
|
1 |
-
/**
|
2 |
-
* Add the snippet screen icon to admin pages
|
3 |
-
*/
|
4 |
-
|
5 |
-
#icon-snippets.icon32 {
|
6 |
-
background: url('../images/screen-icon.png') no-repeat scroll transparent;
|
7 |
-
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
assets/scss/table-legacy.scss
DELETED
@@ -1,51 +0,0 @@
|
|
1 |
-
/**
|
2 |
-
* Custom styling for the snippets table
|
3 |
-
* on the pre-3.8 interface
|
4 |
-
*/
|
5 |
-
|
6 |
-
.snippets {
|
7 |
-
|
8 |
-
.delete a {
|
9 |
-
color: #21759b;
|
10 |
-
}
|
11 |
-
|
12 |
-
.inactive {
|
13 |
-
|
14 |
-
th, td {
|
15 |
-
background-color: #f4f4f4;
|
16 |
-
}
|
17 |
-
|
18 |
-
a {
|
19 |
-
color: #557799;
|
20 |
-
|
21 |
-
&, #all-snippets-table &, #search-snippets-table & {
|
22 |
-
&:hover {
|
23 |
-
color: #d54e21;
|
24 |
-
}
|
25 |
-
}
|
26 |
-
}
|
27 |
-
}
|
28 |
-
|
29 |
-
.active {
|
30 |
-
th, td {
|
31 |
-
color: #000;
|
32 |
-
}
|
33 |
-
}
|
34 |
-
|
35 |
-
#wpbody-content & {
|
36 |
-
|
37 |
-
tr {
|
38 |
-
background-color: #fcfcfc;
|
39 |
-
}
|
40 |
-
|
41 |
-
.column-name {
|
42 |
-
white-space: nowrap; /* prevents wrapping of snippet title */
|
43 |
-
}
|
44 |
-
|
45 |
-
.manage-column.column-id.sortable {
|
46 |
-
min-width: 44px;
|
47 |
-
}
|
48 |
-
|
49 |
-
}
|
50 |
-
|
51 |
-
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
assets/scss/table.scss
DELETED
@@ -1,80 +0,0 @@
|
|
1 |
-
/**
|
2 |
-
* Custom styling for the snippets table
|
3 |
-
*/
|
4 |
-
|
5 |
-
.snippets {
|
6 |
-
|
7 |
-
th, td {
|
8 |
-
color: #000;
|
9 |
-
}
|
10 |
-
|
11 |
-
tr {
|
12 |
-
background: #fff;
|
13 |
-
}
|
14 |
-
|
15 |
-
.row-actions {
|
16 |
-
color: #ddd;
|
17 |
-
}
|
18 |
-
|
19 |
-
tfoot th {
|
20 |
-
border-top: none !important;
|
21 |
-
|
22 |
-
&.check-column {
|
23 |
-
padding: 13px 0 0 3px;
|
24 |
-
}
|
25 |
-
}
|
26 |
-
|
27 |
-
thead th.check-column,
|
28 |
-
tfoot th.check-column,
|
29 |
-
.inactive th.check-column {
|
30 |
-
padding-left: 5px;
|
31 |
-
}
|
32 |
-
|
33 |
-
.column-description p {
|
34 |
-
color: #333;
|
35 |
-
}
|
36 |
-
|
37 |
-
.inactive {
|
38 |
-
|
39 |
-
a {
|
40 |
-
color: #579;
|
41 |
-
}
|
42 |
-
}
|
43 |
-
|
44 |
-
.inactive, .active {
|
45 |
-
td, th {
|
46 |
-
padding: 10px 9px;
|
47 |
-
border: none;
|
48 |
-
box-shadow: inset 0 -1px 0 rgba(0,0,0,0.1);
|
49 |
-
}
|
50 |
-
}
|
51 |
-
|
52 |
-
.active {
|
53 |
-
|
54 |
-
td, th {
|
55 |
-
background-color: rgba(120,200,230,0.06);
|
56 |
-
}
|
57 |
-
|
58 |
-
th.check-column {
|
59 |
-
border-left: 2px solid #2ea2cc;
|
60 |
-
}
|
61 |
-
|
62 |
-
}
|
63 |
-
|
64 |
-
tr.active + tr.inactive th,
|
65 |
-
tr.active + tr.inactive td {
|
66 |
-
border-top: 1px solid rgba(0,0,0,0.03);
|
67 |
-
box-shadow: inset 0px 1px 0 rgba(0,0,0,0.02), inset 0 -1px 0 #e1e1e1;
|
68 |
-
}
|
69 |
-
|
70 |
-
&, #all-snippets-table, #search-snippets-table {
|
71 |
-
a.delete:hover {
|
72 |
-
border-bottom: 1px solid #f00;
|
73 |
-
color: #f00;
|
74 |
-
}
|
75 |
-
}
|
76 |
-
|
77 |
-
#wpbody-content & .column-name {
|
78 |
-
white-space: nowrap; /* prevents wrapping of snippet title */
|
79 |
-
}
|
80 |
-
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
code-snippets.php
CHANGED
@@ -7,9 +7,9 @@
|
|
7 |
* contribute to the localization, please see https://github.com/sheabunge/code-snippets
|
8 |
*
|
9 |
* @package Code_Snippets
|
10 |
-
* @version 2.
|
11 |
* @author Shea Bunge <http://bungeshea.com/>
|
12 |
-
* @copyright Copyright (c) 2012-
|
13 |
* @link http://bungeshea.com/plugins/code-snippets/
|
14 |
* @license http://opensource.org/licenses/MIT
|
15 |
*/
|
@@ -20,7 +20,7 @@ Plugin URI: http://bungeshea.com/plugins/code-snippets/
|
|
20 |
Description: An easy, clean and simple way to add code snippets to your site. No need to edit to your theme's functions.php file again!
|
21 |
Author: Shea Bunge
|
22 |
Author URI: http://bungeshea.com
|
23 |
-
Version: 2.
|
24 |
License: MIT
|
25 |
License URI: license.txt
|
26 |
Text Domain: code-snippets
|
@@ -34,7 +34,7 @@ if ( ! defined( 'ABSPATH' ) ) {
|
|
34 |
|
35 |
/**
|
36 |
* The version number for this release of the plugin.
|
37 |
-
* This will later be used for upgrades and
|
38 |
*
|
39 |
* This should be set to the 'Plugin Version' value,
|
40 |
* as defined above in the plugin header
|
@@ -42,7 +42,7 @@ if ( ! defined( 'ABSPATH' ) ) {
|
|
42 |
* @since 2.0
|
43 |
* @var string A PHP-standardized version number string
|
44 |
*/
|
45 |
-
define( 'CODE_SNIPPETS_VERSION', '2.
|
46 |
|
47 |
/**
|
48 |
* The full path to the main file of this plugin
|
@@ -61,6 +61,9 @@ define( 'CODE_SNIPPETS_FILE', __FILE__ );
|
|
61 |
*/
|
62 |
foreach ( array(
|
63 |
|
|
|
|
|
|
|
64 |
/* Database operations functions */
|
65 |
'db.php',
|
66 |
|
@@ -73,26 +76,20 @@ foreach ( array(
|
|
73 |
/* Upgrade function */
|
74 |
'upgrade.php',
|
75 |
|
76 |
-
/* General Administration functions */
|
77 |
-
'admin.php',
|
78 |
-
|
79 |
/* CodeMirror editor functions */
|
80 |
'editor.php',
|
81 |
|
82 |
-
/*
|
83 |
-
'
|
84 |
|
85 |
-
/*
|
86 |
-
'
|
87 |
-
|
88 |
-
/* Import snippets component */
|
89 |
-
'import/import.php',
|
90 |
|
91 |
/* Settings component */
|
92 |
'settings/editor-preview.php',
|
93 |
'settings/settings-fields.php',
|
94 |
'settings/settings.php',
|
95 |
-
'settings/admin.php',
|
96 |
|
97 |
) as $include ) {
|
98 |
|
7 |
* contribute to the localization, please see https://github.com/sheabunge/code-snippets
|
8 |
*
|
9 |
* @package Code_Snippets
|
10 |
+
* @version 2.4.0
|
11 |
* @author Shea Bunge <http://bungeshea.com/>
|
12 |
+
* @copyright Copyright (c) 2012-2015, Shea Bunge
|
13 |
* @link http://bungeshea.com/plugins/code-snippets/
|
14 |
* @license http://opensource.org/licenses/MIT
|
15 |
*/
|
20 |
Description: An easy, clean and simple way to add code snippets to your site. No need to edit to your theme's functions.php file again!
|
21 |
Author: Shea Bunge
|
22 |
Author URI: http://bungeshea.com
|
23 |
+
Version: 2.4.0
|
24 |
License: MIT
|
25 |
License URI: license.txt
|
26 |
Text Domain: code-snippets
|
34 |
|
35 |
/**
|
36 |
* The version number for this release of the plugin.
|
37 |
+
* This will later be used for upgrades and enqueuing files
|
38 |
*
|
39 |
* This should be set to the 'Plugin Version' value,
|
40 |
* as defined above in the plugin header
|
42 |
* @since 2.0
|
43 |
* @var string A PHP-standardized version number string
|
44 |
*/
|
45 |
+
define( 'CODE_SNIPPETS_VERSION', '2.4.0' );
|
46 |
|
47 |
/**
|
48 |
* The full path to the main file of this plugin
|
61 |
*/
|
62 |
foreach ( array(
|
63 |
|
64 |
+
/* Snippet class */
|
65 |
+
'class-snippet.php',
|
66 |
+
|
67 |
/* Database operations functions */
|
68 |
'db.php',
|
69 |
|
76 |
/* Upgrade function */
|
77 |
'upgrade.php',
|
78 |
|
|
|
|
|
|
|
79 |
/* CodeMirror editor functions */
|
80 |
'editor.php',
|
81 |
|
82 |
+
/* General functions */
|
83 |
+
'functions.php',
|
84 |
|
85 |
+
/* General Administration functions */
|
86 |
+
'contextual-help.php',
|
87 |
+
'admin.php',
|
|
|
|
|
88 |
|
89 |
/* Settings component */
|
90 |
'settings/editor-preview.php',
|
91 |
'settings/settings-fields.php',
|
92 |
'settings/settings.php',
|
|
|
93 |
|
94 |
) as $include ) {
|
95 |
|
css/build/edit-snippet.css
DELETED
@@ -1,53 +0,0 @@
|
|
1 |
-
/**
|
2 |
-
* Custom styling for the single snippet admin page
|
3 |
-
*/
|
4 |
-
|
5 |
-
h3 {
|
6 |
-
/* Provide some decent space between the fields and titles */
|
7 |
-
margin: 1em 0;
|
8 |
-
}
|
9 |
-
|
10 |
-
label {
|
11 |
-
/* What's with the pointer mouse on labels? */
|
12 |
-
cursor: auto;
|
13 |
-
}
|
14 |
-
|
15 |
-
/* Position the description heading on the same level as the editor buttons */
|
16 |
-
|
17 |
-
label[for='snippet_description'] h3 div {
|
18 |
-
position: absolute;
|
19 |
-
}
|
20 |
-
|
21 |
-
/* Add spacing in between the action buttons */
|
22 |
-
|
23 |
-
.submit .button {
|
24 |
-
margin-right: 0.5em;
|
25 |
-
}
|
26 |
-
|
27 |
-
/**
|
28 |
-
* Customize the CodeMirror editor
|
29 |
-
* to look nice and support auto-resizing
|
30 |
-
*/
|
31 |
-
|
32 |
-
.CodeMirror {
|
33 |
-
width: 100%;
|
34 |
-
height: auto;
|
35 |
-
min-height: 300px;
|
36 |
-
border: 1px solid #dfdfdf;
|
37 |
-
border-radius: 3px;
|
38 |
-
background-color: white;
|
39 |
-
}
|
40 |
-
|
41 |
-
.CodeMirror-scroll {
|
42 |
-
overflow-x: auto;
|
43 |
-
overflow-y: hidden;
|
44 |
-
}
|
45 |
-
|
46 |
-
.CodeMirror-sizer {
|
47 |
-
min-height: 300px !important;
|
48 |
-
}
|
49 |
-
|
50 |
-
.CodeMirror-focused .cm-matchhighlight {
|
51 |
-
color: white !important;
|
52 |
-
outline: 1px solid green;
|
53 |
-
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
css/build/manage-snippets.css
DELETED
@@ -1,80 +0,0 @@
|
|
1 |
-
/**
|
2 |
-
* Custom styling for the snippets table
|
3 |
-
*/
|
4 |
-
|
5 |
-
.snippets th,
|
6 |
-
.snippets td {
|
7 |
-
color: black;
|
8 |
-
}
|
9 |
-
|
10 |
-
.snippets tr {
|
11 |
-
background: white;
|
12 |
-
}
|
13 |
-
|
14 |
-
.snippets .row-actions {
|
15 |
-
color: #dddddd;
|
16 |
-
}
|
17 |
-
|
18 |
-
.snippets .clear-filters {
|
19 |
-
vertical-align: middle;
|
20 |
-
}
|
21 |
-
|
22 |
-
.snippets tfoot th {
|
23 |
-
border-top: none !important;
|
24 |
-
}
|
25 |
-
|
26 |
-
.snippets tfoot th.check-column {
|
27 |
-
padding: 13px 0 0 3px;
|
28 |
-
}
|
29 |
-
|
30 |
-
.snippets thead th.check-column,
|
31 |
-
.snippets tfoot th.check-column,
|
32 |
-
.snippets .inactive th.check-column {
|
33 |
-
padding-left: 5px;
|
34 |
-
}
|
35 |
-
|
36 |
-
.snippets .column-description p {
|
37 |
-
color: #333333;
|
38 |
-
}
|
39 |
-
|
40 |
-
.snippets .inactive a {
|
41 |
-
color: #557799;
|
42 |
-
}
|
43 |
-
|
44 |
-
.snippets .inactive td,
|
45 |
-
.snippets .inactive th,
|
46 |
-
.snippets .active td,
|
47 |
-
.snippets .active th {
|
48 |
-
padding: 10px 9px;
|
49 |
-
border: none;
|
50 |
-
-webkit-box-shadow: inset 0 -1px 0 rgba(0, 0, 0, 0.1);
|
51 |
-
box-shadow: inset 0 -1px 0 rgba(0, 0, 0, 0.1);
|
52 |
-
}
|
53 |
-
|
54 |
-
.snippets .active td,
|
55 |
-
.snippets .active th {
|
56 |
-
background-color: rgba(120, 200, 230, 0.06);
|
57 |
-
}
|
58 |
-
|
59 |
-
.snippets .active th.check-column {
|
60 |
-
border-left: 2px solid #2ea2cc;
|
61 |
-
}
|
62 |
-
|
63 |
-
.snippets tr.active + tr.inactive th,
|
64 |
-
.snippets tr.active + tr.inactive td {
|
65 |
-
border-top: 1px solid rgba(0, 0, 0, 0.03);
|
66 |
-
-webkit-box-shadow: inset 0px 1px 0 rgba(0, 0, 0, 0.02), inset 0 -1px 0 #e1e1e1;
|
67 |
-
box-shadow: inset 0px 1px 0 rgba(0, 0, 0, 0.02), inset 0 -1px 0 #e1e1e1;
|
68 |
-
}
|
69 |
-
|
70 |
-
.snippets a.delete:hover,
|
71 |
-
.snippets #all-snippets-table a.delete:hover,
|
72 |
-
.snippets #search-snippets-table a.delete:hover {
|
73 |
-
border-bottom: 1px solid red;
|
74 |
-
color: red;
|
75 |
-
}
|
76 |
-
|
77 |
-
#wpbody-content .snippets .column-name {
|
78 |
-
white-space: nowrap;
|
79 |
-
/* prevents wrapping of snippet title */
|
80 |
-
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
css/build/menu-icon.css
DELETED
@@ -1,16 +0,0 @@
|
|
1 |
-
/**
|
2 |
-
* Add the snippets icon to the admin menu
|
3 |
-
*/
|
4 |
-
|
5 |
-
@font-face {
|
6 |
-
font-family: 'code-snippets';
|
7 |
-
src: url('../font/code-snippets.eot');
|
8 |
-
src: url('../font/code-snippets.eot?#iefix') format('embedded-opentype'), url('../font/code-snippets.ttf') format('truetype'), url('../font/code-snippets.woff') format('woff'), url('../font/code-snippets.svg#code-snippets') format('svg');
|
9 |
-
font-weight: normal;
|
10 |
-
font-style: normal;
|
11 |
-
}
|
12 |
-
|
13 |
-
#toplevel_page_snippets div.wp-menu-image:before {
|
14 |
-
font-family: 'code-snippets' !important;
|
15 |
-
content: '\e600';
|
16 |
-
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
css/edit-snippet.scss
DELETED
@@ -1,51 +0,0 @@
|
|
1 |
-
/**
|
2 |
-
* Custom styling for the single snippet admin page
|
3 |
-
*/
|
4 |
-
|
5 |
-
h3 {
|
6 |
-
/* Provide some decent space between the fields and titles */
|
7 |
-
margin: 1em 0;
|
8 |
-
}
|
9 |
-
|
10 |
-
label {
|
11 |
-
/* What's with the pointer mouse on labels? */
|
12 |
-
cursor: auto;
|
13 |
-
}
|
14 |
-
|
15 |
-
/* Position the description heading on the same level as the editor buttons */
|
16 |
-
label[for='snippet_description'] h3 div {
|
17 |
-
position: absolute;
|
18 |
-
}
|
19 |
-
|
20 |
-
/* Add spacing in between the action buttons */
|
21 |
-
.submit .button {
|
22 |
-
margin-right: .5em;
|
23 |
-
}
|
24 |
-
|
25 |
-
/**
|
26 |
-
* Customize the CodeMirror editor
|
27 |
-
* to look nice and support auto-resizing
|
28 |
-
*/
|
29 |
-
.CodeMirror {
|
30 |
-
width: 100%;
|
31 |
-
height: auto;
|
32 |
-
min-height: 300px;
|
33 |
-
|
34 |
-
border: 1px solid #dfdfdf;
|
35 |
-
border-radius: 3px;
|
36 |
-
background-color: #fff;;
|
37 |
-
}
|
38 |
-
|
39 |
-
.CodeMirror-scroll {
|
40 |
-
overflow-x: auto;
|
41 |
-
overflow-y: hidden;
|
42 |
-
}
|
43 |
-
|
44 |
-
.CodeMirror-sizer {
|
45 |
-
min-height: 300px !important;
|
46 |
-
}
|
47 |
-
|
48 |
-
.CodeMirror-focused .cm-matchhighlight {
|
49 |
-
color: white !important;
|
50 |
-
outline: 1px solid green;
|
51 |
-
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
css/manage-snippets.scss
DELETED
@@ -1,84 +0,0 @@
|
|
1 |
-
/**
|
2 |
-
* Custom styling for the snippets table
|
3 |
-
*/
|
4 |
-
|
5 |
-
.snippets {
|
6 |
-
|
7 |
-
th, td {
|
8 |
-
color: #000;
|
9 |
-
}
|
10 |
-
|
11 |
-
tr {
|
12 |
-
background: #fff;
|
13 |
-
}
|
14 |
-
|
15 |
-
.row-actions {
|
16 |
-
color: #ddd;
|
17 |
-
}
|
18 |
-
|
19 |
-
.clear-filters {
|
20 |
-
vertical-align: middle;
|
21 |
-
}
|
22 |
-
|
23 |
-
tfoot th {
|
24 |
-
border-top: none !important;
|
25 |
-
|
26 |
-
&.check-column {
|
27 |
-
padding: 13px 0 0 3px;
|
28 |
-
}
|
29 |
-
}
|
30 |
-
|
31 |
-
thead th.check-column,
|
32 |
-
tfoot th.check-column,
|
33 |
-
.inactive th.check-column {
|
34 |
-
padding-left: 5px;
|
35 |
-
}
|
36 |
-
|
37 |
-
.column-description p {
|
38 |
-
color: #333;
|
39 |
-
}
|
40 |
-
|
41 |
-
.inactive {
|
42 |
-
|
43 |
-
a {
|
44 |
-
color: #579;
|
45 |
-
}
|
46 |
-
}
|
47 |
-
|
48 |
-
.inactive, .active {
|
49 |
-
td, th {
|
50 |
-
padding: 10px 9px;
|
51 |
-
border: none;
|
52 |
-
box-shadow: inset 0 -1px 0 rgba(0,0,0,0.1);
|
53 |
-
}
|
54 |
-
}
|
55 |
-
|
56 |
-
.active {
|
57 |
-
|
58 |
-
td, th {
|
59 |
-
background-color: rgba(120,200,230,0.06);
|
60 |
-
}
|
61 |
-
|
62 |
-
th.check-column {
|
63 |
-
border-left: 2px solid #2ea2cc;
|
64 |
-
}
|
65 |
-
|
66 |
-
}
|
67 |
-
|
68 |
-
tr.active + tr.inactive th,
|
69 |
-
tr.active + tr.inactive td {
|
70 |
-
border-top: 1px solid rgba(0,0,0,0.03);
|
71 |
-
box-shadow: inset 0px 1px 0 rgba(0,0,0,0.02), inset 0 -1px 0 #e1e1e1;
|
72 |
-
}
|
73 |
-
|
74 |
-
&, #all-snippets-table, #search-snippets-table {
|
75 |
-
a.delete:hover {
|
76 |
-
border-bottom: 1px solid #f00;
|
77 |
-
color: #f00;
|
78 |
-
}
|
79 |
-
}
|
80 |
-
|
81 |
-
#wpbody-content & .column-name {
|
82 |
-
white-space: nowrap; /* prevents wrapping of snippet title */
|
83 |
-
}
|
84 |
-
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
css/menu-icon.scss
DELETED
@@ -1,19 +0,0 @@
|
|
1 |
-
/**
|
2 |
-
* Add the snippets icon to the admin menu
|
3 |
-
*/
|
4 |
-
|
5 |
-
@font-face {
|
6 |
-
font-family: 'code-snippets';
|
7 |
-
src: url('../font/code-snippets.eot');
|
8 |
-
src: url('../font/code-snippets.eot?#iefix') format('embedded-opentype'),
|
9 |
-
url('../font/code-snippets.ttf') format('truetype'),
|
10 |
-
url('../font/code-snippets.woff') format('woff'),
|
11 |
-
url('../font/code-snippets.svg#code-snippets') format('svg');
|
12 |
-
font-weight: normal;
|
13 |
-
font-style: normal;
|
14 |
-
}
|
15 |
-
|
16 |
-
#toplevel_page_snippets div.wp-menu-image:before {
|
17 |
-
font-family: 'code-snippets' !important;
|
18 |
-
content: '\e600';
|
19 |
-
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
css/min/cmthemes/3024-day.css
CHANGED
@@ -1 +1 @@
|
|
1 |
-
.cm-s-3024-day.CodeMirror{background:#f7f7f7;color:#3a3432}.cm-s-3024-day div.CodeMirror-selected{background:#d6d5d4
|
1 |
+
.cm-s-3024-day.CodeMirror{background:#f7f7f7;color:#3a3432}.cm-s-3024-day div.CodeMirror-selected{background:#d6d5d4}.cm-s-3024-day .CodeMirror-line::selection,.cm-s-3024-day .CodeMirror-line>span::selection,.cm-s-3024-day .CodeMirror-line>span>span::selection{background:#d6d5d4}.cm-s-3024-day .CodeMirror-line::-moz-selection,.cm-s-3024-day .CodeMirror-line>span::-moz-selection,.cm-s-3024-day .CodeMirror-line>span>span::selection{background:#d9d9d9}.cm-s-3024-day .CodeMirror-gutters{background:#f7f7f7;border-right:0}.cm-s-3024-day .CodeMirror-guttermarker{color:#db2d20}.cm-s-3024-day .CodeMirror-guttermarker-subtle,.cm-s-3024-day .CodeMirror-linenumber{color:#807d7c}.cm-s-3024-day .CodeMirror-cursor{border-left:1px solid #5c5855}.cm-s-3024-day span.cm-comment{color:#cdab53}.cm-s-3024-day span.cm-atom,.cm-s-3024-day span.cm-number{color:#a16a94}.cm-s-3024-day span.cm-property,.cm-s-3024-day span.cm-attribute{color:#01a252}.cm-s-3024-day span.cm-keyword{color:#db2d20}.cm-s-3024-day span.cm-string{color:#fded02}.cm-s-3024-day span.cm-variable{color:#01a252}.cm-s-3024-day span.cm-variable-2{color:#01a0e4}.cm-s-3024-day span.cm-def{color:#e8bbd0}.cm-s-3024-day span.cm-bracket{color:#3a3432}.cm-s-3024-day span.cm-tag{color:#db2d20}.cm-s-3024-day span.cm-link{color:#a16a94}.cm-s-3024-day span.cm-error{background:#db2d20;color:#5c5855}.cm-s-3024-day .CodeMirror-activeline-background{background:#e8f2ff}.cm-s-3024-day .CodeMirror-matchingbracket{text-decoration:underline;color:#a16a94!important}
|
css/min/cmthemes/3024-night.css
CHANGED
@@ -1 +1 @@
|
|
1 |
-
.cm-s-3024-night.CodeMirror{background:#090300;color:#d6d5d4}.cm-s-3024-night div.CodeMirror-selected{background:#3a3432
|
1 |
+
.cm-s-3024-night.CodeMirror{background:#090300;color:#d6d5d4}.cm-s-3024-night div.CodeMirror-selected{background:#3a3432}.cm-s-3024-night .CodeMirror-line::selection,.cm-s-3024-night .CodeMirror-line>span::selection,.cm-s-3024-night .CodeMirror-line>span>span::selection{background:rgba(58,52,50,.99)}.cm-s-3024-night .CodeMirror-line::-moz-selection,.cm-s-3024-night .CodeMirror-line>span::-moz-selection,.cm-s-3024-night .CodeMirror-line>span>span::-moz-selection{background:rgba(58,52,50,.99)}.cm-s-3024-night .CodeMirror-gutters{background:#090300;border-right:0}.cm-s-3024-night .CodeMirror-guttermarker{color:#db2d20}.cm-s-3024-night .CodeMirror-guttermarker-subtle,.cm-s-3024-night .CodeMirror-linenumber{color:#5c5855}.cm-s-3024-night .CodeMirror-cursor{border-left:1px solid #807d7c}.cm-s-3024-night span.cm-comment{color:#cdab53}.cm-s-3024-night span.cm-atom,.cm-s-3024-night span.cm-number{color:#a16a94}.cm-s-3024-night span.cm-property,.cm-s-3024-night span.cm-attribute{color:#01a252}.cm-s-3024-night span.cm-keyword{color:#db2d20}.cm-s-3024-night span.cm-string{color:#fded02}.cm-s-3024-night span.cm-variable{color:#01a252}.cm-s-3024-night span.cm-variable-2{color:#01a0e4}.cm-s-3024-night span.cm-def{color:#e8bbd0}.cm-s-3024-night span.cm-bracket{color:#d6d5d4}.cm-s-3024-night span.cm-tag{color:#db2d20}.cm-s-3024-night span.cm-link{color:#a16a94}.cm-s-3024-night span.cm-error{background:#db2d20;color:#807d7c}.cm-s-3024-night .CodeMirror-activeline-background{background:#2F2F2F}.cm-s-3024-night .CodeMirror-matchingbracket{text-decoration:underline;color:#fff!important}
|
css/min/cmthemes/abcdef.css
ADDED
@@ -0,0 +1 @@
|
|
|
1 |
+
.cm-s-abcdef.CodeMirror{background:#0f0f0f;color:#defdef}.cm-s-abcdef div.CodeMirror-selected{background:#515151}.cm-s-abcdef .CodeMirror-line::selection,.cm-s-abcdef .CodeMirror-line>span::selection,.cm-s-abcdef .CodeMirror-line>span>span::selection{background:rgba(56,56,56,.99)}.cm-s-abcdef .CodeMirror-line::-moz-selection,.cm-s-abcdef .CodeMirror-line>span::-moz-selection,.cm-s-abcdef .CodeMirror-line>span>span::-moz-selection{background:rgba(56,56,56,.99)}.cm-s-abcdef .CodeMirror-gutters{background:#555;border-right:2px solid #314151}.cm-s-abcdef .CodeMirror-guttermarker{color:#222}.cm-s-abcdef .CodeMirror-guttermarker-subtle{color:azure}.cm-s-abcdef .CodeMirror-linenumber{color:#fff}.cm-s-abcdef .CodeMirror-cursor{border-left:1px solid #0f0}.cm-s-abcdef span.cm-keyword{color:darkgoldenrod;font-weight:700}.cm-s-abcdef span.cm-atom{color:#77F}.cm-s-abcdef span.cm-number{color:violet}.cm-s-abcdef span.cm-def{color:#fffabc}.cm-s-abcdef span.cm-variable{color:#abcdef}.cm-s-abcdef span.cm-variable-2{color:#cacbcc}.cm-s-abcdef span.cm-variable-3{color:#def}.cm-s-abcdef span.cm-property{color:#fedcba}.cm-s-abcdef span.cm-operator{color:#ff0}.cm-s-abcdef span.cm-comment{color:#7a7b7c;font-style:italic}.cm-s-abcdef span.cm-string{color:#2b4}.cm-s-abcdef span.cm-meta{color:#C9F}.cm-s-abcdef span.cm-qualifier{color:#FFF700}.cm-s-abcdef span.cm-builtin{color:#30aabc}.cm-s-abcdef span.cm-bracket{color:#8a8a8a}.cm-s-abcdef span.cm-tag{color:#fd4}.cm-s-abcdef span.cm-attribute{color:#df0}.cm-s-abcdef span.cm-error{color:red}.cm-s-abcdef span.cm-header{color:aquamarine;font-weight:700}.cm-s-abcdef span.cm-link{color:#00f}.cm-s-abcdef .CodeMirror-activeline-background{background:#314151}
|
css/min/cmthemes/ambiance.css
CHANGED
@@ -1 +1 @@
|
|
1 |
-
.cm-s-ambiance .cm-keyword{color:#cda869}.cm-s-ambiance .cm-atom{color:#CF7EA9}.cm-s-ambiance .cm-number{color:#78CF8A}.cm-s-ambiance .cm-def{color:#aac6e3}.cm-s-ambiance .cm-variable{color:#ffb795}.cm-s-ambiance .cm-variable-2{color:#eed1b3}.cm-s-ambiance .cm-variable-3{color:#faded3}.cm-s-ambiance .cm-property{color:#eed1b3}.cm-s-ambiance .cm-operator{color:#fa8d6a}.cm-s-ambiance .cm-comment{color:#555;font-style:italic}.cm-s-ambiance .cm-string{color:#8f9d6a}.cm-s-ambiance .cm-string-2{color:#9d937c}.cm-s-ambiance .cm-meta{color:#D2A8A1}.cm-s-ambiance .cm-qualifier{color:#ff0}.cm-s-ambiance .cm-builtin{color:#99c}.cm-s-ambiance .cm-bracket{color:#24C2C7}.cm-s-ambiance .cm-tag{color:#fee4ff}.cm-s-ambiance .cm-attribute{color:#9B859D}.cm-s-ambiance .cm-header{color:#00f}.cm-s-ambiance .cm-quote{color:#24C2C7}.cm-s-ambiance .cm-hr{color:pink}.cm-s-ambiance .cm-link{color:#F4C20B}.cm-s-ambiance .cm-special{color:#FF9D00}.cm-s-ambiance .cm-error{color:#AF2018}.cm-s-ambiance .CodeMirror-matchingbracket{color:#0f0}.cm-s-ambiance .CodeMirror-nonmatchingbracket{color:#f22}.cm-s-ambiance .CodeMirror-selected{background:rgba(255,255,255,.15)}.cm-s-ambiance.CodeMirror-focused .CodeMirror-selected{background:rgba(255,255,255,.1)}.cm-s-ambiance.CodeMirror ::selection{background:rgba(255,255,255,.1)}.cm-s-ambiance.CodeMirror ::-moz-selection{background:rgba(255,255,255,.1)}.cm-s-ambiance.CodeMirror{line-height:1.4em;color:#E6E1DC;background-color:#202020;-webkit-box-shadow:inset 0 0 10px #000;-moz-box-shadow:inset 0 0 10px #000;box-shadow:inset 0 0 10px #000}.cm-s-ambiance .CodeMirror-gutters{background:#3D3D3D;border-right:1px solid #4D4D4D;box-shadow:0 10px 20px #000}.cm-s-ambiance .CodeMirror-linenumber{text-shadow:0 1px 1px #4d4d4d;color:#111;padding:0 5px}.cm-s-ambiance .CodeMirror-guttermarker{color:#aaa}.cm-s-ambiance .CodeMirror-guttermarker-subtle{color:#111}.cm-s-ambiance .CodeMirror-lines .CodeMirror-cursor{border-left:1px solid #7991E8}.cm-s-ambiance .CodeMirror-activeline-background{background:0% 0% rgba(255,255,255,.031)}.cm-s-ambiance.CodeMirror,.cm-s-ambiance .CodeMirror-gutters{background-image:url("data:image/png;base64,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")}
|
1 |
+
.cm-s-ambiance .cm-header{color:#00f}.cm-s-ambiance .cm-quote{color:#24C2C7}.cm-s-ambiance .cm-keyword{color:#cda869}.cm-s-ambiance .cm-atom{color:#CF7EA9}.cm-s-ambiance .cm-number{color:#78CF8A}.cm-s-ambiance .cm-def{color:#aac6e3}.cm-s-ambiance .cm-variable{color:#ffb795}.cm-s-ambiance .cm-variable-2{color:#eed1b3}.cm-s-ambiance .cm-variable-3{color:#faded3}.cm-s-ambiance .cm-property{color:#eed1b3}.cm-s-ambiance .cm-operator{color:#fa8d6a}.cm-s-ambiance .cm-comment{color:#555;font-style:italic}.cm-s-ambiance .cm-string{color:#8f9d6a}.cm-s-ambiance .cm-string-2{color:#9d937c}.cm-s-ambiance .cm-meta{color:#D2A8A1}.cm-s-ambiance .cm-qualifier{color:#ff0}.cm-s-ambiance .cm-builtin{color:#99c}.cm-s-ambiance .cm-bracket{color:#24C2C7}.cm-s-ambiance .cm-tag{color:#fee4ff}.cm-s-ambiance .cm-attribute{color:#9B859D}.cm-s-ambiance .cm-hr{color:pink}.cm-s-ambiance .cm-link{color:#F4C20B}.cm-s-ambiance .cm-special{color:#FF9D00}.cm-s-ambiance .cm-error{color:#AF2018}.cm-s-ambiance .CodeMirror-matchingbracket{color:#0f0}.cm-s-ambiance .CodeMirror-nonmatchingbracket{color:#f22}.cm-s-ambiance div.CodeMirror-selected{background:rgba(255,255,255,.15)}.cm-s-ambiance.CodeMirror-focused div.CodeMirror-selected{background:rgba(255,255,255,.1)}.cm-s-ambiance .CodeMirror-line::selection,.cm-s-ambiance .CodeMirror-line>span::selection,.cm-s-ambiance .CodeMirror-line>span>span::selection{background:rgba(255,255,255,.1)}.cm-s-ambiance .CodeMirror-line::-moz-selection,.cm-s-ambiance .CodeMirror-line>span::-moz-selection,.cm-s-ambiance .CodeMirror-line>span>span::-moz-selection{background:rgba(255,255,255,.1)}.cm-s-ambiance.CodeMirror{line-height:1.4em;color:#E6E1DC;background-color:#202020;-webkit-box-shadow:inset 0 0 10px #000;-moz-box-shadow:inset 0 0 10px #000;box-shadow:inset 0 0 10px #000}.cm-s-ambiance .CodeMirror-gutters{background:#3D3D3D;border-right:1px solid #4D4D4D;box-shadow:0 10px 20px #000}.cm-s-ambiance .CodeMirror-linenumber{text-shadow:0 1px 1px #4d4d4d;color:#111;padding:0 5px}.cm-s-ambiance .CodeMirror-guttermarker{color:#aaa}.cm-s-ambiance .CodeMirror-guttermarker-subtle{color:#111}.cm-s-ambiance .CodeMirror-cursor{border-left:1px solid #7991E8}.cm-s-ambiance .CodeMirror-activeline-background{background:0% 0% rgba(255,255,255,.031)}.cm-s-ambiance.CodeMirror,.cm-s-ambiance .CodeMirror-gutters{background-image:url("data:image/png;base64,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")}
|
css/min/cmthemes/base16-dark.css
CHANGED
@@ -1 +1 @@
|
|
1 |
-
.cm-s-base16-dark.CodeMirror{background:#151515;color:#e0e0e0}.cm-s-base16-dark div.CodeMirror-selected{background:#303030
|
1 |
+
.cm-s-base16-dark.CodeMirror{background:#151515;color:#e0e0e0}.cm-s-base16-dark div.CodeMirror-selected{background:#303030}.cm-s-base16-dark .CodeMirror-line::selection,.cm-s-base16-dark .CodeMirror-line>span::selection,.cm-s-base16-dark .CodeMirror-line>span>span::selection{background:rgba(48,48,48,.99)}.cm-s-base16-dark .CodeMirror-line::-moz-selection,.cm-s-base16-dark .CodeMirror-line>span::-moz-selection,.cm-s-base16-dark .CodeMirror-line>span>span::-moz-selection{background:rgba(48,48,48,.99)}.cm-s-base16-dark .CodeMirror-gutters{background:#151515;border-right:0}.cm-s-base16-dark .CodeMirror-guttermarker{color:#ac4142}.cm-s-base16-dark .CodeMirror-guttermarker-subtle,.cm-s-base16-dark .CodeMirror-linenumber{color:#505050}.cm-s-base16-dark .CodeMirror-cursor{border-left:1px solid #b0b0b0}.cm-s-base16-dark span.cm-comment{color:#8f5536}.cm-s-base16-dark span.cm-atom,.cm-s-base16-dark span.cm-number{color:#aa759f}.cm-s-base16-dark span.cm-property,.cm-s-base16-dark span.cm-attribute{color:#90a959}.cm-s-base16-dark span.cm-keyword{color:#ac4142}.cm-s-base16-dark span.cm-string{color:#f4bf75}.cm-s-base16-dark span.cm-variable{color:#90a959}.cm-s-base16-dark span.cm-variable-2{color:#6a9fb5}.cm-s-base16-dark span.cm-def{color:#d28445}.cm-s-base16-dark span.cm-bracket{color:#e0e0e0}.cm-s-base16-dark span.cm-tag{color:#ac4142}.cm-s-base16-dark span.cm-link{color:#aa759f}.cm-s-base16-dark span.cm-error{background:#ac4142;color:#b0b0b0}.cm-s-base16-dark .CodeMirror-activeline-background{background:#202020}.cm-s-base16-dark .CodeMirror-matchingbracket{text-decoration:underline;color:#fff!important}
|
css/min/cmthemes/base16-light.css
CHANGED
@@ -1 +1 @@
|
|
1 |
-
.cm-s-base16-light.CodeMirror{background:#f5f5f5;color:#202020}.cm-s-base16-light div.CodeMirror-selected{background:#e0e0e0
|
1 |
+
.cm-s-base16-light.CodeMirror{background:#f5f5f5;color:#202020}.cm-s-base16-light div.CodeMirror-selected{background:#e0e0e0}.cm-s-base16-light .CodeMirror-line::selection,.cm-s-base16-light .CodeMirror-line>span::selection,.cm-s-base16-light .CodeMirror-line>span>span::selection{background:#e0e0e0}.cm-s-base16-light .CodeMirror-line::-moz-selection,.cm-s-base16-light .CodeMirror-line>span::-moz-selection,.cm-s-base16-light .CodeMirror-line>span>span::-moz-selection{background:#e0e0e0}.cm-s-base16-light .CodeMirror-gutters{background:#f5f5f5;border-right:0}.cm-s-base16-light .CodeMirror-guttermarker{color:#ac4142}.cm-s-base16-light .CodeMirror-guttermarker-subtle,.cm-s-base16-light .CodeMirror-linenumber{color:#b0b0b0}.cm-s-base16-light .CodeMirror-cursor{border-left:1px solid #505050}.cm-s-base16-light span.cm-comment{color:#8f5536}.cm-s-base16-light span.cm-atom,.cm-s-base16-light span.cm-number{color:#aa759f}.cm-s-base16-light span.cm-property,.cm-s-base16-light span.cm-attribute{color:#90a959}.cm-s-base16-light span.cm-keyword{color:#ac4142}.cm-s-base16-light span.cm-string{color:#f4bf75}.cm-s-base16-light span.cm-variable{color:#90a959}.cm-s-base16-light span.cm-variable-2{color:#6a9fb5}.cm-s-base16-light span.cm-def{color:#d28445}.cm-s-base16-light span.cm-bracket{color:#202020}.cm-s-base16-light span.cm-tag{color:#ac4142}.cm-s-base16-light span.cm-link{color:#aa759f}.cm-s-base16-light span.cm-error{background:#ac4142;color:#505050}.cm-s-base16-light .CodeMirror-activeline-background{background:#DDDCDC}.cm-s-base16-light .CodeMirror-matchingbracket{text-decoration:underline;color:#fff!important}
|
css/min/cmthemes/blackboard.css
CHANGED
@@ -1 +1 @@
|
|
1 |
-
.cm-s-blackboard.CodeMirror{background:#0C1021;color:#F8F8F8}.cm-s-blackboard .CodeMirror-selected{background:#253B76
|
1 |
+
.cm-s-blackboard.CodeMirror{background:#0C1021;color:#F8F8F8}.cm-s-blackboard div.CodeMirror-selected{background:#253B76}.cm-s-blackboard .CodeMirror-line::selection,.cm-s-blackboard .CodeMirror-line>span::selection,.cm-s-blackboard .CodeMirror-line>span>span::selection{background:rgba(37,59,118,.99)}.cm-s-blackboard .CodeMirror-line::-moz-selection,.cm-s-blackboard .CodeMirror-line>span::-moz-selection,.cm-s-blackboard .CodeMirror-line>span>span::-moz-selection{background:rgba(37,59,118,.99)}.cm-s-blackboard .CodeMirror-gutters{background:#0C1021;border-right:0}.cm-s-blackboard .CodeMirror-guttermarker{color:#FBDE2D}.cm-s-blackboard .CodeMirror-guttermarker-subtle,.cm-s-blackboard .CodeMirror-linenumber{color:#888}.cm-s-blackboard .CodeMirror-cursor{border-left:1px solid #A7A7A7}.cm-s-blackboard .cm-keyword{color:#FBDE2D}.cm-s-blackboard .cm-atom,.cm-s-blackboard .cm-number{color:#D8FA3C}.cm-s-blackboard .cm-def{color:#8DA6CE}.cm-s-blackboard .cm-variable{color:#FF6400}.cm-s-blackboard .cm-operator{color:#FBDE2D}.cm-s-blackboard .cm-comment{color:#AEAEAE}.cm-s-blackboard .cm-string,.cm-s-blackboard .cm-string-2{color:#61CE3C}.cm-s-blackboard .cm-meta{color:#D8FA3C}.cm-s-blackboard .cm-builtin,.cm-s-blackboard .cm-tag,.cm-s-blackboard .cm-attribute{color:#8DA6CE}.cm-s-blackboard .cm-header{color:#FF6400}.cm-s-blackboard .cm-hr{color:#AEAEAE}.cm-s-blackboard .cm-link{color:#8DA6CE}.cm-s-blackboard .cm-error{background:#9D1E15;color:#F8F8F8}.cm-s-blackboard .CodeMirror-activeline-background{background:#3C3636}.cm-s-blackboard .CodeMirror-matchingbracket{outline:1px solid grey;color:#fff!important}
|
css/min/cmthemes/cobalt.css
CHANGED
@@ -1 +1 @@
|
|
1 |
-
.cm-s-cobalt.CodeMirror{background:#002240;color:#fff}.cm-s-cobalt div.CodeMirror-selected{background:#b36539
|
1 |
+
.cm-s-cobalt.CodeMirror{background:#002240;color:#fff}.cm-s-cobalt div.CodeMirror-selected{background:#b36539}.cm-s-cobalt .CodeMirror-line::selection,.cm-s-cobalt .CodeMirror-line>span::selection,.cm-s-cobalt .CodeMirror-line>span>span::selection{background:rgba(179,101,57,.99)}.cm-s-cobalt .CodeMirror-line::-moz-selection,.cm-s-cobalt .CodeMirror-line>span::-moz-selection,.cm-s-cobalt .CodeMirror-line>span>span::-moz-selection{background:rgba(179,101,57,.99)}.cm-s-cobalt .CodeMirror-gutters{background:#002240;border-right:1px solid #aaa}.cm-s-cobalt .CodeMirror-guttermarker{color:#ffee80}.cm-s-cobalt .CodeMirror-guttermarker-subtle,.cm-s-cobalt .CodeMirror-linenumber{color:#d0d0d0}.cm-s-cobalt .CodeMirror-cursor{border-left:1px solid #fff}.cm-s-cobalt span.cm-comment{color:#08f}.cm-s-cobalt span.cm-atom{color:#845dc4}.cm-s-cobalt span.cm-number,.cm-s-cobalt span.cm-attribute{color:#ff80e1}.cm-s-cobalt span.cm-keyword{color:#ffee80}.cm-s-cobalt span.cm-string{color:#3ad900}.cm-s-cobalt span.cm-meta{color:#ff9d00}.cm-s-cobalt span.cm-variable-2,.cm-s-cobalt span.cm-tag{color:#9effff}.cm-s-cobalt span.cm-variable-3,.cm-s-cobalt span.cm-def{color:#fff}.cm-s-cobalt span.cm-bracket{color:#d8d8d8}.cm-s-cobalt span.cm-builtin,.cm-s-cobalt span.cm-special{color:#ff9e59}.cm-s-cobalt span.cm-link{color:#845dc4}.cm-s-cobalt span.cm-error{color:#9d1e15}.cm-s-cobalt .CodeMirror-activeline-background{background:#002D57}.cm-s-cobalt .CodeMirror-matchingbracket{outline:1px solid grey;color:#fff!important}
|
css/min/cmthemes/colorforth.css
CHANGED
@@ -1 +1 @@
|
|
1 |
-
.cm-s-colorforth.CodeMirror{background:#000;color:#f8f8f8}.cm-s-colorforth .CodeMirror-gutters{background:#0a001f;border-right:1px solid #aaa}.cm-s-colorforth .CodeMirror-guttermarker{color:#FFBD40}.cm-s-colorforth .CodeMirror-guttermarker-subtle{color:#78846f}.cm-s-colorforth .CodeMirror-linenumber{color:#bababa}.cm-s-colorforth .CodeMirror-cursor{border-left:1px solid #fff
|
1 |
+
.cm-s-colorforth.CodeMirror{background:#000;color:#f8f8f8}.cm-s-colorforth .CodeMirror-gutters{background:#0a001f;border-right:1px solid #aaa}.cm-s-colorforth .CodeMirror-guttermarker{color:#FFBD40}.cm-s-colorforth .CodeMirror-guttermarker-subtle{color:#78846f}.cm-s-colorforth .CodeMirror-linenumber{color:#bababa}.cm-s-colorforth .CodeMirror-cursor{border-left:1px solid #fff}.cm-s-colorforth span.cm-comment{color:#ededed}.cm-s-colorforth span.cm-def{color:#ff1c1c;font-weight:700}.cm-s-colorforth span.cm-keyword{color:#ffd900}.cm-s-colorforth span.cm-builtin{color:#00d95a}.cm-s-colorforth span.cm-variable{color:#73ff00}.cm-s-colorforth span.cm-string{color:#007bff}.cm-s-colorforth span.cm-number{color:#00c4ff}.cm-s-colorforth span.cm-atom{color:#606060}.cm-s-colorforth span.cm-variable-2{color:#EEE}.cm-s-colorforth span.cm-variable-3{color:#DDD}.cm-s-colorforth span.cm-meta{color:#ff0}.cm-s-colorforth span.cm-qualifier{color:#FFF700}.cm-s-colorforth span.cm-bracket{color:#cc7}.cm-s-colorforth span.cm-tag{color:#FFBD40}.cm-s-colorforth span.cm-attribute{color:#FFF700}.cm-s-colorforth span.cm-error{color:red}.cm-s-colorforth div.CodeMirror-selected{background:#333d53}.cm-s-colorforth span.cm-compilation{background:rgba(255,255,255,.12)}.cm-s-colorforth .CodeMirror-activeline-background{background:#253540}
|
css/min/cmthemes/dracula.css
ADDED
@@ -0,0 +1 @@
|
|
|
1 |
+
.cm-s-dracula.CodeMirror,.cm-s-dracula .CodeMirror-gutters{background-color:#282a36!important;color:#f8f8f2!important;border:none}.cm-s-dracula .CodeMirror-cursor{border-left:solid thin #f8f8f0}.cm-s-dracula .CodeMirror-linenumber{color:#6D8A88}.cm-s-dracula.CodeMirror-focused div.CodeMirror-selected{background:rgba(255,255,255,.1)}.cm-s-dracula .CodeMirror-line::selection,.cm-s-dracula .CodeMirror-line>span::selection,.cm-s-dracula .CodeMirror-line>span>span::selection{background:rgba(255,255,255,.1)}.cm-s-dracula .CodeMirror-line::-moz-selection,.cm-s-dracula .CodeMirror-line>span::-moz-selection,.cm-s-dracula .CodeMirror-line>span>span::-moz-selection{background:rgba(255,255,255,.1)}.cm-s-dracula span.cm-comment{color:#6272a4}.cm-s-dracula span.cm-string,.cm-s-dracula span.cm-string-2{color:#f1fa8c}.cm-s-dracula span.cm-number{color:#bd93f9}.cm-s-dracula span.cm-variable{color:#50fa7b}.cm-s-dracula span.cm-variable-2{color:#fff}.cm-s-dracula span.cm-def{color:#ffb86c}.cm-s-dracula span.cm-keyword,.cm-s-dracula span.cm-operator{color:#ff79c6}.cm-s-dracula span.cm-atom{color:#bd93f9}.cm-s-dracula span.cm-meta{color:#f8f8f2}.cm-s-dracula span.cm-tag{color:#ff79c6}.cm-s-dracula span.cm-attribute,.cm-s-dracula span.cm-qualifier{color:#50fa7b}.cm-s-dracula span.cm-property{color:#66d9ef}.cm-s-dracula span.cm-builtin,.cm-s-dracula span.cm-variable-3{color:#50fa7b}.cm-s-dracula .CodeMirror-activeline-background{background:rgba(255,255,255,.1)}.cm-s-dracula .CodeMirror-matchingbracket{text-decoration:underline;color:#fff!important}
|
css/min/cmthemes/eclipse.css
CHANGED
@@ -1 +1 @@
|
|
1 |
-
.cm-s-eclipse span.cm-meta{color:#FF1717}.cm-s-eclipse span.cm-keyword{line-height:1em;font-weight:700;color:#7F0055}.cm-s-eclipse span.cm-atom{color:#219}.cm-s-eclipse span.cm-number{color:#164}.cm-s-eclipse span.cm-def{color:#00f}.cm-s-eclipse span.cm-variable{color:#000}.cm-s-eclipse span.cm-variable-2,.cm-s-eclipse span.cm-variable-3{color:#0000C0}.cm-s-eclipse span.cm-property,.cm-s-eclipse span.cm-operator{color:#000}.cm-s-eclipse span.cm-comment{color:#3F7F5F}.cm-s-eclipse span.cm-string{color:#2A00FF}.cm-s-eclipse span.cm-string-2{color:#f50}.cm-s-eclipse span.cm-qualifier{color:#555}.cm-s-eclipse span.cm-builtin{color:#30a}.cm-s-eclipse span.cm-bracket{color:#cc7}.cm-s-eclipse span.cm-tag{color:#170}.cm-s-eclipse span.cm-attribute{color:#00c}.cm-s-eclipse span.cm-link{color:#219}.cm-s-eclipse span.cm-error{color:red}.cm-s-eclipse .CodeMirror-activeline-background{background:#e8f2ff
|
1 |
+
.cm-s-eclipse span.cm-meta{color:#FF1717}.cm-s-eclipse span.cm-keyword{line-height:1em;font-weight:700;color:#7F0055}.cm-s-eclipse span.cm-atom{color:#219}.cm-s-eclipse span.cm-number{color:#164}.cm-s-eclipse span.cm-def{color:#00f}.cm-s-eclipse span.cm-variable{color:#000}.cm-s-eclipse span.cm-variable-2,.cm-s-eclipse span.cm-variable-3{color:#0000C0}.cm-s-eclipse span.cm-property,.cm-s-eclipse span.cm-operator{color:#000}.cm-s-eclipse span.cm-comment{color:#3F7F5F}.cm-s-eclipse span.cm-string{color:#2A00FF}.cm-s-eclipse span.cm-string-2{color:#f50}.cm-s-eclipse span.cm-qualifier{color:#555}.cm-s-eclipse span.cm-builtin{color:#30a}.cm-s-eclipse span.cm-bracket{color:#cc7}.cm-s-eclipse span.cm-tag{color:#170}.cm-s-eclipse span.cm-attribute{color:#00c}.cm-s-eclipse span.cm-link{color:#219}.cm-s-eclipse span.cm-error{color:red}.cm-s-eclipse .CodeMirror-activeline-background{background:#e8f2ff}.cm-s-eclipse .CodeMirror-matchingbracket{outline:1px solid grey;color:#000!important}
|
css/min/cmthemes/elegant.css
CHANGED
@@ -1 +1 @@
|
|
1 |
-
.cm-s-elegant span.cm-number,.cm-s-elegant span.cm-string,.cm-s-elegant span.cm-atom{color:#762}.cm-s-elegant span.cm-comment{color:#262;font-style:italic;line-height:1em}.cm-s-elegant span.cm-meta{color:#555;font-style:italic;line-height:1em}.cm-s-elegant span.cm-variable{color:#000}.cm-s-elegant span.cm-variable-2{color:#b11}.cm-s-elegant span.cm-qualifier{color:#555}.cm-s-elegant span.cm-keyword{color:#730}.cm-s-elegant span.cm-builtin{color:#30a}.cm-s-elegant span.cm-link{color:#762}.cm-s-elegant span.cm-error{background-color:#fdd}.cm-s-elegant .CodeMirror-activeline-background{background:#e8f2ff
|
1 |
+
.cm-s-elegant span.cm-number,.cm-s-elegant span.cm-string,.cm-s-elegant span.cm-atom{color:#762}.cm-s-elegant span.cm-comment{color:#262;font-style:italic;line-height:1em}.cm-s-elegant span.cm-meta{color:#555;font-style:italic;line-height:1em}.cm-s-elegant span.cm-variable{color:#000}.cm-s-elegant span.cm-variable-2{color:#b11}.cm-s-elegant span.cm-qualifier{color:#555}.cm-s-elegant span.cm-keyword{color:#730}.cm-s-elegant span.cm-builtin{color:#30a}.cm-s-elegant span.cm-link{color:#762}.cm-s-elegant span.cm-error{background-color:#fdd}.cm-s-elegant .CodeMirror-activeline-background{background:#e8f2ff}.cm-s-elegant .CodeMirror-matchingbracket{outline:1px solid grey;color:#000!important}
|
css/min/cmthemes/erlang-dark.css
CHANGED
@@ -1 +1 @@
|
|
1 |
-
.cm-s-erlang-dark.CodeMirror{background:#002240;color:#fff}.cm-s-erlang-dark div.CodeMirror-selected{background:#b36539
|
1 |
+
.cm-s-erlang-dark.CodeMirror{background:#002240;color:#fff}.cm-s-erlang-dark div.CodeMirror-selected{background:#b36539}.cm-s-erlang-dark .CodeMirror-line::selection,.cm-s-erlang-dark .CodeMirror-line>span::selection,.cm-s-erlang-dark .CodeMirror-line>span>span::selection{background:rgba(179,101,57,.99)}.cm-s-erlang-dark .CodeMirror-line::-moz-selection,.cm-s-erlang-dark .CodeMirror-line>span::-moz-selection,.cm-s-erlang-dark .CodeMirror-line>span>span::-moz-selection{background:rgba(179,101,57,.99)}.cm-s-erlang-dark .CodeMirror-gutters{background:#002240;border-right:1px solid #aaa}.cm-s-erlang-dark .CodeMirror-guttermarker{color:#fff}.cm-s-erlang-dark .CodeMirror-guttermarker-subtle,.cm-s-erlang-dark .CodeMirror-linenumber{color:#d0d0d0}.cm-s-erlang-dark .CodeMirror-cursor{border-left:1px solid #fff}.cm-s-erlang-dark span.cm-quote{color:#ccc}.cm-s-erlang-dark span.cm-atom{color:#f133f1}.cm-s-erlang-dark span.cm-attribute{color:#ff80e1}.cm-s-erlang-dark span.cm-bracket{color:#ff9d00}.cm-s-erlang-dark span.cm-builtin{color:#eaa}.cm-s-erlang-dark span.cm-comment{color:#77f}.cm-s-erlang-dark span.cm-def{color:#e7a}.cm-s-erlang-dark span.cm-keyword{color:#ffee80}.cm-s-erlang-dark span.cm-meta{color:#50fefe}.cm-s-erlang-dark span.cm-number{color:#ffd0d0}.cm-s-erlang-dark span.cm-operator{color:#d55}.cm-s-erlang-dark span.cm-property,.cm-s-erlang-dark span.cm-qualifier{color:#ccc}.cm-s-erlang-dark span.cm-special{color:#fbb}.cm-s-erlang-dark span.cm-string{color:#3ad900}.cm-s-erlang-dark span.cm-string-2{color:#ccc}.cm-s-erlang-dark span.cm-tag{color:#9effff}.cm-s-erlang-dark span.cm-variable{color:#50fe50}.cm-s-erlang-dark span.cm-variable-2{color:#e0e}.cm-s-erlang-dark span.cm-variable-3{color:#ccc}.cm-s-erlang-dark span.cm-error{color:#9d1e15}.cm-s-erlang-dark .CodeMirror-activeline-background{background:#013461}.cm-s-erlang-dark .CodeMirror-matchingbracket{outline:1px solid grey;color:#fff!important}
|
css/min/cmthemes/icecoder.css
ADDED
@@ -0,0 +1 @@
|
|
|
1 |
+
.cm-s-icecoder{color:#666;background:#141612}.cm-s-icecoder span.cm-keyword{color:#eee;font-weight:700}.cm-s-icecoder span.cm-atom{color:#e1c76e}.cm-s-icecoder span.cm-number{color:#6cb5d9}.cm-s-icecoder span.cm-def{color:#b9ca4a}.cm-s-icecoder span.cm-variable{color:#6cb5d9}.cm-s-icecoder span.cm-variable-2{color:#cc1e5c}.cm-s-icecoder span.cm-variable-3{color:#f9602c}.cm-s-icecoder span.cm-property{color:#eee}.cm-s-icecoder span.cm-operator{color:#9179bb}.cm-s-icecoder span.cm-comment{color:#97a3aa}.cm-s-icecoder span.cm-string{color:#b9ca4a}.cm-s-icecoder span.cm-string-2{color:#6cb5d9}.cm-s-icecoder span.cm-meta,.cm-s-icecoder span.cm-qualifier{color:#555}.cm-s-icecoder span.cm-builtin{color:#214e7b}.cm-s-icecoder span.cm-bracket{color:#cc7}.cm-s-icecoder span.cm-tag{color:#e8e8e8}.cm-s-icecoder span.cm-attribute{color:#099}.cm-s-icecoder span.cm-header{color:#6a0d6a}.cm-s-icecoder span.cm-quote{color:#186718}.cm-s-icecoder span.cm-hr{color:#888}.cm-s-icecoder span.cm-link{color:#e1c76e}.cm-s-icecoder span.cm-error{color:#d00}.cm-s-icecoder .CodeMirror-cursor{border-left:1px solid #fff}.cm-s-icecoder div.CodeMirror-selected{color:#fff;background:#037}.cm-s-icecoder .CodeMirror-gutters{background:#141612;min-width:41px;border-right:0}.cm-s-icecoder .CodeMirror-linenumber{color:#555;cursor:default}.cm-s-icecoder .CodeMirror-matchingbracket{border:1px solid grey;color:#000!important}
|
css/min/cmthemes/lesser-dark.css
CHANGED
@@ -1 +1 @@
|
|
1 |
-
.cm-s-lesser-dark{line-height:1.3em}.cm-s-lesser-dark.CodeMirror{background:#262626;color:#EBEFE7;text-shadow:0 -1px 1px #262626}.cm-s-lesser-dark div.CodeMirror-selected{background:#45443B
|
1 |
+
.cm-s-lesser-dark{line-height:1.3em}.cm-s-lesser-dark.CodeMirror{background:#262626;color:#EBEFE7;text-shadow:0 -1px 1px #262626}.cm-s-lesser-dark div.CodeMirror-selected{background:#45443B}.cm-s-lesser-dark .CodeMirror-line::selection,.cm-s-lesser-dark .CodeMirror-line>span::selection,.cm-s-lesser-dark .CodeMirror-line>span>span::selection{background:rgba(69,68,59,.99)}.cm-s-lesser-dark .CodeMirror-line::-moz-selection,.cm-s-lesser-dark .CodeMirror-line>span::-moz-selection,.cm-s-lesser-dark .CodeMirror-line>span>span::-moz-selection{background:rgba(69,68,59,.99)}.cm-s-lesser-dark .CodeMirror-cursor{border-left:1px solid #fff}.cm-s-lesser-dark pre{padding:0 8px}.cm-s-lesser-dark.CodeMirror span.CodeMirror-matchingbracket{color:#7EFC7E}.cm-s-lesser-dark .CodeMirror-gutters{background:#262626;border-right:1px solid #aaa}.cm-s-lesser-dark .CodeMirror-guttermarker{color:#599eff}.cm-s-lesser-dark .CodeMirror-guttermarker-subtle,.cm-s-lesser-dark .CodeMirror-linenumber{color:#777}.cm-s-lesser-dark span.cm-header{color:#a0a}.cm-s-lesser-dark span.cm-quote{color:#090}.cm-s-lesser-dark span.cm-keyword{color:#599eff}.cm-s-lesser-dark span.cm-atom{color:#C2B470}.cm-s-lesser-dark span.cm-number{color:#B35E4D}.cm-s-lesser-dark span.cm-def{color:#fff}.cm-s-lesser-dark span.cm-variable{color:#D9BF8C}.cm-s-lesser-dark span.cm-variable-2{color:#669199}.cm-s-lesser-dark span.cm-variable-3{color:#fff}.cm-s-lesser-dark span.cm-property,.cm-s-lesser-dark span.cm-operator{color:#92A75C}.cm-s-lesser-dark span.cm-comment{color:#666}.cm-s-lesser-dark span.cm-string{color:#BCD279}.cm-s-lesser-dark span.cm-string-2{color:#f50}.cm-s-lesser-dark span.cm-meta{color:#738C73}.cm-s-lesser-dark span.cm-qualifier{color:#555}.cm-s-lesser-dark span.cm-builtin{color:#ff9e59}.cm-s-lesser-dark span.cm-bracket{color:#EBEFE7}.cm-s-lesser-dark span.cm-tag{color:#669199}.cm-s-lesser-dark span.cm-attribute{color:#00c}.cm-s-lesser-dark span.cm-hr{color:#999}.cm-s-lesser-dark span.cm-link{color:#00c}.cm-s-lesser-dark span.cm-error{color:#9d1e15}.cm-s-lesser-dark .CodeMirror-activeline-background{background:#3C3A3A}.cm-s-lesser-dark .CodeMirror-matchingbracket{outline:1px solid grey;color:#fff!important}
|
css/min/cmthemes/liquibyte.css
CHANGED
@@ -1 +1 @@
|
|
1 |
-
.cm-s-liquibyte.CodeMirror{background-color:#000;color:#fff;line-height:1.2em;font-size:1em}.CodeMirror-focused .cm-matchhighlight{text-decoration:underline;text-decoration-color:#0f0;text-decoration-style:wavy}.cm-trailingspace{text-decoration-color:red}.cm-trailingspace,.cm-tab{text-decoration:line-through;text-decoration-style:dotted}.cm-tab{text-decoration-color:#404040}.cm-s-liquibyte .CodeMirror-gutters{background-color:#262626;border-right:1px solid #505050;padding-right:.8em}.cm-s-liquibyte .CodeMirror-gutter-elt div{font-size:1.2em}.cm-s-liquibyte .CodeMirror-linenumber{color:#606060;padding-left:0}.cm-s-liquibyte .CodeMirror-cursor{border-left:1px solid #eee
|
1 |
+
.cm-s-liquibyte.CodeMirror{background-color:#000;color:#fff;line-height:1.2em;font-size:1em}.CodeMirror-focused .cm-matchhighlight{text-decoration:underline;text-decoration-color:#0f0;text-decoration-style:wavy}.cm-trailingspace{text-decoration-color:red}.cm-trailingspace,.cm-tab{text-decoration:line-through;text-decoration-style:dotted}.cm-tab{text-decoration-color:#404040}.cm-s-liquibyte .CodeMirror-gutters{background-color:#262626;border-right:1px solid #505050;padding-right:.8em}.cm-s-liquibyte .CodeMirror-gutter-elt div{font-size:1.2em}.cm-s-liquibyte .CodeMirror-linenumber{color:#606060;padding-left:0}.cm-s-liquibyte .CodeMirror-cursor{border-left:1px solid #eee}.cm-s-liquibyte span.cm-comment{color:green}.cm-s-liquibyte span.cm-def{color:#ffaf40;font-weight:700}.cm-s-liquibyte span.cm-keyword{color:#c080ff;font-weight:700}.cm-s-liquibyte span.cm-builtin{color:#ffaf40;font-weight:700}.cm-s-liquibyte span.cm-variable{color:#5967ff;font-weight:700}.cm-s-liquibyte span.cm-string{color:#ff8000}.cm-s-liquibyte span.cm-number{color:#0f0;font-weight:700}.cm-s-liquibyte span.cm-atom{color:#bf3030;font-weight:700}.cm-s-liquibyte span.cm-variable-2{color:#007f7f;font-weight:700}.cm-s-liquibyte span.cm-variable-3{color:#c080ff;font-weight:700}.cm-s-liquibyte span.cm-property{color:#999;font-weight:700}.cm-s-liquibyte span.cm-operator{color:#fff}.cm-s-liquibyte span.cm-meta{color:#0f0}.cm-s-liquibyte span.cm-qualifier{color:#fff700;font-weight:700}.cm-s-liquibyte span.cm-bracket{color:#cc7}.cm-s-liquibyte span.cm-tag{color:#ff0;font-weight:700}.cm-s-liquibyte span.cm-attribute{color:#c080ff;font-weight:700}.cm-s-liquibyte span.cm-error{color:red}.cm-s-liquibyte div.CodeMirror-selected{background-color:rgba(255,0,0,.25)}.cm-s-liquibyte span.cm-compilation{background-color:rgba(255,255,255,.12)}.cm-s-liquibyte .CodeMirror-activeline-background{background-color:rgba(0,255,0,.15)}div.CodeMirror span.CodeMirror-matchingbracket{color:#0f0;font-weight:700}div.CodeMirror span.CodeMirror-nonmatchingbracket{color:red;font-weight:700}.CodeMirror-matchingtag{background-color:rgba(150,255,0,.3)}div.CodeMirror-simplescroll-horizontal div:hover,div.CodeMirror-simplescroll-vertical div:hover{background-color:rgba(80,80,80,.7)}div.CodeMirror-simplescroll-horizontal div,div.CodeMirror-simplescroll-vertical div{background-color:rgba(80,80,80,.3);border:1px solid #404040;border-radius:5px}div.CodeMirror-simplescroll-vertical div{border-top:1px solid #404040;border-bottom:1px solid #404040}div.CodeMirror-simplescroll-horizontal div{border-left:1px solid #404040;border-right:1px solid #404040}div.CodeMirror-simplescroll-vertical{background-color:#262626}div.CodeMirror-simplescroll-horizontal{background-color:#262626;border-top:1px solid #404040}div.CodeMirror-overlayscroll-horizontal div,div.CodeMirror-overlayscroll-vertical div{background-color:#404040;border-radius:5px;border:1px solid #404040}
|
css/min/cmthemes/material.css
ADDED
@@ -0,0 +1 @@
|
|
|
1 |
+
.cm-s-material{background-color:#263238;color:rgba(233,237,237,1)}.cm-s-material .CodeMirror-gutters{background:#263238;color:#537f7e;border:none}.cm-s-material .CodeMirror-guttermarker,.cm-s-material .CodeMirror-guttermarker-subtle,.cm-s-material .CodeMirror-linenumber{color:#537f7e}.cm-s-material .CodeMirror-cursor{border-left:1px solid #f8f8f0}.cm-s-material div.CodeMirror-selected{background:rgba(255,255,255,.15)}.cm-s-material.CodeMirror-focused div.CodeMirror-selected{background:rgba(255,255,255,.1)}.cm-s-material .CodeMirror-line::selection,.cm-s-material .CodeMirror-line>span::selection,.cm-s-material .CodeMirror-line>span>span::selection{background:rgba(255,255,255,.1)}.cm-s-material .CodeMirror-line::-moz-selection,.cm-s-material .CodeMirror-line>span::-moz-selection,.cm-s-material .CodeMirror-line>span>span::-moz-selection{background:rgba(255,255,255,.1)}.cm-s-material .CodeMirror-activeline-background{background:rgba(0,0,0,0)}.cm-s-material .cm-keyword{color:rgba(199,146,234,1)}.cm-s-material .cm-operator{color:rgba(233,237,237,1)}.cm-s-material .cm-variable-2{color:#80CBC4}.cm-s-material .cm-builtin{color:#DECB6B}.cm-s-material .cm-atom,.cm-s-material .cm-number{color:#F77669}.cm-s-material .cm-def{color:rgba(233,237,237,1)}.cm-s-material .cm-error{color:rgba(255,255,255,1);background-color:#EC5F67}.cm-s-material .cm-string{color:#C3E88D}.cm-s-material .cm-string-2{color:#80CBC4}.cm-s-material .cm-comment{color:#546E7A}.cm-s-material .cm-variable{color:#82B1FF}.cm-s-material .cm-tag,.cm-s-material .cm-meta{color:#80CBC4}.cm-s-material .cm-attribute{color:#FFCB6B}.cm-s-material .cm-property{color:#80CBAE}.cm-s-material .cm-qualifier,.cm-s-material .cm-variable-3{color:#DECB6B}.cm-s-material .cm-tag{color:rgba(255,83,112,1)}.cm-s-material .CodeMirror-matchingbracket{text-decoration:underline;color:#fff!important}
|
css/min/cmthemes/mbo.css
CHANGED
@@ -1 +1 @@
|
|
1 |
-
.cm-s-mbo.CodeMirror{background:#2c2c2c;color:#ffffec}.cm-s-mbo div.CodeMirror-selected{background:#716C62
|
1 |
+
.cm-s-mbo.CodeMirror{background:#2c2c2c;color:#ffffec}.cm-s-mbo div.CodeMirror-selected{background:#716C62}.cm-s-mbo .CodeMirror-line::selection,.cm-s-mbo .CodeMirror-line>span::selection,.cm-s-mbo .CodeMirror-line>span>span::selection{background:rgba(113,108,98,.99)}.cm-s-mbo .CodeMirror-line::-moz-selection,.cm-s-mbo .CodeMirror-line>span::-moz-selection,.cm-s-mbo .CodeMirror-line>span>span::-moz-selection{background:rgba(113,108,98,.99)}.cm-s-mbo .CodeMirror-gutters{background:#4e4e4e;border-right:0}.cm-s-mbo .CodeMirror-guttermarker{color:#fff}.cm-s-mbo .CodeMirror-guttermarker-subtle{color:grey}.cm-s-mbo .CodeMirror-linenumber{color:#dadada}.cm-s-mbo .CodeMirror-cursor{border-left:1px solid #ffffec}.cm-s-mbo span.cm-comment{color:#95958a}.cm-s-mbo span.cm-atom,.cm-s-mbo span.cm-number{color:#00a8c6}.cm-s-mbo span.cm-property,.cm-s-mbo span.cm-attribute{color:#9ddfe9}.cm-s-mbo span.cm-keyword{color:#ffb928}.cm-s-mbo span.cm-string{color:#ffcf6c}.cm-s-mbo span.cm-string.cm-property,.cm-s-mbo span.cm-variable{color:#ffffec}.cm-s-mbo span.cm-variable-2{color:#00a8c6}.cm-s-mbo span.cm-def{color:#ffffec}.cm-s-mbo span.cm-bracket{color:#fffffc;font-weight:700}.cm-s-mbo span.cm-tag{color:#9ddfe9}.cm-s-mbo span.cm-link{color:#f54b07}.cm-s-mbo span.cm-error{border-bottom:#636363;color:#ffffec}.cm-s-mbo span.cm-qualifier{color:#ffffec}.cm-s-mbo .CodeMirror-activeline-background{background:#494b41}.cm-s-mbo .CodeMirror-matchingbracket{color:#222!important}.cm-s-mbo .CodeMirror-matchingtag{background:rgba(255,255,255,.37)}
|
css/min/cmthemes/mdn-like.css
CHANGED
@@ -1 +1 @@
|
|
1 |
-
.cm-s-mdn-like.CodeMirror{color:#999;background-color:#fff}.cm-s-mdn-like .CodeMirror-selected{background:#cfc
|
1 |
+
.cm-s-mdn-like.CodeMirror{color:#999;background-color:#fff}.cm-s-mdn-like div.CodeMirror-selected{background:#cfc}.cm-s-mdn-like .CodeMirror-line::selection,.cm-s-mdn-like .CodeMirror-line>span::selection,.cm-s-mdn-like .CodeMirror-line>span>span::selection{background:#cfc}.cm-s-mdn-like .CodeMirror-line::-moz-selection,.cm-s-mdn-like .CodeMirror-line>span::-moz-selection,.cm-s-mdn-like .CodeMirror-line>span>span::-moz-selection{background:#cfc}.cm-s-mdn-like .CodeMirror-gutters{background:#f8f8f8;border-left:6px solid rgba(0,83,159,.65);color:#333}.cm-s-mdn-like .CodeMirror-linenumber{color:#aaa;padding-left:8px}.cm-s-mdn-like .CodeMirror-cursor{border-left:2px solid #222}.cm-s-mdn-like .cm-keyword{color:#6262FF}.cm-s-mdn-like .cm-atom{color:#F90}.cm-s-mdn-like .cm-number{color:#ca7841}.cm-s-mdn-like .cm-def{color:#8DA6CE}.cm-s-mdn-like span.cm-variable-2,.cm-s-mdn-like span.cm-tag{color:#690}.cm-s-mdn-like span.cm-variable-3,.cm-s-mdn-like span.cm-def,.cm-s-mdn-like .cm-variable{color:#07a}.cm-s-mdn-like .cm-property{color:#905}.cm-s-mdn-like .cm-qualifier{color:#690}.cm-s-mdn-like .cm-operator{color:#cda869}.cm-s-mdn-like .cm-comment{color:#777;font-weight:400}.cm-s-mdn-like .cm-string{color:#07a;font-style:italic}.cm-s-mdn-like .cm-string-2{color:#bd6b18}.cm-s-mdn-like .cm-meta{color:#000}.cm-s-mdn-like .cm-builtin{color:#9B7536}.cm-s-mdn-like .cm-tag{color:#997643}.cm-s-mdn-like .cm-attribute{color:#d6bb6d}.cm-s-mdn-like .cm-header{color:#FF6400}.cm-s-mdn-like .cm-hr{color:#AEAEAE}.cm-s-mdn-like .cm-link{color:#ad9361;font-style:italic;text-decoration:none}.cm-s-mdn-like .cm-error{border-bottom:1px solid red}div.cm-s-mdn-like .CodeMirror-activeline-background{background:#efefff}div.cm-s-mdn-like span.CodeMirror-matchingbracket{outline:1px solid grey;color:inherit}.cm-s-mdn-like.CodeMirror{background-image:url(data:image/png;base64,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)}
|
css/min/cmthemes/midnight.css
CHANGED
@@ -1 +1 @@
|
|
1 |
-
.cm-s-midnight span.CodeMirror-matchhighlight{background:#494949}.cm-s-midnight.CodeMirror-focused span.CodeMirror-matchhighlight{background:#314D67!important}.cm-s-midnight .CodeMirror-activeline-background{background:#253540
|
1 |
+
.cm-s-midnight span.CodeMirror-matchhighlight{background:#494949}.cm-s-midnight.CodeMirror-focused span.CodeMirror-matchhighlight{background:#314D67!important}.cm-s-midnight .CodeMirror-activeline-background{background:#253540}.cm-s-midnight.CodeMirror{background:#0F192A;color:#D1EDFF;border-top:1px solid #000;border-bottom:1px solid #000}.cm-s-midnight div.CodeMirror-selected{background:#314D67}.cm-s-midnight .CodeMirror-line::selection,.cm-s-midnight .CodeMirror-line>span::selection,.cm-s-midnight .CodeMirror-line>span>span::selection{background:rgba(49,77,103,.99)}.cm-s-midnight .CodeMirror-line::-moz-selection,.cm-s-midnight .CodeMirror-line>span::-moz-selection,.cm-s-midnight .CodeMirror-line>span>span::-moz-selection{background:rgba(49,77,103,.99)}.cm-s-midnight .CodeMirror-gutters{background:#0F192A;border-right:1px solid}.cm-s-midnight .CodeMirror-guttermarker{color:#fff}.cm-s-midnight .CodeMirror-guttermarker-subtle{color:#d0d0d0}.cm-s-midnight .CodeMirror-linenumber{color:#D0D0D0}.cm-s-midnight .CodeMirror-cursor{border-left:1px solid #F8F8F0}.cm-s-midnight span.cm-comment{color:#428BDD}.cm-s-midnight span.cm-atom{color:#AE81FF}.cm-s-midnight span.cm-number{color:#D1EDFF}.cm-s-midnight span.cm-property,.cm-s-midnight span.cm-attribute{color:#A6E22E}.cm-s-midnight span.cm-keyword{color:#E83737}.cm-s-midnight span.cm-string{color:#1DC116}.cm-s-midnight span.cm-variable,.cm-s-midnight span.cm-variable-2{color:#FFAA3E}.cm-s-midnight span.cm-def{color:#4DD}.cm-s-midnight span.cm-bracket{color:#D1EDFF}.cm-s-midnight span.cm-tag{color:#449}.cm-s-midnight span.cm-link{color:#AE81FF}.cm-s-midnight span.cm-error{background:#F92672;color:#F8F8F0}.cm-s-midnight .CodeMirror-matchingbracket{text-decoration:underline;color:#fff!important}
|
css/min/cmthemes/monokai.css
CHANGED
@@ -1 +1 @@
|
|
1 |
-
.cm-s-monokai.CodeMirror{background:#272822;color:#f8f8f2}.cm-s-monokai div.CodeMirror-selected{background:#49483E
|
1 |
+
.cm-s-monokai.CodeMirror{background:#272822;color:#f8f8f2}.cm-s-monokai div.CodeMirror-selected{background:#49483E}.cm-s-monokai .CodeMirror-line::selection,.cm-s-monokai .CodeMirror-line>span::selection,.cm-s-monokai .CodeMirror-line>span>span::selection{background:rgba(73,72,62,.99)}.cm-s-monokai .CodeMirror-line::-moz-selection,.cm-s-monokai .CodeMirror-line>span::-moz-selection,.cm-s-monokai .CodeMirror-line>span>span::-moz-selection{background:rgba(73,72,62,.99)}.cm-s-monokai .CodeMirror-gutters{background:#272822;border-right:0}.cm-s-monokai .CodeMirror-guttermarker{color:#fff}.cm-s-monokai .CodeMirror-guttermarker-subtle,.cm-s-monokai .CodeMirror-linenumber{color:#d0d0d0}.cm-s-monokai .CodeMirror-cursor{border-left:1px solid #f8f8f0}.cm-s-monokai span.cm-comment{color:#75715e}.cm-s-monokai span.cm-atom,.cm-s-monokai span.cm-number{color:#ae81ff}.cm-s-monokai span.cm-property,.cm-s-monokai span.cm-attribute{color:#a6e22e}.cm-s-monokai span.cm-keyword{color:#f92672}.cm-s-monokai span.cm-string{color:#e6db74}.cm-s-monokai span.cm-variable{color:#f8f8f2}.cm-s-monokai span.cm-variable-2{color:#9effff}.cm-s-monokai span.cm-variable-3{color:#66d9ef}.cm-s-monokai span.cm-def{color:#fd971f}.cm-s-monokai span.cm-bracket{color:#f8f8f2}.cm-s-monokai span.cm-tag{color:#f92672}.cm-s-monokai span.cm-header,.cm-s-monokai span.cm-link{color:#ae81ff}.cm-s-monokai span.cm-error{background:#f92672;color:#f8f8f0}.cm-s-monokai .CodeMirror-activeline-background{background:#373831}.cm-s-monokai .CodeMirror-matchingbracket{text-decoration:underline;color:#fff!important}
|
css/min/cmthemes/neat.css
CHANGED
@@ -1 +1 @@
|
|
1 |
-
.cm-s-neat span.cm-comment{color:#a86}.cm-s-neat span.cm-keyword{line-height:1em;font-weight:700;color:#00f}.cm-s-neat span.cm-string{color:#a22}.cm-s-neat span.cm-builtin{line-height:1em;font-weight:700;color:#077}.cm-s-neat span.cm-special{line-height:1em;font-weight:700;color:#0aa}.cm-s-neat span.cm-variable{color:#000}.cm-s-neat span.cm-number,.cm-s-neat span.cm-atom{color:#3a3}.cm-s-neat span.cm-meta{color:#555}.cm-s-neat span.cm-link{color:#3a3}.cm-s-neat .CodeMirror-activeline-background{background:#e8f2ff
|
1 |
+
.cm-s-neat span.cm-comment{color:#a86}.cm-s-neat span.cm-keyword{line-height:1em;font-weight:700;color:#00f}.cm-s-neat span.cm-string{color:#a22}.cm-s-neat span.cm-builtin{line-height:1em;font-weight:700;color:#077}.cm-s-neat span.cm-special{line-height:1em;font-weight:700;color:#0aa}.cm-s-neat span.cm-variable{color:#000}.cm-s-neat span.cm-number,.cm-s-neat span.cm-atom{color:#3a3}.cm-s-neat span.cm-meta{color:#555}.cm-s-neat span.cm-link{color:#3a3}.cm-s-neat .CodeMirror-activeline-background{background:#e8f2ff}.cm-s-neat .CodeMirror-matchingbracket{outline:1px solid grey;color:#000!important}
|
css/min/cmthemes/neo.css
CHANGED
@@ -1 +1 @@
|
|
1 |
-
.cm-s-neo.CodeMirror{background-color:#fff;color:#2e383c;line-height:1.4375}.cm-s-neo .cm-comment{color:#75787b}.cm-s-neo .cm-keyword,.cm-s-neo .cm-property{color:#1d75b3}.cm-s-neo .cm-atom,.cm-s-neo .cm-number{color:#75438a}.cm-s-neo .cm-node,.cm-s-neo .cm-tag{color:#9c3328}.cm-s-neo .cm-string{color:#b35e14}.cm-s-neo .cm-variable,.cm-s-neo .cm-qualifier{color:#047d65}.cm-s-neo pre{padding:0}.cm-s-neo .CodeMirror-gutters{border:none;border-right:10px solid transparent;background-color:transparent}.cm-s-neo .CodeMirror-linenumber{padding:0;color:#e0e2e5}.cm-s-neo .CodeMirror-guttermarker{color:#1d75b3}.cm-s-neo .CodeMirror-guttermarker-subtle{color:#e0e2e5}.cm-s-neo
|
1 |
+
.cm-s-neo.CodeMirror{background-color:#fff;color:#2e383c;line-height:1.4375}.cm-s-neo .cm-comment{color:#75787b}.cm-s-neo .cm-keyword,.cm-s-neo .cm-property{color:#1d75b3}.cm-s-neo .cm-atom,.cm-s-neo .cm-number{color:#75438a}.cm-s-neo .cm-node,.cm-s-neo .cm-tag{color:#9c3328}.cm-s-neo .cm-string{color:#b35e14}.cm-s-neo .cm-variable,.cm-s-neo .cm-qualifier{color:#047d65}.cm-s-neo pre{padding:0}.cm-s-neo .CodeMirror-gutters{border:none;border-right:10px solid transparent;background-color:transparent}.cm-s-neo .CodeMirror-linenumber{padding:0;color:#e0e2e5}.cm-s-neo .CodeMirror-guttermarker{color:#1d75b3}.cm-s-neo .CodeMirror-guttermarker-subtle{color:#e0e2e5}.cm-s-neo .CodeMirror-cursor{width:auto;border:0;background:rgba(155,157,162,.37);z-index:1}
|
css/min/cmthemes/night.css
CHANGED
@@ -1 +1 @@
|
|
1 |
-
.cm-s-night.CodeMirror{background:#0a001f;color:#f8f8f8}.cm-s-night div.CodeMirror-selected{background:#447
|
1 |
+
.cm-s-night.CodeMirror{background:#0a001f;color:#f8f8f8}.cm-s-night div.CodeMirror-selected{background:#447}.cm-s-night .CodeMirror-line::selection,.cm-s-night .CodeMirror-line>span::selection,.cm-s-night .CodeMirror-line>span>span::selection{background:rgba(68,68,119,.99)}.cm-s-night .CodeMirror-line::-moz-selection,.cm-s-night .CodeMirror-line>span::-moz-selection,.cm-s-night .CodeMirror-line>span>span::-moz-selection{background:rgba(68,68,119,.99)}.cm-s-night .CodeMirror-gutters{background:#0a001f;border-right:1px solid #aaa}.cm-s-night .CodeMirror-guttermarker{color:#fff}.cm-s-night .CodeMirror-guttermarker-subtle{color:#bbb}.cm-s-night .CodeMirror-linenumber{color:#f8f8f8}.cm-s-night .CodeMirror-cursor{border-left:1px solid #fff}.cm-s-night span.cm-atom{color:#845dc4}.cm-s-night span.cm-number,.cm-s-night span.cm-attribute{color:#ffd500}.cm-s-night span.cm-keyword{color:#599eff}.cm-s-night span.cm-string{color:#37f14a}.cm-s-night span.cm-meta{color:#7678e2}.cm-s-night span.cm-variable-2,.cm-s-night span.cm-tag{color:#99b2ff}.cm-s-night span.cm-variable-3,.cm-s-night span.cm-def{color:#fff}.cm-s-night span.cm-bracket{color:#8da6ce}.cm-s-night span.cm-comment{color:#6900a1}.cm-s-night span.cm-builtin,.cm-s-night span.cm-special{color:#ff9e59}.cm-s-night span.cm-link{color:#845dc4}.cm-s-night span.cm-error{color:#9d1e15}.cm-s-night .CodeMirror-activeline-background{background:#1C005A}.cm-s-night .CodeMirror-matchingbracket{outline:1px solid grey;color:#fff!important}
|
css/min/cmthemes/paraiso-dark.css
CHANGED
@@ -1 +1 @@
|
|
1 |
-
.cm-s-paraiso-dark.CodeMirror{background:#2f1e2e;color:#b9b6b0}.cm-s-paraiso-dark div.CodeMirror-selected{background:#41323f
|
1 |
+
.cm-s-paraiso-dark.CodeMirror{background:#2f1e2e;color:#b9b6b0}.cm-s-paraiso-dark div.CodeMirror-selected{background:#41323f}.cm-s-paraiso-dark .CodeMirror-line::selection,.cm-s-paraiso-dark .CodeMirror-line>span::selection,.cm-s-paraiso-dark .CodeMirror-line>span>span::selection{background:rgba(65,50,63,.99)}.cm-s-paraiso-dark .CodeMirror-line::-moz-selection,.cm-s-paraiso-dark .CodeMirror-line>span::-moz-selection,.cm-s-paraiso-dark .CodeMirror-line>span>span::-moz-selection{background:rgba(65,50,63,.99)}.cm-s-paraiso-dark .CodeMirror-gutters{background:#2f1e2e;border-right:0}.cm-s-paraiso-dark .CodeMirror-guttermarker{color:#ef6155}.cm-s-paraiso-dark .CodeMirror-guttermarker-subtle,.cm-s-paraiso-dark .CodeMirror-linenumber{color:#776e71}.cm-s-paraiso-dark .CodeMirror-cursor{border-left:1px solid #8d8687}.cm-s-paraiso-dark span.cm-comment{color:#e96ba8}.cm-s-paraiso-dark span.cm-atom,.cm-s-paraiso-dark span.cm-number{color:#815ba4}.cm-s-paraiso-dark span.cm-property,.cm-s-paraiso-dark span.cm-attribute{color:#48b685}.cm-s-paraiso-dark span.cm-keyword{color:#ef6155}.cm-s-paraiso-dark span.cm-string{color:#fec418}.cm-s-paraiso-dark span.cm-variable{color:#48b685}.cm-s-paraiso-dark span.cm-variable-2{color:#06b6ef}.cm-s-paraiso-dark span.cm-def{color:#f99b15}.cm-s-paraiso-dark span.cm-bracket{color:#b9b6b0}.cm-s-paraiso-dark span.cm-tag{color:#ef6155}.cm-s-paraiso-dark span.cm-link{color:#815ba4}.cm-s-paraiso-dark span.cm-error{background:#ef6155;color:#8d8687}.cm-s-paraiso-dark .CodeMirror-activeline-background{background:#4D344A}.cm-s-paraiso-dark .CodeMirror-matchingbracket{text-decoration:underline;color:#fff!important}
|
css/min/cmthemes/paraiso-light.css
CHANGED
@@ -1 +1 @@
|
|
1 |
-
.cm-s-paraiso-light.CodeMirror{background:#e7e9db;color:#41323f}.cm-s-paraiso-light div.CodeMirror-selected{background:#b9b6b0
|
1 |
+
.cm-s-paraiso-light.CodeMirror{background:#e7e9db;color:#41323f}.cm-s-paraiso-light div.CodeMirror-selected{background:#b9b6b0}.cm-s-paraiso-light .CodeMirror-line::selection,.cm-s-paraiso-light .CodeMirror-line>span::selection,.cm-s-paraiso-light .CodeMirror-line>span>span::selection{background:#b9b6b0}.cm-s-paraiso-light .CodeMirror-line::-moz-selection,.cm-s-paraiso-light .CodeMirror-line>span::-moz-selection,.cm-s-paraiso-light .CodeMirror-line>span>span::-moz-selection{background:#b9b6b0}.cm-s-paraiso-light .CodeMirror-gutters{background:#e7e9db;border-right:0}.cm-s-paraiso-light .CodeMirror-guttermarker{color:#000}.cm-s-paraiso-light .CodeMirror-guttermarker-subtle,.cm-s-paraiso-light .CodeMirror-linenumber{color:#8d8687}.cm-s-paraiso-light .CodeMirror-cursor{border-left:1px solid #776e71}.cm-s-paraiso-light span.cm-comment{color:#e96ba8}.cm-s-paraiso-light span.cm-atom,.cm-s-paraiso-light span.cm-number{color:#815ba4}.cm-s-paraiso-light span.cm-property,.cm-s-paraiso-light span.cm-attribute{color:#48b685}.cm-s-paraiso-light span.cm-keyword{color:#ef6155}.cm-s-paraiso-light span.cm-string{color:#fec418}.cm-s-paraiso-light span.cm-variable{color:#48b685}.cm-s-paraiso-light span.cm-variable-2{color:#06b6ef}.cm-s-paraiso-light span.cm-def{color:#f99b15}.cm-s-paraiso-light span.cm-bracket{color:#41323f}.cm-s-paraiso-light span.cm-tag{color:#ef6155}.cm-s-paraiso-light span.cm-link{color:#815ba4}.cm-s-paraiso-light span.cm-error{background:#ef6155;color:#776e71}.cm-s-paraiso-light .CodeMirror-activeline-background{background:#CFD1C4}.cm-s-paraiso-light .CodeMirror-matchingbracket{text-decoration:underline;color:#fff!important}
|
css/min/cmthemes/pastel-on-dark.css
CHANGED
@@ -1 +1 @@
|
|
1 |
-
.cm-s-pastel-on-dark.CodeMirror{background:#2c2827;color:#8F938F;line-height:1.5;font-size:14px}.cm-s-pastel-on-dark div.CodeMirror-selected{background:rgba(221,240,255,.2)
|
1 |
+
.cm-s-pastel-on-dark.CodeMirror{background:#2c2827;color:#8F938F;line-height:1.5;font-size:14px}.cm-s-pastel-on-dark div.CodeMirror-selected{background:rgba(221,240,255,.2)}.cm-s-pastel-on-dark .CodeMirror-line::selection,.cm-s-pastel-on-dark .CodeMirror-line>span::selection,.cm-s-pastel-on-dark .CodeMirror-line>span>span::selection{background:rgba(221,240,255,.2)}.cm-s-pastel-on-dark .CodeMirror-line::-moz-selection,.cm-s-pastel-on-dark .CodeMirror-line>span::-moz-selection,.cm-s-pastel-on-dark .CodeMirror-line>span>span::-moz-selection{background:rgba(221,240,255,.2)}.cm-s-pastel-on-dark .CodeMirror-gutters{background:#34302f;border-right:0;padding:0 3px}.cm-s-pastel-on-dark .CodeMirror-guttermarker{color:#fff}.cm-s-pastel-on-dark .CodeMirror-guttermarker-subtle,.cm-s-pastel-on-dark .CodeMirror-linenumber{color:#8F938F}.cm-s-pastel-on-dark .CodeMirror-cursor{border-left:1px solid #A7A7A7}.cm-s-pastel-on-dark span.cm-comment{color:#A6C6FF}.cm-s-pastel-on-dark span.cm-atom{color:#DE8E30}.cm-s-pastel-on-dark span.cm-number{color:#ccc}.cm-s-pastel-on-dark span.cm-property{color:#8F938F}.cm-s-pastel-on-dark span.cm-attribute{color:#a6e22e}.cm-s-pastel-on-dark span.cm-keyword{color:#AEB2F8}.cm-s-pastel-on-dark span.cm-string{color:#66A968}.cm-s-pastel-on-dark span.cm-variable{color:#AEB2F8}.cm-s-pastel-on-dark span.cm-variable-2{color:#BEBF55}.cm-s-pastel-on-dark span.cm-variable-3{color:#DE8E30}.cm-s-pastel-on-dark span.cm-def{color:#757aD8}.cm-s-pastel-on-dark span.cm-bracket{color:#f8f8f2}.cm-s-pastel-on-dark span.cm-tag{color:#C1C144}.cm-s-pastel-on-dark span.cm-link{color:#ae81ff}.cm-s-pastel-on-dark span.cm-qualifier,.cm-s-pastel-on-dark span.cm-builtin{color:#C1C144}.cm-s-pastel-on-dark span.cm-error{background:#757aD8;color:#f8f8f0}.cm-s-pastel-on-dark .CodeMirror-activeline-background{background:rgba(255,255,255,.031)}.cm-s-pastel-on-dark .CodeMirror-matchingbracket{border:1px solid rgba(255,255,255,.25);color:#8F938F!important;margin:-1px -1px 0}
|
css/min/cmthemes/rubyblue.css
CHANGED
@@ -1 +1 @@
|
|
1 |
-
.cm-s-rubyblue.CodeMirror{background:#112435;color:#fff}.cm-s-rubyblue div.CodeMirror-selected{background:#38566F
|
1 |
+
.cm-s-rubyblue.CodeMirror{background:#112435;color:#fff}.cm-s-rubyblue div.CodeMirror-selected{background:#38566F}.cm-s-rubyblue .CodeMirror-line::selection,.cm-s-rubyblue .CodeMirror-line>span::selection,.cm-s-rubyblue .CodeMirror-line>span>span::selection{background:rgba(56,86,111,.99)}.cm-s-rubyblue .CodeMirror-line::-moz-selection,.cm-s-rubyblue .CodeMirror-line>span::-moz-selection,.cm-s-rubyblue .CodeMirror-line>span>span::-moz-selection{background:rgba(56,86,111,.99)}.cm-s-rubyblue .CodeMirror-gutters{background:#1F4661;border-right:7px solid #3E7087}.cm-s-rubyblue .CodeMirror-guttermarker{color:#fff}.cm-s-rubyblue .CodeMirror-guttermarker-subtle{color:#3E7087}.cm-s-rubyblue .CodeMirror-linenumber{color:#fff}.cm-s-rubyblue .CodeMirror-cursor{border-left:1px solid #fff}.cm-s-rubyblue span.cm-comment{color:#999;font-style:italic;line-height:1em}.cm-s-rubyblue span.cm-atom{color:#F4C20B}.cm-s-rubyblue span.cm-number,.cm-s-rubyblue span.cm-attribute{color:#82C6E0}.cm-s-rubyblue span.cm-keyword{color:#F0F}.cm-s-rubyblue span.cm-string{color:#F08047}.cm-s-rubyblue span.cm-meta{color:#F0F}.cm-s-rubyblue span.cm-variable-2,.cm-s-rubyblue span.cm-tag{color:#7BD827}.cm-s-rubyblue span.cm-variable-3,.cm-s-rubyblue span.cm-def{color:#fff}.cm-s-rubyblue span.cm-bracket{color:#F0F}.cm-s-rubyblue span.cm-link{color:#F4C20B}.cm-s-rubyblue span.CodeMirror-matchingbracket{color:#F0F!important}.cm-s-rubyblue span.cm-builtin,.cm-s-rubyblue span.cm-special{color:#FF9D00}.cm-s-rubyblue span.cm-error{color:#AF2018}.cm-s-rubyblue .CodeMirror-activeline-background{background:#173047}
|
css/min/cmthemes/seti.css
ADDED
@@ -0,0 +1 @@
|
|
|
1 |
+
.cm-s-seti.CodeMirror{background-color:#151718!important;color:#CFD2D1!important;border:none}.cm-s-seti .CodeMirror-gutters{color:#404b53;background-color:#0E1112;border:none}.cm-s-seti .CodeMirror-cursor{border-left:solid thin #f8f8f0}.cm-s-seti .CodeMirror-linenumber{color:#6D8A88}.cm-s-seti.CodeMirror-focused div.CodeMirror-selected{background:rgba(255,255,255,.1)}.cm-s-seti .CodeMirror-line::selection,.cm-s-seti .CodeMirror-line>span::selection,.cm-s-seti .CodeMirror-line>span>span::selection{background:rgba(255,255,255,.1)}.cm-s-seti .CodeMirror-line::-moz-selection,.cm-s-seti .CodeMirror-line>span::-moz-selection,.cm-s-seti .CodeMirror-line>span>span::-moz-selection{background:rgba(255,255,255,.1)}.cm-s-seti span.cm-comment{color:#41535b}.cm-s-seti span.cm-string,.cm-s-seti span.cm-string-2{color:#55b5db}.cm-s-seti span.cm-number{color:#cd3f45}.cm-s-seti span.cm-variable{color:#55b5db}.cm-s-seti span.cm-variable-2{color:#a074c4}.cm-s-seti span.cm-def{color:#55b5db}.cm-s-seti span.cm-operator{color:#9fca56}.cm-s-seti span.cm-keyword{color:#e6cd69}.cm-s-seti span.cm-atom{color:#cd3f45}.cm-s-seti span.cm-meta,.cm-s-seti span.cm-tag{color:#55b5db}.cm-s-seti span.cm-attribute,.cm-s-seti span.cm-qualifier{color:#9fca56}.cm-s-seti span.cm-property{color:#a074c4}.cm-s-seti span.cm-variable-3,.cm-s-seti span.cm-builtin{color:#9fca56}.cm-s-seti .CodeMirror-activeline-background{background:#101213}.cm-s-seti .CodeMirror-matchingbracket{text-decoration:underline;color:#fff!important}
|
css/min/cmthemes/solarized.css
CHANGED
@@ -1 +1 @@
|
|
1 |
-
.solarized.base03{color:#002b36}.solarized.base02{color:#073642}.solarized.base01{color:#586e75}.solarized.base00{color:#657b83}.solarized.base0{color:#839496}.solarized.base1{color:#93a1a1}.solarized.base2{color:#eee8d5}.solarized.base3{color:#fdf6e3}.solarized.solar-yellow{color:#b58900}.solarized.solar-orange{color:#cb4b16}.solarized.solar-red{color:#dc322f}.solarized.solar-magenta{color:#d33682}.solarized.solar-violet{color:#6c71c4}.solarized.solar-blue{color:#268bd2}.solarized.solar-cyan{color:#2aa198}.solarized.solar-green{color:#859900}.cm-s-solarized{line-height:1.45em;color-profile:sRGB;rendering-intent:auto}.cm-s-solarized.cm-s-dark{color:#839496;background-color:#002b36;text-shadow:#002b36 0 1px}.cm-s-solarized.cm-s-light{background-color:#fdf6e3;color:#657b83;text-shadow:#eee8d5 0 1px}.cm-s-solarized .CodeMirror-widget{text-shadow:none}.cm-s-solarized .cm-keyword{color:#cb4b16}.cm-s-solarized .cm-atom,.cm-s-solarized .cm-number{color:#d33682}.cm-s-solarized .cm-def{color:#2aa198}.cm-s-solarized .cm-variable{color:#839496}.cm-s-solarized .cm-variable-2{color:#b58900}.cm-s-solarized .cm-variable-3{color:#6c71c4}.cm-s-solarized .cm-property{color:#2aa198}.cm-s-solarized .cm-operator{color:#6c71c4}.cm-s-solarized .cm-comment{color:#586e75;font-style:italic}.cm-s-solarized .cm-string{color:#859900}.cm-s-solarized .cm-string-2{color:#b58900}.cm-s-solarized .cm-meta{color:#859900}.cm-s-solarized .cm-qualifier{color:#b58900}.cm-s-solarized .cm-builtin{color:#d33682}.cm-s-solarized .cm-bracket{color:#cb4b16}.cm-s-solarized .CodeMirror-matchingbracket{color:#859900}.cm-s-solarized .CodeMirror-nonmatchingbracket{color:#dc322f}.cm-s-solarized .cm-tag{color:#93a1a1}.cm-s-solarized .cm-attribute{color:#2aa198}.cm-s-solarized .cm-
|
1 |
+
.solarized.base03{color:#002b36}.solarized.base02{color:#073642}.solarized.base01{color:#586e75}.solarized.base00{color:#657b83}.solarized.base0{color:#839496}.solarized.base1{color:#93a1a1}.solarized.base2{color:#eee8d5}.solarized.base3{color:#fdf6e3}.solarized.solar-yellow{color:#b58900}.solarized.solar-orange{color:#cb4b16}.solarized.solar-red{color:#dc322f}.solarized.solar-magenta{color:#d33682}.solarized.solar-violet{color:#6c71c4}.solarized.solar-blue{color:#268bd2}.solarized.solar-cyan{color:#2aa198}.solarized.solar-green{color:#859900}.cm-s-solarized{line-height:1.45em;color-profile:sRGB;rendering-intent:auto}.cm-s-solarized.cm-s-dark{color:#839496;background-color:#002b36;text-shadow:#002b36 0 1px}.cm-s-solarized.cm-s-light{background-color:#fdf6e3;color:#657b83;text-shadow:#eee8d5 0 1px}.cm-s-solarized .CodeMirror-widget{text-shadow:none}.cm-s-solarized .cm-header{color:#586e75}.cm-s-solarized .cm-quote{color:#93a1a1}.cm-s-solarized .cm-keyword{color:#cb4b16}.cm-s-solarized .cm-atom,.cm-s-solarized .cm-number{color:#d33682}.cm-s-solarized .cm-def{color:#2aa198}.cm-s-solarized .cm-variable{color:#839496}.cm-s-solarized .cm-variable-2{color:#b58900}.cm-s-solarized .cm-variable-3{color:#6c71c4}.cm-s-solarized .cm-property{color:#2aa198}.cm-s-solarized .cm-operator{color:#6c71c4}.cm-s-solarized .cm-comment{color:#586e75;font-style:italic}.cm-s-solarized .cm-string{color:#859900}.cm-s-solarized .cm-string-2{color:#b58900}.cm-s-solarized .cm-meta{color:#859900}.cm-s-solarized .cm-qualifier{color:#b58900}.cm-s-solarized .cm-builtin{color:#d33682}.cm-s-solarized .cm-bracket{color:#cb4b16}.cm-s-solarized .CodeMirror-matchingbracket{color:#859900}.cm-s-solarized .CodeMirror-nonmatchingbracket{color:#dc322f}.cm-s-solarized .cm-tag{color:#93a1a1}.cm-s-solarized .cm-attribute{color:#2aa198}.cm-s-solarized .cm-hr{color:transparent;border-top:1px solid #586e75;display:block}.cm-s-solarized .cm-link{color:#93a1a1;cursor:pointer}.cm-s-solarized .cm-special{color:#6c71c4}.cm-s-solarized .cm-em{color:#999;text-decoration:underline;text-decoration-style:dotted}.cm-s-solarized .cm-strong{color:#eee}.cm-s-solarized .cm-error,.cm-s-solarized .cm-invalidchar{color:#586e75;border-bottom:1px dotted #dc322f}.cm-s-solarized.cm-s-dark div.CodeMirror-selected{background:#073642}.cm-s-solarized.cm-s-dark.CodeMirror ::selection{background:rgba(7,54,66,.99)}.cm-s-solarized.cm-s-dark .CodeMirror-line::-moz-selection,.cm-s-dark .CodeMirror-line>span::-moz-selection,.cm-s-dark .CodeMirror-line>span>span::-moz-selection{background:rgba(7,54,66,.99)}.cm-s-solarized.cm-s-light div.CodeMirror-selected{background:#eee8d5}.cm-s-solarized.cm-s-light .CodeMirror-line::selection,.cm-s-light .CodeMirror-line>span::selection,.cm-s-light .CodeMirror-line>span>span::selection{background:#eee8d5}.cm-s-solarized.cm-s-light .CodeMirror-line::-moz-selection,.cm-s-ligh .CodeMirror-line>span::-moz-selection,.cm-s-ligh .CodeMirror-line>span>span::-moz-selection{background:#eee8d5}.cm-s-solarized.CodeMirror{-moz-box-shadow:inset 7px 0 12px -6px #000;-webkit-box-shadow:inset 7px 0 12px -6px #000;box-shadow:inset 7px 0 12px -6px #000}.cm-s-solarized .CodeMirror-gutters{border-right:1px solid}.cm-s-solarized.cm-s-dark .CodeMirror-gutters{background-color:#002b36;border-color:#00232c}.cm-s-solarized.cm-s-dark .CodeMirror-linenumber{text-shadow:#021014 0 -1px}.cm-s-solarized.cm-s-light .CodeMirror-gutters{background-color:#fdf6e3;border-color:#eee8d5}.cm-s-solarized .CodeMirror-linenumber{color:#586e75;padding:0 5px}.cm-s-solarized .CodeMirror-guttermarker-subtle{color:#586e75}.cm-s-solarized.cm-s-dark .CodeMirror-guttermarker{color:#ddd}.cm-s-solarized.cm-s-light .CodeMirror-guttermarker{color:#cb4b16}.cm-s-solarized .CodeMirror-gutter .CodeMirror-gutter-text{color:#586e75}.cm-s-solarized .CodeMirror-cursor{border-left:1px solid #819090}.cm-s-solarized.cm-s-dark .CodeMirror-activeline-background{background:rgba(255,255,255,.1)}.cm-s-solarized.cm-s-light .CodeMirror-activeline-background{background:rgba(0,0,0,.1)}
|
css/min/cmthemes/the-matrix.css
CHANGED
@@ -1 +1 @@
|
|
1 |
-
.cm-s-the-matrix.CodeMirror{background:#000;color:#0f0}.cm-s-the-matrix div.CodeMirror-selected{background:#2D2D2D
|
1 |
+
.cm-s-the-matrix.CodeMirror{background:#000;color:#0f0}.cm-s-the-matrix div.CodeMirror-selected{background:#2D2D2D}.cm-s-the-matrix .CodeMirror-line::selection,.cm-s-the-matrix .CodeMirror-line>span::selection,.cm-s-the-matrix .CodeMirror-line>span>span::selection{background:rgba(45,45,45,.99)}.cm-s-the-matrix .CodeMirror-line::-moz-selection,.cm-s-the-matrix .CodeMirror-line>span::-moz-selection,.cm-s-the-matrix .CodeMirror-line>span>span::-moz-selection{background:rgba(45,45,45,.99)}.cm-s-the-matrix .CodeMirror-gutters{background:#060;border-right:2px solid #0f0}.cm-s-the-matrix .CodeMirror-guttermarker{color:#0f0}.cm-s-the-matrix .CodeMirror-guttermarker-subtle,.cm-s-the-matrix .CodeMirror-linenumber{color:#fff}.cm-s-the-matrix .CodeMirror-cursor{border-left:1px solid #0f0}.cm-s-the-matrix span.cm-keyword{color:#008803;font-weight:700}.cm-s-the-matrix span.cm-atom{color:#3FF}.cm-s-the-matrix span.cm-number{color:#FFB94F}.cm-s-the-matrix span.cm-def{color:#99C}.cm-s-the-matrix span.cm-variable{color:#F6C}.cm-s-the-matrix span.cm-variable-2{color:#C6F}.cm-s-the-matrix span.cm-variable-3{color:#96F}.cm-s-the-matrix span.cm-property{color:#62FFA0}.cm-s-the-matrix span.cm-operator{color:#999}.cm-s-the-matrix span.cm-comment{color:#ccc}.cm-s-the-matrix span.cm-string{color:#39C}.cm-s-the-matrix span.cm-meta{color:#C9F}.cm-s-the-matrix span.cm-qualifier{color:#FFF700}.cm-s-the-matrix span.cm-builtin{color:#30a}.cm-s-the-matrix span.cm-bracket{color:#cc7}.cm-s-the-matrix span.cm-tag{color:#FFBD40}.cm-s-the-matrix span.cm-attribute{color:#FFF700}.cm-s-the-matrix span.cm-error{color:red}.cm-s-the-matrix .CodeMirror-activeline-background{background:#040}
|
css/min/cmthemes/tomorrow-night-bright.css
CHANGED
@@ -1 +1 @@
|
|
1 |
-
.cm-s-tomorrow-night-bright.CodeMirror{background:#000;color:#eaeaea}.cm-s-tomorrow-night-bright div.CodeMirror-selected{background:#424242
|
1 |
+
.cm-s-tomorrow-night-bright.CodeMirror{background:#000;color:#eaeaea}.cm-s-tomorrow-night-bright div.CodeMirror-selected{background:#424242}.cm-s-tomorrow-night-bright .CodeMirror-gutters{background:#000;border-right:0}.cm-s-tomorrow-night-bright .CodeMirror-guttermarker{color:#e78c45}.cm-s-tomorrow-night-bright .CodeMirror-guttermarker-subtle{color:#777}.cm-s-tomorrow-night-bright .CodeMirror-linenumber{color:#424242}.cm-s-tomorrow-night-bright .CodeMirror-cursor{border-left:1px solid #6A6A6A}.cm-s-tomorrow-night-bright span.cm-comment{color:#d27b53}.cm-s-tomorrow-night-bright span.cm-atom,.cm-s-tomorrow-night-bright span.cm-number{color:#a16a94}.cm-s-tomorrow-night-bright span.cm-property,.cm-s-tomorrow-night-bright span.cm-attribute{color:#9c9}.cm-s-tomorrow-night-bright span.cm-keyword{color:#d54e53}.cm-s-tomorrow-night-bright span.cm-string{color:#e7c547}.cm-s-tomorrow-night-bright span.cm-variable{color:#b9ca4a}.cm-s-tomorrow-night-bright span.cm-variable-2{color:#7aa6da}.cm-s-tomorrow-night-bright span.cm-def{color:#e78c45}.cm-s-tomorrow-night-bright span.cm-bracket{color:#eaeaea}.cm-s-tomorrow-night-bright span.cm-tag{color:#d54e53}.cm-s-tomorrow-night-bright span.cm-link{color:#a16a94}.cm-s-tomorrow-night-bright span.cm-error{background:#d54e53;color:#6A6A6A}.cm-s-tomorrow-night-bright .CodeMirror-activeline-background{background:#2a2a2a}.cm-s-tomorrow-night-bright .CodeMirror-matchingbracket{text-decoration:underline;color:#fff!important}
|
css/min/cmthemes/tomorrow-night-eighties.css
CHANGED
@@ -1 +1 @@
|
|
1 |
-
.cm-s-tomorrow-night-eighties.CodeMirror{background:#000;color:#ccc}.cm-s-tomorrow-night-eighties div.CodeMirror-selected{background:#2D2D2D
|
1 |
+
.cm-s-tomorrow-night-eighties.CodeMirror{background:#000;color:#ccc}.cm-s-tomorrow-night-eighties div.CodeMirror-selected{background:#2D2D2D}.cm-s-tomorrow-night-eighties .CodeMirror-line::selection,.cm-s-tomorrow-night-eighties .CodeMirror-line>span::selection,.cm-s-tomorrow-night-eighties .CodeMirror-line>span>span::selection{background:rgba(45,45,45,.99)}.cm-s-tomorrow-night-eighties .CodeMirror-line::-moz-selection,.cm-s-tomorrow-night-eighties .CodeMirror-line>span::-moz-selection,.cm-s-tomorrow-night-eighties .CodeMirror-line>span>span::-moz-selection{background:rgba(45,45,45,.99)}.cm-s-tomorrow-night-eighties .CodeMirror-gutters{background:#000;border-right:0}.cm-s-tomorrow-night-eighties .CodeMirror-guttermarker{color:#f2777a}.cm-s-tomorrow-night-eighties .CodeMirror-guttermarker-subtle{color:#777}.cm-s-tomorrow-night-eighties .CodeMirror-linenumber{color:#515151}.cm-s-tomorrow-night-eighties .CodeMirror-cursor{border-left:1px solid #6A6A6A}.cm-s-tomorrow-night-eighties span.cm-comment{color:#d27b53}.cm-s-tomorrow-night-eighties span.cm-atom,.cm-s-tomorrow-night-eighties span.cm-number{color:#a16a94}.cm-s-tomorrow-night-eighties span.cm-property,.cm-s-tomorrow-night-eighties span.cm-attribute{color:#9c9}.cm-s-tomorrow-night-eighties span.cm-keyword{color:#f2777a}.cm-s-tomorrow-night-eighties span.cm-string{color:#fc6}.cm-s-tomorrow-night-eighties span.cm-variable{color:#9c9}.cm-s-tomorrow-night-eighties span.cm-variable-2{color:#69c}.cm-s-tomorrow-night-eighties span.cm-def{color:#f99157}.cm-s-tomorrow-night-eighties span.cm-bracket{color:#ccc}.cm-s-tomorrow-night-eighties span.cm-tag{color:#f2777a}.cm-s-tomorrow-night-eighties span.cm-link{color:#a16a94}.cm-s-tomorrow-night-eighties span.cm-error{background:#f2777a;color:#6A6A6A}.cm-s-tomorrow-night-eighties .CodeMirror-activeline-background{background:#343600}.cm-s-tomorrow-night-eighties .CodeMirror-matchingbracket{text-decoration:underline;color:#fff!important}
|
css/min/cmthemes/ttcn.css
ADDED
@@ -0,0 +1 @@
|
|
|
1 |
+
.cm-s-ttcn .cm-quote{color:#090}.cm-strong{font-weight:700}.cm-s-ttcn .cm-header{color:#00f;font-weight:700}.cm-s-ttcn .cm-atom{color:#219}.cm-s-ttcn .cm-attribute{color:#00c}.cm-s-ttcn .cm-bracket{color:#997}.cm-s-ttcn .cm-comment{color:#333}.cm-s-ttcn .cm-def{color:#00f}.cm-s-ttcn .cm-em{font-style:italic}.cm-s-ttcn .cm-error{color:red}.cm-s-ttcn .cm-hr{color:#999}.cm-s-ttcn .cm-keyword{font-weight:700}.cm-s-ttcn .cm-link{color:#00c;text-decoration:underline}.cm-s-ttcn .cm-meta{color:#555}.cm-s-ttcn .cm-negative{color:#d44}.cm-s-ttcn .cm-positive{color:#292}.cm-s-ttcn .cm-qualifier{color:#555}.cm-s-ttcn .cm-strikethrough{text-decoration:line-through}.cm-s-ttcn .cm-string{color:#006400}.cm-s-ttcn .cm-string-2{color:#f50}.cm-s-ttcn .cm-strong{font-weight:700}.cm-s-ttcn .cm-tag{color:#170}.cm-s-ttcn .cm-variable{color:#8B2252}.cm-s-ttcn .cm-variable-2{color:#05a}.cm-s-ttcn .cm-variable-3{color:#085}.cm-s-ttcn .cm-invalidchar{color:red}.cm-s-ttcn .cm-accessTypes,.cm-s-ttcn .cm-compareTypes{color:#27408B}.cm-s-ttcn .cm-cmipVerbs{color:#8B2252}.cm-s-ttcn .cm-modifier{color:#D2691E}.cm-s-ttcn .cm-status{color:#8B4545}.cm-s-ttcn .cm-storage{color:#A020F0}.cm-s-ttcn .cm-tags{color:#006400}.cm-s-ttcn .cm-externalCommands{color:#8B4545;font-weight:700}.cm-s-ttcn .cm-fileNCtrlMaskOptions,.cm-s-ttcn .cm-sectionTitle{color:#2E8B57;font-weight:700}.cm-s-ttcn .cm-booleanConsts,.cm-s-ttcn .cm-otherConsts,.cm-s-ttcn .cm-verdictConsts{color:#006400}.cm-s-ttcn .cm-configOps,.cm-s-ttcn .cm-functionOps,.cm-s-ttcn .cm-portOps,.cm-s-ttcn .cm-sutOps,.cm-s-ttcn .cm-timerOps,.cm-s-ttcn .cm-verdictOps{color:#00f}.cm-s-ttcn .cm-preprocessor,.cm-s-ttcn .cm-templateMatch,.cm-s-ttcn .cm-ttcn3Macros{color:#27408B}.cm-s-ttcn .cm-types{color:#A52A2A;font-weight:700}.cm-s-ttcn .cm-visibilityModifiers{font-weight:700}
|
css/min/cmthemes/twilight.css
CHANGED
@@ -1 +1 @@
|
|
1 |
-
.cm-s-twilight.CodeMirror{background:#141414;color:#f7f7f7}.cm-s-twilight .CodeMirror-selected{background:#323232
|
1 |
+
.cm-s-twilight.CodeMirror{background:#141414;color:#f7f7f7}.cm-s-twilight div.CodeMirror-selected{background:#323232}.cm-s-twilight .CodeMirror-line::selection,.cm-s-twilight .CodeMirror-line>span::selection,.cm-s-twilight .CodeMirror-line>span>span::selection{background:rgba(50,50,50,.99)}.cm-s-twilight .CodeMirror-line::-moz-selection,.cm-s-twilight .CodeMirror-line>span::-moz-selection,.cm-s-twilight .CodeMirror-line>span>span::-moz-selection{background:rgba(50,50,50,.99)}.cm-s-twilight .CodeMirror-gutters{background:#222;border-right:1px solid #aaa}.cm-s-twilight .CodeMirror-guttermarker{color:#fff}.cm-s-twilight .CodeMirror-guttermarker-subtle,.cm-s-twilight .CodeMirror-linenumber{color:#aaa}.cm-s-twilight .CodeMirror-cursor{border-left:1px solid #fff}.cm-s-twilight .cm-keyword{color:#f9ee98}.cm-s-twilight .cm-atom{color:#FC0}.cm-s-twilight .cm-number{color:#ca7841}.cm-s-twilight .cm-def{color:#8DA6CE}.cm-s-twilight span.cm-variable-2,.cm-s-twilight span.cm-tag,.cm-s-twilight span.cm-variable-3,.cm-s-twilight span.cm-def{color:#607392}.cm-s-twilight .cm-operator{color:#cda869}.cm-s-twilight .cm-comment{color:#777;font-style:italic;font-weight:400}.cm-s-twilight .cm-string{color:#8f9d6a;font-style:italic}.cm-s-twilight .cm-string-2{color:#bd6b18}.cm-s-twilight .cm-meta{background-color:#141414;color:#f7f7f7}.cm-s-twilight .cm-builtin{color:#cda869}.cm-s-twilight .cm-tag{color:#997643}.cm-s-twilight .cm-attribute{color:#d6bb6d}.cm-s-twilight .cm-header{color:#FF6400}.cm-s-twilight .cm-hr{color:#AEAEAE}.cm-s-twilight .cm-link{color:#ad9361;font-style:italic;text-decoration:none}.cm-s-twilight .cm-error{border-bottom:1px solid red}.cm-s-twilight .CodeMirror-activeline-background{background:#27282E}.cm-s-twilight .CodeMirror-matchingbracket{outline:1px solid grey;color:#fff!important}
|
css/min/cmthemes/vibrant-ink.css
CHANGED
@@ -1 +1 @@
|
|
1 |
-
.cm-s-vibrant-ink.CodeMirror{background:#000;color:#fff}.cm-s-vibrant-ink .CodeMirror-selected{background:#35493c
|
1 |
+
.cm-s-vibrant-ink.CodeMirror{background:#000;color:#fff}.cm-s-vibrant-ink div.CodeMirror-selected{background:#35493c}.cm-s-vibrant-ink .CodeMirror-line::selection,.cm-s-vibrant-ink .CodeMirror-line>span::selection,.cm-s-vibrant-ink .CodeMirror-line>span>span::selection{background:rgba(53,73,60,.99)}.cm-s-vibrant-ink .CodeMirror-line::-moz-selection,.cm-s-vibrant-ink .CodeMirror-line>span::-moz-selection,.cm-s-vibrant-ink .CodeMirror-line>span>span::-moz-selection{background:rgba(53,73,60,.99)}.cm-s-vibrant-ink .CodeMirror-gutters{background:#002240;border-right:1px solid #aaa}.cm-s-vibrant-ink .CodeMirror-guttermarker{color:#fff}.cm-s-vibrant-ink .CodeMirror-guttermarker-subtle,.cm-s-vibrant-ink .CodeMirror-linenumber{color:#d0d0d0}.cm-s-vibrant-ink .CodeMirror-cursor{border-left:1px solid #fff}.cm-s-vibrant-ink .cm-keyword{color:#CC7832}.cm-s-vibrant-ink .cm-atom{color:#FC0}.cm-s-vibrant-ink .cm-number{color:#FFEE98}.cm-s-vibrant-ink .cm-def{color:#8DA6CE}.cm-s-vibrant-ink span.cm-variable-2,.cm-s-vibrant span.cm-tag,.cm-s-vibrant-ink span.cm-variable-3,.cm-s-vibrant span.cm-def{color:#FFC66D}.cm-s-vibrant-ink .cm-operator{color:#888}.cm-s-vibrant-ink .cm-comment{color:gray;font-weight:700}.cm-s-vibrant-ink .cm-string{color:#A5C25C}.cm-s-vibrant-ink .cm-string-2{color:red}.cm-s-vibrant-ink .cm-meta{color:#D8FA3C}.cm-s-vibrant-ink .cm-builtin,.cm-s-vibrant-ink .cm-tag,.cm-s-vibrant-ink .cm-attribute{color:#8DA6CE}.cm-s-vibrant-ink .cm-header{color:#FF6400}.cm-s-vibrant-ink .cm-hr{color:#AEAEAE}.cm-s-vibrant-ink .cm-link{color:#00f}.cm-s-vibrant-ink .cm-error{border-bottom:1px solid red}.cm-s-vibrant-ink .CodeMirror-activeline-background{background:#27282E}.cm-s-vibrant-ink .CodeMirror-matchingbracket{outline:1px solid grey;color:#fff!important}
|
css/min/cmthemes/xq-dark.css
CHANGED
@@ -1 +1 @@
|
|
1 |
-
.cm-s-xq-dark.CodeMirror{background:#0a001f;color:#f8f8f8}.cm-s-xq-dark .CodeMirror-selected{background:#27007A
|
1 |
+
.cm-s-xq-dark.CodeMirror{background:#0a001f;color:#f8f8f8}.cm-s-xq-dark div.CodeMirror-selected{background:#27007A}.cm-s-xq-dark .CodeMirror-line::selection,.cm-s-xq-dark .CodeMirror-line>span::selection,.cm-s-xq-dark .CodeMirror-line>span>span::selection{background:rgba(39,0,122,.99)}.cm-s-xq-dark .CodeMirror-line::-moz-selection,.cm-s-xq-dark .CodeMirror-line>span::-moz-selection,.cm-s-xq-dark .CodeMirror-line>span>span::-moz-selection{background:rgba(39,0,122,.99)}.cm-s-xq-dark .CodeMirror-gutters{background:#0a001f;border-right:1px solid #aaa}.cm-s-xq-dark .CodeMirror-guttermarker{color:#FFBD40}.cm-s-xq-dark .CodeMirror-guttermarker-subtle,.cm-s-xq-dark .CodeMirror-linenumber{color:#f8f8f8}.cm-s-xq-dark .CodeMirror-cursor{border-left:1px solid #fff}.cm-s-xq-dark span.cm-keyword{color:#FFBD40}.cm-s-xq-dark span.cm-atom{color:#6C8CD5}.cm-s-xq-dark span.cm-number{color:#164}.cm-s-xq-dark span.cm-def{color:#FFF;text-decoration:underline}.cm-s-xq-dark span.cm-variable{color:#FFF}.cm-s-xq-dark span.cm-variable-2{color:#EEE}.cm-s-xq-dark span.cm-variable-3{color:#DDD}.cm-s-xq-dark span.cm-comment{color:gray}.cm-s-xq-dark span.cm-string{color:#9FEE00}.cm-s-xq-dark span.cm-meta{color:#ff0}.cm-s-xq-dark span.cm-qualifier{color:#FFF700}.cm-s-xq-dark span.cm-builtin{color:#30a}.cm-s-xq-dark span.cm-bracket{color:#cc7}.cm-s-xq-dark span.cm-tag{color:#FFBD40}.cm-s-xq-dark span.cm-attribute{color:#FFF700}.cm-s-xq-dark span.cm-error{color:red}.cm-s-xq-dark .CodeMirror-activeline-background{background:#27282E}.cm-s-xq-dark .CodeMirror-matchingbracket{outline:1px solid grey;color:#fff!important}
|
css/min/cmthemes/xq-light.css
CHANGED
@@ -1 +1 @@
|
|
1 |
-
.cm-s-xq-light span.cm-keyword{line-height:1em;font-weight:700;color:#5A5CAD}.cm-s-xq-light span.cm-atom{color:#6C8CD5}.cm-s-xq-light span.cm-number{color:#164}.cm-s-xq-light span.cm-def{text-decoration:underline}.cm-s-xq-light span.cm-variable,.cm-s-xq-light span.cm-variable-2,.cm-s-xq-light span.cm-variable-3{color:#000}.cm-s-xq-light span.cm-comment{color:#0080FF;font-style:italic}.cm-s-xq-light span.cm-string{color:red}.cm-s-xq-light span.cm-meta{color:#ff0}.cm-s-xq-light span.cm-qualifier{color:grey}.cm-s-xq-light span.cm-builtin{color:#7EA656}.cm-s-xq-light span.cm-bracket{color:#cc7}.cm-s-xq-light span.cm-tag{color:#3F7F7F}.cm-s-xq-light span.cm-attribute{color:#7F007F}.cm-s-xq-light span.cm-error{color:red}.cm-s-xq-light .CodeMirror-activeline-background{background:#e8f2ff
|
1 |
+
.cm-s-xq-light span.cm-keyword{line-height:1em;font-weight:700;color:#5A5CAD}.cm-s-xq-light span.cm-atom{color:#6C8CD5}.cm-s-xq-light span.cm-number{color:#164}.cm-s-xq-light span.cm-def{text-decoration:underline}.cm-s-xq-light span.cm-variable,.cm-s-xq-light span.cm-variable-2,.cm-s-xq-light span.cm-variable-3{color:#000}.cm-s-xq-light span.cm-comment{color:#0080FF;font-style:italic}.cm-s-xq-light span.cm-string{color:red}.cm-s-xq-light span.cm-meta{color:#ff0}.cm-s-xq-light span.cm-qualifier{color:grey}.cm-s-xq-light span.cm-builtin{color:#7EA656}.cm-s-xq-light span.cm-bracket{color:#cc7}.cm-s-xq-light span.cm-tag{color:#3F7F7F}.cm-s-xq-light span.cm-attribute{color:#7F007F}.cm-s-xq-light span.cm-error{color:red}.cm-s-xq-light .CodeMirror-activeline-background{background:#e8f2ff}.cm-s-xq-light .CodeMirror-matchingbracket{outline:1px solid grey;color:#000!important;background:#ff0}
|
css/min/cmthemes/yeti.css
ADDED
@@ -0,0 +1 @@
|
|
|
1 |
+
.cm-s-yeti.CodeMirror{background-color:#ECEAE8!important;color:#d1c9c0!important;border:none}.cm-s-yeti .CodeMirror-gutters{color:#adaba6;background-color:#E5E1DB;border:none}.cm-s-yeti .CodeMirror-cursor{border-left:solid thin #d1c9c0}.cm-s-yeti .CodeMirror-linenumber{color:#adaba6}.cm-s-yeti.CodeMirror-focused div.CodeMirror-selected{background:#DCD8D2}.cm-s-yeti .CodeMirror-line::selection,.cm-s-yeti .CodeMirror-line>span::selection,.cm-s-yeti .CodeMirror-line>span>span::selection{background:#DCD8D2}.cm-s-yeti .CodeMirror-line::-moz-selection,.cm-s-yeti .CodeMirror-line>span::-moz-selection,.cm-s-yeti .CodeMirror-line>span>span::-moz-selection{background:#DCD8D2}.cm-s-yeti span.cm-comment{color:#d4c8be}.cm-s-yeti span.cm-string,.cm-s-yeti span.cm-string-2{color:#96c0d8}.cm-s-yeti span.cm-number{color:#a074c4}.cm-s-yeti span.cm-variable{color:#55b5db}.cm-s-yeti span.cm-variable-2{color:#a074c4}.cm-s-yeti span.cm-def{color:#55b5db}.cm-s-yeti span.cm-operator,.cm-s-yeti span.cm-keyword{color:#9fb96e}.cm-s-yeti span.cm-atom{color:#a074c4}.cm-s-yeti span.cm-meta,.cm-s-yeti span.cm-tag{color:#96c0d8}.cm-s-yeti span.cm-attribute{color:#9fb96e}.cm-s-yeti span.cm-qualifier{color:#96c0d8}.cm-s-yeti span.cm-property,.cm-s-yeti span.cm-builtin{color:#a074c4}.cm-s-yeti span.cm-variable-3{color:#96c0d8}.cm-s-yeti .CodeMirror-activeline-background{background:#E7E4E0}.cm-s-yeti .CodeMirror-matchingbracket{text-decoration:underline}
|
css/min/cmthemes/zenburn.css
CHANGED
@@ -1 +1 @@
|
|
1 |
-
.cm-s-zenburn .CodeMirror-gutters{background:#3f3f3f!important}.cm-s-zenburn .CodeMirror-foldgutter-open,.CodeMirror-foldgutter-folded{color:#999}.cm-s-zenburn .CodeMirror-cursor{border-left:1px solid #fff
|
1 |
+
.cm-s-zenburn .CodeMirror-gutters{background:#3f3f3f!important}.cm-s-zenburn .CodeMirror-foldgutter-open,.CodeMirror-foldgutter-folded{color:#999}.cm-s-zenburn .CodeMirror-cursor{border-left:1px solid #fff}.cm-s-zenburn{background-color:#3f3f3f;color:#dcdccc}.cm-s-zenburn span.cm-builtin{color:#dcdccc;font-weight:700}.cm-s-zenburn span.cm-comment{color:#7f9f7f}.cm-s-zenburn span.cm-keyword{color:#f0dfaf;font-weight:700}.cm-s-zenburn span.cm-atom{color:#bfebbf}.cm-s-zenburn span.cm-def{color:#dcdccc}.cm-s-zenburn span.cm-variable{color:#dfaf8f}.cm-s-zenburn span.cm-variable-2{color:#dcdccc}.cm-s-zenburn span.cm-string,.cm-s-zenburn span.cm-string-2{color:#cc9393}.cm-s-zenburn span.cm-number{color:#dcdccc}.cm-s-zenburn span.cm-tag{color:#93e0e3}.cm-s-zenburn span.cm-property,.cm-s-zenburn span.cm-attribute{color:#dfaf8f}.cm-s-zenburn span.cm-qualifier{color:#7cb8bb}.cm-s-zenburn span.cm-meta{color:#f0dfaf}.cm-s-zenburn span.cm-header,.cm-s-zenburn span.cm-operator{color:#f0efd0}.cm-s-zenburn span.CodeMirror-matchingbracket{box-sizing:border-box;background:0 0;border-bottom:1px solid}.cm-s-zenburn span.CodeMirror-nonmatchingbracket{border-bottom:1px solid;background:0 0}.cm-s-zenburn .CodeMirror-activeline,.cm-s-zenburn .CodeMirror-activeline-background{background:#000}.cm-s-zenburn div.CodeMirror-selected{background:#545454}.cm-s-zenburn .CodeMirror-focused div.CodeMirror-selected{background:#4f4f4f}
|
css/min/codemirror.css
CHANGED
@@ -1 +1 @@
|
|
1 |
-
.CodeMirror{font-family:monospace;height:300px;color:#000}.CodeMirror-lines{padding:4px 0}.CodeMirror pre{padding:0 4px}.CodeMirror-scrollbar-filler,.CodeMirror-gutter-filler{background-color:#fff}.CodeMirror-gutters{border-right:1px solid #ddd;background-color:#f7f7f7;white-space:nowrap}.CodeMirror-linenumber{padding:0 3px 0 5px;min-width:20px;text-align:right;color:#999;white-space:nowrap}.CodeMirror-guttermarker{color:#000}.CodeMirror-guttermarker-subtle{color:#999}.CodeMirror
|
1 |
+
.CodeMirror{font-family:monospace;height:300px;color:#000}.CodeMirror-lines{padding:4px 0}.CodeMirror pre{padding:0 4px}.CodeMirror-scrollbar-filler,.CodeMirror-gutter-filler{background-color:#fff}.CodeMirror-gutters{border-right:1px solid #ddd;background-color:#f7f7f7;white-space:nowrap}.CodeMirror-linenumber{padding:0 3px 0 5px;min-width:20px;text-align:right;color:#999;white-space:nowrap}.CodeMirror-guttermarker{color:#000}.CodeMirror-guttermarker-subtle{color:#999}.CodeMirror-cursor{border-left:1px solid #000;border-right:none;width:0}.CodeMirror div.CodeMirror-secondarycursor{border-left:1px solid silver}.cm-fat-cursor .CodeMirror-cursor{width:auto;border:0;background:#7e7}.cm-fat-cursor div.CodeMirror-cursors{z-index:1}.cm-animate-fat-cursor{width:auto;border:0;-webkit-animation:blink 1.06s steps(1)infinite;-moz-animation:blink 1.06s steps(1)infinite;animation:blink 1.06s steps(1)infinite;background-color:#7e7}@-moz-keyframes blink{50%{background-color:transparent}}@-webkit-keyframes blink{50%{background-color:transparent}}@keyframes blink{50%{background-color:transparent}}.cm-tab{display:inline-block;text-decoration:inherit}.CodeMirror-ruler{border-left:1px solid #ccc;position:absolute}.cm-s-default .cm-header{color:#00f}.cm-s-default .cm-quote{color:#090}.cm-negative{color:#d44}.cm-positive{color:#292}.cm-header,.cm-strong{font-weight:700}.cm-em{font-style:italic}.cm-link{text-decoration:underline}.cm-strikethrough{text-decoration:line-through}.cm-s-default .cm-keyword{color:#708}.cm-s-default .cm-atom{color:#219}.cm-s-default .cm-number{color:#164}.cm-s-default .cm-def{color:#00f}.cm-s-default .cm-variable-2{color:#05a}.cm-s-default .cm-variable-3{color:#085}.cm-s-default .cm-comment{color:#a50}.cm-s-default .cm-string{color:#a11}.cm-s-default .cm-string-2{color:#f50}.cm-s-default .cm-meta,.cm-s-default .cm-qualifier{color:#555}.cm-s-default .cm-builtin{color:#30a}.cm-s-default .cm-bracket{color:#997}.cm-s-default .cm-tag{color:#170}.cm-s-default .cm-attribute{color:#00c}.cm-s-default .cm-hr{color:#999}.cm-s-default .cm-link{color:#00c}.cm-s-default .cm-error,.cm-invalidchar{color:red}.CodeMirror-composing{border-bottom:2px solid}div.CodeMirror span.CodeMirror-matchingbracket{color:#0f0}div.CodeMirror span.CodeMirror-nonmatchingbracket{color:#f22}.CodeMirror-matchingtag{background:rgba(255,150,0,.3)}.CodeMirror-activeline-background{background:#e8f2ff}.CodeMirror{position:relative;overflow:hidden;background:#fff}.CodeMirror-scroll{overflow:scroll!important;margin-bottom:-30px;margin-right:-30px;padding-bottom:30px;height:100%;outline:none;position:relative}.CodeMirror-sizer{position:relative;border-right:30px solid transparent}.CodeMirror-vscrollbar,.CodeMirror-hscrollbar,.CodeMirror-scrollbar-filler,.CodeMirror-gutter-filler{position:absolute;z-index:6;display:none}.CodeMirror-vscrollbar{right:0;top:0;overflow-x:hidden;overflow-y:scroll}.CodeMirror-hscrollbar{bottom:0;left:0;overflow-y:hidden;overflow-x:scroll}.CodeMirror-scrollbar-filler{right:0;bottom:0}.CodeMirror-gutter-filler{left:0;bottom:0}.CodeMirror-gutters{position:absolute;left:0;top:0;z-index:3}.CodeMirror-gutter{white-space:normal;height:100%;display:inline-block;margin-bottom:-30px;*zoom:1;*display:inline}.CodeMirror-gutter-wrapper{position:absolute;z-index:4;background:none!important;border:none!important}.CodeMirror-gutter-background{position:absolute;top:0;bottom:0;z-index:4}.CodeMirror-gutter-elt{position:absolute;cursor:default;z-index:4}.CodeMirror-gutter-wrapper{-webkit-user-select:none;-moz-user-select:none;user-select:none}.CodeMirror-lines{cursor:text;min-height:1px}.CodeMirror pre{-moz-border-radius:0;-webkit-border-radius:0;border-radius:0;border-width:0;background:0 0;font-family:inherit;font-size:inherit;margin:0;white-space:pre;word-wrap:normal;line-height:inherit;color:inherit;z-index:2;position:relative;overflow:visible;-webkit-tap-highlight-color:transparent}.CodeMirror-wrap pre{word-wrap:break-word;white-space:pre-wrap;word-break:normal}.CodeMirror-linebackground{position:absolute;left:0;right:0;top:0;bottom:0;z-index:0}.CodeMirror-linewidget{position:relative;z-index:2;overflow:auto}.CodeMirror-code{outline:none}.CodeMirror-scroll,.CodeMirror-sizer,.CodeMirror-gutter,.CodeMirror-gutters,.CodeMirror-linenumber{-moz-box-sizing:content-box;box-sizing:content-box}.CodeMirror-measure{position:absolute;width:100%;height:0;overflow:hidden;visibility:hidden}.CodeMirror-cursor{position:absolute}.CodeMirror-measure pre{position:static}div.CodeMirror-cursors{visibility:hidden;position:relative;z-index:3}div.CodeMirror-dragcursors,.CodeMirror-focused div.CodeMirror-cursors{visibility:visible}.CodeMirror-selected{background:#d9d9d9}.CodeMirror-focused .CodeMirror-selected{background:#d7d4f0}.CodeMirror-crosshair{cursor:crosshair}.CodeMirror-line::selection,.CodeMirror-line>span::selection,.CodeMirror-line>span>span::selection{background:#d7d4f0}.CodeMirror-line::-moz-selection,.CodeMirror-line>span::-moz-selection,.CodeMirror-line>span>span::-moz-selection{background:#d7d4f0}.cm-searching{background:#ffa;background:rgba(255,255,0,.4)}.CodeMirror span{*vertical-align:text-bottom}.cm-force-border{padding-right:.1px}@media print{.CodeMirror div.CodeMirror-cursors{visibility:hidden}}.cm-tab-wrap-hack:after{content:''}span.CodeMirror-selectedtext{background:0 0}
|
css/min/edit-snippet.css
DELETED
@@ -1 +0,0 @@
|
|
1 |
-
h3{margin:1em 0}label{cursor:auto}label[for='snippet_description'] h3 div{position:absolute}.submit .button{margin-right:.5em}.CodeMirror{width:100%;height:auto;min-height:300px;border:1px solid #dfdfdf;border-radius:3px;background-color:#fff}.CodeMirror-scroll{overflow-x:auto;overflow-y:hidden}.CodeMirror-sizer{min-height:300px!important}.CodeMirror-focused .cm-matchhighlight{color:#fff!important;outline:1px solid green}
|
|
css/min/edit.css
CHANGED
@@ -1 +1 @@
|
|
1 |
-
h3{margin:1em 0}label{cursor:auto}label[for='snippet_description'] h3 div{position:absolute}ul.tagit{background-color:#fff}.submit .button{margin-right:.5em}.snippet-scope div{margin-right:30px;display:inline-block}.CodeMirror{width:100%;height:auto;min-height:300px;border:1px solid #dfdfdf;border-radius:3px;background-color:#fff}.CodeMirror-scroll{overflow-x:auto;overflow-y:hidden}.CodeMirror-sizer{min-height:300px!important}.CodeMirror-focused .cm-matchhighlight{color:#fff!important;outline:1px solid green}
|
1 |
+
.form-table th{width:auto}h3{margin:1em 0}label{cursor:auto}label[for='snippet_description'] h3 div{position:absolute}ul.tagit{background-color:#fff}.submit .button{margin-right:.5em}.snippet-scope div{margin-right:30px;display:inline-block}.CodeMirror{width:100%;height:auto;min-height:300px;border:1px solid #dfdfdf;border-radius:3px;background-color:#fff}.CodeMirror-scroll{overflow-x:auto;overflow-y:hidden}.CodeMirror-sizer{min-height:300px!important}.CodeMirror-focused .cm-matchhighlight{color:#fff!important;outline:1px solid green}
|
css/min/manage-snippets.css
DELETED
@@ -1 +0,0 @@
|
|
1 |
-
.snippets th,.snippets td{color:#000}.snippets tr{background:#fff}.snippets .row-actions{color:#ddd}.snippets .clear-filters{vertical-align:middle}.snippets tfoot th{border-top:none!important}.snippets tfoot th.check-column{padding:13px 0 0 3px}.snippets thead th.check-column,.snippets tfoot th.check-column,.snippets .inactive th.check-column{padding-left:5px}.snippets .column-description p{color:#333}.snippets .inactive a{color:#579}.snippets .inactive td,.snippets .inactive th,.snippets .active td,.snippets .active th{padding:10px 9px;border:none;-webkit-box-shadow:inset 0 -1px 0 rgba(0,0,0,.1);box-shadow:inset 0 -1px 0 rgba(0,0,0,.1)}.snippets .active td,.snippets .active th{background-color:rgba(120,200,230,.06)}.snippets .active th.check-column{border-left:2px solid #2ea2cc}.snippets tr.active+tr.inactive th,.snippets tr.active+tr.inactive td{border-top:1px solid rgba(0,0,0,.03);-webkit-box-shadow:inset 0 1px 0 rgba(0,0,0,.02),inset 0 -1px 0 #e1e1e1;box-shadow:inset 0 1px 0 rgba(0,0,0,.02),inset 0 -1px 0 #e1e1e1}.snippets a.delete:hover,.snippets #all-snippets-table a.delete:hover,.snippets #search-snippets-table a.delete:hover{border-bottom:1px solid red;color:red}#wpbody-content .snippets .column-name{white-space:nowrap}
|
|
css/min/manage.css
CHANGED
@@ -1 +1 @@
|
|
1 |
-
.snippets th,.snippets td{color:#000}.snippets tr{background:#fff}.snippets .row-actions{color:#ddd}.snippets .clear-filters{vertical-align:middle}.snippets tfoot th{border-top:none!important}.snippets tfoot th.check-column{padding:13px 0 0 3px}.snippets thead th.check-column,.snippets tfoot th.check-column,.snippets .inactive th.check-column{padding-left:5px}.snippets .column-description p{color:#333}.snippets .inactive a{color:#579}.snippets .inactive td,.snippets .inactive th,.snippets .active td,.snippets .active th{padding:10px 9px;border:none;-webkit-box-shadow:inset 0 -1px 0 rgba(0,0,0,.1);box-shadow:inset 0 -1px 0 rgba(0,0,0,.1)}.snippets .active td,.snippets .active th{background-color:rgba(120,200,230,.06)}.snippets .active th.check-column{border-left:2px solid #2ea2cc}.snippets tr.active+tr.inactive th,.snippets tr.active+tr.inactive td{border-top:1px solid rgba(0,0,0,.03);-webkit-box-shadow:inset 0 1px 0 rgba(0,0,0,.02),inset 0 -1px 0 #e1e1e1;box-shadow:inset 0 1px 0 rgba(0,0,0,.02),inset 0 -1px 0 #e1e1e1}.snippets a.delete:hover,.snippets #all-snippets-table a.delete:hover,.snippets #search-snippets-table a.delete:hover{border-bottom:1px solid red;color:red}#wpbody-content .snippets .column-name{white-space:nowrap}
|
1 |
+
.admin-scope .column-name>a:after,.frontend-scope .column-name>a:after{padding-left:5px;font-family:"dashicons";vertical-align:top}.admin-scope .column-name>a:after{font-size:14px;content:"\f111"}.frontend-scope .column-name>a:after{font-size:16px;content:"\f177"}.snippets .badge{margin-left:4px;padding:3px 6px;text-decoration:none;border:medium none;border-radius:2px;background:#e0e0e0;font-size:smaller}.clear-filters{vertical-align:bottom}.snippets th,.snippets td{color:#000}.snippets tr{background:#fff}.snippets .row-actions{color:#ddd}.snippets .clear-filters{vertical-align:middle}.snippets tfoot th{border-top:none!important}.snippets tfoot th.check-column{padding:13px 0 0 3px}.snippets thead th.check-column,.snippets tfoot th.check-column,.snippets .inactive th.check-column{padding-left:5px}.snippets .column-description p{color:#333}.snippets .inactive a{color:#579}.snippets .inactive td,.snippets .inactive th,.snippets .active td,.snippets .active th{padding:10px 9px;border:none;-webkit-box-shadow:inset 0 -1px 0 rgba(0,0,0,.1);box-shadow:inset 0 -1px 0 rgba(0,0,0,.1)}.snippets .active td,.snippets .active th{background-color:rgba(120,200,230,.06)}.snippets .active th.check-column{border-left:2px solid #2ea2cc}.snippets tr.active+tr.inactive th,.snippets tr.active+tr.inactive td{border-top:1px solid rgba(0,0,0,.03);-webkit-box-shadow:inset 0 1px 0 rgba(0,0,0,.02),inset 0 -1px 0 #e1e1e1;box-shadow:inset 0 1px 0 rgba(0,0,0,.02),inset 0 -1px 0 #e1e1e1}.snippets a.delete:hover,.snippets #all-snippets-table a.delete:hover,.snippets #search-snippets-table a.delete:hover{border-bottom:1px solid red;color:red}#wpbody-content .snippets .column-name{white-space:nowrap}
|
includes/admin-menus/class-admin-menu.php
ADDED
@@ -0,0 +1,96 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
|
3 |
+
class Code_Snippets_Admin_Menu {
|
4 |
+
|
5 |
+
public $name, $label, $title;
|
6 |
+
|
7 |
+
/**
|
8 |
+
* Constructor
|
9 |
+
* @param string $name The snippet page shortname
|
10 |
+
* @param string $label The label shown in the admin menu
|
11 |
+
* @param string $title The text used for the page title
|
12 |
+
*/
|
13 |
+
function __construct( $name, $label, $title ) {
|
14 |
+
$this->name = $name;
|
15 |
+
$this->label = $label;
|
16 |
+
$this->title = $title;
|
17 |
+
|
18 |
+
add_action( 'admin_menu', array( $this, 'register' ) );
|
19 |
+
add_action( 'network_admin_menu', array( $this, 'register' ) );
|
20 |
+
}
|
21 |
+
|
22 |
+
/**
|
23 |
+
* Add a sub-menu to the Snippets menu
|
24 |
+
* @uses add_submenu_page() to register a submenu
|
25 |
+
* @param string $slug The slug of the menu
|
26 |
+
* @param string $label The label shown in the admin menu
|
27 |
+
* @param string $title The page title
|
28 |
+
*/
|
29 |
+
public function add_menu( $slug, $label, $title ) {
|
30 |
+
$hook = add_submenu_page(
|
31 |
+
code_snippets_get_menu_slug(),
|
32 |
+
$title,
|
33 |
+
$label,
|
34 |
+
get_snippets_cap(),
|
35 |
+
$slug,
|
36 |
+
array( $this, 'render' )
|
37 |
+
);
|
38 |
+
|
39 |
+
add_action( 'load-' . $hook, array( $this, 'load' ) );
|
40 |
+
}
|
41 |
+
|
42 |
+
/**
|
43 |
+
* Register the admin menu
|
44 |
+
*/
|
45 |
+
public function register() {
|
46 |
+
$this->add_menu( code_snippets_get_menu_slug( $this->name ), $this->label, $this->title );
|
47 |
+
}
|
48 |
+
|
49 |
+
/**
|
50 |
+
* Render the menu
|
51 |
+
*/
|
52 |
+
public function render() {
|
53 |
+
$this->print_messages();
|
54 |
+
include dirname( plugin_dir_path( __FILE__ ) ) . "/views/$this->name.php";
|
55 |
+
}
|
56 |
+
|
57 |
+
/**
|
58 |
+
* Print the status and error messages
|
59 |
+
*/
|
60 |
+
protected function print_messages() {}
|
61 |
+
|
62 |
+
/**
|
63 |
+
* Retrieve a result message based on a posted status
|
64 |
+
* @return string|bool The result message if a valid status was recieved, otherwise false
|
65 |
+
*/
|
66 |
+
protected function get_result_message( $messages, $request_var = 'result', $class = 'updated' ) {
|
67 |
+
|
68 |
+
if ( empty( $_REQUEST[ $request_var ] ) ) {
|
69 |
+
return;
|
70 |
+
}
|
71 |
+
|
72 |
+
$result = $_REQUEST[ $request_var ];
|
73 |
+
|
74 |
+
if ( isset( $messages[ $result ] ) ) {
|
75 |
+
return sprintf(
|
76 |
+
'<div id="message" class="%1$s %2$s fade"><p>%1$s</p></div>',
|
77 |
+
$messages[ $result ], $class
|
78 |
+
);
|
79 |
+
}
|
80 |
+
|
81 |
+
return false;
|
82 |
+
}
|
83 |
+
|
84 |
+
/**
|
85 |
+
* Executed when the admin page is loaded
|
86 |
+
*/
|
87 |
+
public function load() {
|
88 |
+
/* Make sure the user has permission to be here */
|
89 |
+
if ( ! current_user_can( get_snippets_cap() ) ) {
|
90 |
+
wp_die( __( 'You are not authorized to access this page.', 'code-snippets' ) );
|
91 |
+
}
|
92 |
+
|
93 |
+
/* Create the snippet tables if they don't exist */
|
94 |
+
create_code_snippets_tables();
|
95 |
+
}
|
96 |
+
}
|
includes/admin-menus/class-edit-menu.php
ADDED
@@ -0,0 +1,340 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
|
3 |
+
/**
|
4 |
+
* This class handles the add/edit menu
|
5 |
+
*/
|
6 |
+
class Code_Snippets_Edit_Menu extends Code_Snippets_Admin_Menu {
|
7 |
+
|
8 |
+
/**
|
9 |
+
* Constructor
|
10 |
+
*/
|
11 |
+
public function __construct() {
|
12 |
+
parent::__construct( 'edit',
|
13 |
+
__( 'Edit Snippet', 'code-snippets' ),
|
14 |
+
__( 'Edit Snippet', 'code-snippets' )
|
15 |
+
);
|
16 |
+
|
17 |
+
add_action( 'admin_init', array( $this, 'remove_incompatible_codemirror' ) );
|
18 |
+
}
|
19 |
+
|
20 |
+
/**
|
21 |
+
* Register the admin menu
|
22 |
+
*/
|
23 |
+
public function register() {
|
24 |
+
|
25 |
+
/* Add New Snippet menu */
|
26 |
+
$this->add_menu(
|
27 |
+
code_snippets_get_menu_slug( 'add' ),
|
28 |
+
__( 'Add New', 'code-snippets' ),
|
29 |
+
__( 'Add New Snippet', 'code-snippets' )
|
30 |
+
);
|
31 |
+
|
32 |
+
/* Add edit menu if we are currently editing a snippet */
|
33 |
+
if ( isset( $_REQUEST['page'] ) && code_snippets_get_menu_slug( 'edit' ) === $_REQUEST['page'] ) {
|
34 |
+
parent::register();
|
35 |
+
}
|
36 |
+
}
|
37 |
+
|
38 |
+
/**
|
39 |
+
* Executed when the menu is loaded
|
40 |
+
*/
|
41 |
+
public function load() {
|
42 |
+
parent::load();
|
43 |
+
|
44 |
+
/* Don't allow visiting the edit snippet page without a valid ID */
|
45 |
+
if ( code_snippets_get_menu_slug( 'edit' ) === $_REQUEST['page'] ) {
|
46 |
+
if ( ! isset( $_REQUEST['id'] ) || 0 == $_REQUEST['id'] ) {
|
47 |
+
wp_redirect( code_snippets_get_menu_url( 'add' ) );
|
48 |
+
exit;
|
49 |
+
}
|
50 |
+
}
|
51 |
+
|
52 |
+
/* Load the contextual help tabs */
|
53 |
+
code_snippets_load_edit_help();
|
54 |
+
|
55 |
+
/* Enqueue the code editor and other scripts and styles */
|
56 |
+
add_action( 'admin_enqueue_scripts', array( $this, 'enqueue_assets' ), 9 );
|
57 |
+
|
58 |
+
/* Register action hooks */
|
59 |
+
add_action( 'code_snippets/admin/single', array( $this, 'render_description_editor' ), 9 );
|
60 |
+
add_action( 'code_snippets/admin/single', array( $this, 'render_tags_editor' ) );
|
61 |
+
|
62 |
+
if ( code_snippets_get_setting( 'general', 'snippet_scope_enabled' ) ) {
|
63 |
+
add_action( 'code_snippets/admin/single/settings', array( $this, 'render_scope_setting' ) );
|
64 |
+
}
|
65 |
+
|
66 |
+
if ( get_current_screen()->in_admin( 'network' ) ) {
|
67 |
+
add_action( 'code_snippets/admin/single/settings', array( $this, 'render_multisite_sharing_setting' ) );
|
68 |
+
}
|
69 |
+
|
70 |
+
$this->save_posted_snippet();
|
71 |
+
}
|
72 |
+
|
73 |
+
/**
|
74 |
+
* Save the posted snippet to the database
|
75 |
+
* @uses wp_redirect() to pass the results to the page
|
76 |
+
* @uses save_snippet() to save the snippet to the database
|
77 |
+
*/
|
78 |
+
private function save_posted_snippet() {
|
79 |
+
|
80 |
+
/* Make sure the nonce validates before we do any snippet ops */
|
81 |
+
if ( ! isset( $_REQUEST['_wpnonce'] ) || ! wp_verify_nonce( $_REQUEST['_wpnonce'], 'save_snippet' ) ) {
|
82 |
+
return;
|
83 |
+
}
|
84 |
+
|
85 |
+
/* Save the snippet if one has been submitted */
|
86 |
+
if ( isset( $_POST['save_snippet'] ) || isset( $_POST['save_snippet_activate'] ) || isset( $_POST['save_snippet_deactivate'] ) ) {
|
87 |
+
|
88 |
+
/* Build snippet object from fields with 'snippet_' prefix */
|
89 |
+
$snippet = new Snippet();
|
90 |
+
foreach ( $_POST as $field => $value ) {
|
91 |
+
if ( 'snippet_' === substr( $field, 0, 8 ) ) {
|
92 |
+
|
93 |
+
/* Remove 'snippet_' prefix from field name */
|
94 |
+
$field = substr( $field, 8 );
|
95 |
+
$snippet->$field = stripslashes( $value );
|
96 |
+
}
|
97 |
+
}
|
98 |
+
|
99 |
+
/* Activate or deactivate the snippet before saving if we clicked the button */
|
100 |
+
|
101 |
+
// Shared network snippets cannot be network activated
|
102 |
+
if ( isset( $_POST['snippet_sharing'] ) && 'on' === $_POST['snippet_sharing'] ) {
|
103 |
+
$snippet->active = 0;
|
104 |
+
unset( $_POST['save_snippet_activate'], $_POST['save_snippet_deactivate'] );
|
105 |
+
} elseif ( isset( $_POST['save_snippet_activate'] ) ) {
|
106 |
+
$snippet->active = 1;
|
107 |
+
} elseif ( isset( $_POST['save_snippet_deactivate'] ) ) {
|
108 |
+
$snippet->active = 0;
|
109 |
+
}
|
110 |
+
|
111 |
+
/* Save the snippet to the database */
|
112 |
+
$snippet_id = save_snippet( $snippet );
|
113 |
+
|
114 |
+
/* Update the shared network snippets if necessary */
|
115 |
+
if ( $snippet_id && get_current_screen()->in_admin( 'network' ) ) {
|
116 |
+
$shared_snippets = get_site_option( 'shared_network_snippets', array() );
|
117 |
+
|
118 |
+
if ( isset( $_POST['snippet_sharing'] ) && 'on' === $_POST['snippet_sharing'] ) {
|
119 |
+
|
120 |
+
/* Add the snippet ID to the array if it isn't already */
|
121 |
+
if ( ! in_array( $snippet_id, $shared_snippets ) ) {
|
122 |
+
$shared_snippets[] = $snippet_id;
|
123 |
+
update_site_option( 'shared_network_snippets', array_values( $shared_snippets ) );
|
124 |
+
}
|
125 |
+
} elseif ( in_array( $snippet_id, $shared_snippets ) ) {
|
126 |
+
/* Remove the snippet ID from the array */
|
127 |
+
$shared_snippets = array_diff( $shared_snippets, array( $snippet_id ) );
|
128 |
+
update_site_option( 'shared_network_snippets', array_values( $shared_snippets ) );
|
129 |
+
}
|
130 |
+
}
|
131 |
+
|
132 |
+
/* If the saved snippet ID is invalid, display an error message */
|
133 |
+
if ( ! $snippet_id || $snippet_id < 1 ) {
|
134 |
+
/* An error occurred */
|
135 |
+
wp_redirect( add_query_arg( 'result', 'error', code_snippets_get_menu_url( 'add' ) ) );
|
136 |
+
exit;
|
137 |
+
}
|
138 |
+
|
139 |
+
/* Set the result depending on if the snippet was just added */
|
140 |
+
$result = isset( $_POST['snippet_id'] ) ? 'updated' : 'added';
|
141 |
+
|
142 |
+
/* Append a suffix if the snippet was activated or deactivated */
|
143 |
+
if ( isset( $_POST['save_snippet_activate'] ) ) {
|
144 |
+
$result .= '-and-activated';
|
145 |
+
} elseif ( isset( $_POST['save_snippet_deactivate'] ) ) {
|
146 |
+
$result .= '-and-deactivated';
|
147 |
+
}
|
148 |
+
|
149 |
+
/* Redirect to edit snippet page */
|
150 |
+
wp_redirect( add_query_arg(
|
151 |
+
array( 'id' => $snippet_id, 'result' => $result ),
|
152 |
+
code_snippets_get_menu_url( 'edit' )
|
153 |
+
) );
|
154 |
+
exit;
|
155 |
+
}
|
156 |
+
|
157 |
+
/* Delete the snippet if the button was clicked */
|
158 |
+
elseif ( isset( $_POST['snippet_id'], $_POST['delete_snippet'] ) ) {
|
159 |
+
delete_snippet( $_POST['snippet_id'] );
|
160 |
+
wp_redirect( add_query_arg( 'result', 'delete', code_snippets_get_menu_url( 'manage' ) ) );
|
161 |
+
exit;
|
162 |
+
}
|
163 |
+
|
164 |
+
/* Export the snippet if the button was clicked */
|
165 |
+
elseif ( isset( $_POST['snippet_id'], $_POST['export_snippet'] ) ) {
|
166 |
+
export_snippets( $_POST['snippet_id'] );
|
167 |
+
}
|
168 |
+
}
|
169 |
+
|
170 |
+
/**
|
171 |
+
* Add a description editor to the single snippet page
|
172 |
+
* @param Snippet $snippet The snippet being used for this page
|
173 |
+
*/
|
174 |
+
function render_description_editor( Snippet $snippet ) {
|
175 |
+
$settings = code_snippets_get_settings();
|
176 |
+
$settings = $settings['description_editor'];
|
177 |
+
$media_buttons = $settings['media_buttons'];
|
178 |
+
|
179 |
+
echo '<label for="snippet_description"><h3>';
|
180 |
+
$heading = __( 'Description', 'code-snippets' );
|
181 |
+
echo $media_buttons ? $heading : "<div>$heading</div>";
|
182 |
+
echo '</h3></label>';
|
183 |
+
|
184 |
+
remove_editor_styles(); // stop custom theme styling interfering with the editor
|
185 |
+
|
186 |
+
wp_editor(
|
187 |
+
$snippet->description,
|
188 |
+
'description',
|
189 |
+
apply_filters( 'code_snippets/admin/description_editor_settings', array(
|
190 |
+
'textarea_name' => 'snippet_description',
|
191 |
+
'textarea_rows' => $settings['rows'],
|
192 |
+
'teeny' => ! $settings['use_full_mce'],
|
193 |
+
'media_buttons' => $media_buttons,
|
194 |
+
) )
|
195 |
+
);
|
196 |
+
}
|
197 |
+
|
198 |
+
/**
|
199 |
+
* Render the interface for editing snippet tags
|
200 |
+
* @param Snippet $snippet the snippet currently being edited
|
201 |
+
*/
|
202 |
+
function render_tags_editor( Snippet $snippet ) {
|
203 |
+
?>
|
204 |
+
<label for="snippet_tags" style="cursor: auto;">
|
205 |
+
<h3><?php esc_html_e( 'Tags', 'code-snippets' ); ?></h3>
|
206 |
+
</label>
|
207 |
+
|
208 |
+
<input type="text" id="snippet_tags" name="snippet_tags" style="width: 100%;"
|
209 |
+
placeholder="<?php esc_html_e( 'Enter a list of tags; separated by commas', 'code-snippets' ); ?>" value="<?php echo $snippet->tags_list; ?>" />
|
210 |
+
|
211 |
+
<script type="text/javascript">
|
212 |
+
jQuery('#snippet_tags').tagit({
|
213 |
+
availableTags: ['<?php echo implode( "','", get_all_snippet_tags() ); ?>'],
|
214 |
+
allowSpaces: true,
|
215 |
+
removeConfirmation: true
|
216 |
+
});
|
217 |
+
</script>
|
218 |
+
<?php
|
219 |
+
}
|
220 |
+
|
221 |
+
/**
|
222 |
+
* Render the snippet scope setting
|
223 |
+
* @param Snippet $snippet the snippet currently being edited
|
224 |
+
*/
|
225 |
+
function render_scope_setting( Snippet $snippet ) {
|
226 |
+
|
227 |
+
$scopes = array(
|
228 |
+
__( 'Run snippet everywhere', 'code-snippets' ),
|
229 |
+
__( 'Only run in adminstration area', 'code-snippets' ),
|
230 |
+
__( 'Only run on site front-end', 'code-snippets' ),
|
231 |
+
);
|
232 |
+
|
233 |
+
echo '<tr class="snippet-scope">';
|
234 |
+
echo '<th scope="row">' . __( 'Scope', 'code-snippets' ) . '</th><td>';
|
235 |
+
|
236 |
+
foreach ( $scopes as $scope => $label ) {
|
237 |
+
printf( '<div><input type="radio" name="snippet_scope" value="%d"', $scope );
|
238 |
+
checked( $scope, $snippet->scope );
|
239 |
+
echo "> $label</div>";
|
240 |
+
}
|
241 |
+
|
242 |
+
echo '</td></tr>';
|
243 |
+
}
|
244 |
+
|
245 |
+
/**
|
246 |
+
* Render the setting for shared network snippets
|
247 |
+
* @param object $snippet The snippet currently being edited
|
248 |
+
*/
|
249 |
+
function render_multisite_sharing_setting( $snippet ) {
|
250 |
+
$shared_snippets = get_site_option( 'shared_network_snippets', array() );
|
251 |
+
?>
|
252 |
+
|
253 |
+
<tr class="snippet-sharing-setting">
|
254 |
+
<th scope="row"><?php _e( 'Sharing', 'code-snippets' ) ?></th>
|
255 |
+
<td><label for="snippet_sharing">
|
256 |
+
<input type="checkbox" name="snippet_sharing"
|
257 |
+
<?php checked( in_array( $snippet->id, $shared_snippets ) ); ?>>
|
258 |
+
<?php _e( 'Allow this snippet to be activated on individual sites on the network', 'code-snippets' ); ?>
|
259 |
+
</label></td>
|
260 |
+
</tr>
|
261 |
+
|
262 |
+
<?php
|
263 |
+
}
|
264 |
+
|
265 |
+
/*
|
266 |
+
* Print the status and error messages
|
267 |
+
*/
|
268 |
+
protected function print_messages() {
|
269 |
+
|
270 |
+
/* Check if an error exists, and if so, build the message */
|
271 |
+
$error = $this->get_result_message(
|
272 |
+
array( 'error' => __( 'An error occurred when saving the snippet.', 'code-snippets' ) ),
|
273 |
+
'result', 'error'
|
274 |
+
);
|
275 |
+
|
276 |
+
/* Output the error message if it exists, otherwise try to output a result message */
|
277 |
+
if ( $error ) {
|
278 |
+
echo $error;
|
279 |
+
} else {
|
280 |
+
echo $this->get_result_message(
|
281 |
+
array(
|
282 |
+
'added' => __( 'Snippet <strong>added</strong>.', 'code-snippets' ),
|
283 |
+
'updated' => __( 'Snippet <strong>updated</strong>.', 'code-snippets' ),
|
284 |
+
'added-and-activated' => __( 'Snippet <strong>added</strong> and <strong>activated</strong>.', 'code-snippets' ),
|
285 |
+
'updated-and-activated' => __( 'Snippet <strong>updated</strong> and <strong>activated</strong>.', 'code-snippets' ),
|
286 |
+
'updated-and-deactivated' => __( 'Snippet <strong>updated</strong> and <strong>deactivated</strong>.', 'code-snippets' ),
|
287 |
+
)
|
288 |
+
);
|
289 |
+
}
|
290 |
+
}
|
291 |
+
|
292 |
+
/**
|
293 |
+
* Registers and loads the code editor's assets
|
294 |
+
*
|
295 |
+
* @uses wp_enqueue_style() to add the stylesheets to the queue
|
296 |
+
* @uses wp_enqueue_script() to add the scripts to the queue
|
297 |
+
*/
|
298 |
+
function enqueue_assets() {
|
299 |
+
$tagit_version = '2.0';
|
300 |
+
$url = plugin_dir_url( CODE_SNIPPETS_FILE );
|
301 |
+
|
302 |
+
/* Enqueue CodeMirror */
|
303 |
+
code_snippets_enqueue_codemirror();
|
304 |
+
|
305 |
+
/* Tag It UI */
|
306 |
+
wp_enqueue_script(
|
307 |
+
'code-snippets-tag-it',
|
308 |
+
$url . 'js/min/tag-it.js',
|
309 |
+
array(
|
310 |
+
'jquery-ui-core',
|
311 |
+
'jquery-ui-widget',
|
312 |
+
'jquery-ui-position',
|
313 |
+
'jquery-ui-autocomplete',
|
314 |
+
'jquery-effects-blind',
|
315 |
+
'jquery-effects-highlight',
|
316 |
+
),
|
317 |
+
$tagit_version
|
318 |
+
);
|
319 |
+
|
320 |
+
wp_enqueue_style(
|
321 |
+
'code-snippets-tag-it',
|
322 |
+
$url . 'css/min/tagit.css',
|
323 |
+
false, $tagit_version
|
324 |
+
);
|
325 |
+
}
|
326 |
+
|
327 |
+
/**
|
328 |
+
* Remove the old CodeMirror version used by the Debug Bar Console plugin
|
329 |
+
* that is messing up the snippet editor
|
330 |
+
*/
|
331 |
+
function remove_incompatible_codemirror() {
|
332 |
+
global $pagenow;
|
333 |
+
|
334 |
+
/* Try to discern if we are on the single snippet page as best as we can at this early time */
|
335 |
+
is_admin() && 'admin.php' === $pagenow && isset( $_GET['page'] ) && code_snippets_get_menu_slug( 'edit' ) === $_GET['page']
|
336 |
+
|
337 |
+
/* Remove the action and stop all Debug Bar Console scripts */
|
338 |
+
&& remove_action( 'debug_bar_enqueue_scripts', 'debug_bar_console_scripts' );
|
339 |
+
}
|
340 |
+
}
|
includes/admin-menus/class-import-menu.php
ADDED
@@ -0,0 +1,105 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
|
3 |
+
/**
|
4 |
+
* This class handles the import admin menu
|
5 |
+
* @since 2.4.0
|
6 |
+
* @package Code_Snippets
|
7 |
+
*/
|
8 |
+
class Code_Snippets_Import_Menu extends Code_Snippets_Admin_Menu {
|
9 |
+
|
10 |
+
/**
|
11 |
+
* Class constructor
|
12 |
+
*/
|
13 |
+
function __construct() {
|
14 |
+
parent::__construct( 'import',
|
15 |
+
__( 'Import', 'code-snippets' ),
|
16 |
+
__( 'Import Snippets', 'code-snippets' )
|
17 |
+
);
|
18 |
+
|
19 |
+
add_action( 'admin_init', array( $this, 'register_importer' ) );
|
20 |
+
add_action( 'load-importer-code-snippets', array( $this, 'load' ) );
|
21 |
+
}
|
22 |
+
|
23 |
+
/**
|
24 |
+
* Executed when the menu is loaded
|
25 |
+
*/
|
26 |
+
public function load() {
|
27 |
+
parent::load();
|
28 |
+
code_snippets_load_import_help();
|
29 |
+
$this->process_import_file();
|
30 |
+
}
|
31 |
+
|
32 |
+
/**
|
33 |
+
* Process the uploaded import file
|
34 |
+
*
|
35 |
+
* @uses import_snippets() to process the import file
|
36 |
+
* @uses wp_redirect() to pass the import results to the page
|
37 |
+
* @uses add_query_arg() to append the results to the current URI
|
38 |
+
*/
|
39 |
+
private function process_import_file() {
|
40 |
+
|
41 |
+
/* Ensure the import file exists */
|
42 |
+
if ( ! isset( $_FILES['code_snippets_import_file']['tmp_name'] ) ) {
|
43 |
+
return;
|
44 |
+
}
|
45 |
+
|
46 |
+
/* Import the snippets */
|
47 |
+
$result = import_snippets( $_FILES['code_snippets_import_file']['tmp_name'], $network );
|
48 |
+
|
49 |
+
/* Send the amount of imported snippets to the page */
|
50 |
+
$url = add_query_arg(
|
51 |
+
$result ?
|
52 |
+
array( 'imported' => count( $result ) ) :
|
53 |
+
array( 'error' => true )
|
54 |
+
);
|
55 |
+
|
56 |
+
wp_redirect( esc_url_raw( $url ) );
|
57 |
+
exit;
|
58 |
+
}
|
59 |
+
|
60 |
+
/**
|
61 |
+
* Add the importer to the Tools > Import menu
|
62 |
+
*/
|
63 |
+
function register_importer() {
|
64 |
+
|
65 |
+
/* Only register the importer if the current user can manage snippets */
|
66 |
+
if ( ! defined( 'WP_LOAD_IMPORTERS' ) || ! current_user_can( get_snippets_cap() ) ) {
|
67 |
+
return;
|
68 |
+
}
|
69 |
+
|
70 |
+
/* Register the Code Snippets importer with WordPress */
|
71 |
+
register_importer(
|
72 |
+
'code-snippets',
|
73 |
+
__( 'Code Snippets', 'code-snippets' ),
|
74 |
+
__( 'Import snippets from a code snippets export file', 'code-snippets' ),
|
75 |
+
array( $this, 'render' )
|
76 |
+
);
|
77 |
+
}
|
78 |
+
|
79 |
+
/**
|
80 |
+
* Print the status and error messages
|
81 |
+
*/
|
82 |
+
protected function print_messages() {
|
83 |
+
if ( isset( $_REQUEST['imported'] ) ) {
|
84 |
+
echo '<div id="message" class="updated fade"><p>';
|
85 |
+
|
86 |
+
printf(
|
87 |
+
_n(
|
88 |
+
'Successfully imported <strong>%d</strong> snippet. <a href="%s">Have fun!</a>',
|
89 |
+
'Successfully imported <strong>%d</strong> snippets. <a href="%s">Have fun!</a>',
|
90 |
+
count( $_REQUEST['imported'] ),
|
91 |
+
'code-snippets'
|
92 |
+
),
|
93 |
+
$_REQUEST['imported'],
|
94 |
+
code_snippets_get_menu_url( 'manage' )
|
95 |
+
);
|
96 |
+
|
97 |
+
echo '</p></div>';
|
98 |
+
|
99 |
+
} elseif ( isset( $_REQUEST['error'] ) && $_REQUEST['error'] ) {
|
100 |
+
echo '<div id="message" class="error fade"><p>';
|
101 |
+
_e( 'An error occurred when processing the import file.', 'code-snippets' );
|
102 |
+
echo '</p></div>';
|
103 |
+
}
|
104 |
+
}
|
105 |
+
}
|
includes/admin-menus/class-manage-menu.php
ADDED
@@ -0,0 +1,106 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
|
3 |
+
/**
|
4 |
+
* This class handles the manage snippets menu
|
5 |
+
* @since 2.4.0
|
6 |
+
* @package Code_Snippets
|
7 |
+
*/
|
8 |
+
class Code_Snippets_Manage_Menu extends Code_Snippets_Admin_Menu {
|
9 |
+
|
10 |
+
/**
|
11 |
+
* Holds the list table class
|
12 |
+
* @var Code_Snippets_List_Table
|
13 |
+
*/
|
14 |
+
public $list_table;
|
15 |
+
|
16 |
+
/**
|
17 |
+
* Class constructor
|
18 |
+
*/
|
19 |
+
public function __construct() {
|
20 |
+
|
21 |
+
parent::__construct( 'manage',
|
22 |
+
__( 'Manage', 'code-snippets' ),
|
23 |
+
__( 'Snippets', 'code-snippets' )
|
24 |
+
);
|
25 |
+
|
26 |
+
add_filter( 'set-screen-option', array( $this, 'save_screen_option' ), 10, 3 );
|
27 |
+
}
|
28 |
+
|
29 |
+
/**
|
30 |
+
* Register the top-level 'Snippets' menu and associated 'Manage' subpage
|
31 |
+
*
|
32 |
+
* @uses add_menu_page() to register a top-level menu
|
33 |
+
* @uses add_submenu_page() to register a sub-menu
|
34 |
+
*/
|
35 |
+
function register() {
|
36 |
+
|
37 |
+
/* Register the top-level menu */
|
38 |
+
add_menu_page(
|
39 |
+
__( 'Snippets', 'code-snippets' ),
|
40 |
+
__( 'Snippets', 'code-snippets' ),
|
41 |
+
get_snippets_cap(),
|
42 |
+
code_snippets_get_menu_slug(),
|
43 |
+
array( $this, 'render' ),
|
44 |
+
'div', // icon is added through CSS
|
45 |
+
is_network_admin() ? 21 : 67
|
46 |
+
);
|
47 |
+
|
48 |
+
/* Register the sub-menu */
|
49 |
+
parent::register();
|
50 |
+
}
|
51 |
+
|
52 |
+
/**
|
53 |
+
* Executed when the admin page is loaded
|
54 |
+
*/
|
55 |
+
function load() {
|
56 |
+
parent::load();
|
57 |
+
|
58 |
+
/* Load the contextual help tabs */
|
59 |
+
code_snippets_load_manage_help();
|
60 |
+
|
61 |
+
/* Initialize the list table class */
|
62 |
+
require_once plugin_dir_path( CODE_SNIPPETS_FILE ) . 'includes/class-list-table.php';
|
63 |
+
$this->list_table = new Code_Snippets_List_Table();
|
64 |
+
$this->list_table->prepare_items();
|
65 |
+
}
|
66 |
+
|
67 |
+
/**
|
68 |
+
* Print the status and error messages
|
69 |
+
*/
|
70 |
+
protected function print_messages() {
|
71 |
+
|
72 |
+
/* Output a warning if safe mode is active */
|
73 |
+
if ( defined( 'CODE_SNIPPETS_SAFE_MODE' ) && CODE_SNIPPETS_SAFE_MODE ) {
|
74 |
+
echo '<div id="message" class="error fade"><p>';
|
75 |
+
_e( '<strong>Warning:</strong> Safe mode is active and snippets will not execute! Remove the <code>CODE_SNIPPETS_SAFE_MODE</code> constant from <code>wp-config.php</code> to turn off safe mode. <a href="https://github.com/sheabunge/code-snippets/wiki/Safe-Mode" target="_blank">Help</a>', 'code-snippets' );
|
76 |
+
echo '</p></div>';
|
77 |
+
}
|
78 |
+
|
79 |
+
echo $this->get_result_message(
|
80 |
+
array(
|
81 |
+
'activated' => __( 'Snippet <strong>activated</strong>.', 'code-snippets' ),
|
82 |
+
'activated-multi' => __( 'Selected snippets <strong>activated</strong>.', 'code-snippets' ),
|
83 |
+
'deactivated' => __( 'Snippet <strong>deactivated</strong>.', 'code-snippets' ),
|
84 |
+
'deactivated-multi' => __( 'Selected snippets <strong>deactivated</strong>.', 'code-snippets' ),
|
85 |
+
'deleted' => __( 'Snippet <strong>deleted</strong>.', 'code-snippets' ),
|
86 |
+
'deleted-multi' => __( 'Selected snippets <strong>deleted</strong>.', 'code-snippets' ),
|
87 |
+
)
|
88 |
+
);
|
89 |
+
}
|
90 |
+
|
91 |
+
/**
|
92 |
+
* Handles saving the user's snippets per page preference
|
93 |
+
*
|
94 |
+
* @param unknown $status
|
95 |
+
* @param string $option The screen option name
|
96 |
+
* @param unknown $value
|
97 |
+
* @return unknown
|
98 |
+
*/
|
99 |
+
function save_screen_option( $status, $option, $value ) {
|
100 |
+
if ( 'snippets_per_page' === $option ) {
|
101 |
+
return $value;
|
102 |
+
}
|
103 |
+
|
104 |
+
return $status;
|
105 |
+
}
|
106 |
+
}
|
includes/admin-menus/class-settings-menu.php
ADDED
@@ -0,0 +1,50 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
|
3 |
+
/**
|
4 |
+
* This class handles the settings admin menu
|
5 |
+
* @since 2.4.0
|
6 |
+
* @package Code_Snippets
|
7 |
+
*/
|
8 |
+
class Code_Snippets_Settings_Menu extends Code_Snippets_Admin_Menu {
|
9 |
+
|
10 |
+
/**
|
11 |
+
* Constructor
|
12 |
+
*/
|
13 |
+
public function __construct() {
|
14 |
+
|
15 |
+
parent::__construct( 'settings',
|
16 |
+
__( 'Settings', 'code-snippets' ),
|
17 |
+
__( 'Snippets Settings', 'code-snippets' )
|
18 |
+
);
|
19 |
+
}
|
20 |
+
|
21 |
+
function load() {
|
22 |
+
parent::load();
|
23 |
+
|
24 |
+
if ( is_network_admin() ) {
|
25 |
+
wp_redirect( code_snippets_get_menu_url( 'settings', 'admin' ) );
|
26 |
+
exit;
|
27 |
+
}
|
28 |
+
}
|
29 |
+
|
30 |
+
/**
|
31 |
+
* Render the admin screen
|
32 |
+
*/
|
33 |
+
function render() {
|
34 |
+
?>
|
35 |
+
<div class="wrap">
|
36 |
+
<h2><?php esc_html_e( 'Settings', 'code-snippets' ); ?></h2>
|
37 |
+
|
38 |
+
<?php settings_errors( 'code-snippets-settings-notices' ); ?>
|
39 |
+
|
40 |
+
<form action="<?php admin_url( 'options.php' ); ?>" method="post">
|
41 |
+
<?php settings_fields( 'code-snippets' ); ?>
|
42 |
+
<table class="form-table">
|
43 |
+
<?php do_settings_sections( 'code-snippets' ); ?>
|
44 |
+
</table>
|
45 |
+
<?php submit_button(); ?>
|
46 |
+
</form>
|
47 |
+
</div>
|
48 |
+
<?php
|
49 |
+
}
|
50 |
+
}
|
includes/admin.php
CHANGED
@@ -1,10 +1,9 @@
|
|
1 |
<?php
|
2 |
|
3 |
/**
|
4 |
-
*
|
5 |
*
|
6 |
-
* @package
|
7 |
-
* @subpackage Administration
|
8 |
*/
|
9 |
|
10 |
/* Bail if not in admin area */
|
@@ -13,56 +12,33 @@ if ( ! is_admin() ) {
|
|
13 |
}
|
14 |
|
15 |
/**
|
16 |
-
*
|
17 |
-
* @param string $menu The menu to retrieve the slug for
|
18 |
-
* @return string The menu's slug
|
19 |
*/
|
20 |
-
function
|
21 |
-
$
|
22 |
-
$
|
23 |
-
$import = array( 'import', 'import-snippets' );
|
24 |
-
$settings = array( 'settings', 'snippets-settings' );
|
25 |
-
|
26 |
-
if ( in_array( $menu, $edit ) ) {
|
27 |
-
return 'edit-snippet';
|
28 |
-
} elseif ( in_array( $menu, $add ) ) {
|
29 |
-
return 'add-snippet';
|
30 |
-
} elseif ( in_array( $menu, $import ) ) {
|
31 |
-
return 'import-snippets';
|
32 |
-
} elseif ( in_array( $menu, $settings ) ) {
|
33 |
-
return 'snippets-settings';
|
34 |
-
} else {
|
35 |
-
return 'snippets';
|
36 |
-
}
|
37 |
-
}
|
38 |
|
39 |
-
|
40 |
-
|
41 |
-
|
42 |
-
|
43 |
-
*/
|
44 |
-
|
45 |
-
|
46 |
-
|
47 |
-
|
48 |
-
|
49 |
-
|
50 |
-
|
51 |
-
|
52 |
-
|
53 |
-
|
|
|
|
|
54 |
}
|
55 |
}
|
56 |
|
57 |
-
|
58 |
-
* Fetch the admin menu hook for a snippets menu
|
59 |
-
* @param string $menu The menu to retrieve the hook for
|
60 |
-
* @return string The menu's hook
|
61 |
-
*/
|
62 |
-
function code_snippets_get_menu_hook( $menu = '' ) {
|
63 |
-
$slug = code_snippets_get_menu_slug( $menu );
|
64 |
-
return get_plugin_page_hookname( $slug, 'snippets' );
|
65 |
-
}
|
66 |
|
67 |
/**
|
68 |
* Allow super admins to control site admin access to
|
@@ -72,10 +48,9 @@ function code_snippets_get_menu_hook( $menu = '' ) {
|
|
72 |
* network admin menu
|
73 |
*
|
74 |
* @since 1.7.1
|
75 |
-
* @access private
|
76 |
*
|
77 |
-
* @param
|
78 |
-
* @return array
|
79 |
*/
|
80 |
function code_snippets_mu_menu_items( $menu_items ) {
|
81 |
$menu_items['snippets'] = __( 'Snippets', 'code-snippets' );
|
@@ -88,13 +63,23 @@ add_filter( 'mu_menu_items', 'code_snippets_mu_menu_items' );
|
|
88 |
* Enqueue the stylesheet for a snippet menu
|
89 |
*
|
90 |
* @since 2.2.0
|
91 |
-
* @uses wp_enqueue_style()
|
92 |
-
* @
|
|
|
|
|
93 |
*/
|
94 |
function code_snippets_enqueue_admin_stylesheet( $hook ) {
|
95 |
$pages = array( 'manage', 'add', 'edit', 'settings' );
|
96 |
$hooks = array_map( 'code_snippets_get_menu_hook', $pages );
|
97 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
98 |
/* Only load the stylesheet on the right snippets page */
|
99 |
if ( ! in_array( $hook, $hooks ) ) {
|
100 |
return;
|
@@ -116,34 +101,13 @@ function code_snippets_enqueue_admin_stylesheet( $hook ) {
|
|
116 |
|
117 |
add_action( 'admin_enqueue_scripts', 'code_snippets_enqueue_admin_stylesheet' );
|
118 |
|
119 |
-
/**
|
120 |
-
* Enqueue the icon stylesheet globally in the admin
|
121 |
-
*
|
122 |
-
* @since 1.0
|
123 |
-
* @access private
|
124 |
-
* @uses wp_enqueue_style() To add the stylesheet to the queue
|
125 |
-
* @uses get_user_option() To check if MP6 mode is active
|
126 |
-
* @uses plugins_url() To retrieve a URL to assets
|
127 |
-
*/
|
128 |
-
function code_snippets_load_admin_icon_style() {
|
129 |
-
|
130 |
-
wp_enqueue_style(
|
131 |
-
'menu-icon-snippets',
|
132 |
-
plugins_url( 'css/min/menu-icon.css', CODE_SNIPPETS_FILE ),
|
133 |
-
false,
|
134 |
-
CODE_SNIPPETS_VERSION
|
135 |
-
);
|
136 |
-
}
|
137 |
-
|
138 |
-
add_action( 'admin_enqueue_scripts', 'code_snippets_load_admin_icon_style' );
|
139 |
-
|
140 |
/**
|
141 |
* Adds a link pointing to the Manage Snippets page
|
142 |
*
|
143 |
* @since 2.0
|
144 |
-
*
|
145 |
-
* @param
|
146 |
-
* @return array
|
147 |
*/
|
148 |
function code_snippets_plugin_settings_link( $links ) {
|
149 |
array_unshift( $links, sprintf(
|
@@ -160,8 +124,8 @@ add_filter( 'plugin_action_links_' . plugin_basename( CODE_SNIPPETS_FILE ), 'cod
|
|
160 |
/**
|
161 |
* Adds extra links related to the plugin
|
162 |
*
|
163 |
-
* @since
|
164 |
-
|
165 |
* @param array $links The existing plugin info links
|
166 |
* @param string $file The plugin the links are for
|
167 |
* @return array The modified plugin info links
|
@@ -237,20 +201,3 @@ function code_snippets_survey_message() {
|
|
237 |
}
|
238 |
|
239 |
add_action( 'code_snippets/admin/manage', 'code_snippets_survey_message' );
|
240 |
-
|
241 |
-
/**
|
242 |
-
* Remove the old CodeMirror version used by the Debug Bar Console
|
243 |
-
* plugin that is messing up the snippet editor
|
244 |
-
* @since 1.9
|
245 |
-
*/
|
246 |
-
function code_snippets_remove_debug_bar_codemirror() {
|
247 |
-
global $pagenow;
|
248 |
-
|
249 |
-
/* Try to discern if we are on the single snippet page as best as we can at this early time */
|
250 |
-
is_admin() && 'admin.php' === $pagenow && isset( $_GET['page'] ) && 'snippet' === $_GET['page']
|
251 |
-
|
252 |
-
/* Remove the action and stop all Debug Bar Console scripts */
|
253 |
-
&& remove_action( 'debug_bar_enqueue_scripts', 'debug_bar_console_scripts' );
|
254 |
-
}
|
255 |
-
|
256 |
-
add_action( 'init', 'code_snippets_remove_debug_bar_codemirror' );
|
1 |
<?php
|
2 |
|
3 |
/**
|
4 |
+
* General functions specific to the administration interface
|
5 |
*
|
6 |
+
* @package Code_Snippets
|
|
|
7 |
*/
|
8 |
|
9 |
/* Bail if not in admin area */
|
12 |
}
|
13 |
|
14 |
/**
|
15 |
+
* Load the admin menu classes
|
|
|
|
|
16 |
*/
|
17 |
+
function code_snippets_load_admin_classes() {
|
18 |
+
$admin_classes = plugin_dir_path( __FILE__ ) . 'admin-menus/';
|
19 |
+
require_once $admin_classes . 'class-admin-menu.php';
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
20 |
|
21 |
+
/* Manage menu */
|
22 |
+
require_once $admin_classes . 'class-manage-menu.php';
|
23 |
+
new Code_Snippets_Manage_Menu();
|
24 |
+
|
25 |
+
/* Edit/add new menu */
|
26 |
+
require_once $admin_classes . 'class-edit-menu.php';
|
27 |
+
new Code_Snippets_Edit_Menu();
|
28 |
+
|
29 |
+
/* Import menu */
|
30 |
+
require_once $admin_classes . 'class-import-menu.php';
|
31 |
+
new Code_Snippets_Import_Menu();
|
32 |
+
|
33 |
+
if ( ! is_network_admin() ) {
|
34 |
+
|
35 |
+
/* Settings menu */
|
36 |
+
require_once $admin_classes . 'class-settings-menu.php';
|
37 |
+
new Code_Snippets_Settings_Menu();
|
38 |
}
|
39 |
}
|
40 |
|
41 |
+
code_snippets_load_admin_classes();
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
42 |
|
43 |
/**
|
44 |
* Allow super admins to control site admin access to
|
48 |
* network admin menu
|
49 |
*
|
50 |
* @since 1.7.1
|
|
|
51 |
*
|
52 |
+
* @param array $menu_items The current mu menu items
|
53 |
+
* @return array The modified mu menu items
|
54 |
*/
|
55 |
function code_snippets_mu_menu_items( $menu_items ) {
|
56 |
$menu_items['snippets'] = __( 'Snippets', 'code-snippets' );
|
63 |
* Enqueue the stylesheet for a snippet menu
|
64 |
*
|
65 |
* @since 2.2.0
|
66 |
+
* @uses wp_enqueue_style() to add the stylesheet to the queue
|
67 |
+
* @uses get_user_option() to check if MP6 mode is active
|
68 |
+
* @uses plugins_url() to retrieve a URL to assets
|
69 |
+
* @param string $hook the current page hook
|
70 |
*/
|
71 |
function code_snippets_enqueue_admin_stylesheet( $hook ) {
|
72 |
$pages = array( 'manage', 'add', 'edit', 'settings' );
|
73 |
$hooks = array_map( 'code_snippets_get_menu_hook', $pages );
|
74 |
|
75 |
+
/* First, load the menu icon stylesheet */
|
76 |
+
wp_enqueue_style(
|
77 |
+
'menu-icon-snippets',
|
78 |
+
plugins_url( 'css/min/menu-icon.css', CODE_SNIPPETS_FILE ),
|
79 |
+
false,
|
80 |
+
CODE_SNIPPETS_VERSION
|
81 |
+
);
|
82 |
+
|
83 |
/* Only load the stylesheet on the right snippets page */
|
84 |
if ( ! in_array( $hook, $hooks ) ) {
|
85 |
return;
|
101 |
|
102 |
add_action( 'admin_enqueue_scripts', 'code_snippets_enqueue_admin_stylesheet' );
|
103 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
104 |
/**
|
105 |
* Adds a link pointing to the Manage Snippets page
|
106 |
*
|
107 |
* @since 2.0
|
108 |
+
*
|
109 |
+
* @param array $links The existing plugin action links
|
110 |
+
* @return array The modified plugin action links
|
111 |
*/
|
112 |
function code_snippets_plugin_settings_link( $links ) {
|
113 |
array_unshift( $links, sprintf(
|
124 |
/**
|
125 |
* Adds extra links related to the plugin
|
126 |
*
|
127 |
+
* @since 2.0
|
128 |
+
|
129 |
* @param array $links The existing plugin info links
|
130 |
* @param string $file The plugin the links are for
|
131 |
* @return array The modified plugin info links
|
201 |
}
|
202 |
|
203 |
add_action( 'code_snippets/admin/manage', 'code_snippets_survey_message' );
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
includes/caps.php
CHANGED
@@ -28,8 +28,8 @@ function get_snippets_cap() {
|
|
28 |
/**
|
29 |
* Add the multisite capabilities to a user
|
30 |
*
|
31 |
-
* @since
|
32 |
-
* @param
|
33 |
*/
|
34 |
function grant_network_snippets_cap( $user_id ) {
|
35 |
|
@@ -46,7 +46,7 @@ add_action( 'grant_super_admin', 'grant_network_snippets_cap' );
|
|
46 |
* Remove the multisite capabilities from a user
|
47 |
*
|
48 |
* @since 2.0
|
49 |
-
* @param
|
50 |
*/
|
51 |
function remove_network_snippets_cap( $user_id ) {
|
52 |
|
28 |
/**
|
29 |
* Add the multisite capabilities to a user
|
30 |
*
|
31 |
+
* @since 2.0
|
32 |
+
* @param int $user_id The ID of the user to add the cap to
|
33 |
*/
|
34 |
function grant_network_snippets_cap( $user_id ) {
|
35 |
|
46 |
* Remove the multisite capabilities from a user
|
47 |
*
|
48 |
* @since 2.0
|
49 |
+
* @param int $user_id The ID of the user to remove the cap from
|
50 |
*/
|
51 |
function remove_network_snippets_cap( $user_id ) {
|
52 |
|
includes/class-admin.php
DELETED
@@ -1,777 +0,0 @@
|
|
1 |
-
<?php
|
2 |
-
|
3 |
-
/**
|
4 |
-
* Contains the class for handling the administration interface
|
5 |
-
*
|
6 |
-
* @package Code_Snippets
|
7 |
-
* @subpackage Administration
|
8 |
-
*/
|
9 |
-
|
10 |
-
/**
|
11 |
-
* This class handles the admin interface for Code Snippets
|
12 |
-
*
|
13 |
-
* Don't directly access the methods in this class or attempt to
|
14 |
-
* re-initialize it. Instead, use the instance in $code_snippets->admin
|
15 |
-
*
|
16 |
-
* @since 1.7.1
|
17 |
-
* @package Code_Snippets
|
18 |
-
* @subpackage Administration
|
19 |
-
*/
|
20 |
-
class Code_Snippets_Admin {
|
21 |
-
|
22 |
-
/**
|
23 |
-
* The full URLs to the admin pages
|
24 |
-
*
|
25 |
-
* @var string
|
26 |
-
* @since 1.7.1
|
27 |
-
* @access public
|
28 |
-
*/
|
29 |
-
public $manage_url, $single_url, $import_url = '';
|
30 |
-
|
31 |
-
/**
|
32 |
-
* The hooks for the admin pages
|
33 |
-
* Used primarily for enqueueing scripts and styles
|
34 |
-
*
|
35 |
-
* @var string
|
36 |
-
* @since 1.7.1
|
37 |
-
* @access public
|
38 |
-
*/
|
39 |
-
public $manage_page, $single_page, $import_page = '';
|
40 |
-
|
41 |
-
/**
|
42 |
-
* Initializes the variables and
|
43 |
-
* loads everything needed for the class
|
44 |
-
*
|
45 |
-
* @since 1.7.1
|
46 |
-
*/
|
47 |
-
function __construct() {
|
48 |
-
global $code_snippets;
|
49 |
-
|
50 |
-
$this->manage_slug = apply_filters( 'code_snippets/admin/manage_slug', 'snippets' );
|
51 |
-
$this->single_slug = apply_filters( 'code_snippets/admin/single_slug', 'snippet' );
|
52 |
-
|
53 |
-
$this->manage_url = self_admin_url( 'admin.php?page=' . $this->manage_slug );
|
54 |
-
$this->single_url = self_admin_url( 'admin.php?page=' . $this->single_slug );
|
55 |
-
|
56 |
-
$this->setup_hooks();
|
57 |
-
}
|
58 |
-
|
59 |
-
/**
|
60 |
-
* Register action and filter hooks
|
61 |
-
*
|
62 |
-
* @since 1.7.1
|
63 |
-
* @access private
|
64 |
-
* @return void
|
65 |
-
*/
|
66 |
-
function setup_hooks() {
|
67 |
-
global $code_snippets;
|
68 |
-
|
69 |
-
/* add the administration menus */
|
70 |
-
add_action( 'admin_menu', array( $this, 'add_admin_menus' ), 5 );
|
71 |
-
add_action( 'network_admin_menu', array( $this, 'add_admin_menus' ), 5 );
|
72 |
-
|
73 |
-
/* register the importer */
|
74 |
-
add_action( 'admin_init', array( $this, 'load_importer' ) );
|
75 |
-
add_action( 'network_admin_menu', array( $this, 'add_import_admin_menu' ) );
|
76 |
-
|
77 |
-
/* add helpful links to the Plugins menu */
|
78 |
-
add_filter( 'plugin_action_links_' . $code_snippets->basename, array( $this, 'settings_link' ) );
|
79 |
-
add_filter( 'plugin_row_meta', array( $this, 'plugin_meta' ), 10, 2 );
|
80 |
-
|
81 |
-
/* Add a custom icon to Snippets menu pages */
|
82 |
-
add_action( 'admin_enqueue_scripts', array( $this, 'load_admin_icon_style' ) );
|
83 |
-
|
84 |
-
/* Add the description editor to the Snippets > Add New page */
|
85 |
-
add_action( 'code_snippets/admin/single', array( $this, 'description_editor_box' ), 5 );
|
86 |
-
|
87 |
-
/* Handle saving the user's screen option preferences */
|
88 |
-
add_filter( 'set-screen-option', array( $this, 'set_screen_option' ), 10, 3 );
|
89 |
-
|
90 |
-
/* Allow super admins to control site admins access to snippet admin menus */
|
91 |
-
add_filter( 'mu_menu_items', array( $this, 'mu_menu_items') );
|
92 |
-
|
93 |
-
/* Add the survey notice on the manage snippets page */
|
94 |
-
add_action( 'code_snippets/admin/manage', array( $this, 'survey_message' ) );
|
95 |
-
|
96 |
-
/* Remove incompatible Debug Bar Console CodeMirror version */
|
97 |
-
$this->remove_debug_bar_codemirror();
|
98 |
-
}
|
99 |
-
|
100 |
-
/**
|
101 |
-
* Remove the old CodeMirror version used by the Debug Bar Console
|
102 |
-
* plugin that is messing up the snippet editor
|
103 |
-
* @since 1.9
|
104 |
-
*/
|
105 |
-
function remove_debug_bar_codemirror() {
|
106 |
-
global $pagenow;
|
107 |
-
|
108 |
-
/* Try to discern if we are on the single snippet page as best as we can at this early time */
|
109 |
-
is_admin() && 'admin.php' === $pagenow && isset( $_GET['page' ] ) && 'snippet' === $_GET['page']
|
110 |
-
|
111 |
-
/* Remove the action and stop all Debug Bar Console scripts */
|
112 |
-
&& remove_action( 'debug_bar_enqueue_scripts', 'debug_bar_console_scripts' );
|
113 |
-
}
|
114 |
-
|
115 |
-
/**
|
116 |
-
* Check if we are on the pre-3.8 interface
|
117 |
-
*
|
118 |
-
* @return boolean
|
119 |
-
* @since 1.9.1
|
120 |
-
*/
|
121 |
-
function is_legacy_interface() {
|
122 |
-
return !defined( 'MP6' ) && version_compare( $GLOBALS['wp_version'], '3.8-alpha', '<' );
|
123 |
-
}
|
124 |
-
|
125 |
-
/**
|
126 |
-
* Handles saving the user's snippets per page preference
|
127 |
-
*
|
128 |
-
* @param unknown $status
|
129 |
-
* @param string $option
|
130 |
-
* @param unknown $value
|
131 |
-
* @return unknown
|
132 |
-
*/
|
133 |
-
function set_screen_option( $status, $option, $value ) {
|
134 |
-
if ( 'snippets_per_page' === $option )
|
135 |
-
return $value;
|
136 |
-
}
|
137 |
-
|
138 |
-
/**
|
139 |
-
* Allow super admins to control site admin access to
|
140 |
-
* snippet admin menus
|
141 |
-
*
|
142 |
-
* Adds a checkbox to the *Settings > Network Settings*
|
143 |
-
* network admin menu
|
144 |
-
*
|
145 |
-
* @since 1.7.1
|
146 |
-
* @access private
|
147 |
-
*
|
148 |
-
* @param array $menu_items The current mu menu items
|
149 |
-
* @return array The modified mu menu items
|
150 |
-
*/
|
151 |
-
function mu_menu_items( $menu_items ) {
|
152 |
-
$menu_items['snippets'] = __( 'Snippets', 'code-snippets' );
|
153 |
-
return $menu_items;
|
154 |
-
}
|
155 |
-
|
156 |
-
/**
|
157 |
-
* Load the Code Snippets importer
|
158 |
-
*
|
159 |
-
* Add both an importer to the Tools menu
|
160 |
-
* and an Import Snippets page to the network admin menu
|
161 |
-
*
|
162 |
-
* @since 1.6
|
163 |
-
* @access private
|
164 |
-
* @return void
|
165 |
-
*/
|
166 |
-
function load_importer() {
|
167 |
-
global $code_snippets;
|
168 |
-
|
169 |
-
/* Only register the importer if the current user can manage snippets */
|
170 |
-
if ( defined( 'WP_LOAD_IMPORTERS' ) && current_user_can( $code_snippets->get_cap() ) ) {
|
171 |
-
|
172 |
-
/* Load Importer API */
|
173 |
-
require_once ABSPATH . 'wp-admin/includes/import.php';
|
174 |
-
|
175 |
-
if ( ! class_exists( 'WP_Importer' ) ) {
|
176 |
-
$class_wp_importer = ABSPATH . 'wp-admin/includes/class-wp-importer.php';
|
177 |
-
if ( file_exists( $class_wp_importer ) ) {
|
178 |
-
require_once $class_wp_importer;
|
179 |
-
}
|
180 |
-
}
|
181 |
-
|
182 |
-
/* Register the Code Snippets importer with WordPress */
|
183 |
-
register_importer(
|
184 |
-
'code-snippets',
|
185 |
-
__( 'Code Snippets', 'code-snippets' ),
|
186 |
-
__( 'Import snippets from a Code Snippets export file', 'code-snippets' ),
|
187 |
-
array( $this, 'display_import_menu' )
|
188 |
-
);
|
189 |
-
}
|
190 |
-
|
191 |
-
$this->import_url = self_admin_url( 'admin.php?import=code-snippets' );
|
192 |
-
add_action( 'load-importer-code-snippets', array( $this, 'load_import_menu' ) );
|
193 |
-
}
|
194 |
-
|
195 |
-
/**
|
196 |
-
* Load contextual help tabs for an admin screen.
|
197 |
-
*
|
198 |
-
* @since 1.8
|
199 |
-
* @access public
|
200 |
-
* @param string $slug The file handle (filename with no path or extension) to load
|
201 |
-
* @return void
|
202 |
-
*/
|
203 |
-
public function load_help_tabs( $slug ) {
|
204 |
-
global $code_snippets;
|
205 |
-
include $code_snippets->plugin_dir . "admin/help/{$slug}.php";
|
206 |
-
}
|
207 |
-
|
208 |
-
/**
|
209 |
-
* Load an admin view template
|
210 |
-
*
|
211 |
-
* @since 1.8
|
212 |
-
* @access public
|
213 |
-
* @param string $slug The file handle (filename with no path or extension) to load
|
214 |
-
* @return void
|
215 |
-
*/
|
216 |
-
public function get_view( $slug ) {
|
217 |
-
global $code_snippets;
|
218 |
-
require $code_snippets->plugin_dir . "admin/views/{$slug}.php";
|
219 |
-
}
|
220 |
-
|
221 |
-
/**
|
222 |
-
* Display the admin status and error messages
|
223 |
-
*
|
224 |
-
* @since 1.8
|
225 |
-
* @access public
|
226 |
-
* @param string $slug The file handle (filename with no path or extension) to load
|
227 |
-
* @return void
|
228 |
-
*/
|
229 |
-
public function get_messages( $slug ) {
|
230 |
-
global $code_snippets;
|
231 |
-
require $code_snippets->plugin_dir . "admin/messages/{$slug}.php";
|
232 |
-
}
|
233 |
-
|
234 |
-
/**
|
235 |
-
* Check if the current user can manage snippets.
|
236 |
-
* If not, display an error message
|
237 |
-
*
|
238 |
-
* @since 1.9.1.1
|
239 |
-
* @access public
|
240 |
-
* @return void
|
241 |
-
*/
|
242 |
-
public function check_perms() {
|
243 |
-
global $code_snippets;
|
244 |
-
|
245 |
-
if ( ! current_user_can( $code_snippets->get_cap() ) ) {
|
246 |
-
wp_die( __( 'You are not access this page.', 'code-snippets' ) );
|
247 |
-
}
|
248 |
-
}
|
249 |
-
|
250 |
-
/**
|
251 |
-
* Add the dashboard admin menu and subpages
|
252 |
-
*
|
253 |
-
* @since 1.0
|
254 |
-
* @access private
|
255 |
-
*
|
256 |
-
* @uses add_menu_page() To register a top-level menu
|
257 |
-
* @uses add_submenu_page() To register a submenu page
|
258 |
-
* @uses apply_filters() To retrieve the current menu slug
|
259 |
-
* @uses plugins_url() To retrieve the URL to a resource
|
260 |
-
* @return void
|
261 |
-
*/
|
262 |
-
function add_admin_menus() {
|
263 |
-
global $code_snippets;
|
264 |
-
|
265 |
-
/* Provide a raster icon for the legacy interface */
|
266 |
-
if ( $this->is_legacy_interface() ) {
|
267 |
-
$menu_icon = apply_filters( 'code_snippets/admin/menu_icon_url',
|
268 |
-
plugins_url( 'assets/images/menu-icon.png', $code_snippets->file )
|
269 |
-
);
|
270 |
-
} else {
|
271 |
-
$menu_icon = 'div';
|
272 |
-
}
|
273 |
-
|
274 |
-
/* Add the top-level menu and associated subpage */
|
275 |
-
$this->manage_page = add_menu_page(
|
276 |
-
__( 'Snippets', 'code-snippets' ),
|
277 |
-
__( 'Snippets', 'code-snippets' ),
|
278 |
-
$code_snippets->get_cap(),
|
279 |
-
$this->manage_slug,
|
280 |
-
array( $this, 'display_manage_menu' ),
|
281 |
-
$menu_icon,
|
282 |
-
is_network_admin() ? 21 : 67
|
283 |
-
);
|
284 |
-
|
285 |
-
add_submenu_page(
|
286 |
-
$this->manage_slug,
|
287 |
-
__( 'Snippets', 'code-snippets' ),
|
288 |
-
__( 'Manage', 'code-snippets' ),
|
289 |
-
$code_snippets->get_cap(),
|
290 |
-
$this->manage_slug,
|
291 |
-
array( $this, 'display_manage_menu')
|
292 |
-
);
|
293 |
-
|
294 |
-
/* Add the Edit/Add New Snippet page */
|
295 |
-
$editing = ( isset( $_REQUEST['page'], $_REQUEST['edit'] ) && $this->single_slug === $_REQUEST['page'] );
|
296 |
-
|
297 |
-
$this->single_page = add_submenu_page(
|
298 |
-
$this->manage_slug,
|
299 |
-
$editing ? __( 'Edit Snippet', 'code-snippets' ) : __( 'Add New Snippet', 'code-snippets' ),
|
300 |
-
$editing ? __( 'Edit', 'code-snippets' ) : __( 'Add New', 'code-snippets' ),
|
301 |
-
$code_snippets->get_cap(),
|
302 |
-
$this->single_slug,
|
303 |
-
array( $this, 'display_single_menu' )
|
304 |
-
);
|
305 |
-
|
306 |
-
add_action( "load-$this->manage_page", array( $this, 'load_manage_menu' ) );
|
307 |
-
add_action( "load-$this->single_page", array( $this, 'load_single_menu' ) );
|
308 |
-
}
|
309 |
-
|
310 |
-
/**
|
311 |
-
* Add an Import Snippets page to the network admin menu.
|
312 |
-
* We need to do this as there is no Tools menu in the network
|
313 |
-
* admin, and so we cannot register an importer
|
314 |
-
*
|
315 |
-
* @since 1.6
|
316 |
-
* @access private
|
317 |
-
* @uses add_submenu_page() To register the menu page
|
318 |
-
* @uses apply_filters() To retrieve the current menu slug
|
319 |
-
* @uses add_action() To enqueue scripts and styles
|
320 |
-
* @return void
|
321 |
-
*/
|
322 |
-
function add_import_admin_menu() {
|
323 |
-
global $code_snippets;
|
324 |
-
|
325 |
-
$this->import_page = add_submenu_page(
|
326 |
-
$this->manage_slug,
|
327 |
-
__( 'Import Snippets', 'code-snippets' ),
|
328 |
-
__( 'Import', 'code-snippets' ),
|
329 |
-
$code_snippets->get_cap(),
|
330 |
-
'import-code-snippets',
|
331 |
-
array( $this, 'display_import_menu' )
|
332 |
-
);
|
333 |
-
|
334 |
-
$this->import_url = self_admin_url( 'admin.php?page=import-code-snippets' );
|
335 |
-
add_action( "load-$this->import_page", array( $this, 'load_import_menu' ) );
|
336 |
-
}
|
337 |
-
|
338 |
-
/**
|
339 |
-
* Enqueue the icon stylesheet
|
340 |
-
*
|
341 |
-
* @since 1.0
|
342 |
-
* @access private
|
343 |
-
* @uses wp_enqueue_style() To add the stylesheet to the queue
|
344 |
-
* @uses get_user_option() To check if MP6 mode is active
|
345 |
-
* @uses plugins_url To retrieve a URL to assets
|
346 |
-
* @return void
|
347 |
-
*/
|
348 |
-
function load_admin_icon_style() {
|
349 |
-
global $code_snippets;
|
350 |
-
|
351 |
-
$stylesheet = $this->is_legacy_interface() ? 'screen-icon' : 'menu-icon';
|
352 |
-
|
353 |
-
wp_enqueue_style(
|
354 |
-
'icon-snippets',
|
355 |
-
plugins_url( "assets/css/{$stylesheet}.css", $code_snippets->file ),
|
356 |
-
false,
|
357 |
-
$code_snippets->version
|
358 |
-
);
|
359 |
-
}
|
360 |
-
|
361 |
-
/**
|
362 |
-
* Initializes the list table class and loads the help tabs
|
363 |
-
* for the Manage Snippets page
|
364 |
-
*
|
365 |
-
* @since 1.0
|
366 |
-
* @access private
|
367 |
-
* @return void
|
368 |
-
*/
|
369 |
-
function load_manage_menu() {
|
370 |
-
global $code_snippets;
|
371 |
-
|
372 |
-
/* Make sure the user has permission to be here */
|
373 |
-
$this->check_perms();
|
374 |
-
|
375 |
-
/* Create the snippet tables if they don't exist */
|
376 |
-
$code_snippets->maybe_create_tables( true, true );
|
377 |
-
|
378 |
-
/* Load the screen help tabs */
|
379 |
-
$this->load_help_tabs( 'manage' );
|
380 |
-
|
381 |
-
/* Initialize the snippet table class */
|
382 |
-
$code_snippets->get_include( 'class-list-table' );
|
383 |
-
$code_snippets->list_table = new Code_Snippets_List_Table();
|
384 |
-
$code_snippets->list_table->prepare_items();
|
385 |
-
}
|
386 |
-
|
387 |
-
/**
|
388 |
-
* Loads the help tabs for the Edit Snippets page
|
389 |
-
*
|
390 |
-
* @since 1.0
|
391 |
-
* @access private
|
392 |
-
* @return void
|
393 |
-
*
|
394 |
-
* @uses $wpdb To save the posted snippet to the database
|
395 |
-
* @uses wp_redirect To pass the results to the page
|
396 |
-
*/
|
397 |
-
function load_single_menu() {
|
398 |
-
global $code_snippets;
|
399 |
-
$screen = get_current_screen();
|
400 |
-
|
401 |
-
/* Make sure the user has permission to be here */
|
402 |
-
$this->check_perms();
|
403 |
-
|
404 |
-
/* Create the snippet tables if they don't exist */
|
405 |
-
$code_snippets->maybe_create_tables( true, true );
|
406 |
-
|
407 |
-
/* Load the screen help tabs */
|
408 |
-
$this->load_help_tabs( 'single' );
|
409 |
-
|
410 |
-
/* Enqueue the code editor and other scripts and styles */
|
411 |
-
add_filter( 'admin_enqueue_scripts', array( $this, 'single_menu_enqueue_scripts' ) );
|
412 |
-
|
413 |
-
/* Make sure the nonce validates before we do any snippet ops */
|
414 |
-
if ( ! isset( $_REQUEST['_wpnonce'] ) || ! wp_verify_nonce( $_REQUEST['_wpnonce'], 'save_snippet' ) ) {
|
415 |
-
return;
|
416 |
-
}
|
417 |
-
|
418 |
-
/* Save the snippet if one has been submitted */
|
419 |
-
if ( isset( $_POST['save_snippet'] ) || isset( $_POST['save_snippet_activate'] ) || isset( $_POST['save_snippet_deactivate'] ) ) {
|
420 |
-
|
421 |
-
/* Activate or deactivate the snippet before saving if we clicked the button */
|
422 |
-
if ( isset( $_POST['save_snippet_activate'] ) ) {
|
423 |
-
$_POST['snippet_active'] = 1;
|
424 |
-
} elseif ( isset( $_POST['save_snippet_deactivate'] ) ) {
|
425 |
-
$_POST['snippet_active'] = 0;
|
426 |
-
}
|
427 |
-
|
428 |
-
/* Save the snippet to the database */
|
429 |
-
$result = $code_snippets->save_snippet( stripslashes_deep( $_POST ) );
|
430 |
-
|
431 |
-
/* Strip old status query vars from URL */
|
432 |
-
$_SERVER['REQUEST_URI'] = remove_query_arg( array( 'added', 'updated', 'activated', 'deactivated', 'invalid' ) );
|
433 |
-
|
434 |
-
/* Build the status message and redirect */
|
435 |
-
|
436 |
-
if ( $result && isset( $_POST['save_snippet_activate'] ) ) {
|
437 |
-
/* Snippet was activated addition to saving*/
|
438 |
-
$_SERVER['REQUEST_URI'] = add_query_arg( 'activated', true );
|
439 |
-
}
|
440 |
-
elseif ( $result && isset( $_POST['save_snippet_deactivate'] ) ) {
|
441 |
-
/* Snippet was deactivated addition to saving*/
|
442 |
-
$_SERVER['REQUEST_URI'] = add_query_arg( 'deactivated', true );
|
443 |
-
}
|
444 |
-
|
445 |
-
if ( ! $result || $result < 1 ) {
|
446 |
-
/* An error occurred */
|
447 |
-
wp_redirect( add_query_arg( 'invalid', true ) );
|
448 |
-
}
|
449 |
-
elseif ( isset( $_POST['snippet_id'] ) ) {
|
450 |
-
/* Existing snippet was updated */
|
451 |
-
wp_redirect( add_query_arg( array( 'edit' => $result, 'updated' => true ) ) );
|
452 |
-
}
|
453 |
-
else {
|
454 |
-
/* New snippet was added */
|
455 |
-
wp_redirect( add_query_arg( array( 'edit' => $result, 'added' => true ) ) );
|
456 |
-
}
|
457 |
-
}
|
458 |
-
|
459 |
-
/* Delete the snippet if the button was clicked */
|
460 |
-
elseif ( isset( $_POST['snippet_id'], $_POST['delete_snippet'] ) ) {
|
461 |
-
$code_snippets->delete_snippet( $_POST['snippet_id'] );
|
462 |
-
wp_redirect( add_query_arg( 'delete', true, $this->manage_url ) );
|
463 |
-
}
|
464 |
-
|
465 |
-
/* Export the snippet if the button was clicked */
|
466 |
-
elseif ( isset( $_POST['snippet_id'], $_POST['export_snippet'] ) ) {
|
467 |
-
$code_snippets->export( $_POST['snippet_id'] );
|
468 |
-
}
|
469 |
-
}
|
470 |
-
|
471 |
-
/**
|
472 |
-
* Registers and loads the code editor's scripts
|
473 |
-
*
|
474 |
-
* @since 1.7
|
475 |
-
* @access private
|
476 |
-
*
|
477 |
-
* @uses wp_register_script()
|
478 |
-
* @uses wp_register_style()
|
479 |
-
* @uses wp_enqueue_script() To add the scripts to the queue
|
480 |
-
* @uses wp_enqueue_style() To add the stylesheets to the queue
|
481 |
-
*
|
482 |
-
* @param string $hook The current page hook, to be compared with the single snippet page hook
|
483 |
-
* @return void
|
484 |
-
*/
|
485 |
-
function single_menu_enqueue_scripts( $hook ) {
|
486 |
-
global $code_snippets;
|
487 |
-
|
488 |
-
/* If we're not on the right admin page, bail early */
|
489 |
-
if ( $hook !== $this->single_page )
|
490 |
-
return;
|
491 |
-
|
492 |
-
/* Remove other CodeMirror styles */
|
493 |
-
wp_deregister_style( 'codemirror' );
|
494 |
-
wp_deregister_style( 'wpeditor' );
|
495 |
-
|
496 |
-
/* CodeMirror */
|
497 |
-
|
498 |
-
$codemirror_version = '3.20.0';
|
499 |
-
$codemirror_url = plugins_url( 'vendor/codemirror/', $code_snippets->file );
|
500 |
-
|
501 |
-
wp_enqueue_style(
|
502 |
-
'code-snippets-codemirror',
|
503 |
-
$codemirror_url . 'lib/codemirror.css',
|
504 |
-
false,
|
505 |
-
$codemirror_version
|
506 |
-
);
|
507 |
-
|
508 |
-
wp_enqueue_script(
|
509 |
-
'code-snippets-codemirror',
|
510 |
-
$codemirror_url . 'lib/codemirror.js',
|
511 |
-
false,
|
512 |
-
$codemirror_version
|
513 |
-
);
|
514 |
-
|
515 |
-
/* CodeMirror Modes */
|
516 |
-
|
517 |
-
wp_enqueue_script(
|
518 |
-
'code-snippets-codemirror-mode-clike',
|
519 |
-
$codemirror_url . 'mode/clike/clike.js',
|
520 |
-
array( 'code-snippets-codemirror' ),
|
521 |
-
$codemirror_version
|
522 |
-
);
|
523 |
-
|
524 |
-
wp_enqueue_script(
|
525 |
-
'code-snippets-codemirror-mode-php',
|
526 |
-
$codemirror_url . 'mode/php/php.js',
|
527 |
-
array( 'code-snippets-codemirror', 'code-snippets-codemirror-mode-clike' ),
|
528 |
-
$codemirror_version
|
529 |
-
);
|
530 |
-
|
531 |
-
|
532 |
-
/* CodeMirror Addons */
|
533 |
-
|
534 |
-
wp_enqueue_script(
|
535 |
-
'code-snippets-codemirror-addon-searchcursor',
|
536 |
-
$codemirror_url . 'addon/search/searchcursor.js',
|
537 |
-
array( 'code-snippets-codemirror' ),
|
538 |
-
$codemirror_version
|
539 |
-
);
|
540 |
-
|
541 |
-
wp_enqueue_script(
|
542 |
-
'code-snippets-codemirror-addon-search',
|
543 |
-
$codemirror_url . 'addon/search/search.js',
|
544 |
-
array( 'code-snippets-codemirror', 'code-snippets-codemirror-addon-searchcursor' ),
|
545 |
-
$codemirror_version
|
546 |
-
);
|
547 |
-
|
548 |
-
wp_enqueue_script(
|
549 |
-
'code-snippets-codemirror-addon-matchbrackets',
|
550 |
-
$codemirror_url . 'addon/edit/matchbrackets.js',
|
551 |
-
array( 'code-snippets-codemirror' ),
|
552 |
-
$codemirror_version
|
553 |
-
);
|
554 |
-
|
555 |
-
/* Plugin Assets */
|
556 |
-
|
557 |
-
wp_enqueue_style(
|
558 |
-
'code-snippets-admin-single',
|
559 |
-
plugins_url( 'assets/css/admin-single.css', $code_snippets->file ),
|
560 |
-
false,
|
561 |
-
$code_snippets->version
|
562 |
-
);
|
563 |
-
|
564 |
-
wp_enqueue_script(
|
565 |
-
'code-snippets-admin-single',
|
566 |
-
plugins_url( 'assets/js/admin-single.js', $code_snippets->file ),
|
567 |
-
array( 'code-snippets-codemirror' ),
|
568 |
-
$code_snippets->version,
|
569 |
-
true // Load in footer
|
570 |
-
);
|
571 |
-
}
|
572 |
-
|
573 |
-
/**
|
574 |
-
* Processes import files and loads the help tabs for the Import Snippets page
|
575 |
-
*
|
576 |
-
* @since 1.3
|
577 |
-
*
|
578 |
-
* @uses $code_snippets->import() To process the import file
|
579 |
-
* @uses wp_redirect() To pass the import results to the page
|
580 |
-
* @uses add_query_arg() To append the results to the current URI
|
581 |
-
* @uses $this->load_help_tabs() To load the screen contextual help tabs
|
582 |
-
*
|
583 |
-
* @param string $file A filesystem path to the import file
|
584 |
-
* @return void
|
585 |
-
*/
|
586 |
-
function load_import_menu() {
|
587 |
-
global $code_snippets;
|
588 |
-
|
589 |
-
/* Make sure the user has permission to be here */
|
590 |
-
$this->check_perms();
|
591 |
-
|
592 |
-
/* Create the snippet tables if they don't exist */
|
593 |
-
$code_snippets->maybe_create_tables( true, true );
|
594 |
-
|
595 |
-
/* Process import files */
|
596 |
-
|
597 |
-
if ( isset( $_FILES['code_snippets_import_file']['tmp_name'] ) ) {
|
598 |
-
|
599 |
-
/* Import the snippets. The result is the number of snippets that were imported */
|
600 |
-
$result = $code_snippets->import( $_FILES['code_snippets_import_file']['tmp_name'] );
|
601 |
-
|
602 |
-
/* Send the amount of imported snippets to the page */
|
603 |
-
if ( false === $result ) {
|
604 |
-
wp_redirect( add_query_arg( 'error', true ) );
|
605 |
-
} else {
|
606 |
-
wp_redirect( add_query_arg( 'imported', $result ) );
|
607 |
-
}
|
608 |
-
}
|
609 |
-
|
610 |
-
/* Load the screen help tabs */
|
611 |
-
$this->load_help_tabs( 'import' );
|
612 |
-
}
|
613 |
-
|
614 |
-
/**
|
615 |
-
* Displays the manage snippets page
|
616 |
-
*
|
617 |
-
* @since 1.0
|
618 |
-
* @access private
|
619 |
-
* @uses $this->get_view() To load an admin view template
|
620 |
-
* @return void
|
621 |
-
*/
|
622 |
-
function display_manage_menu() {
|
623 |
-
$this->get_view( 'manage' );
|
624 |
-
}
|
625 |
-
|
626 |
-
/**
|
627 |
-
* Displays the single snippet page
|
628 |
-
*
|
629 |
-
* @since 1.0
|
630 |
-
* @access private
|
631 |
-
* @uses $this->get_view() To load an admin view template
|
632 |
-
* @return void
|
633 |
-
*/
|
634 |
-
function display_single_menu() {
|
635 |
-
$this->get_view( 'single' );
|
636 |
-
}
|
637 |
-
|
638 |
-
/**
|
639 |
-
* Displays the import snippets page
|
640 |
-
*
|
641 |
-
* @since 1.3
|
642 |
-
* @access private
|
643 |
-
* @uses $this->get_view() To load an admin view template
|
644 |
-
* @return void
|
645 |
-
*/
|
646 |
-
function display_import_menu() {
|
647 |
-
$this->get_view( 'import' );
|
648 |
-
}
|
649 |
-
|
650 |
-
/**
|
651 |
-
* Add a description editor to the single snippet page
|
652 |
-
*
|
653 |
-
* @since 1.7
|
654 |
-
* @access private
|
655 |
-
* @param object $snippet The snippet being used for this page
|
656 |
-
* @return void
|
657 |
-
*/
|
658 |
-
function description_editor_box( $snippet ) {
|
659 |
-
|
660 |
-
?>
|
661 |
-
|
662 |
-
<label for="snippet_description">
|
663 |
-
<h3><div><?php _e( 'Description', 'code-snippets' ); ?></div></h3>
|
664 |
-
</label>
|
665 |
-
|
666 |
-
<?php
|
667 |
-
|
668 |
-
remove_editor_styles(); // stop custom theme styling interfering with the editor
|
669 |
-
|
670 |
-
wp_editor(
|
671 |
-
$snippet->description,
|
672 |
-
'description',
|
673 |
-
apply_filters( 'code_snippets/admin/description_editor_settings', array(
|
674 |
-
'textarea_name' => 'snippet_description',
|
675 |
-
'textarea_rows' => 10,
|
676 |
-
'teeny' => true,
|
677 |
-
'media_buttons' => false,
|
678 |
-
) )
|
679 |
-
);
|
680 |
-
}
|
681 |
-
|
682 |
-
/**
|
683 |
-
* Adds a link pointing to the Manage Snippets page
|
684 |
-
*
|
685 |
-
* @since 1.0
|
686 |
-
* @access private
|
687 |
-
* @param array $links The existing plugin action links
|
688 |
-
* @return array The modified plugin action links
|
689 |
-
*/
|
690 |
-
function settings_link( $links ) {
|
691 |
-
array_unshift( $links, sprintf(
|
692 |
-
'<a href="%1$s" title="%2$s">%3$s</a>',
|
693 |
-
$this->manage_url,
|
694 |
-
__( 'Manage your existing snippets', 'code-snippets' ),
|
695 |
-
__( 'Manage', 'code-snippets' )
|
696 |
-
) );
|
697 |
-
return $links;
|
698 |
-
}
|
699 |
-
|
700 |
-
/**
|
701 |
-
* Adds extra links related to the plugin
|
702 |
-
*
|
703 |
-
* @since 1.2
|
704 |
-
* @access private
|
705 |
-
* @param array $links The existing plugin info links
|
706 |
-
* @param string $file The plugin the links are for
|
707 |
-
* @return array The modified plugin info links
|
708 |
-
*/
|
709 |
-
function plugin_meta( $links, $file ) {
|
710 |
-
global $code_snippets;
|
711 |
-
|
712 |
-
/* We only want to affect the Code Snippets plugin listing */
|
713 |
-
if ( $file !== $code_snippets->basename )
|
714 |
-
return $links;
|
715 |
-
|
716 |
-
$format = '<a href="%1$s" title="%2$s">%3$s</a>';
|
717 |
-
|
718 |
-
/* array_merge appends the links to the end */
|
719 |
-
return array_merge( $links, array(
|
720 |
-
sprintf( $format,
|
721 |
-
'http://wordpress.org/plugins/code-snippets/',
|
722 |
-
__( 'Visit the WordPress.org plugin page', 'code-snippets' ),
|
723 |
-
__( 'About', 'code-snippets' )
|
724 |
-
),
|
725 |
-
sprintf( $format,
|
726 |
-
'http://wordpress.org/support/plugin/code-snippets/',
|
727 |
-
__( 'Visit the support forums', 'code-snippets' ),
|
728 |
-
__( 'Support', 'code-snippets' )
|
729 |
-
),
|
730 |
-
sprintf( $format,
|
731 |
-
'http://code-snippets.bungeshea.com/donate/',
|
732 |
-
__("Support this plugin's development", 'code-snippets' ),
|
733 |
-
__( 'Donate', 'code-snippets' )
|
734 |
-
)
|
735 |
-
) );
|
736 |
-
}
|
737 |
-
|
738 |
-
/**
|
739 |
-
* Print a notice inviting people to participate in the Code Snippets Survey
|
740 |
-
*
|
741 |
-
* @since 1.9
|
742 |
-
* @return void
|
743 |
-
*/
|
744 |
-
function survey_message() {
|
745 |
-
global $current_user;
|
746 |
-
|
747 |
-
$key = 'ignore_code_snippets_survey_message';
|
748 |
-
|
749 |
-
/* Bail now if the user has dismissed the message */
|
750 |
-
if ( get_user_meta( $current_user->ID, $key ) ) {
|
751 |
-
return;
|
752 |
-
}
|
753 |
-
elseif ( isset( $_GET[ $key ], $_REQUEST['_wpnonce'] ) && wp_verify_nonce( $_REQUEST['_wpnonce'], $key ) ) {
|
754 |
-
add_user_meta( $current_user->ID, $key, true, true );
|
755 |
-
return;
|
756 |
-
}
|
757 |
-
|
758 |
-
?>
|
759 |
-
|
760 |
-
<br />
|
761 |
-
|
762 |
-
<div class="updated"><p>
|
763 |
-
|
764 |
-
<?php _e( "<strong>Have feedback on Code Snippets?</strong> Please take the time to answer a short survey on how you use this plugin and what you'd like to see changed or added in the future.", 'code-snippets' ); ?>
|
765 |
-
|
766 |
-
<a href="http://code-snippets.bungeshea.com/survey/" class="button secondary" target="_blank" style="margin: auto .5em;">
|
767 |
-
<?php _e( 'Take the survey now', 'code-snippets' ); ?>
|
768 |
-
</a>
|
769 |
-
|
770 |
-
<a href="<?php echo wp_nonce_url( add_query_arg( $key, true ), $key ); ?>">Dismiss</a>
|
771 |
-
|
772 |
-
</p></div>
|
773 |
-
|
774 |
-
<?php
|
775 |
-
}
|
776 |
-
|
777 |
-
} // end of class
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
includes/class-export-php.php
DELETED
@@ -1,78 +0,0 @@
|
|
1 |
-
<?php
|
2 |
-
|
3 |
-
/**
|
4 |
-
* This file handles exporting snippets in PHP format
|
5 |
-
*
|
6 |
-
* It's better to call the $code_snippets->export_php()
|
7 |
-
* method than directly using this class
|
8 |
-
*
|
9 |
-
* @since 1.9
|
10 |
-
* @package Code_Snippets
|
11 |
-
* @subpackage Export
|
12 |
-
*/
|
13 |
-
|
14 |
-
if ( ! class_exists( 'Code_Snippets_Export_PHP' ) ) :
|
15 |
-
|
16 |
-
/**
|
17 |
-
* Exports selected snippets to a XML or PHP file.
|
18 |
-
*
|
19 |
-
* @since 1.3
|
20 |
-
* @param array $ids The IDs of the snippets to export
|
21 |
-
* @param string $format The format of the export file
|
22 |
-
* @return void
|
23 |
-
*/
|
24 |
-
class Code_Snippets_Export_PHP extends Code_Snippets_Export {
|
25 |
-
|
26 |
-
/**
|
27 |
-
* Constructor function
|
28 |
-
* @param array $ids The IDs of the snippets to export
|
29 |
-
* @param string $table The name of the table to fetch snippets from
|
30 |
-
*/
|
31 |
-
public function __construct( array $ids, $table ) {
|
32 |
-
add_filter( 'code_snippets/export/filename', array( $this, 'replace_filename_extension' ) );
|
33 |
-
parent::__construct( $ids, $table );
|
34 |
-
}
|
35 |
-
|
36 |
-
/**
|
37 |
-
* Replace the .xml file extension with a .php file extension
|
38 |
-
* @param string $filename The filename with a .xml extension
|
39 |
-
* @return string The filename with a .php extension
|
40 |
-
*/
|
41 |
-
public function replace_filename_extension( $filename ) {
|
42 |
-
$filename = str_replace( '.xml', '.php', $filename );
|
43 |
-
return $filename;
|
44 |
-
}
|
45 |
-
|
46 |
-
/**
|
47 |
-
* Begin the export file
|
48 |
-
*/
|
49 |
-
protected function do_header() {
|
50 |
-
echo '<?php';
|
51 |
-
}
|
52 |
-
|
53 |
-
/**
|
54 |
-
* Output a single snippet
|
55 |
-
* @param array $snippet
|
56 |
-
*/
|
57 |
-
protected function do_item( $snippet ) {
|
58 |
-
|
59 |
-
echo "\n/**\n * {$snippet['name']}\n";
|
60 |
-
|
61 |
-
if ( ! empty( $snippet['description'] ) ) {
|
62 |
-
|
63 |
-
/* Convert description to PhpDoc */
|
64 |
-
$desc = strip_tags( str_replace( "\n", "\n * ", $snippet['description'] ) );
|
65 |
-
|
66 |
-
echo " *\n * $desc\n";
|
67 |
-
}
|
68 |
-
|
69 |
-
echo " */\n{$snippet['code']}\n";
|
70 |
-
}
|
71 |
-
|
72 |
-
/**
|
73 |
-
* Finish off the file
|
74 |
-
*/
|
75 |
-
protected function do_footer() {}
|
76 |
-
}
|
77 |
-
|
78 |
-
endif; // class exists check
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
includes/class-export.php
CHANGED
@@ -1,23 +1,13 @@
|
|
1 |
<?php
|
2 |
|
3 |
/**
|
4 |
-
*
|
5 |
*
|
6 |
* It's better to call the export_snippets()
|
7 |
* function than directly using this class
|
8 |
*
|
9 |
-
* @since
|
10 |
-
* @package
|
11 |
-
* @subpackage Export
|
12 |
-
*/
|
13 |
-
|
14 |
-
/**
|
15 |
-
* Exports selected snippets to a XML or PHP file.
|
16 |
-
*
|
17 |
-
* @since 1.3
|
18 |
-
* @param array $ids The IDs of the snippets to export
|
19 |
-
* @param string $format The format of the export file
|
20 |
-
* @return void
|
21 |
*/
|
22 |
class Code_Snippets_Export {
|
23 |
|
@@ -36,35 +26,35 @@ class Code_Snippets_Export {
|
|
36 |
/**
|
37 |
* The export file format.
|
38 |
* Either 'xml' or 'php'
|
39 |
-
* @var
|
40 |
*/
|
41 |
protected $format;
|
42 |
|
43 |
/**
|
44 |
* The DOM document.
|
45 |
* Only used in XML exports
|
46 |
-
* @var
|
47 |
*/
|
48 |
protected $dom;
|
49 |
|
50 |
/**
|
51 |
* The DOM document root element
|
52 |
* Only used in XML exports
|
53 |
-
* @var
|
54 |
*/
|
55 |
protected $root;
|
56 |
|
57 |
/**
|
58 |
* Constructor function
|
59 |
-
*
|
60 |
-
* @param
|
61 |
-
* @param
|
|
|
62 |
*/
|
63 |
public function __construct( $ids, $table, $format = 'xml' ) {
|
64 |
$this->snippet_ids = (array) $ids;
|
65 |
$this->table_name = $table;
|
66 |
$this->format = 'php' === $format ? 'php' : 'xml';
|
67 |
-
$this->exclude_fields = apply_filters( 'code_snippets/export/exclude_from_export', array( 'id', 'active' ) );
|
68 |
}
|
69 |
|
70 |
/**
|
@@ -75,21 +65,16 @@ class Code_Snippets_Export {
|
|
75 |
|
76 |
if ( 1 == count( $this->snippet_ids ) ) {
|
77 |
/* If there is only snippet to export, use its name instead of the site name */
|
78 |
-
$snippet
|
79 |
-
$
|
80 |
} else {
|
81 |
/* Otherwise, use the site name as set in Settings > General */
|
82 |
-
$
|
83 |
}
|
84 |
|
85 |
-
|
86 |
-
$filename =
|
87 |
-
|
88 |
-
"{$sitename}.code-snippets.{$this->format}",
|
89 |
-
$sitename
|
90 |
-
) );
|
91 |
-
|
92 |
-
return $filename;
|
93 |
}
|
94 |
|
95 |
/**
|
@@ -100,7 +85,7 @@ class Code_Snippets_Export {
|
|
100 |
/* Array of translated comment lines */
|
101 |
$lines = array(
|
102 |
__( 'This is a code snippets export file generated by the Code Snippets WordPress plugin.', 'code-snippets' ),
|
103 |
-
|
104 |
__( 'To import these snippets a WordPress site follow these steps:', 'code-snippets' ),
|
105 |
__( '1. Log in to that site as an administrator.', 'code-snippets' ),
|
106 |
__( '2. Install the Code Snippets plugin using the directions provided at the above link.', 'code-snippets' ),
|
@@ -142,8 +127,8 @@ class Code_Snippets_Export {
|
|
142 |
if ( 'xml' === $this->format ) {
|
143 |
|
144 |
/* Create the root element */
|
145 |
-
$
|
146 |
-
$this->root = $this->dom->appendChild( $
|
147 |
}
|
148 |
|
149 |
/* Loop through the snippets */
|
@@ -151,6 +136,7 @@ class Code_Snippets_Export {
|
|
151 |
|
152 |
/* Grab the snippet from the database */
|
153 |
$snippet = $wpdb->get_row( $wpdb->prepare( "SELECT * FROM {$this->table_name} WHERE id = %d", $id ), ARRAY_A );
|
|
|
154 |
|
155 |
/* Process the snippet item */
|
156 |
if ( 'php' === $this->format ) {
|
@@ -163,45 +149,54 @@ class Code_Snippets_Export {
|
|
163 |
|
164 |
/**
|
165 |
* Append a single snippet item to the document
|
166 |
-
* @param
|
167 |
*/
|
168 |
-
protected function do_item( $snippet ) {
|
169 |
-
$
|
170 |
-
$item = $this->root->appendChild( $
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
171 |
|
172 |
-
|
173 |
|
174 |
-
|
175 |
-
if ( in_array( $field_name, $this->exclude_fields ) ) {
|
176 |
-
continue;
|
177 |
-
}
|
178 |
|
179 |
/* Create a new element for each field */
|
180 |
-
$
|
181 |
-
$field = $item->appendChild( $
|
182 |
|
183 |
-
/* Add the field
|
184 |
$value = $this->dom->createTextNode( $field_value );
|
185 |
-
$
|
186 |
}
|
187 |
}
|
188 |
|
189 |
/**
|
190 |
* Format single snippet item as PHP code
|
191 |
-
* @param
|
192 |
*/
|
193 |
-
protected function do_item_php( $snippet ) {
|
194 |
-
echo "\n/**\n * {$snippet
|
195 |
|
196 |
-
if ( ! empty( $snippet
|
197 |
|
198 |
/* Convert description to PhpDoc */
|
199 |
-
$desc = strip_tags( str_replace( "\n", "\n * ", $snippet
|
200 |
|
201 |
echo " *\n * $desc\n";
|
202 |
}
|
203 |
|
204 |
-
echo " */\n{$snippet
|
205 |
}
|
206 |
|
207 |
/**
|
1 |
<?php
|
2 |
|
3 |
/**
|
4 |
+
* Exports selected snippets to a XML or PHP file.
|
5 |
*
|
6 |
* It's better to call the export_snippets()
|
7 |
* function than directly using this class
|
8 |
*
|
9 |
+
* @since 1.9
|
10 |
+
* @package Code_Snippets
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
11 |
*/
|
12 |
class Code_Snippets_Export {
|
13 |
|
26 |
/**
|
27 |
* The export file format.
|
28 |
* Either 'xml' or 'php'
|
29 |
+
* @var string
|
30 |
*/
|
31 |
protected $format;
|
32 |
|
33 |
/**
|
34 |
* The DOM document.
|
35 |
* Only used in XML exports
|
36 |
+
* @var DOMDocument
|
37 |
*/
|
38 |
protected $dom;
|
39 |
|
40 |
/**
|
41 |
* The DOM document root element
|
42 |
* Only used in XML exports
|
43 |
+
* @var DOMElement
|
44 |
*/
|
45 |
protected $root;
|
46 |
|
47 |
/**
|
48 |
* Constructor function
|
49 |
+
*
|
50 |
+
* @param array $ids The IDs of the snippets to export
|
51 |
+
* @param string $table The name of the table to fetch snippets from
|
52 |
+
* @param string $format The format of the export file
|
53 |
*/
|
54 |
public function __construct( $ids, $table, $format = 'xml' ) {
|
55 |
$this->snippet_ids = (array) $ids;
|
56 |
$this->table_name = $table;
|
57 |
$this->format = 'php' === $format ? 'php' : 'xml';
|
|
|
58 |
}
|
59 |
|
60 |
/**
|
65 |
|
66 |
if ( 1 == count( $this->snippet_ids ) ) {
|
67 |
/* If there is only snippet to export, use its name instead of the site name */
|
68 |
+
$snippet = get_snippet( $this->snippet_ids[0], $this->table_name );
|
69 |
+
$title = strtolower( $snippet->name );
|
70 |
} else {
|
71 |
/* Otherwise, use the site name as set in Settings > General */
|
72 |
+
$title = strtolower( get_bloginfo( 'name' ) );
|
73 |
}
|
74 |
|
75 |
+
$filename = "{$title}.code-snippets.{$this->format}";
|
76 |
+
$filename = apply_filters( 'code_snippets/export/filename', $filename, $title );
|
77 |
+
return sanitize_file_name( $filename );
|
|
|
|
|
|
|
|
|
|
|
78 |
}
|
79 |
|
80 |
/**
|
85 |
/* Array of translated comment lines */
|
86 |
$lines = array(
|
87 |
__( 'This is a code snippets export file generated by the Code Snippets WordPress plugin.', 'code-snippets' ),
|
88 |
+
'https://wordpress.org/plugins/code-snippets',
|
89 |
__( 'To import these snippets a WordPress site follow these steps:', 'code-snippets' ),
|
90 |
__( '1. Log in to that site as an administrator.', 'code-snippets' ),
|
91 |
__( '2. Install the Code Snippets plugin using the directions provided at the above link.', 'code-snippets' ),
|
127 |
if ( 'xml' === $this->format ) {
|
128 |
|
129 |
/* Create the root element */
|
130 |
+
$root_element = $this->dom->createElement( 'snippets' );
|
131 |
+
$this->root = $this->dom->appendChild( $root_element );
|
132 |
}
|
133 |
|
134 |
/* Loop through the snippets */
|
136 |
|
137 |
/* Grab the snippet from the database */
|
138 |
$snippet = $wpdb->get_row( $wpdb->prepare( "SELECT * FROM {$this->table_name} WHERE id = %d", $id ), ARRAY_A );
|
139 |
+
$snippet = new Snippet( $snippet );
|
140 |
|
141 |
/* Process the snippet item */
|
142 |
if ( 'php' === $this->format ) {
|
149 |
|
150 |
/**
|
151 |
* Append a single snippet item to the document
|
152 |
+
* @param Snippet $snippet
|
153 |
*/
|
154 |
+
protected function do_item( Snippet $snippet ) {
|
155 |
+
$item_element = $this->dom->createElement( 'snippet' );
|
156 |
+
$item = $this->root->appendChild( $item_element );
|
157 |
+
|
158 |
+
/* Set the scope attribute */
|
159 |
+
/** @var $item DOMElement */
|
160 |
+
$item->setAttribute( 'scope', $snippet->scope );
|
161 |
+
|
162 |
+
/* Fields to include in the export file */
|
163 |
+
$fields = array(
|
164 |
+
'name' => $snippet->name,
|
165 |
+
'desc' => $snippet->desc,
|
166 |
+
'tags' => $snippet->tags_list,
|
167 |
+
'code' => $snippet->code,
|
168 |
+
);
|
169 |
|
170 |
+
$fields = apply_filters( 'code_snippets/export/xml_fields', $fields, $snippet );
|
171 |
|
172 |
+
foreach ( $fields as $field_name => $field_value ) {
|
|
|
|
|
|
|
173 |
|
174 |
/* Create a new element for each field */
|
175 |
+
$field_element = $this->dom->createElement( $field_name );
|
176 |
+
$field = $item->appendChild( $field_element );
|
177 |
|
178 |
+
/* Add the field content */
|
179 |
$value = $this->dom->createTextNode( $field_value );
|
180 |
+
$field->appendChild( $value );
|
181 |
}
|
182 |
}
|
183 |
|
184 |
/**
|
185 |
* Format single snippet item as PHP code
|
186 |
+
* @param Snippet $snippet
|
187 |
*/
|
188 |
+
protected function do_item_php( Snippet $snippet ) {
|
189 |
+
echo "\n/**\n * {$snippet->name}\n";
|
190 |
|
191 |
+
if ( ! empty( $snippet->desc ) ) {
|
192 |
|
193 |
/* Convert description to PhpDoc */
|
194 |
+
$desc = strip_tags( str_replace( "\n", "\n * ", $snippet->desc ) );
|
195 |
|
196 |
echo " *\n * $desc\n";
|
197 |
}
|
198 |
|
199 |
+
echo " */\n{$snippet->code}\n";
|
200 |
}
|
201 |
|
202 |
/**
|
includes/class-list-table.php
CHANGED
@@ -1,708 +1,993 @@
|
|
1 |
-
<?php
|
2 |
-
|
3 |
-
/**
|
4 |
-
* Contains the class for handling the
|
5 |
-
*
|
6 |
-
* @package
|
7 |
-
|
8 |
-
|
9 |
-
|
10 |
-
|
11 |
-
|
12 |
-
|
13 |
-
|
14 |
-
|
15 |
-
|
16 |
-
*
|
17 |
-
*
|
18 |
-
* @
|
19 |
-
|
20 |
-
|
21 |
-
|
22 |
-
|
23 |
-
|
24 |
-
|
25 |
-
|
26 |
-
|
27 |
-
|
28 |
-
|
29 |
-
|
30 |
-
*
|
31 |
-
|
32 |
-
|
33 |
-
|
34 |
-
|
35 |
-
|
36 |
-
|
37 |
-
|
38 |
-
|
39 |
-
|
40 |
-
|
41 |
-
|
42 |
-
|
43 |
-
|
44 |
-
|
45 |
-
|
46 |
-
|
47 |
-
|
48 |
-
|
49 |
-
|
50 |
-
|
51 |
-
'
|
52 |
-
|
53 |
-
|
54 |
-
/*
|
55 |
-
|
56 |
-
|
57 |
-
|
58 |
-
|
59 |
-
|
60 |
-
|
61 |
-
|
62 |
-
|
63 |
-
/*
|
64 |
-
$
|
65 |
-
|
66 |
-
|
67 |
-
|
68 |
-
|
69 |
-
|
70 |
-
|
71 |
-
|
72 |
-
|
73 |
-
|
74 |
-
|
75 |
-
|
76 |
-
|
77 |
-
|
78 |
-
|
79 |
-
|
80 |
-
|
81 |
-
|
82 |
-
|
83 |
-
|
84 |
-
|
85 |
-
|
86 |
-
|
87 |
-
|
88 |
-
|
89 |
-
|
90 |
-
|
91 |
-
|
92 |
-
|
93 |
-
|
94 |
-
|
95 |
-
|
96 |
-
|
97 |
-
|
98 |
-
|
99 |
-
|
100 |
-
|
101 |
-
|
102 |
-
}
|
103 |
-
|
104 |
-
/**
|
105 |
-
*
|
106 |
-
*
|
107 |
-
* @param
|
108 |
-
* @return
|
109 |
-
*/
|
110 |
-
function
|
111 |
-
|
112 |
-
|
113 |
-
|
114 |
-
|
115 |
-
|
116 |
-
|
117 |
-
|
118 |
-
|
119 |
-
|
120 |
-
|
121 |
-
|
122 |
-
|
123 |
-
|
124 |
-
|
125 |
-
|
126 |
-
|
127 |
-
|
128 |
-
|
129 |
-
|
130 |
-
|
131 |
-
|
132 |
-
|
133 |
-
|
134 |
-
|
135 |
-
|
136 |
-
|
137 |
-
|
138 |
-
|
139 |
-
|
140 |
-
|
141 |
-
|
142 |
-
|
143 |
-
|
144 |
-
|
145 |
-
|
146 |
-
)
|
147 |
-
|
148 |
-
|
149 |
-
|
150 |
-
|
151 |
-
|
152 |
-
|
153 |
-
|
154 |
-
|
155 |
-
)
|
156 |
-
|
157 |
-
|
158 |
-
|
159 |
-
|
160 |
-
|
161 |
-
|
162 |
-
|
163 |
-
|
164 |
-
|
165 |
-
|
166 |
-
|
167 |
-
|
168 |
-
|
169 |
-
|
170 |
-
|
171 |
-
|
172 |
-
|
173 |
-
$actions
|
174 |
-
|
175 |
-
|
176 |
-
|
177 |
-
|
178 |
-
|
179 |
-
|
180 |
-
|
181 |
-
|
182 |
-
|
183 |
-
'
|
184 |
-
) )
|
185 |
-
|
186 |
-
|
187 |
-
|
188 |
-
|
189 |
-
|
190 |
-
|
191 |
-
|
192 |
-
|
193 |
-
|
194 |
-
|
195 |
-
|
196 |
-
|
197 |
-
|
198 |
-
|
199 |
-
|
200 |
-
|
201 |
-
|
202 |
-
|
203 |
-
|
204 |
-
|
205 |
-
|
206 |
-
|
207 |
-
|
208 |
-
|
209 |
-
|
210 |
-
|
211 |
-
|
212 |
-
|
213 |
-
'
|
214 |
-
|
215 |
-
|
216 |
-
|
217 |
-
|
218 |
-
|
219 |
-
|
220 |
-
|
221 |
-
|
222 |
-
|
223 |
-
|
224 |
-
|
225 |
-
|
226 |
-
|
227 |
-
|
228 |
-
|
229 |
-
|
230 |
-
|
231 |
-
|
232 |
-
|
233 |
-
|
234 |
-
*
|
235 |
-
* @
|
236 |
-
|
237 |
-
|
238 |
-
|
239 |
-
|
240 |
-
|
241 |
-
|
242 |
-
|
243 |
-
|
244 |
-
|
245 |
-
|
246 |
-
|
247 |
-
|
248 |
-
|
249 |
-
|
250 |
-
|
251 |
-
|
252 |
-
|
253 |
-
|
254 |
-
|
255 |
-
|
256 |
-
|
257 |
-
|
258 |
-
|
259 |
-
|
260 |
-
|
261 |
-
|
262 |
-
|
263 |
-
|
264 |
-
|
265 |
-
|
266 |
-
|
267 |
-
|
268 |
-
|
269 |
-
|
270 |
-
|
271 |
-
|
272 |
-
|
273 |
-
|
274 |
-
|
275 |
-
|
276 |
-
|
277 |
-
|
278 |
-
|
279 |
-
|
280 |
-
|
281 |
-
|
282 |
-
|
283 |
-
|
284 |
-
|
285 |
-
|
286 |
-
|
287 |
-
*
|
288 |
-
*
|
289 |
-
*
|
290 |
-
*
|
291 |
-
* @
|
292 |
-
|
293 |
-
|
294 |
-
|
295 |
-
|
296 |
-
|
297 |
-
|
298 |
-
|
299 |
-
|
300 |
-
|
301 |
-
|
302 |
-
|
303 |
-
|
304 |
-
|
305 |
-
|
306 |
-
|
307 |
-
|
308 |
-
|
309 |
-
|
310 |
-
|
311 |
-
|
312 |
-
|
313 |
-
|
314 |
-
|
315 |
-
|
316 |
-
|
317 |
-
|
318 |
-
|
319 |
-
|
320 |
-
|
321 |
-
|
322 |
-
|
323 |
-
|
324 |
-
|
325 |
-
|
326 |
-
|
327 |
-
|
328 |
-
|
329 |
-
|
330 |
-
|
331 |
-
|
332 |
-
|
333 |
-
|
334 |
-
|
335 |
-
|
336 |
-
|
337 |
-
|
338 |
-
|
339 |
-
|
340 |
-
|
341 |
-
|
342 |
-
|
343 |
-
|
344 |
-
|
345 |
-
|
346 |
-
|
347 |
-
|
348 |
-
|
349 |
-
|
350 |
-
|
351 |
-
|
352 |
-
|
353 |
-
|
354 |
-
|
355 |
-
|
356 |
-
|
357 |
-
|
358 |
-
|
359 |
-
|
360 |
-
|
361 |
-
|
362 |
-
|
363 |
-
|
364 |
-
|
365 |
-
|
366 |
-
|
367 |
-
|
368 |
-
|
369 |
-
|
370 |
-
|
371 |
-
|
372 |
-
|
373 |
-
|
374 |
-
|
375 |
-
|
376 |
-
|
377 |
-
|
378 |
-
|
379 |
-
|
380 |
-
|
381 |
-
|
382 |
-
|
383 |
-
|
384 |
-
|
385 |
-
|
386 |
-
|
387 |
-
|
388 |
-
|
389 |
-
|
390 |
-
|
391 |
-
|
392 |
-
|
393 |
-
|
394 |
-
|
395 |
-
|
396 |
-
|
397 |
-
|
398 |
-
|
399 |
-
|
400 |
-
|
401 |
-
|
402 |
-
|
403 |
-
|
404 |
-
|
405 |
-
|
406 |
-
|
407 |
-
|
408 |
-
|
409 |
-
|
410 |
-
|
411 |
-
|
412 |
-
|
413 |
-
|
414 |
-
|
415 |
-
$
|
416 |
-
|
417 |
-
|
418 |
-
|
419 |
-
|
420 |
-
|
421 |
-
|
422 |
-
|
423 |
-
|
424 |
-
|
425 |
-
|
426 |
-
|
427 |
-
|
428 |
-
|
429 |
-
|
430 |
-
|
431 |
-
|
432 |
-
|
433 |
-
|
434 |
-
|
435 |
-
|
436 |
-
|
437 |
-
|
438 |
-
|
439 |
-
|
440 |
-
|
441 |
-
|
442 |
-
|
443 |
-
|
444 |
-
|
445 |
-
|
446 |
-
|
447 |
-
|
448 |
-
|
449 |
-
|
450 |
-
|
451 |
-
|
452 |
-
|
453 |
-
|
454 |
-
|
455 |
-
|
456 |
-
|
457 |
-
|
458 |
-
|
459 |
-
|
460 |
-
|
461 |
-
|
462 |
-
|
463 |
-
|
464 |
-
|
465 |
-
|
466 |
-
|
467 |
-
|
468 |
-
|
469 |
-
|
470 |
-
|
471 |
-
foreach( $
|
472 |
-
|
473 |
-
|
474 |
-
|
475 |
-
|
476 |
-
|
477 |
-
|
478 |
-
|
479 |
-
|
480 |
-
|
481 |
-
|
482 |
-
|
483 |
-
|
484 |
-
|
485 |
-
|
486 |
-
|
487 |
-
|
488 |
-
|
489 |
-
|
490 |
-
|
491 |
-
|
492 |
-
|
493 |
-
|
494 |
-
|
495 |
-
|
496 |
-
|
497 |
-
|
498 |
-
|
499 |
-
|
500 |
-
|
501 |
-
|
502 |
-
|
503 |
-
|
504 |
-
|
505 |
-
|
506 |
-
|
507 |
-
|
508 |
-
|
509 |
-
|
510 |
-
|
511 |
-
|
512 |
-
|
513 |
-
'
|
514 |
-
|
515 |
-
|
516 |
-
|
517 |
-
|
518 |
-
|
519 |
-
|
520 |
-
|
521 |
-
|
522 |
-
|
523 |
-
|
524 |
-
|
525 |
-
|
526 |
-
|
527 |
-
|
528 |
-
|
529 |
-
|
530 |
-
|
531 |
-
|
532 |
-
|
533 |
-
|
534 |
-
|
535 |
-
|
536 |
-
|
537 |
-
|
538 |
-
|
539 |
-
|
540 |
-
|
541 |
-
|
542 |
-
|
543 |
-
|
544 |
-
|
545 |
-
|
546 |
-
|
547 |
-
|
548 |
-
|
549 |
-
|
550 |
-
|
551 |
-
|
552 |
-
|
553 |
-
|
554 |
-
|
555 |
-
|
556 |
-
|
557 |
-
|
558 |
-
|
559 |
-
|
560 |
-
|
561 |
-
|
562 |
-
|
563 |
-
|
564 |
-
|
565 |
-
|
566 |
-
|
567 |
-
|
568 |
-
|
569 |
-
|
570 |
-
|
571 |
-
|
572 |
-
|
573 |
-
|
574 |
-
|
575 |
-
|
576 |
-
|
577 |
-
|
578 |
-
|
579 |
-
|
580 |
-
|
581 |
-
|
582 |
-
|
583 |
-
|
584 |
-
|
585 |
-
|
586 |
-
|
587 |
-
|
588 |
-
|
589 |
-
|
590 |
-
|
591 |
-
|
592 |
-
|
593 |
-
|
594 |
-
|
595 |
-
|
596 |
-
|
597 |
-
|
598 |
-
|
599 |
-
|
600 |
-
|
601 |
-
|
602 |
-
|
603 |
-
|
604 |
-
|
605 |
-
|
606 |
-
|
607 |
-
|
608 |
-
|
609 |
-
|
610 |
-
|
611 |
-
|
612 |
-
|
613 |
-
|
614 |
-
|
615 |
-
|
616 |
-
|
617 |
-
|
618 |
-
|
619 |
-
|
620 |
-
|
621 |
-
|
622 |
-
|
623 |
-
|
624 |
-
|
625 |
-
|
626 |
-
|
627 |
-
|
628 |
-
|
629 |
-
|
630 |
-
|
631 |
-
|
632 |
-
|
633 |
-
|
634 |
-
|
635 |
-
|
636 |
-
|
637 |
-
|
638 |
-
|
639 |
-
|
640 |
-
|
641 |
-
|
642 |
-
|
643 |
-
|
644 |
-
|
645 |
-
|
646 |
-
|
647 |
-
|
648 |
-
|
649 |
-
|
650 |
-
|
651 |
-
|
652 |
-
|
653 |
-
|
654 |
-
|
655 |
-
|
656 |
-
|
657 |
-
|
658 |
-
|
659 |
-
|
660 |
-
|
661 |
-
|
662 |
-
|
663 |
-
|
664 |
-
|
665 |
-
|
666 |
-
|
667 |
-
|
668 |
-
|
669 |
-
|
670 |
-
|
671 |
-
|
672 |
-
|
673 |
-
|
674 |
-
|
675 |
-
|
676 |
-
|
677 |
-
|
678 |
-
|
679 |
-
|
680 |
-
|
681 |
-
|
682 |
-
|
683 |
-
|
684 |
-
|
685 |
-
|
686 |
-
|
687 |
-
|
688 |
-
|
689 |
-
|
690 |
-
|
691 |
-
|
692 |
-
|
693 |
-
|
694 |
-
|
695 |
-
|
696 |
-
|
697 |
-
|
698 |
-
|
699 |
-
|
700 |
-
|
701 |
-
|
702 |
-
|
703 |
-
|
704 |
-
|
705 |
-
|
706 |
-
|
707 |
-
|
708 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
|
3 |
+
/**
|
4 |
+
* Contains the class for handling the snippets table
|
5 |
+
*
|
6 |
+
* @package Code_Snippets
|
7 |
+
*/
|
8 |
+
|
9 |
+
/* The WP_List_Table base class is not included by default, so we need to load it */
|
10 |
+
if ( ! class_exists( 'WP_List_Table' ) ) {
|
11 |
+
require_once ABSPATH . 'wp-admin/includes/class-wp-list-table.php';
|
12 |
+
}
|
13 |
+
|
14 |
+
/**
|
15 |
+
* This class handles the table for the manage snippets menu
|
16 |
+
*
|
17 |
+
* @since 1.5
|
18 |
+
* @package Code_Snippets
|
19 |
+
*/
|
20 |
+
class Code_Snippets_List_Table extends WP_List_Table {
|
21 |
+
|
22 |
+
/**
|
23 |
+
* true if the current screen is in the network admin
|
24 |
+
* @var bool
|
25 |
+
*/
|
26 |
+
public $is_network;
|
27 |
+
|
28 |
+
/**
|
29 |
+
* A list of statuses (views)
|
30 |
+
* @var array
|
31 |
+
*/
|
32 |
+
public $statuses = array( 'all', 'active', 'inactive', 'recently_activated' );
|
33 |
+
|
34 |
+
/**
|
35 |
+
* The constructor function for our class.
|
36 |
+
* Adds hooks, initializes variables, setups class.
|
37 |
+
*/
|
38 |
+
public function __construct() {
|
39 |
+
global $status, $page;
|
40 |
+
$screen = get_current_screen();
|
41 |
+
$this->is_network = $screen->in_admin( 'network' );
|
42 |
+
|
43 |
+
/* Determine the status */
|
44 |
+
$status = 'all';
|
45 |
+
if ( isset( $_REQUEST['status'] ) && in_array( $_REQUEST['status'], $this->statuses ) ) {
|
46 |
+
$status = $_REQUEST['status'];
|
47 |
+
}
|
48 |
+
|
49 |
+
/* Add the search query to the URL */
|
50 |
+
if ( isset( $_REQUEST['s'] ) ) {
|
51 |
+
$_SERVER['REQUEST_URI'] = add_query_arg( 's', stripslashes( $_REQUEST['s'] ) );
|
52 |
+
}
|
53 |
+
|
54 |
+
/* Add a snippets per page screen option */
|
55 |
+
$page = $this->get_pagenum();
|
56 |
+
|
57 |
+
add_screen_option( 'per_page', array(
|
58 |
+
'label' => __( 'Snippets per page', 'code-snippets' ),
|
59 |
+
'default' => 10,
|
60 |
+
'option' => 'snippets_per_page',
|
61 |
+
) );
|
62 |
+
|
63 |
+
/* Set the table columns hidden in Screen Options by default */
|
64 |
+
add_filter( "get_user_option_manage{$screen->id}columnshidden", array( $this, 'get_default_hidden_columns' ), 15 );
|
65 |
+
|
66 |
+
/* Strip the result query arg from the URL */
|
67 |
+
$_SERVER['REQUEST_URI'] = remove_query_arg( 'result' );
|
68 |
+
|
69 |
+
/* Add filters to format the snippet description in the same way the post content is formatted */
|
70 |
+
$filters = array( 'wptexturize', 'convert_smilies', 'convert_chars', 'wpautop', 'shortcode_unautop', 'capital_P_dangit' );
|
71 |
+
|
72 |
+
foreach ( $filters as $filter ) {
|
73 |
+
add_filter( 'code_snippets/list_table/print_snippet_description', $filter );
|
74 |
+
}
|
75 |
+
|
76 |
+
/* Setup the class */
|
77 |
+
parent::__construct( array(
|
78 |
+
'ajax' => true,
|
79 |
+
'plural' => 'snippets',
|
80 |
+
'singular' => 'snippet',
|
81 |
+
) );
|
82 |
+
}
|
83 |
+
|
84 |
+
/**
|
85 |
+
* Define the output of all columns that have no callback function
|
86 |
+
*
|
87 |
+
* @param Snippet $snippet The snippet used for the current row
|
88 |
+
* @param string $column_name The name of the column being printed
|
89 |
+
* @return string The content of the column to output
|
90 |
+
*/
|
91 |
+
protected function column_default( $snippet, $column_name ) {
|
92 |
+
|
93 |
+
switch ( $column_name ) {
|
94 |
+
case 'id':
|
95 |
+
return $snippet->id;
|
96 |
+
case 'description':
|
97 |
+
return empty( $snippet->description ) ? '—' :
|
98 |
+
apply_filters( 'code_snippets/list_table/column_description', $snippet->description );
|
99 |
+
default:
|
100 |
+
return apply_filters( "code_snippets/list_table/column_{$column_name}", $snippet );
|
101 |
+
}
|
102 |
+
}
|
103 |
+
|
104 |
+
/**
|
105 |
+
* Build a list of action links for individual snippets
|
106 |
+
*
|
107 |
+
* @param Snippet $snippet The current snippet
|
108 |
+
* @return array The action links HTML
|
109 |
+
*/
|
110 |
+
private function get_snippet_action_links( Snippet $snippet ) {
|
111 |
+
$actions = array();
|
112 |
+
$link_format = '<a href="%2$s">%1$s</a>';
|
113 |
+
|
114 |
+
if ( $snippet->active ) {
|
115 |
+
$actions['deactivate'] = sprintf(
|
116 |
+
$link_format,
|
117 |
+
$snippet->network ? __( 'Network Deactivate', 'code-snippets' ) : __( 'Deactivate', 'code-snippets' ),
|
118 |
+
esc_url( add_query_arg( array(
|
119 |
+
'action' => 'deactivate',
|
120 |
+
'id' => $snippet->id,
|
121 |
+
) ) )
|
122 |
+
);
|
123 |
+
} else {
|
124 |
+
$actions['activate'] = sprintf(
|
125 |
+
$link_format,
|
126 |
+
$snippet->network ? __( 'Network Activate', 'code-snippets' ) : __( 'Activate', 'code-snippets' ),
|
127 |
+
esc_url( add_query_arg( array(
|
128 |
+
'action' => 'activate',
|
129 |
+
'id' => $snippet->id,
|
130 |
+
) ) )
|
131 |
+
);
|
132 |
+
}
|
133 |
+
|
134 |
+
$actions['edit'] = sprintf(
|
135 |
+
$link_format,
|
136 |
+
__( 'Edit', 'code-snippets' ),
|
137 |
+
get_snippet_edit_url( $snippet->id )
|
138 |
+
);
|
139 |
+
|
140 |
+
$actions['export'] = sprintf(
|
141 |
+
$link_format,
|
142 |
+
__( 'Export', 'code-snippets' ),
|
143 |
+
esc_url( add_query_arg( array(
|
144 |
+
'action' => 'export',
|
145 |
+
'id' => $snippet->id,
|
146 |
+
) ) )
|
147 |
+
);
|
148 |
+
|
149 |
+
$actions['delete'] = sprintf(
|
150 |
+
'<a href="%2$s" class="delete" onclick="%3$s">%1$s</a>',
|
151 |
+
__( 'Delete', 'code-snippets' ),
|
152 |
+
esc_url( add_query_arg( array(
|
153 |
+
'action' => 'delete',
|
154 |
+
'id' => $snippet->id,
|
155 |
+
) ) ),
|
156 |
+
esc_js( sprintf(
|
157 |
+
'return confirm("%s");',
|
158 |
+
__( "You are about to permanently delete the selected item.
|
159 |
+
'Cancel' to stop, 'OK' to delete.", 'code-snippets' )
|
160 |
+
) )
|
161 |
+
);
|
162 |
+
|
163 |
+
return $actions;
|
164 |
+
}
|
165 |
+
|
166 |
+
/**
|
167 |
+
* Build a list of action links for individual shared network snippets
|
168 |
+
*
|
169 |
+
* @param Snippet $snippet The current snippet
|
170 |
+
* @return array The action links HTML
|
171 |
+
*/
|
172 |
+
private function get_shared_network_snippet_action_links( Snippet $snippet ) {
|
173 |
+
$actions = array();
|
174 |
+
$link_format = '<a href="%2$s">%1$s</a>';
|
175 |
+
|
176 |
+
/* Only add Activate/Deactivate for subsites */
|
177 |
+
if ( ! $this->is_network ) {
|
178 |
+
|
179 |
+
$action = $snippet->active ? 'deactivate' : 'activate';
|
180 |
+
$label = $snippet->active ? __( 'Deactivate', 'code-snippets' ) : __( 'Activate', 'code-snippets' );
|
181 |
+
$activate_url = add_query_arg( array(
|
182 |
+
'action' => $action . '-shared',
|
183 |
+
'id' => $snippet->id,
|
184 |
+
) );
|
185 |
+
|
186 |
+
$actions[ $action ] = sprintf( $link_format, $label, esc_url( $activate_url ) );
|
187 |
+
}
|
188 |
+
|
189 |
+
/* Don't add Edit/Export/Delete actions for if current user can't manage network snippets */
|
190 |
+
if ( ! current_user_can( apply_filters( 'code_snippets_network_cap', 'manage_network_snippets' ) ) ) {
|
191 |
+
return $actions;
|
192 |
+
}
|
193 |
+
|
194 |
+
$actions['edit'] = sprintf(
|
195 |
+
$link_format,
|
196 |
+
__( 'Edit', 'code-snippets' ),
|
197 |
+
get_snippet_edit_url( $snippet->id, 'network' )
|
198 |
+
);
|
199 |
+
|
200 |
+
$actions['export'] = sprintf(
|
201 |
+
$link_format,
|
202 |
+
__( 'Export', 'code-snippets' ),
|
203 |
+
add_query_arg(
|
204 |
+
array(
|
205 |
+
'action' => 'export',
|
206 |
+
'id' => $snippet->id,
|
207 |
+
),
|
208 |
+
code_snippets_get_menu_url( 'manage', 'network' )
|
209 |
+
)
|
210 |
+
);
|
211 |
+
|
212 |
+
$actions['delete'] = sprintf(
|
213 |
+
'<a href="%2$s" class="delete" onclick="%3$s">%1$s</a>',
|
214 |
+
__( 'Delete', 'code-snippets' ),
|
215 |
+
add_query_arg(
|
216 |
+
array(
|
217 |
+
'action' => 'delete',
|
218 |
+
'id' => $snippet->id,
|
219 |
+
),
|
220 |
+
code_snippets_get_menu_url( 'manage', 'network' )
|
221 |
+
),
|
222 |
+
esc_js( sprintf(
|
223 |
+
'return confirm("%s");',
|
224 |
+
__( "You are about to permanently delete the selected item.
|
225 |
+
'Cancel' to stop, 'OK' to delete.", 'code-snippets' )
|
226 |
+
) )
|
227 |
+
);
|
228 |
+
|
229 |
+
return $actions;
|
230 |
+
}
|
231 |
+
|
232 |
+
/**
|
233 |
+
* Build the content of the snippet name column
|
234 |
+
*
|
235 |
+
* @param Snippet $snippet The snippet being used for the current row
|
236 |
+
* @return string The content of the column to output
|
237 |
+
*/
|
238 |
+
protected function column_name( $snippet ) {
|
239 |
+
|
240 |
+
$action_links = $snippet->shared_network ?
|
241 |
+
$this->get_shared_network_snippet_action_links( $snippet ) :
|
242 |
+
$this->get_snippet_action_links( $snippet );
|
243 |
+
|
244 |
+
$title = empty( $snippet->name ) ? sprintf( __( 'Untitled #%d', 'code-snippets' ), $snippet->id ) : $snippet->name;
|
245 |
+
|
246 |
+
$row_actions = $this->row_actions( $action_links,
|
247 |
+
apply_filters( 'code_snippets/list_table/row_actions_always_visible', false )
|
248 |
+
);
|
249 |
+
|
250 |
+
$out = sprintf(
|
251 |
+
'<a href="%s"><strong>%s</strong></a>',
|
252 |
+
get_snippet_edit_url( $snippet->id, $snippet->network ? 'network' : 'admin' ),
|
253 |
+
$title
|
254 |
+
);
|
255 |
+
|
256 |
+
if ( $snippet->shared_network && ! current_user_can( apply_filters( 'code_snippets_network_cap', 'manage_network_snippets' ) ) ) {
|
257 |
+
$out = sprintf( '<a><strong>%s</strong></a>', $title );
|
258 |
+
}
|
259 |
+
|
260 |
+
if ( $snippet->shared_network ) {
|
261 |
+
$out .= ' <span class="badge">' . esc_html__( 'Shared on Network', 'code-snippets' ) . '</span>';
|
262 |
+
}
|
263 |
+
|
264 |
+
/* Return the name contents */
|
265 |
+
return apply_filters( 'code_snippets/list_table/column_name', $out, $snippet ) . $row_actions;
|
266 |
+
}
|
267 |
+
|
268 |
+
/**
|
269 |
+
* Builds the checkbox column content
|
270 |
+
*
|
271 |
+
* @param Snippet $snippet The snippet being used for the current row
|
272 |
+
* @return string The column content to be printed
|
273 |
+
*/
|
274 |
+
protected function column_cb( $snippet ) {
|
275 |
+
|
276 |
+
$out = sprintf(
|
277 |
+
'<input type="checkbox" name="%s[]" value="%s" />',
|
278 |
+
$snippet->shared_network ? 'shared_ids' : 'ids',
|
279 |
+
$snippet->id
|
280 |
+
);
|
281 |
+
|
282 |
+
return apply_filters( 'code_snippets/list_table/column_cb', $out, $snippet );
|
283 |
+
}
|
284 |
+
|
285 |
+
/**
|
286 |
+
* Output the content of the tags column
|
287 |
+
* This function is used once for each row
|
288 |
+
*
|
289 |
+
* @since 2.0
|
290 |
+
*
|
291 |
+
* @param Snippet $snippet The snippet being used for the current row
|
292 |
+
* @return string The column output
|
293 |
+
*/
|
294 |
+
protected function column_tags( $snippet ) {
|
295 |
+
|
296 |
+
/* Return a placeholder if there are no tags */
|
297 |
+
if ( empty( $snippet->tags ) ) {
|
298 |
+
return '—';
|
299 |
+
}
|
300 |
+
|
301 |
+
$out = array();
|
302 |
+
|
303 |
+
/* Loop through the tags and create a link for each one */
|
304 |
+
foreach ( $snippet->tags as $tag ) {
|
305 |
+
$out[] = sprintf( '<a href="%s">%s</a>',
|
306 |
+
esc_url( add_query_arg( 'tag', esc_attr( $tag ) ) ),
|
307 |
+
esc_html( $tag )
|
308 |
+
);
|
309 |
+
}
|
310 |
+
|
311 |
+
return join( ', ', $out );
|
312 |
+
}
|
313 |
+
|
314 |
+
/**
|
315 |
+
* Define the column headers for the table
|
316 |
+
*
|
317 |
+
* @return array The column headers, ID paired with label
|
318 |
+
*/
|
319 |
+
public function get_columns() {
|
320 |
+
$columns = array(
|
321 |
+
'cb' => '<input type="checkbox">',
|
322 |
+
'name' => __( 'Name', 'code-snippets' ),
|
323 |
+
'id' => __( 'ID', 'code-snippets' ),
|
324 |
+
'description' => __( 'Description', 'code-snippets' ),
|
325 |
+
'tags' => __( 'Tags', 'code-snippets' ),
|
326 |
+
);
|
327 |
+
return apply_filters( 'code_snippets/list_table/columns', $columns );
|
328 |
+
}
|
329 |
+
|
330 |
+
/**
|
331 |
+
* Define the columns that can be sorted
|
332 |
+
*
|
333 |
+
* @return array The IDs of the columns that can be sorted
|
334 |
+
*/
|
335 |
+
protected function get_sortable_columns() {
|
336 |
+
$sortable_columns = array(
|
337 |
+
'id' => array( 'id', true ),
|
338 |
+
'name' => array( 'name', false ),
|
339 |
+
);
|
340 |
+
return apply_filters( 'code_snippets/list_table/sortable_columns', $sortable_columns );
|
341 |
+
}
|
342 |
+
|
343 |
+
/**
|
344 |
+
* Define the columns that are hidden by default
|
345 |
+
*
|
346 |
+
* @param mixed $result
|
347 |
+
* @return mixed|array
|
348 |
+
*/
|
349 |
+
public function get_default_hidden_columns( $result ) {
|
350 |
+
return $result ? $result : array( 'id' );
|
351 |
+
}
|
352 |
+
|
353 |
+
/**
|
354 |
+
* Define the bulk actions to include in the drop-down menus
|
355 |
+
*
|
356 |
+
* @return array An array of menu items with the ID paired to the label
|
357 |
+
*/
|
358 |
+
protected function get_bulk_actions() {
|
359 |
+
$actions = array(
|
360 |
+
'activate-selected' => $this->is_network ? __( 'Network Activate', 'code-snippets' ) : __( 'Activate', 'code-snippets' ),
|
361 |
+
'deactivate-selected' => $this->is_network ? __( 'Network Deactivate', 'code-snippets' ) : __( 'Deactivate', 'code-snippets' ),
|
362 |
+
'export-selected' => __( 'Export', 'code-snippets' ),
|
363 |
+
'delete-selected' => __( 'Delete', 'code-snippets' ),
|
364 |
+
'export-php-selected' => __( 'Export to PHP', 'code-snippets' ),
|
365 |
+
);
|
366 |
+
return apply_filters( 'code_snippets/list_table/bulk_actions', $actions );
|
367 |
+
}
|
368 |
+
|
369 |
+
/**
|
370 |
+
* Retrieve the classes for the table
|
371 |
+
*
|
372 |
+
* We override this in order to add 'snippets' as a class for custom styling
|
373 |
+
*
|
374 |
+
* @return array The classes to include on the table element
|
375 |
+
*/
|
376 |
+
protected function get_table_classes() {
|
377 |
+
$classes = array( 'widefat', $this->_args['plural'] );
|
378 |
+
return apply_filters( 'code_snippets/list_table/table_classes', $classes );
|
379 |
+
}
|
380 |
+
|
381 |
+
/**
|
382 |
+
* Retrieve the 'views' of the table
|
383 |
+
*
|
384 |
+
* Example: active, inactive, recently active
|
385 |
+
*
|
386 |
+
* @return array A list of the view labels linked to the view
|
387 |
+
*/
|
388 |
+
protected function get_views() {
|
389 |
+
global $totals, $status;
|
390 |
+
$status_links = array();
|
391 |
+
|
392 |
+
/* Loop through the view counts */
|
393 |
+
foreach ( $totals as $type => $count ) {
|
394 |
+
|
395 |
+
/* Don't show the view if there is no count */
|
396 |
+
if ( ! $count ) {
|
397 |
+
continue;
|
398 |
+
}
|
399 |
+
|
400 |
+
/* Define the labels for each view */
|
401 |
+
$labels = array(
|
402 |
+
'all' => _n( 'All <span class="count">(%s)</span>', 'All <span class="count">(%s)</span>', $count, 'code-snippets' ),
|
403 |
+
'active' => _n( 'Active <span class="count">(%s)</span>', 'Active <span class="count">(%s)</span>', $count, 'code-snippets' ),
|
404 |
+
'inactive' => _n( 'Inactive <span class="count">(%s)</span>', 'Inactive <span class="count">(%s)</span>', $count, 'code-snippets' ),
|
405 |
+
'recently_activated' => _n( 'Recently Active <span class="count">(%s)</span>', 'Recently Active <span class="count">(%s)</span>', $count, 'code-snippets' ),
|
406 |
+
);
|
407 |
+
|
408 |
+
/* The page URL with the status parameter */
|
409 |
+
$url = esc_url( add_query_arg( 'status', $type ) );
|
410 |
+
|
411 |
+
/* Add a class if this view is currently being viewed */
|
412 |
+
$class = $type === $status ? ' class="current"' : '';
|
413 |
+
|
414 |
+
/* Add the view count to the label */
|
415 |
+
$text = sprintf( $labels[ $type ], number_format_i18n( $count ) );
|
416 |
+
|
417 |
+
/* Construct the link */
|
418 |
+
$status_links[ $type ] = sprintf( '<a href="%s"%s>%s</a>', $url, $class, $text );
|
419 |
+
}
|
420 |
+
|
421 |
+
/* Filter and return the list of views */
|
422 |
+
return apply_filters( 'code_snippets/list_table/views', $status_links );
|
423 |
+
}
|
424 |
+
|
425 |
+
/**
|
426 |
+
* Gets the tags of the snippets currently being viewed in the table
|
427 |
+
* @since 2.0
|
428 |
+
*/
|
429 |
+
public function get_current_tags() {
|
430 |
+
global $snippets, $status;
|
431 |
+
|
432 |
+
/* If we're not viewing a snippets table, get all used tags instead */
|
433 |
+
if ( ! isset( $snippets, $status ) ) {
|
434 |
+
return get_all_snippet_tags();
|
435 |
+
}
|
436 |
+
|
437 |
+
$tags = array();
|
438 |
+
|
439 |
+
/* Merge all tags into a single array */
|
440 |
+
foreach ( $snippets[ $status ] as $snippet ) {
|
441 |
+
$tags = array_merge( $snippet->tags, $tags );
|
442 |
+
}
|
443 |
+
|
444 |
+
/* Remove duplicate tags */
|
445 |
+
return array_values( array_unique( $tags, SORT_REGULAR ) );
|
446 |
+
}
|
447 |
+
|
448 |
+
/**
|
449 |
+
* Add filters and extra actions above and below the table
|
450 |
+
* @param string $which Are the actions displayed on the table top or bottom
|
451 |
+
*/
|
452 |
+
protected function extra_tablenav( $which ) {
|
453 |
+
global $status, $wpdb;
|
454 |
+
|
455 |
+
if ( 'top' === $which ) {
|
456 |
+
|
457 |
+
/* Tags dropdown filter */
|
458 |
+
$tags = $this->get_current_tags();
|
459 |
+
|
460 |
+
if ( count( $tags ) ) {
|
461 |
+
$query = isset( $_GET['tag'] ) ? $_GET['tag'] : '';
|
462 |
+
|
463 |
+
echo '<div class="alignleft actions">';
|
464 |
+
echo '<select name="tag">';
|
465 |
+
|
466 |
+
printf( "<option %s value=''>%s</option>\n",
|
467 |
+
selected( $query, '', false ),
|
468 |
+
__( 'Show all tags', 'code-snippets' )
|
469 |
+
);
|
470 |
+
|
471 |
+
foreach ( $tags as $tag ) {
|
472 |
+
|
473 |
+
printf( "<option %s value='%s'>%s</option>\n",
|
474 |
+
selected( $query, $tag, false ),
|
475 |
+
esc_attr( $tag ),
|
476 |
+
$tag
|
477 |
+
);
|
478 |
+
}
|
479 |
+
|
480 |
+
echo '</select>';
|
481 |
+
|
482 |
+
submit_button( __( 'Filter', 'code-snippets' ), 'button', false, false );
|
483 |
+
echo '</div>';
|
484 |
+
}
|
485 |
+
}
|
486 |
+
|
487 |
+
echo '<div class="alignleft actions">';
|
488 |
+
|
489 |
+
if ( 'recently_activated' === $status ) {
|
490 |
+
submit_button( __( 'Clear List', 'code-snippets' ), 'secondary', 'clear-recent-list', false );
|
491 |
+
}
|
492 |
+
|
493 |
+
do_action( 'code_snippets/list_table/actions', $which );
|
494 |
+
|
495 |
+
echo '</div>';
|
496 |
+
}
|
497 |
+
|
498 |
+
/**
|
499 |
+
* Output form fields needed to preserve important
|
500 |
+
* query vars over form submissions
|
501 |
+
*
|
502 |
+
* @param string $context In what context are the fields being outputted?
|
503 |
+
*/
|
504 |
+
public function required_form_fields( $context = 'main' ) {
|
505 |
+
|
506 |
+
$vars = apply_filters(
|
507 |
+
'code_snippets/list_table/required_form_fields',
|
508 |
+
array( 'page', 's', 'status', 'paged', 'tag' ),
|
509 |
+
$context
|
510 |
+
);
|
511 |
+
|
512 |
+
if ( 'search_box' === $context ) {
|
513 |
+
/* Remove the 's' var if we're doing this for the search box */
|
514 |
+
$vars = array_diff( $vars, array( 's' ) );
|
515 |
+
}
|
516 |
+
|
517 |
+
foreach ( $vars as $var ) {
|
518 |
+
if ( ! empty( $_REQUEST[ $var ] ) ) {
|
519 |
+
printf( '<input type="hidden" name="%s" value="%s" />', $var, $_REQUEST[ $var ] );
|
520 |
+
print "\n";
|
521 |
+
}
|
522 |
+
}
|
523 |
+
|
524 |
+
do_action( 'code_snippets/list_table/print_required_form_fields', $context );
|
525 |
+
}
|
526 |
+
|
527 |
+
|
528 |
+
/**
|
529 |
+
* Clear the recently activated snippets list if we've clicked the button
|
530 |
+
* @return string The action to execute
|
531 |
+
*/
|
532 |
+
public function current_action() {
|
533 |
+
if ( isset( $_POST['clear-recent-list'] ) ) {
|
534 |
+
$action = 'clear-recent-list';
|
535 |
+
} else {
|
536 |
+
$action = parent::current_action();
|
537 |
+
}
|
538 |
+
return apply_filters( 'code_snippets/list_table/current_action', $action );
|
539 |
+
}
|
540 |
+
|
541 |
+
/**
|
542 |
+
* Processes a bulk action
|
543 |
+
*
|
544 |
+
* @uses activate_snippet() to activate snippets
|
545 |
+
* @uses deactivate_snippet() to deactivate snippets
|
546 |
+
* @uses delete_snippet() to delete snippets
|
547 |
+
* @uses export_snippets() to export selected snippets
|
548 |
+
* @uses wp_redirect() to pass the results to the current page
|
549 |
+
* @uses add_query_arg() to append the results to the current URI
|
550 |
+
*/
|
551 |
+
public function process_bulk_actions() {
|
552 |
+
|
553 |
+
if ( isset( $_GET['action'], $_GET['id'] ) ) {
|
554 |
+
|
555 |
+
$id = absint( $_GET['id'] );
|
556 |
+
$action = sanitize_key( $_GET['action'] );
|
557 |
+
$_SERVER['REQUEST_URI'] = remove_query_arg( array( 'action', 'id' ) );
|
558 |
+
|
559 |
+
if ( 'activate' === $action ) {
|
560 |
+
activate_snippet( $id, $this->is_network );
|
561 |
+
$result = 'activated';
|
562 |
+
}
|
563 |
+
elseif ( 'deactivate' === $action ) {
|
564 |
+
deactivate_snippet( $id, $this->is_network );
|
565 |
+
$result = 'deactivated';
|
566 |
+
}
|
567 |
+
elseif ( 'activate-shared' === $action ) {
|
568 |
+
$active_shared_snippets = get_option( 'active_shared_network_snippets', array() );
|
569 |
+
|
570 |
+
if ( ! in_array( $id, $active_shared_snippets ) ) {
|
571 |
+
$active_shared_snippets[] = $id;
|
572 |
+
update_option( 'active_shared_network_snippets', $active_shared_snippets );
|
573 |
+
}
|
574 |
+
|
575 |
+
$result = 'activated';
|
576 |
+
}
|
577 |
+
elseif ( 'deactivate-shared' === $action ) {
|
578 |
+
$active_shared_snippets = get_option( 'active_shared_network_snippets', array() );
|
579 |
+
update_option( 'active_shared_network_snippets', array_diff( $active_shared_snippets, array( $id ) ) );
|
580 |
+
|
581 |
+
$result = 'deactivated';
|
582 |
+
}
|
583 |
+
elseif ( 'delete' === $action ) {
|
584 |
+
delete_snippet( $id, $this->is_network );
|
585 |
+
$result = 'deleted';
|
586 |
+
}
|
587 |
+
elseif ( 'export' === $action ) {
|
588 |
+
export_snippets( array( $id ), $this->is_network );
|
589 |
+
}
|
590 |
+
elseif ( 'export-php' === $action ) {
|
591 |
+
export_snippets( array( $id ), $this->is_network, 'php' );
|
592 |
+
}
|
593 |
+
|
594 |
+
if ( isset( $result ) ) {
|
595 |
+
wp_redirect( esc_url_raw( add_query_arg( 'result', $result ) ) );
|
596 |
+
exit;
|
597 |
+
}
|
598 |
+
}
|
599 |
+
|
600 |
+
if ( ! isset( $_POST['ids'] ) && ! isset( $_POST['shared_ids'] ) ) {
|
601 |
+
return;
|
602 |
+
}
|
603 |
+
|
604 |
+
$ids = isset( $_POST['ids'] ) ? $_POST['ids'] : array();
|
605 |
+
$_SERVER['REQUEST_URI'] = remove_query_arg( 'action' );
|
606 |
+
|
607 |
+
switch ( $this->current_action() ) {
|
608 |
+
|
609 |
+
case 'activate-selected':
|
610 |
+
|
611 |
+
foreach ( $ids as $id ) {
|
612 |
+
activate_snippet( $id, $this->is_network );
|
613 |
+
}
|
614 |
+
|
615 |
+
/* Process the shared network snippets */
|
616 |
+
if ( isset( $_POST['shared_ids'] ) && is_multisite() && ! $this->is_network ) {
|
617 |
+
$active_shared_snippets = get_option( 'active_shared_network_snippets', array() );
|
618 |
+
|
619 |
+
foreach ( $_POST['shared_ids'] as $id ) {
|
620 |
+
if ( ! in_array( $id, $active_shared_snippets ) ) {
|
621 |
+
$active_shared_snippets[] = $id;
|
622 |
+
}
|
623 |
+
}
|
624 |
+
|
625 |
+
update_option( 'active_shared_network_snippets', $active_shared_snippets );
|
626 |
+
}
|
627 |
+
|
628 |
+
wp_redirect( esc_url_raw( add_query_arg( 'result', 'activated-multi' ) ) );
|
629 |
+
exit;
|
630 |
+
|
631 |
+
case 'deactivate-selected':
|
632 |
+
|
633 |
+
foreach ( $ids as $id ) {
|
634 |
+
deactivate_snippet( $id, $this->is_network );
|
635 |
+
}
|
636 |
+
|
637 |
+
/* Process the shared network snippets */
|
638 |
+
if ( isset( $_POST['shared_ids'] ) && is_multisite() && ! $this->is_network ) {
|
639 |
+
$active_shared_snippets = get_option( 'active_shared_network_snippets', array() );
|
640 |
+
$active_shared_snippets = array_diff( $active_shared_snippets, $_POST['shared_ids'] );
|
641 |
+
update_option( 'active_shared_network_snippets', $$active_shared_snippets );
|
642 |
+
}
|
643 |
+
|
644 |
+
wp_redirect( esc_url_raw( add_query_arg( 'result', 'deactivated-multi' ) ) );
|
645 |
+
exit;
|
646 |
+
|
647 |
+
case 'export-selected':
|
648 |
+
export_snippets( $ids, $this->is_network );
|
649 |
+
break;
|
650 |
+
|
651 |
+
case 'export-php-selected':
|
652 |
+
export_snippets( $ids, $this->is_network, 'php' );
|
653 |
+
break;
|
654 |
+
|
655 |
+
case 'delete-selected':
|
656 |
+
foreach ( $ids as $id ) {
|
657 |
+
delete_snippet( $id, $this->is_network );
|
658 |
+
}
|
659 |
+
wp_redirect( esc_url_raw( add_query_arg( 'result', 'deleted-multi' ) ) );
|
660 |
+
exit;
|
661 |
+
|
662 |
+
case 'clear-recent-list':
|
663 |
+
if ( $this->is_network ) {
|
664 |
+
update_site_option( 'recently_activated_snippets', array() );
|
665 |
+
} else {
|
666 |
+
update_option( 'recently_activated_snippets', array() );
|
667 |
+
}
|
668 |
+
break;
|
669 |
+
}
|
670 |
+
}
|
671 |
+
|
672 |
+
/**
|
673 |
+
* Message to display if no snippets are found
|
674 |
+
*/
|
675 |
+
public function no_items() {
|
676 |
+
printf(
|
677 |
+
__( 'You do not appear to have any snippets available at this time. <a href="%s">Add New→</a>', 'code-snippets' ),
|
678 |
+
code_snippets_get_menu_url( 'add' )
|
679 |
+
);
|
680 |
+
}
|
681 |
+
|
682 |
+
/**
|
683 |
+
*
|
684 |
+
*/
|
685 |
+
private function fetch_shared_network_snippets() {
|
686 |
+
/** @var wpdb $wpdb */
|
687 |
+
global $snippets, $wpdb;
|
688 |
+
|
689 |
+
if ( ! is_multisite() || ! $ids = get_site_option( 'shared_network_snippets', false ) ) {
|
690 |
+
return;
|
691 |
+
}
|
692 |
+
|
693 |
+
if ( $this->is_network ) {
|
694 |
+
$limit = count( $snippets['all'] );
|
695 |
+
|
696 |
+
/** @var Snippet $snippet */
|
697 |
+
for ( $i = 0; $i < $limit; $i++ ) {
|
698 |
+
$snippet = &$snippets['all'][ $i ];
|
699 |
+
|
700 |
+
if ( in_array( $snippet->id, $ids ) ) {
|
701 |
+
$snippet->shared_network = true;
|
702 |
+
$snippet->tags = array_merge( $snippet->tags, array( 'shared on network' ) );
|
703 |
+
$snippet->active = false;
|
704 |
+
}
|
705 |
+
}
|
706 |
+
} else {
|
707 |
+
|
708 |
+
$active_shared_snippets = get_option( 'active_shared_network_snippets', array() );
|
709 |
+
|
710 |
+
$sql = sprintf( "SELECT * FROM {$wpdb->ms_snippets} WHERE id IN (%s)",
|
711 |
+
implode( ',', array_fill( 0, count( $ids ), '%d' ) )
|
712 |
+
);
|
713 |
+
|
714 |
+
$shared_snippets = $wpdb->get_results( $wpdb->prepare( $sql, $ids ), ARRAY_A );
|
715 |
+
|
716 |
+
foreach ( $shared_snippets as $index => $snippet ) {
|
717 |
+
$snippet = new Snippet( $snippet );
|
718 |
+
$snippet->network = true;
|
719 |
+
$snippet->shared_network = true;
|
720 |
+
$snippet->tags = array_merge( $snippet->tags, array( 'shared on network' ) );
|
721 |
+
$snippet->active = in_array( $snippet->id, $active_shared_snippets );
|
722 |
+
|
723 |
+
$shared_snippets[ $index ] = $snippet;
|
724 |
+
}
|
725 |
+
|
726 |
+
$snippets['all'] = array_merge( $snippets['all'], $shared_snippets );
|
727 |
+
}
|
728 |
+
}
|
729 |
+
|
730 |
+
/**
|
731 |
+
* Prepares the items to later display in the table.
|
732 |
+
* Should run before any headers are sent.
|
733 |
+
*/
|
734 |
+
public function prepare_items() {
|
735 |
+
global $status, $snippets, $totals, $s;
|
736 |
+
|
737 |
+
wp_reset_vars( array( 'orderby', 'order', 's' ) );
|
738 |
+
|
739 |
+
$screen = get_current_screen();
|
740 |
+
$user = get_current_user_id();
|
741 |
+
|
742 |
+
/* First, lets process the bulk actions */
|
743 |
+
$this->process_bulk_actions();
|
744 |
+
|
745 |
+
/* Initialize the $snippets array */
|
746 |
+
$snippets = array_fill_keys( $this->statuses, array() );
|
747 |
+
|
748 |
+
/* Fetch all snippets */
|
749 |
+
$snippets['all'] = get_snippets( array(), $this->is_network );
|
750 |
+
$snippets['all'] = apply_filters( 'code_snippets/list_table/get_snippets', $snippets['all'] );
|
751 |
+
|
752 |
+
/* Fetch shared network snippets */
|
753 |
+
$this->fetch_shared_network_snippets();
|
754 |
+
|
755 |
+
/* Redirect POST'ed tag filter to GET */
|
756 |
+
if ( isset( $_POST['tag'] ) ) {
|
757 |
+
$location = empty( $_POST['tag'] ) ? remove_query_arg( 'tag' ) : add_query_arg( 'tag', $_POST['tag'] );
|
758 |
+
wp_redirect( esc_url_raw( $location ) );
|
759 |
+
exit;
|
760 |
+
}
|
761 |
+
|
762 |
+
/* Add scope tags */
|
763 |
+
if ( code_snippets_get_setting( 'general', 'snippet_scope_enabled' ) ) {
|
764 |
+
foreach ( $snippets['all'] as $snippet ) {
|
765 |
+
|
766 |
+
if ( 0 != $snippet->scope ) {
|
767 |
+
$snippet->tags = array_merge( $snippet->tags, array( $snippet->scope_name ) );
|
768 |
+
}
|
769 |
+
}
|
770 |
+
}
|
771 |
+
|
772 |
+
/* Filter snippets by tag */
|
773 |
+
if ( ! empty( $_GET['tag'] ) ) {
|
774 |
+
$snippets['all'] = array_filter( $snippets['all'], array( $this, 'tags_filter_callback' ) );
|
775 |
+
}
|
776 |
+
|
777 |
+
/* Filter snippets based on search query */
|
778 |
+
if ( $s ) {
|
779 |
+
$snippets['all'] = array_filter( $snippets['all'], array( $this, 'search_callback' ) );
|
780 |
+
}
|
781 |
+
|
782 |
+
/* Clear recently activated snippets older than a week */
|
783 |
+
$recently_activated = $this->is_network ?
|
784 |
+
get_site_option( 'recently_activated_snippets', array() ) :
|
785 |
+
get_option( 'recently_activated_snippets', array() );
|
786 |
+
|
787 |
+
foreach ( $recently_activated as $key => $time ) {
|
788 |
+
|
789 |
+
if ( $time + WEEK_IN_SECONDS < time() ) {
|
790 |
+
unset( $recently_activated[ $key ] );
|
791 |
+
}
|
792 |
+
}
|
793 |
+
|
794 |
+
$this->is_network ?
|
795 |
+
update_site_option( 'recently_activated_snippets', $recently_activated ) :
|
796 |
+
update_option( 'recently_activated_snippets', $recently_activated );
|
797 |
+
|
798 |
+
/* Filter snippets into individual sections */
|
799 |
+
foreach ( $snippets['all'] as $snippet ) {
|
800 |
+
|
801 |
+
if ( $snippet->active ) {
|
802 |
+
$snippets['active'][] = $snippet;
|
803 |
+
} else {
|
804 |
+
$snippets['inactive'][] = $snippet;
|
805 |
+
|
806 |
+
/* Was the snippet recently activated? */
|
807 |
+
if ( isset( $recently_activated[ $snippet->id ] ) ) {
|
808 |
+
$snippets['recently_activated'][] = $snippet;
|
809 |
+
}
|
810 |
+
}
|
811 |
+
}
|
812 |
+
|
813 |
+
/* Count the totals for each section */
|
814 |
+
$totals = array();
|
815 |
+
foreach ( $snippets as $type => $list ) {
|
816 |
+
$totals[ $type ] = count( $list );
|
817 |
+
}
|
818 |
+
|
819 |
+
/* If the current status is empty, default tp all */
|
820 |
+
if ( empty( $snippets[ $status ] ) ) {
|
821 |
+
$status = 'all';
|
822 |
+
}
|
823 |
+
|
824 |
+
/* Get the current data */
|
825 |
+
$data = $snippets[ $status ];
|
826 |
+
|
827 |
+
/* Decide how many records per page to show by
|
828 |
+
getting the user's setting in the Screen Options panel */
|
829 |
+
$sort_by = $screen->get_option( 'per_page', 'option' );
|
830 |
+
$per_page = get_user_meta( $user, $sort_by, true );
|
831 |
+
|
832 |
+
if ( empty( $per_page ) || $per_page < 1 ) {
|
833 |
+
$per_page = $screen->get_option( 'per_page', 'default' );
|
834 |
+
}
|
835 |
+
|
836 |
+
$per_page = (int) $per_page;
|
837 |
+
|
838 |
+
$this->_column_headers = $this->get_column_info();
|
839 |
+
|
840 |
+
usort( $data, array( $this, 'usort_reorder_callback' ) );
|
841 |
+
|
842 |
+
/* Determine what page the user is currently looking at */
|
843 |
+
$current_page = $this->get_pagenum();
|
844 |
+
|
845 |
+
/* Check how many items are in the data array */
|
846 |
+
$total_items = count( $data );
|
847 |
+
|
848 |
+
/* The WP_List_Table class does not handle pagination for us, so we need
|
849 |
+
to ensure that the data is trimmed to only the current page. */
|
850 |
+
$data = array_slice( $data, ( ( $current_page - 1 ) * $per_page ), $per_page );
|
851 |
+
|
852 |
+
/* Now we can add our *sorted* data to the items property,
|
853 |
+
where it can be used by the rest of the class. */
|
854 |
+
$this->items = $data;
|
855 |
+
|
856 |
+
/* We register our pagination options and calculations */
|
857 |
+
$this->set_pagination_args( array(
|
858 |
+
'total_items' => $total_items, // Calculate the total number of items
|
859 |
+
'per_page' => $per_page, // Determine how many items to show on a page
|
860 |
+
'total_pages' => ceil( $total_items / $per_page ), // Calculate the total number of pages
|
861 |
+
) );
|
862 |
+
}
|
863 |
+
|
864 |
+
/**
|
865 |
+
* Callback for usort() used to sort snippets
|
866 |
+
*
|
867 |
+
* @ignore
|
868 |
+
*
|
869 |
+
* @param Snippet $a The first snippet to compare
|
870 |
+
* @param Snippet $b The second snippet to compare
|
871 |
+
* @return int The sort order
|
872 |
+
*/
|
873 |
+
private function usort_reorder_callback( $a, $b ) {
|
874 |
+
|
875 |
+
/* If no sort, default to ID */
|
876 |
+
$orderby = (
|
877 |
+
! empty( $_REQUEST['orderby'] )
|
878 |
+
? $_REQUEST['orderby']
|
879 |
+
: apply_filters( 'code_snippets/list_table/default_orderby', 'id' )
|
880 |
+
);
|
881 |
+
|
882 |
+
/* If no order, default to ascending */
|
883 |
+
$order = (
|
884 |
+
! empty( $_REQUEST['order'] )
|
885 |
+
? $_REQUEST['order']
|
886 |
+
: apply_filters( 'code_snippets/list_table/default_order', 'asc' )
|
887 |
+
);
|
888 |
+
|
889 |
+
/* Determine sort order */
|
890 |
+
if ( 'id' === $orderby ) {
|
891 |
+
$result = $a->$orderby - $b->$orderby; // get the result for numerical data
|
892 |
+
} else {
|
893 |
+
$result = strcmp( $a->$orderby, $b->$orderby ); // get the result for string data
|
894 |
+
}
|
895 |
+
|
896 |
+
/* Send final sort direction to usort */
|
897 |
+
return ( 'asc' === $order ) ? $result : -$result;
|
898 |
+
}
|
899 |
+
|
900 |
+
/**
|
901 |
+
* Callback for search function
|
902 |
+
* @ignore
|
903 |
+
*
|
904 |
+
* @param Snippet $snippet The snippet being filtered
|
905 |
+
* @return bool The result of the filter
|
906 |
+
*/
|
907 |
+
private function search_callback( $snippet ) {
|
908 |
+
static $term;
|
909 |
+
if ( is_null( $term ) ) {
|
910 |
+
$term = stripslashes( $_REQUEST['s'] );
|
911 |
+
}
|
912 |
+
|
913 |
+
foreach ( $snippet as $value ) {
|
914 |
+
|
915 |
+
if ( is_string( $value ) ) {
|
916 |
+
if ( false !== stripos( $value, $term ) ) {
|
917 |
+
return true;
|
918 |
+
}
|
919 |
+
}
|
920 |
+
elseif ( is_array( $value ) ) {
|
921 |
+
if ( false !== in_array( $term, $value ) ) {
|
922 |
+
return true;
|
923 |
+
}
|
924 |
+
}
|
925 |
+
}
|
926 |
+
|
927 |
+
return false;
|
928 |
+
}
|
929 |
+
|
930 |
+
/**
|
931 |
+
* Callback for filtering snippets by tag
|
932 |
+
*
|
933 |
+
* @ignore
|
934 |
+
*
|
935 |
+
* @param Snippet $snippet The snippet being filtered
|
936 |
+
* @return bool The result of the filter
|
937 |
+
*/
|
938 |
+
private function tags_filter_callback( $snippet ) {
|
939 |
+
$tags = explode( ',', $_GET['tag'] );
|
940 |
+
|
941 |
+
foreach ( $tags as $tag ) {
|
942 |
+
if ( in_array( $tag, $snippet->tags ) ) {
|
943 |
+
return true;
|
944 |
+
}
|
945 |
+
}
|
946 |
+
}
|
947 |
+
|
948 |
+
/**
|
949 |
+
* Display a notice showing the current search terms
|
950 |
+
*
|
951 |
+
* @since 1.7
|
952 |
+
*/
|
953 |
+
public function search_notice() {
|
954 |
+
if ( ! empty( $_REQUEST['s'] ) || ! empty( $_GET['tag'] ) ) {
|
955 |
+
|
956 |
+
echo '<span class="subtitle">' . __( 'Search results', 'code-snippets' );
|
957 |
+
|
958 |
+
if ( ! empty( $_REQUEST['s'] ) ) {
|
959 |
+
echo sprintf( __( ' for “%s”', 'code-snippets' ), esc_html( $_REQUEST['s'] ) );
|
960 |
+
}
|
961 |
+
|
962 |
+
if ( ! empty( $_GET['tag'] ) ) {
|
963 |
+
echo sprintf( __( ' in tag “%s”', 'code-snippets' ), $_GET['tag'] );
|
964 |
+
}
|
965 |
+
|
966 |
+
echo '</span>';
|
967 |
+
|
968 |
+
printf(
|
969 |
+
' <a class="button clear-filters" href="%s">%s</a>',
|
970 |
+
esc_url( remove_query_arg( array( 's', 'tag' ) ) ),
|
971 |
+
__( 'Clear Filters', 'code-snippets' )
|
972 |
+
);
|
973 |
+
}
|
974 |
+
}
|
975 |
+
|
976 |
+
/**
|
977 |
+
* Outputs content for a single row of the table
|
978 |
+
*
|
979 |
+
* @param Snippet $snippet The snippet being used for the current row
|
980 |
+
*/
|
981 |
+
public function single_row( $snippet ) {
|
982 |
+
$row_class = ( $snippet->active ? 'active' : 'inactive' );
|
983 |
+
$row_class .= sprintf( ' %s-scope', $snippet->scope_name );
|
984 |
+
|
985 |
+
if ( $snippet->shared_network ) {
|
986 |
+
$row_class .= ' shared-network';
|
987 |
+
}
|
988 |
+
|
989 |
+
printf( '<tr class="%s">', $row_class );
|
990 |
+
$this->single_row_columns( $snippet );
|
991 |
+
echo '</tr>';
|
992 |
+
}
|
993 |
+
} // end of class
|
includes/class-snippet.php
ADDED
@@ -0,0 +1,241 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
|
3 |
+
/**
|
4 |
+
* A snippet object
|
5 |
+
*
|
6 |
+
* @since 2.4.0
|
7 |
+
* @package Code_Snippets
|
8 |
+
*
|
9 |
+
* @property int $id The database ID
|
10 |
+
* @property string $name The display name
|
11 |
+
* @property string $desc The formatted description
|
12 |
+
* @property string $code The executable code
|
13 |
+
* @property array $tags An array of the tags
|
14 |
+
* @property int $scope The scope number
|
15 |
+
* @property bool $active The active status
|
16 |
+
* @property bool $network true if is multisite-wide snippet, false if site-wide
|
17 |
+
* @property bool $shared_network Whether the snippet is a shared network snippet
|
18 |
+
*
|
19 |
+
* @property-read array $tags_list The tags in string list format
|
20 |
+
* @property-read string $scope_name The name of the scope
|
21 |
+
*/
|
22 |
+
class Snippet {
|
23 |
+
|
24 |
+
/**
|
25 |
+
* The snippet metadata fields.
|
26 |
+
* Initialized with default values.
|
27 |
+
* @var array
|
28 |
+
*/
|
29 |
+
private $fields = array(
|
30 |
+
'id' => 0,
|
31 |
+
'name' => '',
|
32 |
+
'desc' => '',
|
33 |
+
'code' => '',
|
34 |
+
'tags' => array(),
|
35 |
+
'scope' => 0,
|
36 |
+
'active' => false,
|
37 |
+
'network' => null,
|
38 |
+
'shared_network' => null,
|
39 |
+
);
|
40 |
+
|
41 |
+
/**
|
42 |
+
* Set all of the snippet fields from an array or object
|
43 |
+
* @param array|object $fields List of fields
|
44 |
+
*/
|
45 |
+
public function set_fields( $fields ) {
|
46 |
+
|
47 |
+
/* Only accept arrays or objects */
|
48 |
+
if ( ! $fields || is_string( $fields ) ) {
|
49 |
+
return;
|
50 |
+
}
|
51 |
+
|
52 |
+
/* Convert objects into arrays */
|
53 |
+
if ( is_object( $fields ) ) {
|
54 |
+
$fields = get_object_vars( $fields );
|
55 |
+
}
|
56 |
+
|
57 |
+
/* Loop through the passed fields and set them */
|
58 |
+
foreach ( $fields as $field => $value ) {
|
59 |
+
$this->__set( $field, $value );
|
60 |
+
}
|
61 |
+
}
|
62 |
+
|
63 |
+
/**
|
64 |
+
* Constructor function
|
65 |
+
* @param array|object $fields Initial snippet fields
|
66 |
+
*/
|
67 |
+
public function __construct( $fields = null ) {
|
68 |
+
$this->set_fields( $fields );
|
69 |
+
}
|
70 |
+
|
71 |
+
/**
|
72 |
+
* Check if a field is set
|
73 |
+
* @param string $field The field name
|
74 |
+
* @return bool Whether the field is set
|
75 |
+
*/
|
76 |
+
public function __isset( $field ) {
|
77 |
+
return isset( $this->fields[ $field ] ) || method_exists( $this, 'get_' . $field );
|
78 |
+
}
|
79 |
+
|
80 |
+
/**
|
81 |
+
* Retrieve a field's value
|
82 |
+
* @param string $field The field name
|
83 |
+
* @return mixed The field value
|
84 |
+
*/
|
85 |
+
public function __get( $field ) {
|
86 |
+
|
87 |
+
/* Rename the description field */
|
88 |
+
if ( 'description' === $field ) {
|
89 |
+
$field = 'desc';
|
90 |
+
}
|
91 |
+
|
92 |
+
if ( method_exists( $this, 'get_' . $field ) ) {
|
93 |
+
return call_user_func( array( $this, 'get_' . $field ) );
|
94 |
+
}
|
95 |
+
|
96 |
+
return $this->fields[ $field ];
|
97 |
+
}
|
98 |
+
|
99 |
+
/**
|
100 |
+
* Set a field's value
|
101 |
+
* @param string $field The field name
|
102 |
+
* @param mixed $value The field value
|
103 |
+
*/
|
104 |
+
public function __set( $field, $value ) {
|
105 |
+
|
106 |
+
/* Rename the description field */
|
107 |
+
if ( 'description' === $field ) {
|
108 |
+
$field = 'desc';
|
109 |
+
}
|
110 |
+
|
111 |
+
/* Check if the field value should be filtered */
|
112 |
+
if ( method_exists( $this, 'prepare_' . $field ) ) {
|
113 |
+
$value = call_user_func( array( $this, 'prepare_' . $field ), $value );
|
114 |
+
}
|
115 |
+
|
116 |
+
$this->fields[ $field ] = $value;
|
117 |
+
|
118 |
+
}
|
119 |
+
|
120 |
+
/**
|
121 |
+
* Prepare the ID by ensuring it is an absolute integer
|
122 |
+
* @param int $id
|
123 |
+
* @return int
|
124 |
+
*/
|
125 |
+
private function prepare_id( $id ) {
|
126 |
+
return absint( $id );
|
127 |
+
}
|
128 |
+
|
129 |
+
/**
|
130 |
+
* Prepare the code by removing php tags from beginning and end
|
131 |
+
* @param string $code
|
132 |
+
* @return string
|
133 |
+
*/
|
134 |
+
private function prepare_code( $code ) {
|
135 |
+
|
136 |
+
/* Remove <?php and <? from beginning of snippet */
|
137 |
+
$code = preg_replace( '|^[\s]*<\?(php)?|', '', $code );
|
138 |
+
|
139 |
+
/* Remove ?> from end of snippet */
|
140 |
+
$code = preg_replace( '|\?>[\s]*$|', '', $code );
|
141 |
+
|
142 |
+
return $code;
|
143 |
+
}
|
144 |
+
|
145 |
+
/**
|
146 |
+
* Prepare the scope by ensuring that it is a valid number
|
147 |
+
* @param int $scope The field as provided
|
148 |
+
* @return int The field in the correct format
|
149 |
+
*/
|
150 |
+
private function prepare_scope( $scope ) {
|
151 |
+
$scope = (int) $scope;
|
152 |
+
|
153 |
+
if ( in_array( $scope, array( 0, 1, 2 ) ) ) {
|
154 |
+
return $scope;
|
155 |
+
}
|
156 |
+
|
157 |
+
return $this->fields['scope'];
|
158 |
+
}
|
159 |
+
|
160 |
+
/**
|
161 |
+
* Prepare the snippet tags by ensuring they are in the correct format
|
162 |
+
* @param string|array $tags The tags as provided
|
163 |
+
* @return array The tags as an array
|
164 |
+
*/
|
165 |
+
private function prepare_tags( $tags ) {
|
166 |
+
return code_snippets_build_tags_array( $tags );
|
167 |
+
}
|
168 |
+
|
169 |
+
/**
|
170 |
+
* Prepare the active field by ensuring it is the correct type
|
171 |
+
* @param bool|int $active The field as provided
|
172 |
+
* @return bool The field in the correct format
|
173 |
+
*/
|
174 |
+
private function prepare_active( $active ) {
|
175 |
+
if ( is_bool( $active ) ) {
|
176 |
+
return $active;
|
177 |
+
}
|
178 |
+
|
179 |
+
return $active ? true : false;
|
180 |
+
}
|
181 |
+
|
182 |
+
/**
|
183 |
+
* If $network is anything other than true, set it to false
|
184 |
+
* @param bool $network The provided field
|
185 |
+
* @return bool The filtered field
|
186 |
+
*/
|
187 |
+
private function prepare_network( $network ) {
|
188 |
+
|
189 |
+
if ( null === $network && function_exists( 'get_current_screen' ) && $screen = get_current_screen() ) {
|
190 |
+
return $screen->in_admin( 'network' );
|
191 |
+
}
|
192 |
+
|
193 |
+
return true === $network;
|
194 |
+
}
|
195 |
+
|
196 |
+
/**
|
197 |
+
* Retrieve the tags in list format
|
198 |
+
* @return string The tags seperated by a comma and a space
|
199 |
+
*/
|
200 |
+
private function get_tags_list() {
|
201 |
+
return implode( ', ', $this->fields['tags'] );
|
202 |
+
}
|
203 |
+
|
204 |
+
/**
|
205 |
+
* Retrieve the string representation of the scope
|
206 |
+
* @param string $default The name to use for the default scope
|
207 |
+
* @return string The name of the scope
|
208 |
+
*/
|
209 |
+
private function get_scope_name( $default = 'global' ) {
|
210 |
+
|
211 |
+
switch ( intval( $this->fields['scope'] ) ) {
|
212 |
+
case 1:
|
213 |
+
return 'admin';
|
214 |
+
case 2:
|
215 |
+
return 'front-end';
|
216 |
+
default:
|
217 |
+
case 0:
|
218 |
+
return $default;
|
219 |
+
}
|
220 |
+
}
|
221 |
+
|
222 |
+
/**
|
223 |
+
* Determine if the snippet is a shared network snippet
|
224 |
+
* @return bool
|
225 |
+
*/
|
226 |
+
private function get_shared_network() {
|
227 |
+
|
228 |
+
if ( isset( $this->fields['shared_network'] ) ) {
|
229 |
+
return $this->fields['shared_network'];
|
230 |
+
}
|
231 |
+
|
232 |
+
if ( ! is_multisite() || ! $this->fields['network'] ) {
|
233 |
+
$this->fields['shared_network'] = false;
|
234 |
+
} else {
|
235 |
+
$shared_network_snippets = get_site_option( 'shared_network_snippets', array() );
|
236 |
+
$this->fields['shared_network'] = in_array( $this->fields['id'], $shared_network_snippets );
|
237 |
+
}
|
238 |
+
|
239 |
+
return $this->fields['shared_network'];
|
240 |
+
}
|
241 |
+
}
|
includes/contextual-help.php
ADDED
@@ -0,0 +1,124 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
|
3 |
+
/**
|
4 |
+
* This file holds all of the content for the contextual help screens
|
5 |
+
* @package Code_Snippets
|
6 |
+
*/
|
7 |
+
|
8 |
+
/* Exit from file if not loaded from inside WordPress admin */
|
9 |
+
if ( ! function_exists( 'is_admin' ) || ! is_admin() ) {
|
10 |
+
return;
|
11 |
+
}
|
12 |
+
|
13 |
+
/**
|
14 |
+
* Load the help sidebar
|
15 |
+
* @param WP_Screen $screen Screen object
|
16 |
+
*/
|
17 |
+
function code_snippets_load_help_sidebar( $screen ) {
|
18 |
+
$screen->set_help_sidebar(
|
19 |
+
'<p><strong>' . __( 'For more information:', 'code-snippets' ) . '</strong></p>' .
|
20 |
+
'<p><a href="https://wordpress.org/plugins/code-snippets">' . __( 'About Plugin', 'code-snippets' ) . '</a></p>' .
|
21 |
+
'<p><a href="https://wordpress.org/plugins/code-snippets/faq">' . __( 'FAQ', 'code-snippets' ) . '</a></p>' .
|
22 |
+
'<p><a href="https://wordpress.org/support/plugin/code-snippets">' . __( 'Support Forums', 'code-snippets' ) . '</a></p>' .
|
23 |
+
'<p><a href="http://bungeshea.com/plugins/code-snippets/">' . __( 'Plugin Website</a>', 'code-snippets' ) . '</a></p>'
|
24 |
+
);
|
25 |
+
}
|
26 |
+
|
27 |
+
/**
|
28 |
+
* Register and handle the help tabs for the manage snippets admin page
|
29 |
+
*/
|
30 |
+
function code_snippets_load_manage_help() {
|
31 |
+
$screen = get_current_screen();
|
32 |
+
code_snippets_load_help_sidebar( $screen );
|
33 |
+
|
34 |
+
$screen->add_help_tab( array(
|
35 |
+
'id' => 'overview',
|
36 |
+
'title' => __( 'Overview', 'code-snippets' ),
|
37 |
+
'content' =>
|
38 |
+
'<p>' . __( 'Snippets are similar to plugins - they both extend and expand the functionality of WordPress. Snippets are more light-weight, just a few lines of code, and do not put as much load on your server. Here you can manage your existing snippets and preform tasks on them such as activating, deactivating, deleting and exporting.', 'code-snippets' ) . '</p>',
|
39 |
+
) );
|
40 |
+
|
41 |
+
$screen->add_help_tab( array(
|
42 |
+
'id' => 'safe-mode',
|
43 |
+
'title' => __( 'Safe Mode', 'code-snippets' ),
|
44 |
+
'content' =>
|
45 |
+
'<p>' . __( 'Be sure to check your snippets for errors before you activate them, as a faulty snippet could bring your whole blog down. If your site starts doing strange things, deactivate all your snippets and activate them one at a time.', 'code-snippets' ) . '</p>' .
|
46 |
+
'<p>' . __( "If something goes wrong with a snippet and you can't use WordPress, you can cause all snippets to stop executing by adding <code>define('CODE_SNIPPETS_SAFE_MODE', true);</code> to your <code>wp-config.php</code> file. After you have deactivated the offending snippet, you can turn off safe mode by removing this line or replacing <strong>true</strong> with <strong>false</strong>.", 'code-snippets' ) . '</p>',
|
47 |
+
) );
|
48 |
+
|
49 |
+
$screen->add_help_tab( array(
|
50 |
+
'id' => 'uninstall',
|
51 |
+
'title' => __( 'Uninstall', 'code-snippets' ),
|
52 |
+
'content' =>
|
53 |
+
'<p>' . sprintf( __( 'When you delete Code Snippets through the Plugins menu in WordPress it will clear up the <code>%1$s</code> table and a few other bits of data stored in the database. If you want to keep this data (ie: you are only temporally uninstalling Code Snippets) then remove the <code>%2$s</code> folder using FTP.', 'code-snippets' ), get_snippets_table_name(), dirname( CODE_SNIPPETS_FILE ) ) .
|
54 |
+
'<p>' . __( "Even if you're sure that you don't want to use Code Snippets ever again on this WordPress installation, you may want to use the export feature to back up your snippets.", 'code-snippets' ) . '</p>',
|
55 |
+
) );
|
56 |
+
}
|
57 |
+
|
58 |
+
/**
|
59 |
+
* Register and handle the help tabs for the single snippet admin page
|
60 |
+
*/
|
61 |
+
function code_snippets_load_edit_help() {
|
62 |
+
$screen = get_current_screen();
|
63 |
+
code_snippets_load_help_sidebar( $screen );
|
64 |
+
|
65 |
+
$screen->add_help_tab( array(
|
66 |
+
'id' => 'overview',
|
67 |
+
'title' => __( 'Overview', 'code-snippets' ),
|
68 |
+
'content' =>
|
69 |
+
'<p>' . __( 'Snippets are similar to plugins - they both extend and expand the functionality of WordPress. Snippets are more light-weight, just a few lines of code, and do not put as much load on your server. Here you can add a new snippet, or edit an existing one.', 'code-snippets' ) . '</p>',
|
70 |
+
) );
|
71 |
+
|
72 |
+
$screen->add_help_tab( array(
|
73 |
+
'id' => 'finding',
|
74 |
+
'title' => __( 'Finding Snippets', 'code-snippets' ),
|
75 |
+
'content' =>
|
76 |
+
'<p>' . __( 'Here are some links to websites which host a large number of snippets that you can add to your site.
|
77 |
+
<ul>
|
78 |
+
<li><a href="http://wp-snippets.com" title="WordPress Snippets">WP-Snippets</a></li>
|
79 |
+
<li><a href="http://wpsnipp.com" title="WP Snipp">WP Snipp</a></li>
|
80 |
+
<li><a href="http://www.catswhocode.com/blog/snippets" title="Cats Who Code Snippet Library">Cats Who Code</a></li>
|
81 |
+
<li><a href="http://www.wpfunction.me">WP Function Me</a></li>
|
82 |
+
</ul>', 'code-snippets' ) .
|
83 |
+
__( 'More places to find snippets, as well as a selection of example snippets, can be found in the <a href="https://github.com/sheabunge/code-snippets/wiki/Finding-snippets">plugin documentation</a>', 'code-snippets' ) . '</p>',
|
84 |
+
) );
|
85 |
+
|
86 |
+
$screen->add_help_tab( array(
|
87 |
+
'id' => 'adding',
|
88 |
+
'title' => __( 'Adding Snippets', 'code-snippets' ),
|
89 |
+
'content' =>
|
90 |
+
'<p>' . __( 'You need to fill out the name and code fields for your snippet to be added. While the description field will add more information about how your snippet works, what is does and where you found it, it is completely optional.', 'code-snippets' ) . '</p>' .
|
91 |
+
'<p>' . __( 'Please be sure to check that your snippet is valid PHP code and will not produce errors before adding it through this page. While doing so will not become active straight away, it will help to minimise the chance of a faulty snippet becoming active on your site.', 'code-snippets' ) . '</p>',
|
92 |
+
) );
|
93 |
+
}
|
94 |
+
|
95 |
+
/**
|
96 |
+
* Register and handle the help tabs for the import snippets admin page
|
97 |
+
*/
|
98 |
+
function code_snippets_load_import_help() {
|
99 |
+
$screen = get_current_screen();
|
100 |
+
$manage_url = code_snippets_get_menu_url( 'manage' );
|
101 |
+
code_snippets_load_help_sidebar( $screen );
|
102 |
+
|
103 |
+
$screen->add_help_tab( array(
|
104 |
+
'id' => 'overview',
|
105 |
+
'title' => __( 'Overview', 'code-snippets' ),
|
106 |
+
'content' =>
|
107 |
+
'<p>' . __( 'Snippets are similar to plugins - they both extend and expand the functionality of WordPress. Snippets are more light-weight, just a few lines of code, and do not put as much load on your server. Here you can load snippets from a Code Snippets (.xml) import file into the database with your existing snippets.', 'code-snippets' ) . '</p>',
|
108 |
+
) );
|
109 |
+
|
110 |
+
$screen->add_help_tab( array(
|
111 |
+
'id' => 'import',
|
112 |
+
'title' => __( 'Importing', 'code-snippets' ),
|
113 |
+
'content' =>
|
114 |
+
'<p>' . __( 'You can load your snippets from a code snippets (.xml) export file using this page.', 'code-snippets' ) .
|
115 |
+
sprintf( __( 'Snippets will be added to the database along with your existing snippets. Regardless of whether the snippets were active on the previous site, imported snippets are always inactive until activated using the <a href="%s">Manage Snippets</a> page.</p>', 'code-snippets' ), $manage_url ) . '</p>',
|
116 |
+
) );
|
117 |
+
|
118 |
+
$screen->add_help_tab( array(
|
119 |
+
'id' => 'export',
|
120 |
+
'title' => __( 'Exporting', 'code-snippets' ),
|
121 |
+
'content' =>
|
122 |
+
'<p>' . sprintf( __( 'You can save your snippets to a Code Snippets (.xml) export file using the <a href="%s">Manage Snippets</a> page.', 'code-snippets' ), $manage_url ) . '</p>',
|
123 |
+
) );
|
124 |
+
}
|
includes/db.php
CHANGED
@@ -2,6 +2,8 @@
|
|
2 |
|
3 |
/**
|
4 |
* Functions used to manage the database tables
|
|
|
|
|
5 |
*/
|
6 |
|
7 |
/**
|
@@ -25,23 +27,23 @@ function set_snippet_table_vars() {
|
|
25 |
/**
|
26 |
* Return the appropriate snippet table name
|
27 |
*
|
28 |
-
* @since
|
29 |
-
* @param
|
30 |
-
* @return string
|
31 |
*/
|
32 |
function get_snippets_table_name( $multisite = null ) {
|
33 |
global $wpdb;
|
34 |
|
35 |
-
/* If $multisite is null, try to base it on the current admin page */
|
36 |
-
if ( ! isset( $multisite ) && function_exists( 'get_current_screen' ) ) {
|
37 |
-
$multisite = get_current_screen()->is_network;
|
38 |
-
}
|
39 |
-
|
40 |
/* If the first parameter is a string, assume it is a table name */
|
41 |
-
|
42 |
return $multisite;
|
43 |
}
|
44 |
|
|
|
|
|
|
|
|
|
|
|
45 |
/* If multisite is not active, always return the site-wide table name */
|
46 |
if ( ! is_multisite() ) {
|
47 |
$multisite = false;
|
@@ -56,33 +58,27 @@ function get_snippets_table_name( $multisite = null ) {
|
|
56 |
* This function will only execute once per page load, except if $redo is true
|
57 |
*
|
58 |
* @since 1.7.1
|
59 |
-
*
|
60 |
-
* @param
|
61 |
*/
|
62 |
function create_code_snippets_tables( $upgrade = false ) {
|
63 |
global $wpdb;
|
64 |
|
65 |
/* Set the table name variables if not yet defined */
|
66 |
if ( ! isset( $wpdb->snippets, $wpdb->ms_snippets ) ) {
|
67 |
-
|
68 |
}
|
69 |
|
70 |
if ( is_multisite() ) {
|
71 |
|
72 |
-
/* Check if the network snippets table exists */
|
73 |
-
$ms_table_exists = ( $wpdb->get_var( "SHOW TABLES LIKE '$wpdb->ms_snippets'" ) === $wpdb->ms_snippets );
|
74 |
-
|
75 |
/* Create the network snippets table if it doesn't exist, or upgrade it */
|
76 |
-
if ( $upgrade ||
|
77 |
create_code_snippets_table( $wpdb->ms_snippets );
|
78 |
}
|
79 |
}
|
80 |
|
81 |
-
/* Check if the site-specific table exists */
|
82 |
-
$table_exists = ( $wpdb->get_var( "SHOW TABLES LIKE '$wpdb->snippets'" ) === $wpdb->snippets );
|
83 |
-
|
84 |
/* Create the table if it doesn't exist, or upgrade it */
|
85 |
-
if ( $upgrade ||
|
86 |
create_code_snippets_table( $wpdb->snippets );
|
87 |
}
|
88 |
}
|
@@ -91,9 +87,7 @@ function create_code_snippets_tables( $upgrade = false ) {
|
|
91 |
* Create a single snippet table
|
92 |
*
|
93 |
* @since 1.6
|
94 |
-
* @
|
95 |
-
*
|
96 |
-
* @uses dbDelta() To apply the SQL code
|
97 |
* @param string $table_name The name of the table to create
|
98 |
*/
|
99 |
function create_code_snippets_table( $table_name ) {
|
@@ -114,10 +108,10 @@ function create_code_snippets_table( $table_name ) {
|
|
114 |
/* Create the database table */
|
115 |
$sql = "CREATE TABLE $table_name (
|
116 |
id bigint(20) NOT NULL AUTO_INCREMENT,
|
117 |
-
name tinytext
|
118 |
-
description text
|
119 |
-
code longtext
|
120 |
-
tags longtext
|
121 |
scope tinyint(1) NOT NULL default 0,
|
122 |
active tinyint(1) NOT NULL default 0,
|
123 |
PRIMARY KEY (id)
|
2 |
|
3 |
/**
|
4 |
* Functions used to manage the database tables
|
5 |
+
*
|
6 |
+
* @package Code_Snippets
|
7 |
*/
|
8 |
|
9 |
/**
|
27 |
/**
|
28 |
* Return the appropriate snippet table name
|
29 |
*
|
30 |
+
* @since 2.0
|
31 |
+
* @param string|bool|null $multisite Retrieve the multisite table name or the site table name?
|
32 |
+
* @return string The snippet table name
|
33 |
*/
|
34 |
function get_snippets_table_name( $multisite = null ) {
|
35 |
global $wpdb;
|
36 |
|
|
|
|
|
|
|
|
|
|
|
37 |
/* If the first parameter is a string, assume it is a table name */
|
38 |
+
if ( is_string( $multisite ) ) {
|
39 |
return $multisite;
|
40 |
}
|
41 |
|
42 |
+
/* If $multisite is null, try to base it on the current admin page */
|
43 |
+
if ( ! isset( $multisite ) && function_exists( 'get_current_screen' ) ) {
|
44 |
+
$multisite = get_current_screen()->in_admin( 'network' );
|
45 |
+
}
|
46 |
+
|
47 |
/* If multisite is not active, always return the site-wide table name */
|
48 |
if ( ! is_multisite() ) {
|
49 |
$multisite = false;
|
58 |
* This function will only execute once per page load, except if $redo is true
|
59 |
*
|
60 |
* @since 1.7.1
|
61 |
+
*
|
62 |
+
* @param bool $upgrade Run the table creation code even if the table exists
|
63 |
*/
|
64 |
function create_code_snippets_tables( $upgrade = false ) {
|
65 |
global $wpdb;
|
66 |
|
67 |
/* Set the table name variables if not yet defined */
|
68 |
if ( ! isset( $wpdb->snippets, $wpdb->ms_snippets ) ) {
|
69 |
+
set_snippet_table_vars();
|
70 |
}
|
71 |
|
72 |
if ( is_multisite() ) {
|
73 |
|
|
|
|
|
|
|
74 |
/* Create the network snippets table if it doesn't exist, or upgrade it */
|
75 |
+
if ( $upgrade || $wpdb->get_var( "SHOW TABLES LIKE '$wpdb->ms_snippets'" ) !== $wpdb->ms_snippets ) {
|
76 |
create_code_snippets_table( $wpdb->ms_snippets );
|
77 |
}
|
78 |
}
|
79 |
|
|
|
|
|
|
|
80 |
/* Create the table if it doesn't exist, or upgrade it */
|
81 |
+
if ( $upgrade || $wpdb->get_var( "SHOW TABLES LIKE '$wpdb->snippets'" ) !== $wpdb->snippets ) {
|
82 |
create_code_snippets_table( $wpdb->snippets );
|
83 |
}
|
84 |
}
|
87 |
* Create a single snippet table
|
88 |
*
|
89 |
* @since 1.6
|
90 |
+
* @uses dbDelta() to apply the SQL code
|
|
|
|
|
91 |
* @param string $table_name The name of the table to create
|
92 |
*/
|
93 |
function create_code_snippets_table( $table_name ) {
|
108 |
/* Create the database table */
|
109 |
$sql = "CREATE TABLE $table_name (
|
110 |
id bigint(20) NOT NULL AUTO_INCREMENT,
|
111 |
+
name tinytext NOT NULL default '',
|
112 |
+
description text NOT NULL default '',
|
113 |
+
code longtext NOT NULL default '',
|
114 |
+
tags longtext NOT NULL default '',
|
115 |
scope tinyint(1) NOT NULL default 0,
|
116 |
active tinyint(1) NOT NULL default 0,
|
117 |
PRIMARY KEY (id)
|
includes/edit/admin-help.php
DELETED
@@ -1,47 +0,0 @@
|
|
1 |
-
<?php
|
2 |
-
|
3 |
-
/**
|
4 |
-
* Register and handle the help tabs for the
|
5 |
-
* single snippet admin page
|
6 |
-
*
|
7 |
-
* @package Code_Snippets
|
8 |
-
* @subpackage Contextual_Help
|
9 |
-
*/
|
10 |
-
|
11 |
-
$screen = get_current_screen();
|
12 |
-
|
13 |
-
$screen->add_help_tab( array(
|
14 |
-
'id' => 'overview',
|
15 |
-
'title' => __( 'Overview', 'code-snippets' ),
|
16 |
-
'content' =>
|
17 |
-
'<p>' . __( 'Snippets are similar to plugins - they both extend and expand the functionality of WordPress. Snippets are more light-weight, just a few lines of code, and do not put as much load on your server. Here you can add a new snippet, or edit an existing one.', 'code-snippets' ) . '</p>',
|
18 |
-
) );
|
19 |
-
|
20 |
-
$screen->add_help_tab( array(
|
21 |
-
'id' => 'finding',
|
22 |
-
'title' => __( 'Finding Snippets', 'code-snippets' ),
|
23 |
-
'content' =>
|
24 |
-
'<p>' . __( 'Here are some links to websites which host a large number of snippets that you can add to your site.
|
25 |
-
<ul>
|
26 |
-
<li><a href="http://wp-snippets.com" title="WordPress Snippets">WP-Snippets</a></li>
|
27 |
-
<li><a href="http://wpsnipp.com" title="WP Snipp">WP Snipp</a></li>
|
28 |
-
<li><a href="http://www.catswhocode.com/blog/snippets" title="Cats Who Code Snippet Library">Cats Who Code</a></li>
|
29 |
-
<li><a href="http://www.wpfunction.me">WP Function Me</a></li>
|
30 |
-
</ul>', 'code-snippets' ) .
|
31 |
-
__( 'More places to find snippets, as well as a selection of example snippets, can be found in the <a href="https://github.com/sheabunge/code-snippets/wiki/Finding-snippets">plugin documentation</a>', 'code-snippets' ) . '</p>'
|
32 |
-
) );
|
33 |
-
|
34 |
-
$screen->add_help_tab( array(
|
35 |
-
'id' => 'adding',
|
36 |
-
'title' => __( 'Adding Snippets', 'code-snippets' ),
|
37 |
-
'content' =>
|
38 |
-
'<p>' . __( 'You need to fill out the name and code fields for your snippet to be added. While the description field will add more information about how your snippet works, what is does and where you found it, it is completely optional.', 'code-snippets' ) . '</p>' .
|
39 |
-
'<p>' . __( 'Please be sure to check that your snippet is valid PHP code and will not produce errors before adding it through this page. While doing so will not become active straight away, it will help to minimise the chance of a faulty snippet becoming active on your site.', 'code-snippets' ) . '</p>'
|
40 |
-
) );
|
41 |
-
|
42 |
-
$screen->set_help_sidebar(
|
43 |
-
'<p><strong>' . __( 'For more information:', 'code-snippets' ) . '</strong></p>' .
|
44 |
-
'<p>' . __( '<a href="http://wordpress.org/plugins/code-snippets" target="_blank">WordPress Extend</a>', 'code-snippets' ) . '</p>' .
|
45 |
-
'<p>' . __( '<a href="http://wordpress.org/support/plugin/code-snippets" target="_blank">Support Forums</a>', 'code-snippets' ) . '</p>' .
|
46 |
-
'<p>' . __( '<a href="http://bungeshea.com/plugins/code-snippets/" target="_blank">Project Website</a>', 'code-snippets' ) . '</p>'
|
47 |
-
);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
includes/edit/admin-messages.php
DELETED
@@ -1,36 +0,0 @@
|
|
1 |
-
<?php
|
2 |
-
|
3 |
-
/**
|
4 |
-
* Status and error messages for the single snippet page
|
5 |
-
*
|
6 |
-
* @package Code_Snippets
|
7 |
-
* @subpackage Admin_Messages
|
8 |
-
*/
|
9 |
-
|
10 |
-
$_f = '<div id="message" class="%2$s fade"><p>%1$s</p></div>';
|
11 |
-
|
12 |
-
if ( isset( $_REQUEST['invalid'] ) && $_REQUEST['invalid'] ) :
|
13 |
-
|
14 |
-
printf( $_f, __( 'An error occurred when saving the snippet.', 'code-snippets' ), 'error' );
|
15 |
-
|
16 |
-
elseif ( isset( $_REQUEST['activated'], $_REQUEST['updated'] ) && $_REQUEST['activated'] && $_REQUEST['updated'] ) :
|
17 |
-
|
18 |
-
printf( $_f, __( 'Snippet <strong>updated</strong> and <strong>activated</strong>.', 'code-snippets' ), 'updated' );
|
19 |
-
|
20 |
-
elseif ( isset( $_REQUEST['activated'], $_REQUEST['added'] ) && $_REQUEST['activated'] && $_REQUEST['added'] ) :
|
21 |
-
|
22 |
-
printf( $_f, __( 'Snippet <strong>added</strong> and <strong>activated</strong>.', 'code-snippets' ), 'updated' );
|
23 |
-
|
24 |
-
elseif ( isset( $_REQUEST['deactivated'], $_REQUEST['updated'] ) && $_REQUEST['deactivated'] && $_REQUEST['updated'] ) :
|
25 |
-
|
26 |
-
printf( $_f, __( 'Snippet <strong>updated</strong> and <strong>deactivated</strong>.', 'code-snippets' ), 'updated' );
|
27 |
-
|
28 |
-
elseif ( isset( $_REQUEST['updated'] ) && $_REQUEST['updated'] ) :
|
29 |
-
|
30 |
-
printf( $_f, __( 'Snippet <strong>updated</strong>.', 'code-snippets' ), 'updated' );
|
31 |
-
|
32 |
-
elseif ( isset( $_REQUEST['added'] ) && $_REQUEST['added'] ) :
|
33 |
-
|
34 |
-
printf( $_f, __( 'Snippet <strong>added</strong>.', 'code-snippets' ), 'updated' );
|
35 |
-
|
36 |
-
endif;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
includes/edit/edit.php
DELETED
@@ -1,313 +0,0 @@
|
|
1 |
-
<?php
|
2 |
-
|
3 |
-
/**
|
4 |
-
* Functions to handle the single snippet menu
|
5 |
-
*
|
6 |
-
* @package Code_Snippets
|
7 |
-
* @subpackage Administration
|
8 |
-
*/
|
9 |
-
|
10 |
-
/**
|
11 |
-
* Fetch the admin menu slug for a snippets menu
|
12 |
-
* @param integer $id The snippet
|
13 |
-
* @return string The URL to the edit snippet page for that snippet
|
14 |
-
*/
|
15 |
-
function get_snippet_edit_url( $snippet_id ) {
|
16 |
-
return add_query_arg(
|
17 |
-
'id', absint( $snippet_id ),
|
18 |
-
code_snippets_get_menu_url( 'edit' )
|
19 |
-
);
|
20 |
-
}
|
21 |
-
|
22 |
-
/**
|
23 |
-
* Register the single snippet admin menu
|
24 |
-
*
|
25 |
-
* @since 2.0
|
26 |
-
* @access private
|
27 |
-
* @uses add_submenu_page() To register a sub-menu
|
28 |
-
*/
|
29 |
-
function code_snippets_add_single_menu() {
|
30 |
-
|
31 |
-
/* Add New Snippet menu */
|
32 |
-
$add_hook = add_submenu_page(
|
33 |
-
code_snippets_get_menu_slug(),
|
34 |
-
__( 'Add New Snippet', 'code-snippets' ),
|
35 |
-
__( 'Add New', 'code-snippets' ),
|
36 |
-
get_snippets_cap(),
|
37 |
-
code_snippets_get_menu_slug( 'add' ),
|
38 |
-
'code_snippets_render_single_menu'
|
39 |
-
);
|
40 |
-
|
41 |
-
add_action( 'load-' . $add_hook, 'code_snippets_load_single_menu' );
|
42 |
-
|
43 |
-
/* Check if we are currently editing a snippet */
|
44 |
-
if ( isset( $_REQUEST['page'] ) && code_snippets_get_menu_slug( 'edit' ) === $_REQUEST['page'] ) {
|
45 |
-
|
46 |
-
$edit_hook = add_submenu_page(
|
47 |
-
code_snippets_get_menu_slug(),
|
48 |
-
__( 'Edit Snippet', 'code-snippets' ),
|
49 |
-
__( 'Edit Snippet', 'code-snippets' ),
|
50 |
-
get_snippets_cap(),
|
51 |
-
code_snippets_get_menu_slug( 'edit' ),
|
52 |
-
'code_snippets_render_single_menu'
|
53 |
-
);
|
54 |
-
|
55 |
-
add_action( 'load-' . $edit_hook, 'code_snippets_load_single_menu' );
|
56 |
-
}
|
57 |
-
}
|
58 |
-
|
59 |
-
add_action( 'admin_menu', 'code_snippets_add_single_menu', 5 );
|
60 |
-
add_action( 'network_admin_menu', 'code_snippets_add_single_menu', 5 );
|
61 |
-
|
62 |
-
/**
|
63 |
-
* Displays the single snippet menu
|
64 |
-
*
|
65 |
-
* @since 2.0
|
66 |
-
*/
|
67 |
-
function code_snippets_render_single_menu() {
|
68 |
-
require plugin_dir_path( __FILE__ ) . 'admin-messages.php';
|
69 |
-
require plugin_dir_path( __FILE__ ) . 'admin.php';
|
70 |
-
}
|
71 |
-
|
72 |
-
/**
|
73 |
-
* Loads the help tabs for the Edit Snippets page
|
74 |
-
*
|
75 |
-
* @since 1.0
|
76 |
-
* @access private
|
77 |
-
* @uses wp_redirect To pass the results to the page
|
78 |
-
*/
|
79 |
-
function code_snippets_load_single_menu() {
|
80 |
-
|
81 |
-
/* Make sure the user has permission to be here */
|
82 |
-
if ( ! current_user_can( get_snippets_cap() ) ) {
|
83 |
-
wp_die( __( 'You are not authorized to access this page.', 'code-snippets' ) );
|
84 |
-
}
|
85 |
-
|
86 |
-
/* Create the snippet tables if they don't exist */
|
87 |
-
create_code_snippets_tables();
|
88 |
-
|
89 |
-
/* Load the screen help tabs */
|
90 |
-
require plugin_dir_path( __FILE__ ) . 'admin-help.php';
|
91 |
-
|
92 |
-
/* Enqueue the code editor and other scripts and styles */
|
93 |
-
add_action( 'admin_enqueue_scripts', 'code_snippets_enqueue_codemirror', 9 );
|
94 |
-
|
95 |
-
/* Don't allow visiting the edit snippet page without a valid ID */
|
96 |
-
if ( code_snippets_get_menu_slug( 'edit' ) === $_REQUEST['page'] ) {
|
97 |
-
if ( ! isset( $_REQUEST['id'] ) || 0 == $_REQUEST['id'] ) {
|
98 |
-
wp_redirect( code_snippets_get_menu_url( 'add' ) );
|
99 |
-
exit;
|
100 |
-
}
|
101 |
-
}
|
102 |
-
|
103 |
-
/* Make sure the nonce validates before we do any snippet ops */
|
104 |
-
if ( ! isset( $_REQUEST['_wpnonce'] ) || ! wp_verify_nonce( $_REQUEST['_wpnonce'], 'save_snippet' ) ) {
|
105 |
-
return;
|
106 |
-
}
|
107 |
-
|
108 |
-
/* Save the snippet if one has been submitted */
|
109 |
-
if ( isset( $_POST['save_snippet'] ) || isset( $_POST['save_snippet_activate'] ) || isset( $_POST['save_snippet_deactivate'] ) ) {
|
110 |
-
|
111 |
-
/* Activate or deactivate the snippet before saving if we clicked the button */
|
112 |
-
if ( isset( $_POST['save_snippet_activate'] ) ) {
|
113 |
-
$_POST['snippet_active'] = 1;
|
114 |
-
} elseif ( isset( $_POST['save_snippet_deactivate'] ) ) {
|
115 |
-
$_POST['snippet_active'] = 0;
|
116 |
-
}
|
117 |
-
|
118 |
-
/* Save the snippet to the database */
|
119 |
-
$result = save_snippet( stripslashes_deep( $_POST ) );
|
120 |
-
|
121 |
-
/* Build the status message and redirect */
|
122 |
-
$query_args = array();
|
123 |
-
|
124 |
-
if ( $result && isset( $_POST['save_snippet_activate'] ) ) {
|
125 |
-
/* Snippet was activated addition to saving*/
|
126 |
-
$query_args['activated'] = true;
|
127 |
-
}
|
128 |
-
elseif ( $result && isset( $_POST['save_snippet_deactivate'] ) ) {
|
129 |
-
/* Snippet was deactivated addition to saving*/
|
130 |
-
$query_args['deactivated'] = true;
|
131 |
-
}
|
132 |
-
|
133 |
-
if ( ! $result || $result < 1 ) {
|
134 |
-
/* An error occurred */
|
135 |
-
$query_args['invalid'] = true;
|
136 |
-
}
|
137 |
-
elseif ( isset( $_POST['snippet_id'] ) ) {
|
138 |
-
/* Existing snippet was updated */
|
139 |
-
$query_args['id'] = $result;
|
140 |
-
$query_args['updated'] = true;
|
141 |
-
}
|
142 |
-
else {
|
143 |
-
/* New snippet was added */
|
144 |
-
$query_args['id'] = $result;
|
145 |
-
$query_args['added'] = true;
|
146 |
-
}
|
147 |
-
|
148 |
-
/* Redirect to edit snippet page */
|
149 |
-
wp_redirect( add_query_arg( $query_args, code_snippets_get_menu_url( 'edit' ) ) );
|
150 |
-
}
|
151 |
-
|
152 |
-
/* Delete the snippet if the button was clicked */
|
153 |
-
elseif ( isset( $_POST['snippet_id'], $_POST['delete_snippet'] ) ) {
|
154 |
-
delete_snippet( $_POST['snippet_id'] );
|
155 |
-
wp_redirect( add_query_arg( 'delete', true, code_snippets_get_menu_url( 'manage' ) ) );
|
156 |
-
}
|
157 |
-
|
158 |
-
/* Export the snippet if the button was clicked */
|
159 |
-
elseif ( isset( $_POST['snippet_id'], $_POST['export_snippet'] ) ) {
|
160 |
-
export_snippets( $_POST['snippet_id'] );
|
161 |
-
}
|
162 |
-
}
|
163 |
-
|
164 |
-
/**
|
165 |
-
* Add a description editor to the single snippet page
|
166 |
-
*
|
167 |
-
* @since 1.7
|
168 |
-
* @access private
|
169 |
-
* @param object $snippet The snippet being used for this page
|
170 |
-
*/
|
171 |
-
function code_snippets_description_editor_box( $snippet ) {
|
172 |
-
$settings = code_snippets_get_settings();
|
173 |
-
$settings = $settings['description_editor'];
|
174 |
-
$media_buttons = $settings['media_buttons'];
|
175 |
-
|
176 |
-
echo '<label for="snippet_description"><h3>';
|
177 |
-
$heading = __( 'Description', 'code-snippets' );
|
178 |
-
echo $media_buttons ? $heading : "<div>$heading</div>";
|
179 |
-
echo '</h3></label>';
|
180 |
-
|
181 |
-
remove_editor_styles(); // stop custom theme styling interfering with the editor
|
182 |
-
|
183 |
-
wp_editor(
|
184 |
-
$snippet->description,
|
185 |
-
'description',
|
186 |
-
apply_filters( 'code_snippets/admin/description_editor_settings', array(
|
187 |
-
'textarea_name' => 'snippet_description',
|
188 |
-
'textarea_rows' => $settings['rows'],
|
189 |
-
'teeny' => ! $settings['use_full_mce'],
|
190 |
-
'media_buttons' => $media_buttons,
|
191 |
-
) )
|
192 |
-
);
|
193 |
-
}
|
194 |
-
|
195 |
-
add_action( 'code_snippets/admin/single', 'code_snippets_description_editor_box', 9 );
|
196 |
-
|
197 |
-
function code_snippets_snippet_scope_setting( $snippet ) {
|
198 |
-
|
199 |
-
if ( ! code_snippets_get_setting( 'general', 'snippet_scope_enabled' ) ) {
|
200 |
-
return;
|
201 |
-
}
|
202 |
-
|
203 |
-
$scopes = array(
|
204 |
-
__( 'Run snippet everywhere', 'code-snippets' ),
|
205 |
-
__( 'Only run in adminstration area', 'code-snippets' ),
|
206 |
-
__( 'Only run on site front-end', 'code-snippets' ),
|
207 |
-
);
|
208 |
-
|
209 |
-
echo '<div class="snippet-scope">';
|
210 |
-
printf( '<label for="snippet_scope"><h3>%s</h3></label>', __( 'Scope', 'code-snippets' ) );
|
211 |
-
|
212 |
-
foreach ( $scopes as $scope => $label ) {
|
213 |
-
printf( '<div><input type="radio" name="snippet_scope" value="%s"', $scope );
|
214 |
-
checked( $scope, $snippet->scope );
|
215 |
-
echo "> $label</div>";
|
216 |
-
}
|
217 |
-
|
218 |
-
echo '</div>';
|
219 |
-
}
|
220 |
-
|
221 |
-
add_action( 'code_snippets/admin/single', 'code_snippets_snippet_scope_setting', 5 );
|
222 |
-
|
223 |
-
/**
|
224 |
-
* Output the interface for editing snippet tags
|
225 |
-
* @since 2.0
|
226 |
-
* @param object $snippet The snippet currently being edited
|
227 |
-
*/
|
228 |
-
function code_snippets_tags_editor( $snippet ) {
|
229 |
-
?>
|
230 |
-
<label for="snippet_tags" style="cursor: auto;">
|
231 |
-
<h3><?php esc_html_e( 'Tags', 'code-snippets' ); ?></h3>
|
232 |
-
</label>
|
233 |
-
|
234 |
-
<input type="text" id="snippet_tags" name="snippet_tags" style="width: 100%;"
|
235 |
-
placeholder="Enter a list of tags; separated by commas" value="<?php echo implode( ', ', $snippet->tags ); ?>" />
|
236 |
-
|
237 |
-
<script type="text/javascript">
|
238 |
-
jQuery('#snippet_tags').tagit({
|
239 |
-
availableTags: ['<?php echo implode( "','", get_all_snippet_tags() ); ?>'],
|
240 |
-
allowSpaces: true,
|
241 |
-
removeConfirmation: true
|
242 |
-
});
|
243 |
-
</script>
|
244 |
-
<?php
|
245 |
-
}
|
246 |
-
|
247 |
-
add_action( 'code_snippets/admin/single', 'code_snippets_tags_editor' );
|
248 |
-
|
249 |
-
/**
|
250 |
-
* Registers and loads the code editor's assets
|
251 |
-
*
|
252 |
-
* @since 1.7
|
253 |
-
* @access private
|
254 |
-
*
|
255 |
-
* @uses wp_enqueue_script() To add the scripts to the queue
|
256 |
-
* @uses wp_enqueue_style() To add the stylesheets to the queue
|
257 |
-
*/
|
258 |
-
function code_snippets_enqueue_codemirror() {
|
259 |
-
$tagit_version = '2.0';
|
260 |
-
$codemirror_version = '5.2';
|
261 |
-
$url = plugin_dir_url( CODE_SNIPPETS_FILE );
|
262 |
-
|
263 |
-
/* Remove other CodeMirror styles */
|
264 |
-
wp_deregister_style( 'codemirror' );
|
265 |
-
wp_deregister_style( 'wpeditor' );
|
266 |
-
|
267 |
-
/* CodeMirror */
|
268 |
-
wp_enqueue_style(
|
269 |
-
'code-snippets-codemirror',
|
270 |
-
$url . 'css/min/codemirror.css',
|
271 |
-
false, $codemirror_version
|
272 |
-
);
|
273 |
-
|
274 |
-
wp_enqueue_script(
|
275 |
-
'code-snippets-codemirror',
|
276 |
-
$url . 'js/min/codemirror.js',
|
277 |
-
false, $codemirror_version
|
278 |
-
);
|
279 |
-
|
280 |
-
/* CodeMirror Theme */
|
281 |
-
$theme = code_snippets_get_setting( 'editor', 'theme' );
|
282 |
-
|
283 |
-
if ( 'default' !== $theme ) {
|
284 |
-
|
285 |
-
wp_enqueue_style(
|
286 |
-
'code-snippets-codemirror-theme-' . $theme,
|
287 |
-
$url . "css/min/cmthemes/$theme.css",
|
288 |
-
array( 'code-snippets-codemirror' ),
|
289 |
-
$codemirror_version
|
290 |
-
);
|
291 |
-
}
|
292 |
-
|
293 |
-
/* Tag It UI */
|
294 |
-
wp_enqueue_script(
|
295 |
-
'code-snippets-tag-it',
|
296 |
-
$url . 'js/min/tag-it.js',
|
297 |
-
array(
|
298 |
-
'jquery-ui-core',
|
299 |
-
'jquery-ui-widget',
|
300 |
-
'jquery-ui-position',
|
301 |
-
'jquery-ui-autocomplete',
|
302 |
-
'jquery-effects-blind',
|
303 |
-
'jquery-effects-highlight',
|
304 |
-
),
|
305 |
-
$tagit_version
|
306 |
-
);
|
307 |
-
|
308 |
-
wp_enqueue_style(
|
309 |
-
'code-snippets-tag-it',
|
310 |
-
$url . 'css/min/tagit.css',
|
311 |
-
false, $tagit_version
|
312 |
-
);
|
313 |
-
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
includes/editor.php
CHANGED
@@ -2,9 +2,10 @@
|
|
2 |
|
3 |
/**
|
4 |
* Get the attributes for the code editor
|
5 |
-
*
|
6 |
-
* @param
|
7 |
-
* @
|
|
|
8 |
*/
|
9 |
function code_snippets_get_editor_atts( $override_atts, $json_encode ) {
|
10 |
$settings = code_snippets_get_settings();
|
@@ -19,7 +20,6 @@ function code_snippets_get_editor_atts( $override_atts, $json_encode ) {
|
|
19 |
|
20 |
foreach ( $fields as $field ) {
|
21 |
$saved_atts[ $field['codemirror'] ] = $settings[ $field['id'] ];
|
22 |
-
|
23 |
}
|
24 |
|
25 |
$atts = wp_parse_args( $override_atts, $saved_atts );
|
@@ -38,3 +38,44 @@ function code_snippets_get_editor_atts( $override_atts, $json_encode ) {
|
|
38 |
|
39 |
return $atts;
|
40 |
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2 |
|
3 |
/**
|
4 |
* Get the attributes for the code editor
|
5 |
+
*
|
6 |
+
* @param array $override_atts Pass an array of attributes to override the saved ones
|
7 |
+
* @param bool $json_encode Encode the data as JSON
|
8 |
+
* @return array|string Array if $json_encode is false, JSON string if it is true
|
9 |
*/
|
10 |
function code_snippets_get_editor_atts( $override_atts, $json_encode ) {
|
11 |
$settings = code_snippets_get_settings();
|
20 |
|
21 |
foreach ( $fields as $field ) {
|
22 |
$saved_atts[ $field['codemirror'] ] = $settings[ $field['id'] ];
|
|
|
23 |
}
|
24 |
|
25 |
$atts = wp_parse_args( $override_atts, $saved_atts );
|
38 |
|
39 |
return $atts;
|
40 |
}
|
41 |
+
|
42 |
+
/**
|
43 |
+
* Registers and loads the CodeMirror library
|
44 |
+
*
|
45 |
+
* @uses wp_enqueue_style() to add the stylesheets to the queue
|
46 |
+
* @uses wp_enqueue_script() to add the scripts to the queue
|
47 |
+
*/
|
48 |
+
function code_snippets_enqueue_codemirror() {
|
49 |
+
$codemirror_version = '5.6';
|
50 |
+
$url = plugin_dir_url( CODE_SNIPPETS_FILE );
|
51 |
+
|
52 |
+
/* Remove other CodeMirror styles */
|
53 |
+
wp_deregister_style( 'codemirror' );
|
54 |
+
wp_deregister_style( 'wpeditor' );
|
55 |
+
|
56 |
+
/* CodeMirror */
|
57 |
+
wp_enqueue_style(
|
58 |
+
'code-snippets-codemirror',
|
59 |
+
$url . 'css/min/codemirror.css',
|
60 |
+
false, $codemirror_version
|
61 |
+
);
|
62 |
+
|
63 |
+
wp_enqueue_script(
|
64 |
+
'code-snippets-codemirror',
|
65 |
+
$url . 'js/min/codemirror.js',
|
66 |
+
false, $codemirror_version
|
67 |
+
);
|
68 |
+
|
69 |
+
/* CodeMirror Theme */
|
70 |
+
$theme = code_snippets_get_setting( 'editor', 'theme' );
|
71 |
+
|
72 |
+
if ( 'default' !== $theme ) {
|
73 |
+
|
74 |
+
wp_enqueue_style(
|
75 |
+
'code-snippets-codemirror-theme-' . $theme,
|
76 |
+
$url . "css/min/cmthemes/$theme.css",
|
77 |
+
array( 'code-snippets-codemirror' ),
|
78 |
+
$codemirror_version
|
79 |
+
);
|
80 |
+
}
|
81 |
+
}
|
includes/functions.php
CHANGED
@@ -1,23 +1,72 @@
|
|
1 |
-
<?php
|
2 |
-
|
3 |
-
/**
|
4 |
-
*
|
5 |
-
*
|
6 |
-
|
7 |
-
|
8 |
-
|
9 |
-
|
10 |
-
|
11 |
-
*
|
12 |
-
|
13 |
-
|
14 |
-
|
15 |
-
|
16 |
-
|
17 |
-
|
18 |
-
|
19 |
-
|
20 |
-
|
21 |
-
|
22 |
-
|
23 |
-
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
|
3 |
+
/**
|
4 |
+
* This file holds general-use non-admin-specific functions
|
5 |
+
* @package Code_Snippets
|
6 |
+
*/
|
7 |
+
|
8 |
+
/**
|
9 |
+
* Fetch the admin menu slug for a snippets menu
|
10 |
+
* @param string $menu The menu to retrieve the slug for
|
11 |
+
* @return string The menu's slug
|
12 |
+
*/
|
13 |
+
function code_snippets_get_menu_slug( $menu = '' ) {
|
14 |
+
$add = array( 'single', 'add', 'add-new', 'add-snippet', 'new-snippet', 'add-new-snippet' );
|
15 |
+
$edit = array( 'edit', 'edit-snippet' );
|
16 |
+
$import = array( 'import', 'import-snippets' );
|
17 |
+
$settings = array( 'settings', 'snippets-settings' );
|
18 |
+
|
19 |
+
if ( in_array( $menu, $edit ) ) {
|
20 |
+
return 'edit-snippet';
|
21 |
+
} elseif ( in_array( $menu, $add ) ) {
|
22 |
+
return 'add-snippet';
|
23 |
+
} elseif ( in_array( $menu, $import ) ) {
|
24 |
+
return 'import-snippets';
|
25 |
+
} elseif ( in_array( $menu, $settings ) ) {
|
26 |
+
return 'snippets-settings';
|
27 |
+
} else {
|
28 |
+
return 'snippets';
|
29 |
+
}
|
30 |
+
}
|
31 |
+
|
32 |
+
/**
|
33 |
+
* Fetch the URL to a snippets admin menu
|
34 |
+
* @param string $menu The menu to retrieve the URL to
|
35 |
+
* @param string $context The URL scheme to use
|
36 |
+
* @return string The menu's URL
|
37 |
+
*/
|
38 |
+
function code_snippets_get_menu_url( $menu = '', $context = 'self' ) {
|
39 |
+
$slug = code_snippets_get_menu_slug( $menu );
|
40 |
+
$url = 'admin.php?page=' . $slug;
|
41 |
+
|
42 |
+
if ( 'network' === $context ) {
|
43 |
+
return network_admin_url( $url );
|
44 |
+
} elseif ( 'admin' === $context ) {
|
45 |
+
return admin_url( $url );
|
46 |
+
} else {
|
47 |
+
return self_admin_url( $url );
|
48 |
+
}
|
49 |
+
}
|
50 |
+
|
51 |
+
/**
|
52 |
+
* Fetch the admin menu hook for a snippets menu
|
53 |
+
* @param string $menu The menu to retrieve the hook for
|
54 |
+
* @return string The menu's hook
|
55 |
+
*/
|
56 |
+
function code_snippets_get_menu_hook( $menu = '' ) {
|
57 |
+
$slug = code_snippets_get_menu_slug( $menu );
|
58 |
+
return get_plugin_page_hookname( $slug, 'snippets' );
|
59 |
+
}
|
60 |
+
|
61 |
+
/**
|
62 |
+
* Fetch the admin menu slug for a snippets menu
|
63 |
+
* @param int $snippet_id The snippet
|
64 |
+
* @param string $context The URL scheme to use
|
65 |
+
* @return string The URL to the edit snippet page for that snippet
|
66 |
+
*/
|
67 |
+
function get_snippet_edit_url( $snippet_id, $context = 'self' ) {
|
68 |
+
return add_query_arg(
|
69 |
+
'id', absint( $snippet_id ),
|
70 |
+
code_snippets_get_menu_url( 'edit', $context )
|
71 |
+
);
|
72 |
+
}
|
includes/import/admin-help.php
DELETED
@@ -1,41 +0,0 @@
|
|
1 |
-
<?php
|
2 |
-
|
3 |
-
/**
|
4 |
-
* Register and handle the help tabs for the
|
5 |
-
* import snippets admin page
|
6 |
-
*
|
7 |
-
* @package Code_Snippets
|
8 |
-
* @subpackage Import
|
9 |
-
*/
|
10 |
-
|
11 |
-
$screen = get_current_screen();
|
12 |
-
$manage_url = code_snippets_get_menu_url( 'manage' );
|
13 |
-
|
14 |
-
$screen->add_help_tab( array(
|
15 |
-
'id' => 'overview',
|
16 |
-
'title' => __( 'Overview', 'code-snippets' ),
|
17 |
-
'content' =>
|
18 |
-
'<p>' . __( 'Snippets are similar to plugins - they both extend and expand the functionality of WordPress. Snippets are more light-weight, just a few lines of code, and do not put as much load on your server. Here you can load snippets from a Code Snippets (.xml) import file into the database with your existing snippets.', 'code-snippets' ) . '</p>'
|
19 |
-
) );
|
20 |
-
|
21 |
-
$screen->add_help_tab( array(
|
22 |
-
'id' => 'import',
|
23 |
-
'title' => __( 'Importing', 'code-snippets' ),
|
24 |
-
'content' =>
|
25 |
-
'<p>' . __( 'You can load your snippets from a code snippets (.xml) export file using this page.', 'code-snippets' ) .
|
26 |
-
sprintf( __( 'Snippets will be added to the database along with your existing snippets. Regardless of whether the snippets were active on the previous site, imported snippets are always inactive until activated using the <a href="%s">Manage Snippets</a> page.</p>', 'code-snippets' ), $manage_url ) . '</p>'
|
27 |
-
) );
|
28 |
-
|
29 |
-
$screen->add_help_tab( array(
|
30 |
-
'id' => 'export',
|
31 |
-
'title' => __( 'Exporting', 'code-snippets' ),
|
32 |
-
'content' =>
|
33 |
-
'<p>' . sprintf( __( 'You can save your snippets to a Code Snippets (.xml) export file using the <a href="%s">Manage Snippets</a> page.', 'code-snippets' ), $manage_url ) . '</p>'
|
34 |
-
) );
|
35 |
-
|
36 |
-
$screen->set_help_sidebar(
|
37 |
-
'<p><strong>' . __( 'For more information:', 'code-snippets' ) . '</strong></p>' .
|
38 |
-
'<p>' . __( '<a href="http://wordpress.org/plugins/code-snippets" target="_blank">WordPress Extend</a>', 'code-snippets' ) . '</p>' .
|
39 |
-
'<p>' . __( '<a href="http://wordpress.org/support/plugin/code-snippets" target="_blank">Support Forums</a>', 'code-snippets' ) . '</p>' .
|
40 |
-
'<p>' . __( '<a href="http://bungeshea.com/plugins/code-snippets/" target="_blank">Project Website</a>', 'code-snippets' ) . '</p>'
|
41 |
-
);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
includes/import/admin-messages.php
DELETED
@@ -1,32 +0,0 @@
|
|
1 |
-
<?php
|
2 |
-
|
3 |
-
/**
|
4 |
-
* Status and error messages for the import snippets page
|
5 |
-
*
|
6 |
-
* @package Code_Snippets
|
7 |
-
* @subpackage Admin_Messages
|
8 |
-
*/
|
9 |
-
|
10 |
-
if ( isset( $_REQUEST['imported'] ) && 0 !== intval( $_REQUEST['imported'] ) ) {
|
11 |
-
|
12 |
-
echo '<div id="message" class="updated fade"><p>';
|
13 |
-
|
14 |
-
printf(
|
15 |
-
_n(
|
16 |
-
'Successfully imported <strong>%d</strong> snippet. <a href="%s">Have fun!</a>',
|
17 |
-
'Successfully imported <strong>%d</strong> snippets. <a href="%s">Have fun!</a>',
|
18 |
-
$_REQUEST['imported'],
|
19 |
-
'code-snippets'
|
20 |
-
),
|
21 |
-
$_REQUEST['imported'],
|
22 |
-
code_snippets_get_menu_url( 'manage' )
|
23 |
-
);
|
24 |
-
|
25 |
-
echo '</p></div>';
|
26 |
-
}
|
27 |
-
elseif ( isset( $_REQUEST['error'] ) && $_REQUEST['error'] ) {
|
28 |
-
printf(
|
29 |
-
'<div id="message" class="error fade"><p>%s</p></div>',
|
30 |
-
__( 'An error occurred when processing the import file.', 'code-snippets' )
|
31 |
-
);
|
32 |
-
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
includes/import/import.php
DELETED
@@ -1,112 +0,0 @@
|
|
1 |
-
<?php
|
2 |
-
|
3 |
-
/**
|
4 |
-
* Functions to handle the import snippets menu
|
5 |
-
*
|
6 |
-
* @package Code_Snippets
|
7 |
-
* @subpackage Administration
|
8 |
-
*/
|
9 |
-
|
10 |
-
/**
|
11 |
-
* Add the importer to the Tools > Import menu
|
12 |
-
*
|
13 |
-
* @since 1.6
|
14 |
-
* @access private
|
15 |
-
*/
|
16 |
-
function code_snippets_register_importer() {
|
17 |
-
|
18 |
-
/* Only register the importer if the current user can manage snippets */
|
19 |
-
if ( defined( 'WP_LOAD_IMPORTERS' ) && current_user_can( get_snippets_cap() ) ) {
|
20 |
-
|
21 |
-
/* Load Importer API */
|
22 |
-
require_once ABSPATH . 'wp-admin/includes/import.php';
|
23 |
-
|
24 |
-
if ( ! class_exists( 'WP_Importer' ) ) {
|
25 |
-
$class_wp_importer = ABSPATH . 'wp-admin/includes/class-wp-importer.php';
|
26 |
-
if ( file_exists( $class_wp_importer ) ) {
|
27 |
-
require_once $class_wp_importer;
|
28 |
-
}
|
29 |
-
}
|
30 |
-
|
31 |
-
/* Register the Code Snippets importer with WordPress */
|
32 |
-
register_importer(
|
33 |
-
'code-snippets',
|
34 |
-
__( 'Code Snippets', 'code-snippets' ),
|
35 |
-
__( 'Import snippets from a code snippets export file', 'code-snippets' ),
|
36 |
-
'code_snippets_render_import_menu'
|
37 |
-
);
|
38 |
-
}
|
39 |
-
|
40 |
-
add_action( 'load-importer-code-snippets', 'code_snippets_load_import_menu' );
|
41 |
-
}
|
42 |
-
|
43 |
-
add_action( 'admin_init', 'code_snippets_register_importer' );
|
44 |
-
|
45 |
-
/**
|
46 |
-
* Add an Import Snippets page to the admin menu.
|
47 |
-
*
|
48 |
-
* @since 1.6
|
49 |
-
* @uses add_submenu_page() To register the menu page
|
50 |
-
*/
|
51 |
-
function code_snippets_add_import_menu() {
|
52 |
-
|
53 |
-
$hook = add_submenu_page(
|
54 |
-
code_snippets_get_menu_slug(),
|
55 |
-
__( 'Import Snippets', 'code-snippets' ),
|
56 |
-
__( 'Import', 'code-snippets' ),
|
57 |
-
get_snippets_cap(),
|
58 |
-
code_snippets_get_menu_slug( 'import' ),
|
59 |
-
'code_snippets_render_import_menu'
|
60 |
-
);
|
61 |
-
|
62 |
-
add_action( 'load-' . $hook, 'code_snippets_load_import_menu' );
|
63 |
-
}
|
64 |
-
|
65 |
-
add_action( 'admin_menu', 'code_snippets_add_import_menu' );
|
66 |
-
add_action( 'network_admin_menu', 'code_snippets_add_import_menu' );
|
67 |
-
|
68 |
-
/**
|
69 |
-
* Displays the import snippets page
|
70 |
-
*
|
71 |
-
* @since 2.0
|
72 |
-
*/
|
73 |
-
function code_snippets_render_import_menu() {
|
74 |
-
require_once plugin_dir_path( __FILE__ ) . 'admin-messages.php';
|
75 |
-
require_once plugin_dir_path( __FILE__ ) . 'admin.php';
|
76 |
-
}
|
77 |
-
|
78 |
-
/**
|
79 |
-
* Processes import files and loads the help tabs for the Import Snippets page
|
80 |
-
*
|
81 |
-
* @since 1.3
|
82 |
-
*
|
83 |
-
* @uses import_snippets() To process the import file
|
84 |
-
* @uses wp_redirect() To pass the import results to the page
|
85 |
-
* @uses add_query_arg() To append the results to the current URI
|
86 |
-
*/
|
87 |
-
function code_snippets_load_import_menu() {
|
88 |
-
$network = get_current_screen()->is_network;
|
89 |
-
|
90 |
-
/* Make sure the user has permission to be here */
|
91 |
-
if ( ! current_user_can( get_snippets_cap() ) ) {
|
92 |
-
wp_die( __( 'You are not access this page.', 'code-snippets' ) );
|
93 |
-
}
|
94 |
-
|
95 |
-
/* Create the snippet tables if they don't exist */
|
96 |
-
create_code_snippets_tables();
|
97 |
-
|
98 |
-
/* Process import files */
|
99 |
-
|
100 |
-
if ( isset( $_FILES['code_snippets_import_file']['tmp_name'] ) ) {
|
101 |
-
|
102 |
-
/* Import the snippets. The result is the number of snippets that were imported */
|
103 |
-
$result = import_snippets( $_FILES['code_snippets_import_file']['tmp_name'], $network );
|
104 |
-
|
105 |
-
/* Send the amount of imported snippets to the page */
|
106 |
-
$query_args = ( false === $result ) ? array( 'error' => true ) : array( 'imported' => $result );
|
107 |
-
wp_redirect( esc_url_raw( $query_args ) );
|
108 |
-
}
|
109 |
-
|
110 |
-
/* Load the screen help tabs */
|
111 |
-
require plugin_dir_path( __FILE__ ) . 'admin-help.php';
|
112 |
-
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
includes/manage/admin-help.php
DELETED
@@ -1,41 +0,0 @@
|
|
1 |
-
<?php
|
2 |
-
|
3 |
-
/**
|
4 |
-
* Register and handle the help tabs for the
|
5 |
-
* manage snippets admin page
|
6 |
-
*
|
7 |
-
* @package Code_Snippets
|
8 |
-
* @subpackage Manage
|
9 |
-
*/
|
10 |
-
|
11 |
-
$screen = get_current_screen();
|
12 |
-
|
13 |
-
$screen->add_help_tab( array(
|
14 |
-
'id' => 'overview',
|
15 |
-
'title' => __( 'Overview', 'code-snippets' ),
|
16 |
-
'content' =>
|
17 |
-
'<p>' . __( 'Snippets are similar to plugins - they both extend and expand the functionality of WordPress. Snippets are more light-weight, just a few lines of code, and do not put as much load on your server. Here you can manage your existing snippets and preform tasks on them such as activating, deactivating, deleting and exporting.', 'code-snippets' ) . '</p>'
|
18 |
-
) );
|
19 |
-
|
20 |
-
$screen->add_help_tab( array(
|
21 |
-
'id' => 'safe-mode',
|
22 |
-
'title' => __( 'Safe Mode', 'code-snippets' ),
|
23 |
-
'content' =>
|
24 |
-
'<p>' . __( 'Be sure to check your snippets for errors before you activate them, as a faulty snippet could bring your whole blog down. If your site starts doing strange things, deactivate all your snippets and activate them one at a time.', 'code-snippets' ) . '</p>' .
|
25 |
-
'<p>' . __( "If something goes wrong with a snippet and you can't use WordPress, you can cause all snippets to stop executing by adding <code>define('CODE_SNIPPETS_SAFE_MODE', true);</code> to your <code>wp-config.php</code> file. After you have deactivated the offending snippet, you can turn off safe mode by removing this line or replacing <strong>true</strong> with <strong>false</strong>.", 'code-snippets' ) . '</p>'
|
26 |
-
) );
|
27 |
-
|
28 |
-
$screen->add_help_tab( array(
|
29 |
-
'id' => 'uninstall',
|
30 |
-
'title' => __( 'Uninstall', 'code-snippets' ),
|
31 |
-
'content' =>
|
32 |
-
'<p>' . sprintf( __( 'When you delete Code Snippets through the Plugins menu in WordPress it will clear up the <code>%1$s</code> table and a few other bits of data stored in the database. If you want to keep this data (ie: you are only temporally uninstalling Code Snippets) then remove the <code>%2$s</code> folder using FTP.', 'code-snippets' ), get_snippets_table_name(), dirname( CODE_SNIPPETS_FILE ) ) .
|
33 |
-
'<p>' . __( "Even if you're sure that you don't want to use Code Snippets ever again on this WordPress installation, you may want to use the export feature to back up your snippets.", 'code-snippets' ) . '</p>'
|
34 |
-
) );
|
35 |
-
|
36 |
-
$screen->set_help_sidebar(
|
37 |
-
'<p><strong>' . __( 'For more information:', 'code-snippets' ) . '</strong></p>' .
|
38 |
-
'<p>' . __( '<a href="http://wordpress.org/plugins/code-snippets" target="_blank">WordPress Extend</a></p>', 'code-snippets' ) . '</p>' .
|
39 |
-
'<p>' . __( '<a href="http://wordpress.org/support/plugin/code-snippets" target="_blank">Support Forums</a>', 'code-snippets' ) . '</p>' .
|
40 |
-
'<p>' . __( '<a href="http://bungeshea.com/plugins/code-snippets/" target="_blank">Project Website</a>', 'code-snippets' ) . '</p>'
|
41 |
-
);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
includes/manage/admin-messages.php
DELETED
@@ -1,42 +0,0 @@
|
|
1 |
-
<?php
|
2 |
-
|
3 |
-
/**
|
4 |
-
* Status and error messages for the manage snippets page
|
5 |
-
*
|
6 |
-
* @package Code_Snippets
|
7 |
-
* @subpackage Manage
|
8 |
-
*/
|
9 |
-
|
10 |
-
$_f = '<div id="message" class="%2$s fade"><p>%1$s</p></div>';
|
11 |
-
|
12 |
-
if ( defined( 'CODE_SNIPPETS_SAFE_MODE' ) && CODE_SNIPPETS_SAFE_MODE ) :
|
13 |
-
|
14 |
-
printf( $_f, __( '<strong>Warning:</strong> Safe mode is active and snippets will not execute! Remove the <code>CODE_SNIPPETS_SAFE_MODE</code> constant from <code>wp-config.php</code> to turn off safe mode. <a href="https://github.com/sheabunge/code-snippets/wiki/Safe-Mode" target="_blank">Help</a>', 'code-snippets' ), 'error' );
|
15 |
-
|
16 |
-
endif;
|
17 |
-
|
18 |
-
if ( isset( $_REQUEST['activate'] ) ) :
|
19 |
-
|
20 |
-
printf( $_f, __( 'Snippet <strong>activated</strong>.', 'code-snippets' ), 'updated' );
|
21 |
-
|
22 |
-
elseif ( isset( $_REQUEST['activate-multi'] ) ) :
|
23 |
-
|
24 |
-
printf( $_f, __( 'Selected snippets <strong>activated</strong>.', 'code-snippets' ), 'updated' );
|
25 |
-
|
26 |
-
elseif ( isset( $_REQUEST['deactivate'] ) ) :
|
27 |
-
|
28 |
-
printf( $_f, __( 'Snippet <strong>deactivated</strong>.', 'code-snippets' ), 'updated' );
|
29 |
-
|
30 |
-
elseif ( isset( $_REQUEST['deactivate-multi'] ) ) :
|
31 |
-
|
32 |
-
printf( $_f, __( 'Selected snippets <strong>deactivated</strong>.', 'code-snippets' ), 'updated' );
|
33 |
-
|
34 |
-
elseif ( isset( $_REQUEST['delete'] ) ) :
|
35 |
-
|
36 |
-
printf( $_f, __( 'Snippet <strong>deleted</strong>.', 'code-snippets' ), 'updated' );
|
37 |
-
|
38 |
-
elseif ( isset( $_REQUEST['delete-multi'] ) ) :
|
39 |
-
|
40 |
-
printf( $_f, __( 'Selected snippets <strong>deleted</strong>.', 'code-snippets' ), 'updated' );
|
41 |
-
|
42 |
-
endif;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
includes/manage/admin.php
DELETED
@@ -1,51 +0,0 @@
|
|
1 |
-
<?php
|
2 |
-
|
3 |
-
/**
|
4 |
-
* HTML code for the Manage Snippets page
|
5 |
-
*
|
6 |
-
* @package Code_Snippets
|
7 |
-
* @subpackage Manage
|
8 |
-
*/
|
9 |
-
|
10 |
-
/* Bail if accessed directly */
|
11 |
-
if ( ! defined( 'ABSPATH' ) ) {
|
12 |
-
return;
|
13 |
-
}
|
14 |
-
|
15 |
-
global $code_snippets_list_table;
|
16 |
-
?>
|
17 |
-
|
18 |
-
<div class="wrap">
|
19 |
-
<?php screen_icon(); ?>
|
20 |
-
<h2><?php
|
21 |
-
esc_html_e( 'Snippets', 'code-snippets' );
|
22 |
-
|
23 |
-
if ( current_user_can( get_snippets_cap() ) ) {
|
24 |
-
|
25 |
-
printf( '<a href="%2$s" class="add-new-h2">%1$s</a>',
|
26 |
-
esc_html_x( 'Add New', 'snippet', 'code-snippets' ),
|
27 |
-
code_snippets_get_menu_url( 'add' )
|
28 |
-
);
|
29 |
-
}
|
30 |
-
|
31 |
-
$code_snippets_list_table->search_notice();
|
32 |
-
?></h2>
|
33 |
-
|
34 |
-
<?php $code_snippets_list_table->views(); ?>
|
35 |
-
|
36 |
-
<form method="get" action="">
|
37 |
-
<?php
|
38 |
-
$code_snippets_list_table->required_form_fields( 'search_box' );
|
39 |
-
$code_snippets_list_table->search_box( __( 'Search Installed Snippets', 'code-snippets' ), 'search_id' );
|
40 |
-
?>
|
41 |
-
</form>
|
42 |
-
<form method="post" action="">
|
43 |
-
<?php
|
44 |
-
$code_snippets_list_table->required_form_fields();
|
45 |
-
$code_snippets_list_table->display();
|
46 |
-
?>
|
47 |
-
</form>
|
48 |
-
|
49 |
-
<?php do_action( 'code_snippets/admin/manage' ); ?>
|
50 |
-
|
51 |
-
</div>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
includes/manage/class-list-table.php
DELETED
@@ -1,815 +0,0 @@
|
|
1 |
-
<?php
|
2 |
-
|
3 |
-
/**
|
4 |
-
* Contains the class for handling the snippets table
|
5 |
-
*
|
6 |
-
* @package Code_Snippets
|
7 |
-
* @subpackage Administration
|
8 |
-
*/
|
9 |
-
|
10 |
-
/* The WP_List_Table base class is not included by default, so we need to load it */
|
11 |
-
if ( ! class_exists( 'WP_List_Table' ) ) {
|
12 |
-
require_once ABSPATH . 'wp-admin/includes/class-wp-list-table.php';
|
13 |
-
}
|
14 |
-
|
15 |
-
/**
|
16 |
-
* This class handles the table for the manage snippets menu
|
17 |
-
*
|
18 |
-
* @since 1.5
|
19 |
-
* @access private
|
20 |
-
* @package Code_Snippets
|
21 |
-
*/
|
22 |
-
class Code_Snippets_List_Table extends WP_List_Table {
|
23 |
-
|
24 |
-
/**#@+
|
25 |
-
* @since 1.5
|
26 |
-
* @access private
|
27 |
-
*/
|
28 |
-
|
29 |
-
/**
|
30 |
-
* The constructor function for our class.
|
31 |
-
* Adds hooks, initializes variables, setups class.
|
32 |
-
*/
|
33 |
-
function __construct() {
|
34 |
-
global $status, $page;
|
35 |
-
$screen = get_current_screen();
|
36 |
-
|
37 |
-
/* Determine the status */
|
38 |
-
$status = 'all';
|
39 |
-
$statuses = array( 'active', 'inactive', 'recently_activated', 'admin', 'frontend' );
|
40 |
-
if ( isset( $_REQUEST['status'] ) && in_array( $_REQUEST['status'], $statuses ) ) {
|
41 |
-
$status = $_REQUEST['status'];
|
42 |
-
}
|
43 |
-
|
44 |
-
/* Add the search query to the URL */
|
45 |
-
if ( isset( $_REQUEST['s'] ) ) {
|
46 |
-
$_SERVER['REQUEST_URI'] = add_query_arg( 's', stripslashes( $_REQUEST['s'] ) );
|
47 |
-
}
|
48 |
-
|
49 |
-
/* Add a snippets per page screen option */
|
50 |
-
$page = $this->get_pagenum();
|
51 |
-
|
52 |
-
add_screen_option( 'per_page', array(
|
53 |
-
'label' => __( 'Snippets per page', 'code-snippets' ),
|
54 |
-
'default' => 10,
|
55 |
-
'option' => 'snippets_per_page',
|
56 |
-
) );
|
57 |
-
|
58 |
-
/* Set the table columns hidden in Screen Options by default */
|
59 |
-
add_filter( "get_user_option_manage{$screen->id}columnshidden", array( $this, 'get_default_hidden_columns' ), 15 );
|
60 |
-
|
61 |
-
/* Strip once-off query args from the URL */
|
62 |
-
$_SERVER['REQUEST_URI'] = remove_query_arg( array( 'activate', 'activate-multi', 'deactivate', 'deactivate-multi', 'delete', 'delete-multi' ) );
|
63 |
-
|
64 |
-
/* Add filters to format the snippet description in the same way the post content is formatted */
|
65 |
-
$filters = array( 'wptexturize', 'convert_smilies', 'convert_chars', 'wpautop', 'shortcode_unautop', 'capital_P_dangit' );
|
66 |
-
|
67 |
-
foreach ( $filters as $filter ) {
|
68 |
-
add_filter( 'code_snippets/list_table/print_snippet_description', $filter );
|
69 |
-
}
|
70 |
-
|
71 |
-
/* Setup the class */
|
72 |
-
parent::__construct( array(
|
73 |
-
'singular' => 'snippet',
|
74 |
-
'plural' => 'snippets',
|
75 |
-
'ajax' => true,
|
76 |
-
) );
|
77 |
-
}
|
78 |
-
|
79 |
-
/**
|
80 |
-
* Define the output of all columns that have no callback function
|
81 |
-
* @param object $snippet The snippet object used for the current row
|
82 |
-
* @param string $column_name The name of the column being printed
|
83 |
-
* @return string The content of the column to output
|
84 |
-
*/
|
85 |
-
function column_default( $snippet, $column_name ) {
|
86 |
-
|
87 |
-
switch ( $column_name ) {
|
88 |
-
case 'id':
|
89 |
-
return $snippet->id;
|
90 |
-
case 'description':
|
91 |
-
if ( ! empty( $snippet->description ) ) {
|
92 |
-
return apply_filters( 'code_snippets/list_table/print_snippet_description', $snippet->description );
|
93 |
-
} else {
|
94 |
-
return '—';
|
95 |
-
}
|
96 |
-
default:
|
97 |
-
return do_action( "code_snippets/list_table/column_{$column_name}", $snippet );
|
98 |
-
}
|
99 |
-
}
|
100 |
-
|
101 |
-
/**
|
102 |
-
* Builds content of the snippet name column
|
103 |
-
* @param object $snippet The snippet object being used for the current row
|
104 |
-
* @return string The content of the column to output
|
105 |
-
*/
|
106 |
-
function column_name( $snippet ) {
|
107 |
-
|
108 |
-
/* Build row actions */
|
109 |
-
|
110 |
-
$actions = array();
|
111 |
-
$screen = get_current_screen();
|
112 |
-
|
113 |
-
if ( $snippet->active ) {
|
114 |
-
$actions['deactivate'] = sprintf(
|
115 |
-
'<a href="%2$s">%1$s</a>',
|
116 |
-
$screen->is_network ? __( 'Network Deactivate', 'code-snippets' ) : __( 'Deactivate', 'code-snippets' ),
|
117 |
-
esc_url( add_query_arg( array(
|
118 |
-
'action' => 'deactivate',
|
119 |
-
'id' => $snippet->id,
|
120 |
-
) ) )
|
121 |
-
);
|
122 |
-
} else {
|
123 |
-
$actions['activate'] = sprintf(
|
124 |
-
'<a href="%2$s">%1$s</a>',
|
125 |
-
$screen->is_network ? __( 'Network Activate', 'code-snippets' ) : __( 'Activate', 'code-snippets' ),
|
126 |
-
esc_url( add_query_arg( array(
|
127 |
-
'action' => 'activate',
|
128 |
-
'id' => $snippet->id,
|
129 |
-
) ) )
|
130 |
-
);
|
131 |
-
}
|
132 |
-
|
133 |
-
$actions['edit'] = sprintf(
|
134 |
-
'<a href="%2$s">%1$s</a>',
|
135 |
-
__( 'Edit', 'code-snippets' ),
|
136 |
-
get_snippet_edit_url( $snippet->id )
|
137 |
-
);
|
138 |
-
|
139 |
-
$actions['export'] = sprintf(
|
140 |
-
'<a href="%2$s">%1$s</a>',
|
141 |
-
__( 'Export', 'code-snippets' ),
|
142 |
-
esc_url( add_query_arg( array(
|
143 |
-
'action' => 'export',
|
144 |
-
'id' => $snippet->id,
|
145 |
-
) ) )
|
146 |
-
);
|
147 |
-
|
148 |
-
$actions['delete'] = sprintf(
|
149 |
-
'<a href="%2$s" class="delete" onclick="%3$s">%1$s</a>',
|
150 |
-
__( 'Delete', 'code-snippets' ),
|
151 |
-
esc_url( add_query_arg( array(
|
152 |
-
'action' => 'delete',
|
153 |
-
'id' => $snippet->id,
|
154 |
-
) ) ),
|
155 |
-
esc_js( sprintf(
|
156 |
-
'return confirm("%s");',
|
157 |
-
__("You are about to permanently delete the selected item.
|
158 |
-
'Cancel' to stop, 'OK' to delete.", 'code-snippets' )
|
159 |
-
) )
|
160 |
-
);
|
161 |
-
|
162 |
-
if ( ! empty( $snippet->name ) ) {
|
163 |
-
$title = $snippet->name;
|
164 |
-
} else {
|
165 |
-
$title = sprintf( __( 'Untitled #%d', 'code-snippets' ), $snippet->id );
|
166 |
-
}
|
167 |
-
|
168 |
-
$row_actions = $this->row_actions( $actions,
|
169 |
-
apply_filters( 'code_snippets/list_table/row_actions_always_visiable', false )
|
170 |
-
);
|
171 |
-
|
172 |
-
/* Return the name contents */
|
173 |
-
return apply_filters(
|
174 |
-
'code_snippets/list_table/column_name',
|
175 |
-
sprintf( '<a href="%2$s"><strong>%1$s</strong></a>', $title,
|
176 |
-
get_snippet_edit_url( $snippet->id )
|
177 |
-
) . $row_actions,
|
178 |
-
$snippet
|
179 |
-
);
|
180 |
-
}
|
181 |
-
|
182 |
-
/**
|
183 |
-
* Builds the checkbox column content
|
184 |
-
* @param object $snippet The snippet object being used for the current row
|
185 |
-
* @return string The column content to be printed
|
186 |
-
*/
|
187 |
-
function column_cb( $snippet ) {
|
188 |
-
return apply_filters(
|
189 |
-
'code_snippets/list_table/column_cb',
|
190 |
-
sprintf( '<input type="checkbox" name="ids[]" value="%s" />', $snippet->id ),
|
191 |
-
$snippet
|
192 |
-
);
|
193 |
-
}
|
194 |
-
|
195 |
-
/**
|
196 |
-
* Output the content of the tags column
|
197 |
-
* This function is used once for each row
|
198 |
-
* @since 2.0
|
199 |
-
* @param object $snippet
|
200 |
-
*/
|
201 |
-
function column_tags( $snippet ) {
|
202 |
-
|
203 |
-
if ( ! empty( $snippet->tags ) ) {
|
204 |
-
|
205 |
-
foreach ( $snippet->tags as $tag ) {
|
206 |
-
$out[] = sprintf( '<a href="%s">%s</a>',
|
207 |
-
esc_url( add_query_arg( 'tag', esc_attr( $tag ) ) ),
|
208 |
-
esc_html( $tag )
|
209 |
-
);
|
210 |
-
}
|
211 |
-
echo join( ', ', $out );
|
212 |
-
} else {
|
213 |
-
echo '—';
|
214 |
-
}
|
215 |
-
}
|
216 |
-
|
217 |
-
/**
|
218 |
-
* Define the column headers for the table
|
219 |
-
* @return array The column headers, ID paired with label
|
220 |
-
*/
|
221 |
-
function get_columns() {
|
222 |
-
$columns = array(
|
223 |
-
'cb' => '<input type="checkbox" />',
|
224 |
-
'name' => __( 'Name', 'code-snippets' ),
|
225 |
-
'id' => __( 'ID', 'code-snippets' ),
|
226 |
-
'description' => __( 'Description', 'code-snippets' ),
|
227 |
-
'tags' => __( 'Tags', 'code-snippets' ),
|
228 |
-
);
|
229 |
-
return apply_filters( 'code_snippets/list_table/columns', $columns );
|
230 |
-
}
|
231 |
-
|
232 |
-
/**
|
233 |
-
* Define the columns that can be sorted
|
234 |
-
* @return array The IDs of the columns that can be sorted
|
235 |
-
*/
|
236 |
-
function get_sortable_columns() {
|
237 |
-
$sortable_columns = array(
|
238 |
-
'id' => array( 'id', true ),
|
239 |
-
'name' => array( 'name', false ),
|
240 |
-
);
|
241 |
-
return apply_filters( 'code_snippets/list_table/sortable_columns', $sortable_columns );
|
242 |
-
}
|
243 |
-
|
244 |
-
/**
|
245 |
-
* Define the columns that are hidden by default
|
246 |
-
* @param unknown $result
|
247 |
-
* @return unknown
|
248 |
-
*/
|
249 |
-
function get_default_hidden_columns( $result ) {
|
250 |
-
if ( ! $result ) {
|
251 |
-
return array( 'id' );
|
252 |
-
} else {
|
253 |
-
return $result;
|
254 |
-
}
|
255 |
-
}
|
256 |
-
|
257 |
-
/**
|
258 |
-
* Define the bulk actions to include in the drop-down menus
|
259 |
-
* @return array An array of menu items with the ID paired to the label
|
260 |
-
*/
|
261 |
-
function get_bulk_actions() {
|
262 |
-
$screen = get_current_screen();
|
263 |
-
$actions = array(
|
264 |
-
'activate-selected' => $screen->is_network ? __( 'Network Activate', 'code-snippets' ) : __( 'Activate', 'code-snippets' ),
|
265 |
-
'deactivate-selected' => $screen->is_network ? __( 'Network Deactivate', 'code-snippets' ) : __( 'Deactivate', 'code-snippets' ),
|
266 |
-
'export-selected' => __( 'Export', 'code-snippets' ),
|
267 |
-
'delete-selected' => __( 'Delete', 'code-snippets' ),
|
268 |
-
'export-php-selected' => __( 'Export to PHP', 'code-snippets' ),
|
269 |
-
);
|
270 |
-
return apply_filters( 'code_snippets/list_table/bulk_actions', $actions );
|
271 |
-
}
|
272 |
-
|
273 |
-
/**
|
274 |
-
* Retrieve the classes for the table
|
275 |
-
*
|
276 |
-
* We override this in order to add 'snippets' as a class
|
277 |
-
* for custom styling
|
278 |
-
*
|
279 |
-
* @return array The classes to include on the table element
|
280 |
-
*/
|
281 |
-
function get_table_classes() {
|
282 |
-
$classes = array( 'widefat', $this->_args['plural'] );
|
283 |
-
return apply_filters( 'code_snippets/list_table/table_classes', $classes );
|
284 |
-
}
|
285 |
-
|
286 |
-
/**
|
287 |
-
* Retrieve the 'views' of the table
|
288 |
-
*
|
289 |
-
* Example: active, inactive, recently active
|
290 |
-
*
|
291 |
-
* @return array A list of the view labels linked to the view
|
292 |
-
*/
|
293 |
-
function get_views() {
|
294 |
-
global $totals, $status;
|
295 |
-
|
296 |
-
$status_links = array();
|
297 |
-
foreach ( $totals as $type => $count ) {
|
298 |
-
|
299 |
-
if ( ! $count ) {
|
300 |
-
continue;
|
301 |
-
}
|
302 |
-
|
303 |
-
switch ( $type ) {
|
304 |
-
case 'all':
|
305 |
-
$text = _n( 'All <span class="count">(%s)</span>', 'All <span class="count">(%s)</span>', $count, 'code-snippets' );
|
306 |
-
break;
|
307 |
-
case 'active':
|
308 |
-
$text = _n( 'Active <span class="count">(%s)</span>', 'Active <span class="count">(%s)</span>', $count, 'code-snippets' );
|
309 |
-
break;
|
310 |
-
case 'recently_activated':
|
311 |
-
$text = _n( 'Recently Active <span class="count">(%s)</span>', 'Recently Active <span class="count">(%s)</span>', $count, 'code-snippets' );
|
312 |
-
break;
|
313 |
-
case 'inactive':
|
314 |
-
$text = _n( 'Inactive <span class="count">(%s)</span>', 'Inactive <span class="count">(%s)</span>', $count, 'code-snippets' );
|
315 |
-
break;
|
316 |
-
case 'admin':
|
317 |
-
$text = _n( 'Admin <span class="count">(%s)</span>', 'Admin <span class="count">(%s)</span>', $count, 'code-snippets' );
|
318 |
-
break;
|
319 |
-
case 'frontend':
|
320 |
-
$text = _n( 'Front End <span class="count">(%s)</span>', 'Front End <span class="count">(%s)</span>', $count, 'code-snippets' );
|
321 |
-
break;
|
322 |
-
}
|
323 |
-
|
324 |
-
$status_links[ $type ] = sprintf( '<a href="%s"%s>%s</a>',
|
325 |
-
esc_url( add_query_arg( 'status', $type ) ),
|
326 |
-
( $type === $status ) ? ' class="current"' : '',
|
327 |
-
sprintf( $text, number_format_i18n( $count ) )
|
328 |
-
);
|
329 |
-
|
330 |
-
}
|
331 |
-
|
332 |
-
return apply_filters( 'code_snippets/list_table/views', $status_links );
|
333 |
-
}
|
334 |
-
|
335 |
-
/**
|
336 |
-
* Gets the tags of the snippets currently being viewed in the table
|
337 |
-
* @since 2.0
|
338 |
-
*/
|
339 |
-
function get_current_tags() {
|
340 |
-
global $snippets, $status;
|
341 |
-
|
342 |
-
/* If we're not viewing a snippets table, get all used tags instead */
|
343 |
-
if ( ! isset( $snippets, $status ) ) {
|
344 |
-
return get_all_snippet_tags();
|
345 |
-
}
|
346 |
-
|
347 |
-
$tags = array();
|
348 |
-
|
349 |
-
/* Merge all tags into a single array */
|
350 |
-
foreach ( $snippets[ $status ] as $snippet ) {
|
351 |
-
$tags = array_merge( $snippet->tags, $tags );
|
352 |
-
}
|
353 |
-
|
354 |
-
/* Remove duplicate tags */
|
355 |
-
return array_values( array_unique( $tags, SORT_REGULAR ) );
|
356 |
-
}
|
357 |
-
|
358 |
-
/**
|
359 |
-
* Add filters and extra actions above and below the table
|
360 |
-
* @param string $which Are the actions displayed on the table top or bottom
|
361 |
-
*/
|
362 |
-
function extra_tablenav( $which ) {
|
363 |
-
global $status, $wpdb;
|
364 |
-
|
365 |
-
$screen = get_current_screen();
|
366 |
-
|
367 |
-
if ( 'top' === $which ) {
|
368 |
-
|
369 |
-
/* Tags dropdown filter */
|
370 |
-
$tags = $this->get_current_tags();
|
371 |
-
|
372 |
-
if ( count( $tags ) ) {
|
373 |
-
$query = isset( $_GET['tag'] ) ? $_GET['tag'] : '';
|
374 |
-
|
375 |
-
echo '<div class="alignleft actions">';
|
376 |
-
echo '<select name="tag">';
|
377 |
-
|
378 |
-
printf( "<option %s value=''>%s</option>\n",
|
379 |
-
selected( $query, '', false ),
|
380 |
-
__( 'Show all tags', 'code-snippets' )
|
381 |
-
);
|
382 |
-
|
383 |
-
foreach ( $tags as $tag ) {
|
384 |
-
|
385 |
-
printf( "<option %s value='%s'>%s</option>\n",
|
386 |
-
selected( $query, $tag, false ),
|
387 |
-
esc_attr( $tag ),
|
388 |
-
$tag
|
389 |
-
);
|
390 |
-
}
|
391 |
-
|
392 |
-
echo '</select>';
|
393 |
-
|
394 |
-
submit_button( __( 'Filter', 'code-snippets' ), 'button', false, false );
|
395 |
-
echo '</div>';
|
396 |
-
}
|
397 |
-
}
|
398 |
-
|
399 |
-
echo '<div class="alignleft actions">';
|
400 |
-
|
401 |
-
if ( 'recently_activated' === $status ) {
|
402 |
-
submit_button( __( 'Clear List', 'code-snippets' ), 'secondary', 'clear-recent-list', false );
|
403 |
-
}
|
404 |
-
|
405 |
-
do_action( 'code_snippets/list_table/actions', $which );
|
406 |
-
|
407 |
-
echo '</div>';
|
408 |
-
}
|
409 |
-
|
410 |
-
/**
|
411 |
-
* Output form fields needed to preserve important
|
412 |
-
* query vars over form submissions
|
413 |
-
*
|
414 |
-
* @param string $context In what context are the fields being outputted?
|
415 |
-
*/
|
416 |
-
function required_form_fields( $context = 'main' ) {
|
417 |
-
|
418 |
-
$vars = apply_filters(
|
419 |
-
'code_snippets/list_table/required_form_fields',
|
420 |
-
array( 'page', 's', 'status', 'paged', 'tag' ),
|
421 |
-
$context
|
422 |
-
);
|
423 |
-
|
424 |
-
if ( 'search_box' === $context ) {
|
425 |
-
/* Remove the 's' var if we're doing this for the search box */
|
426 |
-
$vars = array_diff( $vars, array( 's' ) );
|
427 |
-
}
|
428 |
-
|
429 |
-
foreach ( $vars as $var ) {
|
430 |
-
if ( ! empty( $_REQUEST[ $var ] ) ) {
|
431 |
-
printf( '<input type="hidden" name="%s" value="%s" />', $var, $_REQUEST[ $var ] );
|
432 |
-
print "\n";
|
433 |
-
}
|
434 |
-
}
|
435 |
-
|
436 |
-
do_action( 'code_snippets/list_table/print_required_form_fields', $context );
|
437 |
-
}
|
438 |
-
|
439 |
-
|
440 |
-
/**
|
441 |
-
* Clear the recently activated snippets list if we've clicked the button
|
442 |
-
* @return string The action to execute
|
443 |
-
*/
|
444 |
-
function current_action() {
|
445 |
-
if ( isset( $_POST['clear-recent-list'] ) ) {
|
446 |
-
$action = 'clear-recent-list';
|
447 |
-
} else {
|
448 |
-
$action = parent::current_action();
|
449 |
-
}
|
450 |
-
return apply_filters( 'code_snippets/list_table/current_action', $action );
|
451 |
-
}
|
452 |
-
|
453 |
-
/**
|
454 |
-
* Processes a bulk action
|
455 |
-
*
|
456 |
-
* @uses activate_snippet() To activate snippets
|
457 |
-
* @uses deactivate_snippet() To deactivate snippets
|
458 |
-
* @uses delete_snippet() To delete snippets
|
459 |
-
* @uses export_snippets() To export selected snippets
|
460 |
-
* @uses wp_redirect() To pass the results to the current page
|
461 |
-
* @uses add_query_arg() To append the results to the current URI
|
462 |
-
*/
|
463 |
-
function process_bulk_actions() {
|
464 |
-
$network = get_current_screen()->is_network;
|
465 |
-
|
466 |
-
if ( isset( $_GET['action'], $_GET['id'] ) ) :
|
467 |
-
|
468 |
-
$id = absint( $_GET['id'] );
|
469 |
-
$action = sanitize_key( $_GET['action'] );
|
470 |
-
$_SERVER['REQUEST_URI'] = remove_query_arg( array( 'action', 'id' ) );
|
471 |
-
|
472 |
-
if ( 'activate' === $action ) {
|
473 |
-
activate_snippet( $id, $network );
|
474 |
-
}
|
475 |
-
elseif ( 'deactivate' === $action ) {
|
476 |
-
deactivate_snippet( $id, $network );
|
477 |
-
}
|
478 |
-
elseif ( 'delete' === $action ) {
|
479 |
-
delete_snippet( $id, $network );
|
480 |
-
}
|
481 |
-
elseif ( 'export' === $action ) {
|
482 |
-
export_snippets( $id, $network );
|
483 |
-
}
|
484 |
-
elseif ( 'export-php' === $action ) {
|
485 |
-
export_snippets( $id, $network, 'php' );
|
486 |
-
}
|
487 |
-
|
488 |
-
if ( ! in_array( $action, array( 'export', 'export-php' ) ) ) {
|
489 |
-
wp_redirect( apply_filters(
|
490 |
-
"code_snippets/{$action}_redirect",
|
491 |
-
esc_url_raw( add_query_arg( $action, true ) )
|
492 |
-
) );
|
493 |
-
}
|
494 |
-
|
495 |
-
endif;
|
496 |
-
|
497 |
-
if ( ! isset( $_POST['ids'] ) ) {
|
498 |
-
return;
|
499 |
-
}
|
500 |
-
|
501 |
-
$ids = $_POST['ids'];
|
502 |
-
|
503 |
-
$_SERVER['REQUEST_URI'] = remove_query_arg( array( 'activate', 'deactivate', 'delete', 'activate-multi', 'deactivate-multi', 'delete-multi' ) );
|
504 |
-
|
505 |
-
switch ( $this->current_action() ) {
|
506 |
-
|
507 |
-
case 'activate-selected':
|
508 |
-
foreach ( $ids as $id ) {
|
509 |
-
activate_snippet( $id, $network );
|
510 |
-
}
|
511 |
-
wp_redirect( esc_url_raw( add_query_arg( 'activate-multi', true ) ) );
|
512 |
-
break;
|
513 |
-
|
514 |
-
case 'deactivate-selected':
|
515 |
-
foreach ( $ids as $id ) {
|
516 |
-
deactivate_snippet( $id, $network );
|
517 |
-
}
|
518 |
-
wp_redirect( esc_url_raw( add_query_arg( 'deactivate-multi', true ) ) );
|
519 |
-
break;
|
520 |
-
|
521 |
-
case 'export-selected':
|
522 |
-
export_snippets( $ids, $network );
|
523 |
-
break;
|
524 |
-
|
525 |
-
case 'export-php-selected':
|
526 |
-
export_snippets( $ids, $network, 'php' );
|
527 |
-
break;
|
528 |
-
|
529 |
-
case 'delete-selected':
|
530 |
-
foreach ( $ids as $id ) {
|
531 |
-
delete_snippet( $id, $network );
|
532 |
-
}
|
533 |
-
wp_redirect( esc_url_raw( add_query_arg( 'delete-multi', true ) ) );
|
534 |
-
break;
|
535 |
-
|
536 |
-
case 'clear-recent-list':
|
537 |
-
if ( $network ) {
|
538 |
-
update_site_option( 'recently_activated_snippets', array() );
|
539 |
-
} else {
|
540 |
-
update_option( 'recently_activated_snippets', array() );
|
541 |
-
}
|
542 |
-
break;
|
543 |
-
}
|
544 |
-
}
|
545 |
-
|
546 |
-
/**
|
547 |
-
* Message to display if no snippets are found
|
548 |
-
*/
|
549 |
-
function no_items() {
|
550 |
-
printf(
|
551 |
-
__( 'You do not appear to have any snippets available at this time. <a href="%s">Add New→</a>', 'code-snippets' ),
|
552 |
-
code_snippets_get_menu_url( 'add' )
|
553 |
-
);
|
554 |
-
}
|
555 |
-
|
556 |
-
/**
|
557 |
-
* Prepares the items to later display in the table.
|
558 |
-
* Should run before any headers are sent.
|
559 |
-
*/
|
560 |
-
function prepare_items() {
|
561 |
-
global $status, $snippets, $totals, $page, $orderby, $order, $s;
|
562 |
-
|
563 |
-
wp_reset_vars( array( 'orderby', 'order', 's' ) );
|
564 |
-
|
565 |
-
$screen = get_current_screen();
|
566 |
-
$user = get_current_user_id();
|
567 |
-
|
568 |
-
/* First, lets process the bulk actions */
|
569 |
-
$this->process_bulk_actions();
|
570 |
-
|
571 |
-
$snippets = array(
|
572 |
-
'all' => apply_filters( 'code_snippets/list_table/get_snippets', get_snippets( $screen->is_network ) ),
|
573 |
-
'active' => array(),
|
574 |
-
'inactive' => array(),
|
575 |
-
'recently_activated' => array(),
|
576 |
-
'admin' => array(),
|
577 |
-
'frontend' => array(),
|
578 |
-
);
|
579 |
-
|
580 |
-
/* Filter snippets by tag */
|
581 |
-
if ( isset( $_POST['tag'] ) ) {
|
582 |
-
$location = empty( $_POST['tag'] ) ? remove_query_arg( 'tag' ) : add_query_arg( 'tag', $_POST['tag'] );
|
583 |
-
wp_redirect( esc_url_raw( $location ) );
|
584 |
-
}
|
585 |
-
|
586 |
-
if ( ! empty( $_GET['tag'] ) ) {
|
587 |
-
$snippets['all'] = array_filter( $snippets['all'], array( $this, '_tags_filter_callback' ) );
|
588 |
-
}
|
589 |
-
|
590 |
-
/* Filter snippets based on search query */
|
591 |
-
if ( $s ) {
|
592 |
-
$snippets['all'] = array_filter( $snippets['all'], array( $this, '_search_callback' ) );
|
593 |
-
}
|
594 |
-
|
595 |
-
if ( $screen->is_network ) {
|
596 |
-
$recently_activated = get_site_option( 'recently_activated_snippets', array() );
|
597 |
-
} else {
|
598 |
-
$recently_activated = get_option( 'recently_activated_snippets', array() );
|
599 |
-
}
|
600 |
-
|
601 |
-
$one_week = 7 * 24 * 60 * 60;
|
602 |
-
foreach ( $recently_activated as $key => $time ) {
|
603 |
-
|
604 |
-
if ( $time + $one_week < time() ) {
|
605 |
-
unset( $recently_activated[ $key ] );
|
606 |
-
}
|
607 |
-
}
|
608 |
-
|
609 |
-
if ( $screen->is_network ) {
|
610 |
-
update_site_option( 'recently_activated_snippets', $recently_activated );
|
611 |
-
} else {
|
612 |
-
update_option( 'recently_activated_snippets', $recently_activated );
|
613 |
-
}
|
614 |
-
|
615 |
-
$scopes_enabled = code_snippets_get_setting( 'general', 'snippet_scope_enabled' );
|
616 |
-
foreach ( (array) $snippets['all'] as $snippet ) {
|
617 |
-
/* Filter into individual sections */
|
618 |
-
if ( $snippet->active ) {
|
619 |
-
$snippets['active'][] = $snippet;
|
620 |
-
} else {
|
621 |
-
// Was the snippet recently activated?
|
622 |
-
if ( isset( $recently_activated[ $snippet->id ] ) ) {
|
623 |
-
$snippets['recently_activated'][] = $snippet;
|
624 |
-
}
|
625 |
-
$snippets['inactive'][] = $snippet;
|
626 |
-
}
|
627 |
-
|
628 |
-
if ( $scopes_enabled ) {
|
629 |
-
|
630 |
-
if ( '1' == $snippet->scope ) {
|
631 |
-
$snippets['admin'][] = $snippet;
|
632 |
-
} elseif ( '2' == $snippet->scope ) {
|
633 |
-
$snippets['frontend'][] = $snippet;
|
634 |
-
}
|
635 |
-
}
|
636 |
-
}
|
637 |
-
|
638 |
-
$totals = array();
|
639 |
-
foreach ( $snippets as $type => $list ) {
|
640 |
-
$totals[ $type ] = count( $list );
|
641 |
-
}
|
642 |
-
|
643 |
-
if ( empty( $snippets[ $status ] ) ) {
|
644 |
-
$status = 'all';
|
645 |
-
}
|
646 |
-
|
647 |
-
$data = $snippets[ $status ];
|
648 |
-
|
649 |
-
/*
|
650 |
-
* First, lets decide how many records per page to show
|
651 |
-
* by getting the user's setting in the Screen Options
|
652 |
-
* panel.
|
653 |
-
*/
|
654 |
-
$sort_by = $screen->get_option( 'per_page', 'option' );
|
655 |
-
$screen_option = $screen->get_option( 'per_page', 'option' );
|
656 |
-
$per_page = get_user_meta( $user, $screen_option, true );
|
657 |
-
|
658 |
-
if ( empty ( $per_page ) || $per_page < 1 ) {
|
659 |
-
$per_page = $screen->get_option( 'per_page', 'default' );
|
660 |
-
}
|
661 |
-
|
662 |
-
$per_page = (int) $per_page;
|
663 |
-
|
664 |
-
$this->_column_headers = $this->get_column_info();
|
665 |
-
|
666 |
-
/**
|
667 |
-
* This checks for sorting input and sorts the data in our array accordingly.
|
668 |
-
*
|
669 |
-
* @ignore
|
670 |
-
*/
|
671 |
-
function usort_reorder( $a, $b ) {
|
672 |
-
|
673 |
-
/* If no sort, default to ID */
|
674 |
-
$orderby = (
|
675 |
-
! empty( $_REQUEST['orderby'] )
|
676 |
-
? $_REQUEST['orderby']
|
677 |
-
: apply_filters( 'code_snippets/list_table/default_orderby', 'id' )
|
678 |
-
);
|
679 |
-
|
680 |
-
/* If no order, default to ascending */
|
681 |
-
$order = (
|
682 |
-
! empty( $_REQUEST['order'] )
|
683 |
-
? $_REQUEST['order']
|
684 |
-
: apply_filters( 'code_snippets/list_table/default_order', 'asc' )
|
685 |
-
);
|
686 |
-
|
687 |
-
/* Determine sort order */
|
688 |
-
if ( 'id' === $orderby ) {
|
689 |
-
$result = $a->$orderby - $b->$orderby; // get the result for numerical data
|
690 |
-
} else {
|
691 |
-
$result = strcmp( $a->$orderby, $b->$orderby ); // get the result for string data
|
692 |
-
}
|
693 |
-
|
694 |
-
/* Send final sort direction to usort */
|
695 |
-
return ( 'asc' === $order ) ? $result : -$result;
|
696 |
-
}
|
697 |
-
|
698 |
-
usort( $data, 'usort_reorder' );
|
699 |
-
|
700 |
-
/*
|
701 |
-
* Let's figure out what page the user is currently
|
702 |
-
* looking at.
|
703 |
-
*/
|
704 |
-
$current_page = $this->get_pagenum();
|
705 |
-
|
706 |
-
/*
|
707 |
-
* Let's check how many items are in our data array.
|
708 |
-
*/
|
709 |
-
$total_items = count( $data );
|
710 |
-
|
711 |
-
/*
|
712 |
-
* The WP_List_Table class does not handle pagination for us, so we need
|
713 |
-
* to ensure that the data is trimmed to only the current page.
|
714 |
-
*/
|
715 |
-
$data = array_slice( $data, ( ( $current_page - 1 ) * $per_page ), $per_page );
|
716 |
-
|
717 |
-
/*
|
718 |
-
* Now we can add our *sorted* data to the items property, where
|
719 |
-
* it can be used by the rest of the class.
|
720 |
-
*/
|
721 |
-
$this->items = $data;
|
722 |
-
|
723 |
-
/*
|
724 |
-
* We also have to register our pagination options & calculations.
|
725 |
-
*/
|
726 |
-
$this->set_pagination_args( array(
|
727 |
-
'total_items' => $total_items, // Calculate the total number of items
|
728 |
-
'per_page' => $per_page, // Determine how many items to show on a page
|
729 |
-
'total_pages' => ceil( $total_items / $per_page ), // Calculate the total number of pages
|
730 |
-
) );
|
731 |
-
}
|
732 |
-
|
733 |
-
/**
|
734 |
-
* Used internally
|
735 |
-
* @ignore
|
736 |
-
*/
|
737 |
-
function _search_callback( $snippet ) {
|
738 |
-
static $term;
|
739 |
-
if ( is_null( $term ) ) {
|
740 |
-
$term = stripslashes( $_REQUEST['s'] );
|
741 |
-
}
|
742 |
-
|
743 |
-
foreach ( $snippet as $value ) {
|
744 |
-
|
745 |
-
if ( is_string( $value ) ) {
|
746 |
-
if ( false !== stripos( $value, $term ) ) {
|
747 |
-
return true;
|
748 |
-
}
|
749 |
-
}
|
750 |
-
elseif ( is_array( $value ) ) {
|
751 |
-
if ( false !== in_array( $term, $value ) ) {
|
752 |
-
return true;
|
753 |
-
}
|
754 |
-
}
|
755 |
-
}
|
756 |
-
|
757 |
-
return false;
|
758 |
-
}
|
759 |
-
|
760 |
-
|
761 |
-
/**
|
762 |
-
* Used internally
|
763 |
-
* @ignore
|
764 |
-
*/
|
765 |
-
function _tags_filter_callback( $snippet ) {
|
766 |
-
$tags = explode( ',', $_GET['tag'] );
|
767 |
-
|
768 |
-
foreach ( $tags as $tag ) {
|
769 |
-
if ( in_array( $tag, $snippet->tags ) ) {
|
770 |
-
return true;
|
771 |
-
}
|
772 |
-
}
|
773 |
-
}
|
774 |
-
|
775 |
-
/**
|
776 |
-
* Display a notice showing the current search terms
|
777 |
-
*
|
778 |
-
* @since 1.7
|
779 |
-
* @access public
|
780 |
-
*/
|
781 |
-
public function search_notice() {
|
782 |
-
if ( ! empty( $_REQUEST['s'] ) || ! empty( $_GET['tag'] ) ) {
|
783 |
-
|
784 |
-
echo '<span class="subtitle">' . __( 'Search results', 'code-snippets' );
|
785 |
-
|
786 |
-
if ( ! empty ( $_REQUEST['s'] ) ) {
|
787 |
-
echo sprintf( __( ' for “%s”', 'code-snippets' ), esc_html( $_REQUEST['s'] ) );
|
788 |
-
}
|
789 |
-
|
790 |
-
if ( ! empty( $_GET['tag'] ) ) {
|
791 |
-
echo sprintf( __( ' in tag “%s”', 'code-snippets' ), $_GET['tag'] );
|
792 |
-
}
|
793 |
-
|
794 |
-
echo '</span>';
|
795 |
-
|
796 |
-
printf(
|
797 |
-
' <a class="button clear-filters" href="%s">' . __( 'Clear Filters', 'code-snippets' ) . '</a>',
|
798 |
-
esc_url( remove_query_arg( array( 's', 'tag' ) ) )
|
799 |
-
);
|
800 |
-
}
|
801 |
-
}
|
802 |
-
|
803 |
-
/**
|
804 |
-
* Outputs content for a single row of the table
|
805 |
-
* @param object $snippet The snippet being used for the current row
|
806 |
-
*/
|
807 |
-
function single_row( $snippet ) {
|
808 |
-
static $row_class = '';
|
809 |
-
$row_class = ( $snippet->active ? 'active' : 'inactive' );
|
810 |
-
printf( '<tr class="%s">', $row_class );
|
811 |
-
$this->single_row_columns( $snippet );
|
812 |
-
echo '</tr>';
|
813 |
-
}
|
814 |
-
|
815 |
-
} // end of class
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
includes/manage/manage.php
DELETED
@@ -1,99 +0,0 @@
|
|
1 |
-
<?php
|
2 |
-
|
3 |
-
/**
|
4 |
-
* Functions to handle the manage snippets menu
|
5 |
-
*
|
6 |
-
* @package Code_Snippets
|
7 |
-
* @subpackage Manage
|
8 |
-
*/
|
9 |
-
|
10 |
-
/**
|
11 |
-
* Register the top-level 'Snippets' menu and associated 'Manage' subpage
|
12 |
-
*
|
13 |
-
* @since 1.0
|
14 |
-
* @access private
|
15 |
-
*
|
16 |
-
* @uses add_menu_page() To register a top-level menu
|
17 |
-
* @uses add_submenu_page() To register a sub-menu
|
18 |
-
*/
|
19 |
-
function code_snippets_add_manage_menu() {
|
20 |
-
|
21 |
-
$hook = add_menu_page(
|
22 |
-
__( 'Snippets', 'code-snippets' ),
|
23 |
-
__( 'Snippets', 'code-snippets' ),
|
24 |
-
get_snippets_cap(),
|
25 |
-
code_snippets_get_menu_slug(),
|
26 |
-
'code_snippets_render_manage_menu',
|
27 |
-
'div', // icon is added through CSS
|
28 |
-
is_network_admin() ? 21 : 67
|
29 |
-
);
|
30 |
-
|
31 |
-
add_submenu_page(
|
32 |
-
code_snippets_get_menu_slug(),
|
33 |
-
__( 'Snippets', 'code-snippets' ),
|
34 |
-
__( 'Manage', 'code-snippets' ),
|
35 |
-
get_snippets_cap(),
|
36 |
-
code_snippets_get_menu_slug(),
|
37 |
-
'code_snippets_render_manage_menu'
|
38 |
-
);
|
39 |
-
|
40 |
-
add_action( 'load-' . $hook, 'code_snippets_load_manage_menu' );
|
41 |
-
}
|
42 |
-
|
43 |
-
add_action( 'admin_menu', 'code_snippets_add_manage_menu', 5 );
|
44 |
-
add_action( 'network_admin_menu', 'code_snippets_add_manage_menu', 5 );
|
45 |
-
|
46 |
-
/**
|
47 |
-
* Displays the manage snippets menu
|
48 |
-
*
|
49 |
-
* @since 2.0
|
50 |
-
*/
|
51 |
-
function code_snippets_render_manage_menu() {
|
52 |
-
require plugin_dir_path( __FILE__ ) . 'admin-messages.php';
|
53 |
-
require plugin_dir_path( __FILE__ ) . 'admin.php';
|
54 |
-
}
|
55 |
-
|
56 |
-
/**
|
57 |
-
* Initializes the list table class and loads the help tabs
|
58 |
-
* for the Manage Snippets page
|
59 |
-
*
|
60 |
-
* @since 1.0
|
61 |
-
* @access private
|
62 |
-
*/
|
63 |
-
function code_snippets_load_manage_menu() {
|
64 |
-
|
65 |
-
/* Make sure the user has permission to be here */
|
66 |
-
if ( ! current_user_can( get_snippets_cap() ) ) {
|
67 |
-
wp_die( __( 'You are not authorized to access this page.', 'code-snippets' ) );
|
68 |
-
}
|
69 |
-
|
70 |
-
/* Create the snippet tables if they don't exist */
|
71 |
-
create_code_snippets_tables();
|
72 |
-
|
73 |
-
/* Load the screen help tabs */
|
74 |
-
require plugin_dir_path( __FILE__ ) . 'admin-help.php';
|
75 |
-
|
76 |
-
/* Initialize the snippet table class */
|
77 |
-
require_once plugin_dir_path( __FILE__ ) . 'class-list-table.php';
|
78 |
-
global $code_snippets_list_table;
|
79 |
-
$code_snippets_list_table = new Code_Snippets_List_Table();
|
80 |
-
$code_snippets_list_table->prepare_items();
|
81 |
-
}
|
82 |
-
|
83 |
-
/**
|
84 |
-
* Handles saving the user's snippets per page preference
|
85 |
-
*
|
86 |
-
* @param unknown $status
|
87 |
-
* @param string $option
|
88 |
-
* @param unknown $value
|
89 |
-
* @return unknown
|
90 |
-
*/
|
91 |
-
function code_snippets_set_screen_option( $status, $option, $value ) {
|
92 |
-
if ( 'snippets_per_page' === $option ) {
|
93 |
-
return $value;
|
94 |
-
}
|
95 |
-
|
96 |
-
return $status;
|
97 |
-
}
|
98 |
-
|
99 |
-
add_filter( 'set-screen-option', 'code_snippets_set_screen_option', 10, 3 );
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
includes/settings/admin.php
DELETED
@@ -1,52 +0,0 @@
|
|
1 |
-
<?php
|
2 |
-
|
3 |
-
/**
|
4 |
-
* This file handles the settings admin menu
|
5 |
-
* @package Code_Snippets
|
6 |
-
*/
|
7 |
-
|
8 |
-
/**
|
9 |
-
* Register the setting sub-menu
|
10 |
-
*
|
11 |
-
* @since 2.0
|
12 |
-
* @access private
|
13 |
-
*
|
14 |
-
* @uses add_submenu_page() To register a sub-menu
|
15 |
-
*/
|
16 |
-
function code_snippets_add_settings_menu() {
|
17 |
-
|
18 |
-
add_submenu_page(
|
19 |
-
code_snippets_get_menu_slug(),
|
20 |
-
__( 'Snippets Settings', 'code-snippets' ),
|
21 |
-
__( 'Settings', 'code-snippets' ),
|
22 |
-
get_snippets_cap(),
|
23 |
-
code_snippets_get_menu_slug( 'settings' ),
|
24 |
-
'code_snippets_render_settings_menu'
|
25 |
-
);
|
26 |
-
}
|
27 |
-
|
28 |
-
add_action( 'admin_menu', 'code_snippets_add_settings_menu' );
|
29 |
-
|
30 |
-
/**
|
31 |
-
* Displays the settings menu
|
32 |
-
*
|
33 |
-
* @since 2.0
|
34 |
-
*/
|
35 |
-
function code_snippets_render_settings_menu() {
|
36 |
-
?>
|
37 |
-
<div class="wrap">
|
38 |
-
<?php screen_icon(); ?>
|
39 |
-
<h2><?php esc_html_e( 'Settings', 'code-snippets' ); ?></h2>
|
40 |
-
|
41 |
-
<?php settings_errors( 'code-snippets-settings-notices' ); ?>
|
42 |
-
|
43 |
-
<form action="options.php" method="post">
|
44 |
-
<?php settings_fields( 'code-snippets' ); ?>
|
45 |
-
<table class="form-table">
|
46 |
-
<?php do_settings_sections( 'code-snippets' ); ?>
|
47 |
-
</table>
|
48 |
-
<?php submit_button(); ?>
|
49 |
-
</form>
|
50 |
-
</div>
|
51 |
-
<?php
|
52 |
-
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
includes/settings/class-settings.php
CHANGED
@@ -9,16 +9,15 @@ class Code_Snippets_Settings {
|
|
9 |
private static $fields = array();
|
10 |
private static $defaults = array();
|
11 |
|
12 |
-
public static function setup() {
|
13 |
-
self::set_fields();
|
14 |
-
self::set_defaults();
|
15 |
-
}
|
16 |
-
|
17 |
/**
|
18 |
* Retrieve the defined fields
|
19 |
* @return array
|
20 |
*/
|
21 |
public static function get_fields() {
|
|
|
|
|
|
|
|
|
22 |
return self::$fields;
|
23 |
}
|
24 |
|
@@ -27,6 +26,10 @@ class Code_Snippets_Settings {
|
|
27 |
* @return array the default field values, keyed by ID
|
28 |
*/
|
29 |
public static function get_defaults() {
|
|
|
|
|
|
|
|
|
30 |
return self::$defaults;
|
31 |
}
|
32 |
|
@@ -34,11 +37,15 @@ class Code_Snippets_Settings {
|
|
34 |
* Loop through the settings fields and extract the default values
|
35 |
*/
|
36 |
private static function set_defaults() {
|
37 |
-
|
|
|
38 |
self::$defaults[ $section_id ] = wp_list_pluck( $section_fields, 'default', 'id' );
|
39 |
}
|
40 |
}
|
41 |
|
|
|
|
|
|
|
42 |
private static function set_fields() {
|
43 |
|
44 |
self::$fields['general'] = array(
|
@@ -64,26 +71,26 @@ class Code_Snippets_Settings {
|
|
64 |
|
65 |
array(
|
66 |
'id' => 'rows',
|
67 |
-
'name' => 'Row Height',
|
68 |
'type' => 'number',
|
69 |
-
'label' => 'rows',
|
70 |
'default' => 5,
|
71 |
'min' => 0,
|
72 |
),
|
73 |
|
74 |
array(
|
75 |
'id' => 'use_full_mce',
|
76 |
-
'name' => 'Use Full Editor',
|
77 |
'type' => 'checkbox',
|
78 |
-
'label' => 'Enable all features of the visual editor',
|
79 |
'default' => false,
|
80 |
),
|
81 |
|
82 |
array(
|
83 |
'id' => 'media_buttons',
|
84 |
-
'name' => 'Media Buttons',
|
85 |
'type' => 'checkbox',
|
86 |
-
'label' => 'Enable the add media buttons',
|
87 |
'default' => false,
|
88 |
),
|
89 |
);
|
9 |
private static $fields = array();
|
10 |
private static $defaults = array();
|
11 |
|
|
|
|
|
|
|
|
|
|
|
12 |
/**
|
13 |
* Retrieve the defined fields
|
14 |
* @return array
|
15 |
*/
|
16 |
public static function get_fields() {
|
17 |
+
if ( empty( self::$fields ) ) {
|
18 |
+
self::set_fields();
|
19 |
+
}
|
20 |
+
|
21 |
return self::$fields;
|
22 |
}
|
23 |
|
26 |
* @return array the default field values, keyed by ID
|
27 |
*/
|
28 |
public static function get_defaults() {
|
29 |
+
if ( empty( self::$defaults ) ) {
|
30 |
+
self::set_defaults();
|
31 |
+
}
|
32 |
+
|
33 |
return self::$defaults;
|
34 |
}
|
35 |
|
37 |
* Loop through the settings fields and extract the default values
|
38 |
*/
|
39 |
private static function set_defaults() {
|
40 |
+
|
41 |
+
foreach ( self::get_fields() as $section_id => $section_fields ) {
|
42 |
self::$defaults[ $section_id ] = wp_list_pluck( $section_fields, 'default', 'id' );
|
43 |
}
|
44 |
}
|
45 |
|
46 |
+
/**
|
47 |
+
* Define the settings fields
|
48 |
+
*/
|
49 |
private static function set_fields() {
|
50 |
|
51 |
self::$fields['general'] = array(
|
71 |
|
72 |
array(
|
73 |
'id' => 'rows',
|
74 |
+
'name' => __( 'Row Height', 'code-snippets' ),
|
75 |
'type' => 'number',
|
76 |
+
'label' => __( 'rows', 'code-snippets' ),
|
77 |
'default' => 5,
|
78 |
'min' => 0,
|
79 |
),
|
80 |
|
81 |
array(
|
82 |
'id' => 'use_full_mce',
|
83 |
+
'name' => __( 'Use Full Editor', 'code-snippets' ),
|
84 |
'type' => 'checkbox',
|
85 |
+
'label' => __( 'Enable all features of the visual editor', 'code-snippets' ),
|
86 |
'default' => false,
|
87 |
),
|
88 |
|
89 |
array(
|
90 |
'id' => 'media_buttons',
|
91 |
+
'name' => __( 'Media Buttons', 'code-snippets' ),
|
92 |
'type' => 'checkbox',
|
93 |
+
'label' => __( 'Enable the add media buttons', 'code-snippets' ),
|
94 |
'default' => false,
|
95 |
),
|
96 |
);
|
includes/settings/editor-preview.php
CHANGED
@@ -1,5 +1,17 @@
|
|
1 |
<?php
|
2 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
3 |
function code_snippets_editor_settings_preview_assets( $hook ) {
|
4 |
|
5 |
/* Only load on the settings page */
|
@@ -11,7 +23,7 @@ function code_snippets_editor_settings_preview_assets( $hook ) {
|
|
11 |
code_snippets_enqueue_codemirror();
|
12 |
|
13 |
/* Enqueue ALL themes */
|
14 |
-
$themes_dir = plugin_dir_path( CODE_SNIPPETS_FILE ) . '
|
15 |
$themes = glob( $themes_dir . '*.css' );
|
16 |
|
17 |
foreach ( $themes as $theme ) {
|
@@ -66,6 +78,9 @@ function code_snippets_codemirror_theme_select_field( $atts ) {
|
|
66 |
echo '</select>';
|
67 |
}
|
68 |
|
|
|
|
|
|
|
69 |
function code_snippets_settings_editor_preview() {
|
70 |
|
71 |
$example_content = "
|
1 |
<?php
|
2 |
|
3 |
+
/**
|
4 |
+
* This file handles the editor preview setting
|
5 |
+
*
|
6 |
+
* @since 2.0
|
7 |
+
* @package Code_Snippets
|
8 |
+
*/
|
9 |
+
|
10 |
+
/**
|
11 |
+
* Load the CSS and JavaScript for the editor preview field
|
12 |
+
*
|
13 |
+
* @param string $hook The current page hook
|
14 |
+
*/
|
15 |
function code_snippets_editor_settings_preview_assets( $hook ) {
|
16 |
|
17 |
/* Only load on the settings page */
|
23 |
code_snippets_enqueue_codemirror();
|
24 |
|
25 |
/* Enqueue ALL themes */
|
26 |
+
$themes_dir = plugin_dir_path( CODE_SNIPPETS_FILE ) . 'css/min/cmthemes/';
|
27 |
$themes = glob( $themes_dir . '*.css' );
|
28 |
|
29 |
foreach ( $themes as $theme ) {
|
78 |
echo '</select>';
|
79 |
}
|
80 |
|
81 |
+
/**
|
82 |
+
* Render the editor preview setting
|
83 |
+
*/
|
84 |
function code_snippets_settings_editor_preview() {
|
85 |
|
86 |
$example_content = "
|
includes/settings/settings-fields.php
CHANGED
@@ -1,12 +1,16 @@
|
|
1 |
<?php
|
2 |
|
3 |
/**
|
4 |
-
* This file handles
|
|
|
|
|
5 |
* @package Code_Snippets
|
6 |
*/
|
7 |
|
8 |
/**
|
9 |
* Render a checkbox field for a setting
|
|
|
|
|
10 |
* @param array $atts The setting field's attributes
|
11 |
*/
|
12 |
function code_snippets_checkbox_field( $atts ) {
|
@@ -34,6 +38,8 @@ function code_snippets_checkbox_field( $atts ) {
|
|
34 |
|
35 |
/**
|
36 |
* Render a number select field for an editor setting
|
|
|
|
|
37 |
* @param array $atts The setting field's attributes
|
38 |
*/
|
39 |
function code_snippets_number_field( $atts ) {
|
1 |
<?php
|
2 |
|
3 |
/**
|
4 |
+
* This file handles rendering the settings fields
|
5 |
+
*
|
6 |
+
* @since 2.0.0
|
7 |
* @package Code_Snippets
|
8 |
*/
|
9 |
|
10 |
/**
|
11 |
* Render a checkbox field for a setting
|
12 |
+
*
|
13 |
+
* @since 2.0.0
|
14 |
* @param array $atts The setting field's attributes
|
15 |
*/
|
16 |
function code_snippets_checkbox_field( $atts ) {
|
38 |
|
39 |
/**
|
40 |
* Render a number select field for an editor setting
|
41 |
+
*
|
42 |
+
* @since 2.0.0
|
43 |
* @param array $atts The setting field's attributes
|
44 |
*/
|
45 |
function code_snippets_number_field( $atts ) {
|
includes/settings/settings.php
CHANGED
@@ -2,11 +2,11 @@
|
|
2 |
|
3 |
/**
|
4 |
* This file registers the settings
|
|
|
5 |
* @package Code_Snippets
|
6 |
*/
|
7 |
|
8 |
-
require plugin_dir_path( __FILE__ ) . '
|
9 |
-
Code_Snippets_Settings::setup();
|
10 |
|
11 |
/**
|
12 |
* Retrieve the default setting values
|
@@ -24,59 +24,52 @@ function code_snippets_get_settings_fields() {
|
|
24 |
return Code_Snippets_Settings::get_fields();
|
25 |
}
|
26 |
|
27 |
-
|
28 |
* Retrieve the setting values from the database.
|
29 |
* If a setting does not exist in the database, the default value will be returned.
|
|
|
30 |
* @return array
|
31 |
*/
|
32 |
function code_snippets_get_settings() {
|
33 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
34 |
$saved = get_option( 'code_snippets_settings', array() );
|
35 |
|
36 |
-
|
37 |
-
|
38 |
-
* @link http://php.net/manual/en/function.array-replace-recursive.php#92574
|
39 |
-
*/
|
40 |
-
if ( ! function_exists( 'array_replace_recursive' ) ) {
|
41 |
-
function array_replace_recursive( $array, $array1 ) {
|
42 |
-
function recurse( $array, $array1 ) {
|
43 |
-
foreach ( $array1 as $key => $value ) {
|
44 |
-
// create new key in $array, if it is empty or not an array
|
45 |
-
if ( ! isset( $array[ $key ] ) || ( isset( $array[ $key ] ) && ! is_array( $array[ $key ] ) ) ) {
|
46 |
-
$array[ $key ] = array();
|
47 |
-
}
|
48 |
-
// overwrite the value in the base array
|
49 |
-
if ( is_array( $value ) ) {
|
50 |
-
$value = recurse( $array[ $key ], $value );
|
51 |
-
}
|
52 |
-
$array[ $key ] = $value;
|
53 |
-
}
|
54 |
-
return $array;
|
55 |
-
}
|
56 |
|
57 |
-
|
58 |
-
|
59 |
-
|
60 |
-
|
61 |
-
|
62 |
-
|
63 |
-
$
|
64 |
-
|
65 |
-
if (
|
66 |
-
$
|
67 |
}
|
68 |
}
|
69 |
-
return $array;
|
70 |
}
|
71 |
}
|
72 |
|
73 |
-
|
|
|
74 |
}
|
75 |
|
76 |
/**
|
77 |
* Retrieve an individual setting field value
|
78 |
-
*
|
79 |
-
* @param
|
|
|
80 |
* @return array
|
81 |
*/
|
82 |
function code_snippets_get_setting( $section, $field ) {
|
@@ -151,8 +144,9 @@ add_action( 'admin_init', 'code_snippets_register_settings' );
|
|
151 |
|
152 |
/**
|
153 |
* Validate the settings
|
154 |
-
*
|
155 |
-
* @
|
|
|
156 |
*/
|
157 |
function code_snippets_settings_validate( array $input ) {
|
158 |
$settings = code_snippets_get_settings();
|
2 |
|
3 |
/**
|
4 |
* This file registers the settings
|
5 |
+
*
|
6 |
* @package Code_Snippets
|
7 |
*/
|
8 |
|
9 |
+
require plugin_dir_path( __FILE__ ) . 'class-settings.php';
|
|
|
10 |
|
11 |
/**
|
12 |
* Retrieve the default setting values
|
24 |
return Code_Snippets_Settings::get_fields();
|
25 |
}
|
26 |
|
27 |
+
/**
|
28 |
* Retrieve the setting values from the database.
|
29 |
* If a setting does not exist in the database, the default value will be returned.
|
30 |
+
*
|
31 |
* @return array
|
32 |
*/
|
33 |
function code_snippets_get_settings() {
|
34 |
+
|
35 |
+
/* Check if the settings have been cached */
|
36 |
+
if ( $settings = wp_cache_get( 'code_snippets_settings' ) ) {
|
37 |
+
return $settings;
|
38 |
+
}
|
39 |
+
|
40 |
+
/* Begin with the default settings */
|
41 |
+
$settings = Code_Snippets_Settings::get_defaults();
|
42 |
+
|
43 |
+
/* Retrieve saved settings from the database */
|
44 |
$saved = get_option( 'code_snippets_settings', array() );
|
45 |
|
46 |
+
/* Replace the default field values with the ones saved in the database */
|
47 |
+
if ( function_exists( 'array_replace_recursive' ) ) {
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
48 |
|
49 |
+
/* Use the much more efficient array_replace_recursive() function in PHP 5.3 and later */
|
50 |
+
$settings = array_replace_recursive( $settings, $saved );
|
51 |
+
} else {
|
52 |
+
|
53 |
+
/* Otherwise, do it manually */
|
54 |
+
foreach ( $settings as $section => $fields ) {
|
55 |
+
foreach ( $fields as $field => $value ) {
|
56 |
+
|
57 |
+
if ( isset( $saved[ $section ][ $field ] ) ) {
|
58 |
+
$settings[ $section ][ $field ] = $saved[ $section ][ $field ];
|
59 |
}
|
60 |
}
|
|
|
61 |
}
|
62 |
}
|
63 |
|
64 |
+
wp_cache_set( 'code_snippets_settings', $settings );
|
65 |
+
return $settings;
|
66 |
}
|
67 |
|
68 |
/**
|
69 |
* Retrieve an individual setting field value
|
70 |
+
*
|
71 |
+
* @param string $section The ID of the section the setting belongs to
|
72 |
+
* @param string $field The ID of the setting field
|
73 |
* @return array
|
74 |
*/
|
75 |
function code_snippets_get_setting( $section, $field ) {
|
144 |
|
145 |
/**
|
146 |
* Validate the settings
|
147 |
+
*
|
148 |
+
* @param array $input The sent settings
|
149 |
+
* @return array The validated settings
|
150 |
*/
|
151 |
function code_snippets_settings_validate( array $input ) {
|
152 |
$settings = code_snippets_get_settings();
|
includes/snippet-ops.php
CHANGED
@@ -6,88 +6,54 @@
|
|
6 |
* @package Code_Snippets
|
7 |
*/
|
8 |
|
9 |
-
/**
|
10 |
-
* Converts an array of snippet data into a snippet object
|
11 |
-
*
|
12 |
-
* @since 2.0
|
13 |
-
* @param mixed $data The snippet data to convert
|
14 |
-
* @return object The resulting snippet object
|
15 |
-
*/
|
16 |
-
function build_snippet_object( $data = null ) {
|
17 |
-
|
18 |
-
$snippet = new stdClass;
|
19 |
-
|
20 |
-
/* Define an empty snippet object with default values */
|
21 |
-
$snippet->id = 0;
|
22 |
-
$snippet->name = '';
|
23 |
-
$snippet->description = '';
|
24 |
-
$snippet->code = '';
|
25 |
-
$snippet->tags = array();
|
26 |
-
$snippet->scope = 0;
|
27 |
-
$snippet->active = 0;
|
28 |
-
$snippet = apply_filters( 'code_snippets/build_default_snippet', $snippet );
|
29 |
-
|
30 |
-
if ( ! isset( $data ) ) {
|
31 |
-
return $snippet;
|
32 |
-
|
33 |
-
} elseif ( is_object( $data ) ) {
|
34 |
-
|
35 |
-
/* If we already have a snippet object, merge it with the default */
|
36 |
-
return (object) array_merge( (array) $snippet, (array) $data );
|
37 |
-
|
38 |
-
} elseif ( is_array( $data ) ) {
|
39 |
-
|
40 |
-
foreach ( $data as $field => $value ) {
|
41 |
-
|
42 |
-
/* Remove 'snippet_' prefix */
|
43 |
-
if ( 'snippet_' === substr( $field, 0, 8 ) ) {
|
44 |
-
$field = substr( $field, 8 );
|
45 |
-
}
|
46 |
-
|
47 |
-
/* Check the field is whitelisted */
|
48 |
-
if ( ! isset( $snippet->$field ) ) {
|
49 |
-
continue;
|
50 |
-
}
|
51 |
-
|
52 |
-
/* Update the field */
|
53 |
-
$snippet->$field = $value;
|
54 |
-
}
|
55 |
-
|
56 |
-
return apply_filters( 'code_snippets/build_snippet_object', $snippet, $data );
|
57 |
-
}
|
58 |
-
|
59 |
-
return $snippet;
|
60 |
-
}
|
61 |
-
|
62 |
/**
|
63 |
* Retrieve a list of snippets from the database
|
64 |
*
|
65 |
* @since 2.0
|
66 |
*
|
67 |
-
* @uses $wpdb
|
68 |
-
* @uses get_snippets_table_name()
|
69 |
*
|
70 |
-
* @param
|
71 |
-
* @
|
|
|
72 |
*/
|
73 |
-
function get_snippets( $multisite = null ) {
|
|
|
74 |
global $wpdb;
|
75 |
-
|
76 |
$table = get_snippets_table_name( $multisite );
|
77 |
-
$
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
78 |
|
|
|
79 |
foreach ( $snippets as $index => $snippet ) {
|
80 |
-
$
|
|
|
81 |
}
|
82 |
|
83 |
return apply_filters( 'code_snippets/get_snippets', $snippets, $multisite );
|
84 |
}
|
85 |
|
86 |
/**
|
87 |
-
* Gets all of the used tags from the database
|
88 |
-
* @since 2.0
|
89 |
-
*/
|
90 |
function get_all_snippet_tags() {
|
|
|
91 |
global $wpdb;
|
92 |
|
93 |
/* Grab all tags from the database */
|
@@ -97,7 +63,6 @@ function get_all_snippet_tags() {
|
|
97 |
|
98 |
/* Merge all tags into a single array */
|
99 |
foreach ( $all_tags as $snippet_tags ) {
|
100 |
-
$snippet_tags = maybe_unserialize( $snippet_tags );
|
101 |
$snippet_tags = code_snippets_build_tags_array( $snippet_tags );
|
102 |
$tags = array_merge( $snippet_tags, $tags );
|
103 |
}
|
@@ -105,82 +70,28 @@ function get_all_snippet_tags() {
|
|
105 |
/* Remove duplicate tags */
|
106 |
return array_values( array_unique( $tags, SORT_REGULAR ) );
|
107 |
}
|
108 |
-
|
109 |
/**
|
110 |
* Make sure that the tags are a valid array
|
111 |
* @since 2.0
|
112 |
*
|
113 |
-
* @param
|
114 |
-
* @return array
|
115 |
*/
|
116 |
function code_snippets_build_tags_array( $tags ) {
|
117 |
|
118 |
-
/* If there are no tags set,
|
119 |
if ( empty( $tags ) ) {
|
120 |
-
|
121 |
}
|
122 |
|
123 |
/* If the tags are set as a string, convert them into an array */
|
124 |
-
|
125 |
$tags = str_replace( ', ', ',', $tags );
|
126 |
$tags = explode( ',', $tags );
|
127 |
}
|
128 |
|
129 |
/* If we still don't have an array, just convert whatever we do have into one */
|
130 |
-
|
131 |
-
$tags = (array) $tags;
|
132 |
-
}
|
133 |
-
|
134 |
-
return $tags;
|
135 |
-
}
|
136 |
-
|
137 |
-
/**
|
138 |
-
* Escape snippet data for inserting into the database
|
139 |
-
*
|
140 |
-
* @since 2.0
|
141 |
-
* @param mixed $snippet An object or array containing the data to escape
|
142 |
-
* @return object The resulting snippet object, with data escaped
|
143 |
-
*/
|
144 |
-
function escape_snippet_data( $snippet ) {
|
145 |
-
|
146 |
-
$snippet = build_snippet_object( $snippet );
|
147 |
-
|
148 |
-
/* Remove <?php and <? from beginning of snippet */
|
149 |
-
$snippet->code = preg_replace( '|^[\s]*<\?(php)?|', '', $snippet->code );
|
150 |
-
|
151 |
-
/* Remove ?> from end of snippet */
|
152 |
-
$snippet->code = preg_replace( '|\?>[\s]*$|', '', $snippet->code );
|
153 |
-
|
154 |
-
/* Ensure the ID is a positive integer */
|
155 |
-
$snippet->id = absint( $snippet->id );
|
156 |
-
|
157 |
-
/* Make sure that the scope is a valid value */
|
158 |
-
if ( ! in_array( $snippet->scope, array( 0, 1, 2 ) ) ) {
|
159 |
-
$snippet->scope = 0;
|
160 |
-
}
|
161 |
-
|
162 |
-
/* Store tags as a string, with tags separated by commas */
|
163 |
-
$snippet->tags = code_snippets_build_tags_array( $snippet->tags );
|
164 |
-
$snippet->tags = implode( ', ', $snippet->tags );
|
165 |
-
|
166 |
-
return apply_filters( 'code_snippets/escape_snippet_data', $snippet );
|
167 |
-
}
|
168 |
-
|
169 |
-
/**
|
170 |
-
* Unescape snippet data after retrieval from the database
|
171 |
-
* ready for use
|
172 |
-
*
|
173 |
-
* @since 2.0
|
174 |
-
* @param mixed $snippet An object or array containing the data to unescape
|
175 |
-
* @return object The resulting snippet object, with data unescaped
|
176 |
-
*/
|
177 |
-
function unescape_snippet_data( $snippet ) {
|
178 |
-
$snippet = build_snippet_object( $snippet );
|
179 |
-
|
180 |
-
/* Ensure the tags are a valid array */
|
181 |
-
$snippet->tags = code_snippets_build_tags_array( $snippet->tags );
|
182 |
-
|
183 |
-
return apply_filters( 'code_snippets/unescape_snippet_data', $snippet );
|
184 |
}
|
185 |
|
186 |
/**
|
@@ -190,14 +101,15 @@ function unescape_snippet_data( $snippet ) {
|
|
190 |
*
|
191 |
* @since 2.0
|
192 |
*
|
193 |
-
* @uses $wpdb
|
194 |
-
* @uses get_snippets_table_name()
|
195 |
*
|
196 |
-
* @param
|
197 |
-
* @param
|
198 |
-
* @return
|
199 |
*/
|
200 |
function get_snippet( $id = 0, $multisite = null ) {
|
|
|
201 |
global $wpdb;
|
202 |
|
203 |
$id = absint( $id );
|
@@ -209,13 +121,16 @@ function get_snippet( $id = 0, $multisite = null ) {
|
|
209 |
$snippet = $wpdb->get_row( $wpdb->prepare( "SELECT * FROM $table WHERE id = %d", $id ) );
|
210 |
|
211 |
/* Unescape the snippet data, ready for use */
|
212 |
-
$snippet =
|
213 |
|
214 |
} else {
|
215 |
|
216 |
/* Get an empty snippet object */
|
217 |
-
$snippet =
|
218 |
}
|
|
|
|
|
|
|
219 |
return apply_filters( 'code_snippets/get_snippet', $snippet, $id, $multisite );
|
220 |
}
|
221 |
|
@@ -224,12 +139,13 @@ function get_snippet( $id = 0, $multisite = null ) {
|
|
224 |
*
|
225 |
* @since 2.0
|
226 |
*
|
227 |
-
* @uses $wpdb
|
228 |
*
|
229 |
-
* @param
|
230 |
-
* @param
|
231 |
*/
|
232 |
function activate_snippet( $id, $multisite = null ) {
|
|
|
233 |
global $wpdb;
|
234 |
$table = get_snippets_table_name( $multisite );
|
235 |
|
@@ -241,6 +157,12 @@ function activate_snippet( $id, $multisite = null ) {
|
|
241 |
array( '%d' )
|
242 |
);
|
243 |
|
|
|
|
|
|
|
|
|
|
|
|
|
244 |
do_action( 'code_snippets/activate_snippet', $id, $multisite );
|
245 |
}
|
246 |
|
@@ -249,12 +171,13 @@ function activate_snippet( $id, $multisite = null ) {
|
|
249 |
*
|
250 |
* @since 2.0
|
251 |
*
|
252 |
-
* @uses $wpdb
|
253 |
*
|
254 |
-
* @param
|
255 |
-
* @param
|
256 |
*/
|
257 |
function deactivate_snippet( $id, $multisite = null ) {
|
|
|
258 |
global $wpdb;
|
259 |
$table = get_snippets_table_name( $multisite );
|
260 |
|
@@ -293,13 +216,14 @@ function deactivate_snippet( $id, $multisite = null ) {
|
|
293 |
* Deletes a snippet from the database
|
294 |
*
|
295 |
* @since 2.0
|
296 |
-
* @uses $wpdb
|
297 |
-
* @uses get_snippets_table_name()
|
298 |
*
|
299 |
-
* @param int
|
300 |
-
* @param
|
301 |
*/
|
302 |
function delete_snippet( $id, $multisite = null ) {
|
|
|
303 |
global $wpdb;
|
304 |
|
305 |
$wpdb->delete(
|
@@ -315,55 +239,57 @@ function delete_snippet( $id, $multisite = null ) {
|
|
315 |
* Saves a snippet to the database.
|
316 |
*
|
317 |
* @since 2.0
|
318 |
-
*
|
|
|
319 |
* @uses get_snippets_table_name() To dynamically retrieve the name of the snippet table
|
320 |
*
|
321 |
-
* @param
|
322 |
-
* @
|
323 |
-
* @return int|boolean The ID of the snippet on success, false on failure
|
324 |
*/
|
325 |
-
function save_snippet( $snippet
|
|
|
326 |
global $wpdb;
|
327 |
|
328 |
-
$
|
329 |
-
$table = get_snippets_table_name( $multisite );
|
330 |
-
$snippet = escape_snippet_data( $snippet );
|
331 |
|
332 |
-
|
333 |
-
|
334 |
-
|
335 |
-
|
|
|
|
|
|
|
|
|
|
|
336 |
|
337 |
-
|
338 |
-
|
339 |
-
}
|
340 |
|
341 |
-
$
|
342 |
-
|
343 |
|
344 |
-
|
|
|
345 |
|
|
|
346 |
$wpdb->update( $table, $data, array( 'id' => $snippet->id ), null, array( '%d' ) );
|
347 |
-
do_action( 'code_snippets/update_snippet', $snippet, $table );
|
348 |
-
return $snippet->id;
|
349 |
-
|
350 |
-
} else {
|
351 |
|
352 |
-
|
353 |
-
do_action( 'code_snippets/create_snippet', $snippet, $table );
|
354 |
-
return $wpdb->insert_id;
|
355 |
}
|
|
|
|
|
356 |
}
|
357 |
|
358 |
/**
|
359 |
* Imports snippets from an XML file
|
360 |
*
|
361 |
* @since 2.0
|
362 |
-
* @uses save_snippet() To add the snippets to the database
|
363 |
*
|
364 |
-
* @
|
365 |
-
*
|
366 |
-
* @
|
|
|
|
|
367 |
*/
|
368 |
function import_snippets( $file, $multisite = null ) {
|
369 |
|
@@ -376,11 +302,14 @@ function import_snippets( $file, $multisite = null ) {
|
|
376 |
|
377 |
$snippets_xml = $dom->getElementsByTagName( 'snippet' );
|
378 |
$fields = array( 'name', 'description', 'code', 'tags', 'scope' );
|
379 |
-
$
|
380 |
|
381 |
/* Loop through all snippets */
|
|
|
|
|
382 |
foreach ( $snippets_xml as $snippet_xml ) {
|
383 |
-
$snippet = new
|
|
|
384 |
|
385 |
/* Build a snippet object by looping through the field names */
|
386 |
foreach ( $fields as $field_name ) {
|
@@ -394,26 +323,32 @@ function import_snippets( $file, $multisite = null ) {
|
|
394 |
}
|
395 |
}
|
396 |
|
|
|
|
|
|
|
|
|
|
|
|
|
397 |
/* Save the snippet and increase the counter if successful */
|
398 |
-
if ( save_snippet( $snippet
|
399 |
-
$
|
400 |
}
|
401 |
}
|
402 |
|
403 |
do_action( 'code_snippets/import', $dom, $multisite );
|
404 |
-
return $
|
405 |
}
|
406 |
|
407 |
/**
|
408 |
* Exports snippets as an XML file
|
409 |
*
|
410 |
* @since 2.0
|
411 |
-
* @uses Code_Snippets_Export
|
412 |
-
* @uses get_snippets_table_name()
|
413 |
*
|
414 |
-
* @param array
|
415 |
-
* @param
|
416 |
-
* @param string
|
417 |
*/
|
418 |
function export_snippets( $ids, $multisite = null, $format = 'xml' ) {
|
419 |
$table = get_snippets_table_name( $multisite );
|
@@ -433,10 +368,12 @@ function export_snippets( $ids, $multisite = null, $format = 'xml' ) {
|
|
433 |
* it will be executed directly
|
434 |
*
|
435 |
* @since 2.0
|
436 |
-
*
|
437 |
-
* @
|
|
|
|
|
438 |
*/
|
439 |
-
function execute_snippet( $code ) {
|
440 |
|
441 |
if ( empty( $code ) ) {
|
442 |
return false;
|
@@ -444,10 +381,12 @@ function execute_snippet( $code ) {
|
|
444 |
|
445 |
ob_start();
|
446 |
$result = eval( $code );
|
447 |
-
$output = ob_get_contents();
|
448 |
ob_end_clean();
|
449 |
|
450 |
-
|
|
|
|
|
|
|
451 |
return $result;
|
452 |
}
|
453 |
|
@@ -455,7 +394,8 @@ function execute_snippet( $code ) {
|
|
455 |
* Run the active snippets
|
456 |
*
|
457 |
* @since 2.0
|
458 |
-
*
|
|
|
459 |
*/
|
460 |
function execute_active_snippets() {
|
461 |
|
@@ -464,37 +404,62 @@ function execute_active_snippets() {
|
|
464 |
return false;
|
465 |
}
|
466 |
|
|
|
467 |
global $wpdb;
|
468 |
|
469 |
if ( ! isset( $wpdb->snippets, $wpdb->ms_snippets ) ) {
|
470 |
set_snippet_table_vars();
|
471 |
}
|
472 |
|
473 |
-
|
474 |
-
if ( $wpdb->get_var( "SHOW TABLES LIKE '$wpdb->snippets'" ) === $wpdb->snippets ) {
|
475 |
-
$sql = "SELECT code FROM {$wpdb->snippets} WHERE active=1";
|
476 |
-
}
|
477 |
|
478 |
-
/* Check if the
|
479 |
-
|
480 |
-
|
481 |
-
|
|
|
|
|
|
|
482 |
}
|
483 |
|
484 |
-
|
485 |
-
|
486 |
|
487 |
-
|
488 |
-
|
|
|
489 |
|
490 |
-
|
491 |
-
|
492 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
493 |
}
|
|
|
494 |
|
495 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
496 |
}
|
497 |
|
498 |
-
|
499 |
-
return false;
|
500 |
}
|
6 |
* @package Code_Snippets
|
7 |
*/
|
8 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
9 |
/**
|
10 |
* Retrieve a list of snippets from the database
|
11 |
*
|
12 |
* @since 2.0
|
13 |
*
|
14 |
+
* @uses $wpdb to query the database for snippets
|
15 |
+
* @uses get_snippets_table_name() to dynamically retrieve the snippet table name
|
16 |
*
|
17 |
+
* @param array $ids The IDs of the snippets to fetch
|
18 |
+
* @param bool|null $multisite Retrieve multisite-wide or site-wide snippets?
|
19 |
+
* @return array An array of Snippet objects
|
20 |
*/
|
21 |
+
function get_snippets( array $ids = array(), $multisite = null ) {
|
22 |
+
/** @var wpdb $wpdb */
|
23 |
global $wpdb;
|
|
|
24 |
$table = get_snippets_table_name( $multisite );
|
25 |
+
$sql = "SELECT * FROM $table";
|
26 |
+
$ids_count = count( $ids );
|
27 |
+
|
28 |
+
if ( 1 == $ids_count ) {
|
29 |
+
return get_snippet( $ids[0] );
|
30 |
+
}
|
31 |
+
|
32 |
+
if ( $ids_count > 1 ) {
|
33 |
+
$sql .= ' WHERE id IN (';
|
34 |
+
$sql .= implode( ',', array_fill( 0, $ids_count, '%d' ) );
|
35 |
+
$sql .= ')';
|
36 |
+
|
37 |
+
$sql = $wpdb->prepare( $sql, $ids );
|
38 |
+
}
|
39 |
+
|
40 |
+
$snippets = $wpdb->get_results( $sql, ARRAY_A );
|
41 |
|
42 |
+
/* Convert snippets to snippet objects */
|
43 |
foreach ( $snippets as $index => $snippet ) {
|
44 |
+
$snippet['network'] = $multisite;
|
45 |
+
$snippets[ $index ] = new Snippet( $snippet );
|
46 |
}
|
47 |
|
48 |
return apply_filters( 'code_snippets/get_snippets', $snippets, $multisite );
|
49 |
}
|
50 |
|
51 |
/**
|
52 |
+
* Gets all of the used tags from the database
|
53 |
+
* @since 2.0
|
54 |
+
*/
|
55 |
function get_all_snippet_tags() {
|
56 |
+
/** @var wpdb $wpdb */
|
57 |
global $wpdb;
|
58 |
|
59 |
/* Grab all tags from the database */
|
63 |
|
64 |
/* Merge all tags into a single array */
|
65 |
foreach ( $all_tags as $snippet_tags ) {
|
|
|
66 |
$snippet_tags = code_snippets_build_tags_array( $snippet_tags );
|
67 |
$tags = array_merge( $snippet_tags, $tags );
|
68 |
}
|
70 |
/* Remove duplicate tags */
|
71 |
return array_values( array_unique( $tags, SORT_REGULAR ) );
|
72 |
}
|
|
|
73 |
/**
|
74 |
* Make sure that the tags are a valid array
|
75 |
* @since 2.0
|
76 |
*
|
77 |
+
* @param mixed $tags The tags to convert into an array
|
78 |
+
* @return array The converted tags
|
79 |
*/
|
80 |
function code_snippets_build_tags_array( $tags ) {
|
81 |
|
82 |
+
/* If there are no tags set, return an empty array */
|
83 |
if ( empty( $tags ) ) {
|
84 |
+
return array();
|
85 |
}
|
86 |
|
87 |
/* If the tags are set as a string, convert them into an array */
|
88 |
+
if ( is_string( $tags ) ) {
|
89 |
$tags = str_replace( ', ', ',', $tags );
|
90 |
$tags = explode( ',', $tags );
|
91 |
}
|
92 |
|
93 |
/* If we still don't have an array, just convert whatever we do have into one */
|
94 |
+
return (array) $tags;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
95 |
}
|
96 |
|
97 |
/**
|
101 |
*
|
102 |
* @since 2.0
|
103 |
*
|
104 |
+
* @uses $wpdb to query the database for snippets
|
105 |
+
* @uses get_snippets_table_name() to dynamically retrieve the snippet table name
|
106 |
*
|
107 |
+
* @param int $id The ID of the snippet to retrieve. 0 to build a new snippet
|
108 |
+
* @param boolean|null $multisite Retrieve a multisite-wide or site-wide snippet?
|
109 |
+
* @return Snippet A single snippet object
|
110 |
*/
|
111 |
function get_snippet( $id = 0, $multisite = null ) {
|
112 |
+
/** @var wpdb $wpdb */
|
113 |
global $wpdb;
|
114 |
|
115 |
$id = absint( $id );
|
121 |
$snippet = $wpdb->get_row( $wpdb->prepare( "SELECT * FROM $table WHERE id = %d", $id ) );
|
122 |
|
123 |
/* Unescape the snippet data, ready for use */
|
124 |
+
$snippet = new Snippet( $snippet );
|
125 |
|
126 |
} else {
|
127 |
|
128 |
/* Get an empty snippet object */
|
129 |
+
$snippet = new Snippet();
|
130 |
}
|
131 |
+
|
132 |
+
$snippet->network = $multisite;
|
133 |
+
|
134 |
return apply_filters( 'code_snippets/get_snippet', $snippet, $id, $multisite );
|
135 |
}
|
136 |
|
139 |
*
|
140 |
* @since 2.0
|
141 |
*
|
142 |
+
* @uses $wpdb to set the snippet's active status
|
143 |
*
|
144 |
+
* @param int $id The ID of the snippet to activate
|
145 |
+
* @param bool|null $multisite Are the snippets multisite-wide or site-wide?
|
146 |
*/
|
147 |
function activate_snippet( $id, $multisite = null ) {
|
148 |
+
/** @var wpdb $wpdb */
|
149 |
global $wpdb;
|
150 |
$table = get_snippets_table_name( $multisite );
|
151 |
|
157 |
array( '%d' )
|
158 |
);
|
159 |
|
160 |
+
/* Remove snippet from shared network snippet list if it was Network Activated */
|
161 |
+
if ( $table == $wpdb->ms_snippets && $shared_network_snippets = get_site_option( 'shared_network_snippets', false ) ) {
|
162 |
+
$shared_network_snippets = array_diff( $shared_network_snippets, array( $id ) );
|
163 |
+
update_site_option( 'shared_network_snippets', $shared_network_snippets );
|
164 |
+
}
|
165 |
+
|
166 |
do_action( 'code_snippets/activate_snippet', $id, $multisite );
|
167 |
}
|
168 |
|
171 |
*
|
172 |
* @since 2.0
|
173 |
*
|
174 |
+
* @uses $wpdb to set the snippets' active status
|
175 |
*
|
176 |
+
* @param int $id The ID of the snippet to deactivate
|
177 |
+
* @param bool|null $multisite Are the snippets multisite-wide or site-wide?
|
178 |
*/
|
179 |
function deactivate_snippet( $id, $multisite = null ) {
|
180 |
+
/** @var wpdb $wpdb */
|
181 |
global $wpdb;
|
182 |
$table = get_snippets_table_name( $multisite );
|
183 |
|
216 |
* Deletes a snippet from the database
|
217 |
*
|
218 |
* @since 2.0
|
219 |
+
* @uses $wpdb to access the database
|
220 |
+
* @uses get_snippets_table_name() to dynamically retrieve the name of the snippet table
|
221 |
*
|
222 |
+
* @param int $id The ID of the snippet to delete
|
223 |
+
* @param bool|null $multisite Delete from site-wide or network-wide table?
|
224 |
*/
|
225 |
function delete_snippet( $id, $multisite = null ) {
|
226 |
+
/** @var wpdb $wpdb */
|
227 |
global $wpdb;
|
228 |
|
229 |
$wpdb->delete(
|
239 |
* Saves a snippet to the database.
|
240 |
*
|
241 |
* @since 2.0
|
242 |
+
*
|
243 |
+
* @uses $wpdb to update/add the snippet to the database
|
244 |
* @uses get_snippets_table_name() To dynamically retrieve the name of the snippet table
|
245 |
*
|
246 |
+
* @param Snippet $snippet The snippet to add/update to the database
|
247 |
+
* @return int The ID of the snippet
|
|
|
248 |
*/
|
249 |
+
function save_snippet( Snippet $snippet ) {
|
250 |
+
/** @var wpdb $wpdb */
|
251 |
global $wpdb;
|
252 |
|
253 |
+
$table = get_snippets_table_name( $snippet->network );
|
|
|
|
|
254 |
|
255 |
+
/* Build array of data to insert */
|
256 |
+
$data = array(
|
257 |
+
'name' => $snippet->name,
|
258 |
+
'description' => $snippet->desc,
|
259 |
+
'code' => $snippet->code,
|
260 |
+
'tags' => $snippet->tags_list,
|
261 |
+
'scope' => $snippet->scope,
|
262 |
+
'active' => intval( $snippet->active ),
|
263 |
+
);
|
264 |
|
265 |
+
/* Create a new snippet if the ID is not set */
|
266 |
+
if ( 0 == $snippet->id ) {
|
|
|
267 |
|
268 |
+
$wpdb->insert( $table, $data, '%s' );
|
269 |
+
$snippet->id = $wpdb->insert_id;
|
270 |
|
271 |
+
do_action( 'code_snippets/create_snippet', $snippet, $table );
|
272 |
+
} else {
|
273 |
|
274 |
+
/* Otherwise update the snippet data */
|
275 |
$wpdb->update( $table, $data, array( 'id' => $snippet->id ), null, array( '%d' ) );
|
|
|
|
|
|
|
|
|
276 |
|
277 |
+
do_action( 'code_snippets/update_snippet', $snippet, $table );
|
|
|
|
|
278 |
}
|
279 |
+
|
280 |
+
return $snippet->id;
|
281 |
}
|
282 |
|
283 |
/**
|
284 |
* Imports snippets from an XML file
|
285 |
*
|
286 |
* @since 2.0
|
|
|
287 |
*
|
288 |
+
* @uses save_snippet() to add the snippets to the database
|
289 |
+
*
|
290 |
+
* @param string $file The path to the XML file to import
|
291 |
+
* @param bool|null $multisite Import into network-wide table or site-wide table?
|
292 |
+
* @return array|bool An array of imported snippet IDs on success, false on failure
|
293 |
*/
|
294 |
function import_snippets( $file, $multisite = null ) {
|
295 |
|
302 |
|
303 |
$snippets_xml = $dom->getElementsByTagName( 'snippet' );
|
304 |
$fields = array( 'name', 'description', 'code', 'tags', 'scope' );
|
305 |
+
$exported_snippets = array();
|
306 |
|
307 |
/* Loop through all snippets */
|
308 |
+
|
309 |
+
/** @var DOMElement $snippet_xml */
|
310 |
foreach ( $snippets_xml as $snippet_xml ) {
|
311 |
+
$snippet = new Snippet();
|
312 |
+
$snippet->network = $multisite;
|
313 |
|
314 |
/* Build a snippet object by looping through the field names */
|
315 |
foreach ( $fields as $field_name ) {
|
323 |
}
|
324 |
}
|
325 |
|
326 |
+
/* Get scope from attribute */
|
327 |
+
$scope = $snippet_xml->getAttribute( 'scope' );
|
328 |
+
if ( ! empty( $scope ) ) {
|
329 |
+
$snippet->scope = $scope;
|
330 |
+
}
|
331 |
+
|
332 |
/* Save the snippet and increase the counter if successful */
|
333 |
+
if ( $snippet_id = save_snippet( $snippet ) ) {
|
334 |
+
$exported_snippets[] = $snippet_id;
|
335 |
}
|
336 |
}
|
337 |
|
338 |
do_action( 'code_snippets/import', $dom, $multisite );
|
339 |
+
return $exported_snippets;
|
340 |
}
|
341 |
|
342 |
/**
|
343 |
* Exports snippets as an XML file
|
344 |
*
|
345 |
* @since 2.0
|
346 |
+
* @uses Code_Snippets_Export to export selected snippets
|
347 |
+
* @uses get_snippets_table_name() to dynamically retrieve the name of the snippet table
|
348 |
*
|
349 |
+
* @param array $ids The IDs of the snippets to export
|
350 |
+
* @param bool|null $multisite Is the snippet a network-wide or site-wide snippet?
|
351 |
+
* @param string $format Export to xml or php?
|
352 |
*/
|
353 |
function export_snippets( $ids, $multisite = null, $format = 'xml' ) {
|
354 |
$table = get_snippets_table_name( $multisite );
|
368 |
* it will be executed directly
|
369 |
*
|
370 |
* @since 2.0
|
371 |
+
*
|
372 |
+
* @param string $code The snippet code to execute
|
373 |
+
* @param int $id The snippet ID
|
374 |
+
* @return mixed The result of the code execution
|
375 |
*/
|
376 |
+
function execute_snippet( $code, $id = 0 ) {
|
377 |
|
378 |
if ( empty( $code ) ) {
|
379 |
return false;
|
381 |
|
382 |
ob_start();
|
383 |
$result = eval( $code );
|
|
|
384 |
ob_end_clean();
|
385 |
|
386 |
+
if ( $id ) {
|
387 |
+
do_action( 'code_snippets/after_execute_snippet', $id, $code );
|
388 |
+
}
|
389 |
+
|
390 |
return $result;
|
391 |
}
|
392 |
|
394 |
* Run the active snippets
|
395 |
*
|
396 |
* @since 2.0
|
397 |
+
*
|
398 |
+
* @return bool true on success, false on failure
|
399 |
*/
|
400 |
function execute_active_snippets() {
|
401 |
|
404 |
return false;
|
405 |
}
|
406 |
|
407 |
+
/** @var wpdb $wpdb */
|
408 |
global $wpdb;
|
409 |
|
410 |
if ( ! isset( $wpdb->snippets, $wpdb->ms_snippets ) ) {
|
411 |
set_snippet_table_vars();
|
412 |
}
|
413 |
|
414 |
+
$current_scope = is_admin() ? 1 : 2;
|
|
|
|
|
|
|
415 |
|
416 |
+
/* Check if the snippets tables exist */
|
417 |
+
$table_exists = $wpdb->get_var( "SHOW TABLES LIKE '$wpdb->snippets'" ) === $wpdb->snippets;
|
418 |
+
$ms_table_exists = is_multisite() && $wpdb->get_var( "SHOW TABLES LIKE '$wpdb->ms_snippets'" ) === $wpdb->ms_snippets;
|
419 |
+
|
420 |
+
/* Fetch snippets from site table */
|
421 |
+
if ( $table_exists ) {
|
422 |
+
$sql = $wpdb->prepare( "SELECT id, code FROM {$wpdb->snippets} WHERE active=1 AND (scope=0 OR scope=%d)", $current_scope );
|
423 |
}
|
424 |
|
425 |
+
/* Fetch snippets from the network table */
|
426 |
+
if ( $ms_table_exists ) {
|
427 |
|
428 |
+
if ( ! empty( $sql ) ) {
|
429 |
+
$sql .= ' UNION ALL ';
|
430 |
+
}
|
431 |
|
432 |
+
/* Only select snippets in the current scope */
|
433 |
+
$sql .= $wpdb->prepare( "SELECT id, code FROM {$wpdb->ms_snippets} WHERE active=1 AND (scope=0 OR scope=%d)", $current_scope );
|
434 |
+
|
435 |
+
/* Add shared network snippets */
|
436 |
+
if ( $active_shared_ids = get_option( 'active_shared_network_snippets', false ) ) {
|
437 |
+
$sql .= ' UNION ALL ';
|
438 |
+
$sql .= $wpdb->prepare(
|
439 |
+
sprintf(
|
440 |
+
"SELECT id, code FROM {$wpdb->ms_snippets} WHERE id IN (%s)",
|
441 |
+
implode( ',', array_fill( 0, count( $active_shared_ids ), '%d' ) )
|
442 |
+
),
|
443 |
+
$active_shared_ids
|
444 |
+
);
|
445 |
}
|
446 |
+
}
|
447 |
|
448 |
+
/* Return false if there is no query */
|
449 |
+
if ( empty( $sql ) ) {
|
450 |
+
return false;
|
451 |
+
}
|
452 |
+
|
453 |
+
/* Grab the snippets from the database */
|
454 |
+
$active_snippets = $wpdb->get_results( $sql, OBJECT_K );
|
455 |
+
|
456 |
+
/* Loop through the returned snippets and execute the PHP code */
|
457 |
+
foreach ( $active_snippets as $snippet_id => $snippet ) {
|
458 |
+
|
459 |
+
if ( apply_filters( 'code_snippets/allow_execute_snippet', true, $snippet_id ) ) {
|
460 |
+
execute_snippet( $snippet->code, $snippet_id );
|
461 |
+
}
|
462 |
}
|
463 |
|
464 |
+
return true;
|
|
|
465 |
}
|
includes/upgrade.php
CHANGED
@@ -1,5 +1,9 @@
|
|
1 |
<?php
|
2 |
|
|
|
|
|
|
|
|
|
3 |
/* Bail on direct access */
|
4 |
if ( ! defined( 'ABSPATH' ) ) {
|
5 |
return;
|
1 |
<?php
|
2 |
|
3 |
+
/**
|
4 |
+
* This file manages upgrades to the database between plugin versions
|
5 |
+
*/
|
6 |
+
|
7 |
/* Bail on direct access */
|
8 |
if ( ! defined( 'ABSPATH' ) ) {
|
9 |
return;
|
includes/{edit/admin.php → views/edit.php}
RENAMED
@@ -3,8 +3,8 @@
|
|
3 |
/**
|
4 |
* HTML code for the Add New/Edit Snippet page
|
5 |
*
|
6 |
-
* @package
|
7 |
-
* @subpackage
|
8 |
*/
|
9 |
|
10 |
/* Bail if accessed directly */
|
@@ -14,27 +14,23 @@ if ( ! defined( 'ABSPATH' ) ) {
|
|
14 |
|
15 |
global $pagenow;
|
16 |
|
17 |
-
$table
|
18 |
$edit_id = code_snippets_get_menu_slug( 'edit' ) === $_REQUEST['page'] ? absint( $_REQUEST['id'] ) : 0;
|
19 |
$snippet = get_snippet( $edit_id );
|
20 |
|
21 |
?>
|
22 |
<div class="wrap">
|
23 |
-
|
24 |
-
<h2><?php
|
25 |
if ( $edit_id ) {
|
26 |
esc_html_e( 'Edit Snippet', 'code-snippets' );
|
27 |
-
|
28 |
-
|
29 |
-
|
30 |
-
|
31 |
-
esc_html_x( 'Add New', 'snippet', 'code-snippets' )
|
32 |
-
);
|
33 |
-
}
|
34 |
} else {
|
35 |
esc_html_e( 'Add New Snippet', 'code-snippets' );
|
36 |
}
|
37 |
-
?></
|
38 |
|
39 |
<form method="post" action="" style="margin-top: 10px;">
|
40 |
<?php
|
@@ -54,14 +50,14 @@ $snippet = get_snippet( $edit_id );
|
|
54 |
</div>
|
55 |
</div>
|
56 |
|
57 |
-
<label for="snippet_code">
|
58 |
-
|
59 |
-
</label>
|
60 |
|
61 |
<textarea id="snippet_code" name="snippet_code" rows="20" spellcheck="false" style="font-family: monospace; width: 100%;"><?php echo esc_textarea( $snippet->code ); ?></textarea>
|
62 |
|
63 |
<?php
|
64 |
-
/* Allow
|
65 |
do_action( 'code_snippets/admin/single', $snippet );
|
66 |
|
67 |
/* Add a nonce for security */
|
@@ -72,7 +68,12 @@ $snippet = get_snippet( $edit_id );
|
|
72 |
<?php
|
73 |
|
74 |
/* Make the 'Save and Activate' button the default if the setting is enabled */
|
75 |
-
|
|
|
|
|
|
|
|
|
|
|
76 |
|
77 |
submit_button(
|
78 |
__( 'Save Changes and Activate', 'code-snippets' ),
|
@@ -126,6 +127,15 @@ $snippet = get_snippet( $edit_id );
|
|
126 |
?>
|
127 |
</p>
|
128 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
129 |
</form>
|
130 |
</div>
|
131 |
|
@@ -139,6 +149,6 @@ $snippet = get_snippet( $edit_id );
|
|
139 |
$atts = array( 'mode' => 'text/x-php' );
|
140 |
echo code_snippets_get_editor_atts( $atts, true );
|
141 |
?>;
|
142 |
-
|
143 |
})();
|
144 |
</script>
|
3 |
/**
|
4 |
* HTML code for the Add New/Edit Snippet page
|
5 |
*
|
6 |
+
* @package Code_Snippets
|
7 |
+
* @subpackage Views
|
8 |
*/
|
9 |
|
10 |
/* Bail if accessed directly */
|
14 |
|
15 |
global $pagenow;
|
16 |
|
17 |
+
$table = get_snippets_table_name();
|
18 |
$edit_id = code_snippets_get_menu_slug( 'edit' ) === $_REQUEST['page'] ? absint( $_REQUEST['id'] ) : 0;
|
19 |
$snippet = get_snippet( $edit_id );
|
20 |
|
21 |
?>
|
22 |
<div class="wrap">
|
23 |
+
<h1><?php
|
|
|
24 |
if ( $edit_id ) {
|
25 |
esc_html_e( 'Edit Snippet', 'code-snippets' );
|
26 |
+
printf( ' <a href="%1$s" class="page-title-action add-new-h2">%2$s</a>',
|
27 |
+
code_snippets_get_menu_url( 'add' ),
|
28 |
+
esc_html_x( 'Add New', 'snippet', 'code-snippets' )
|
29 |
+
);
|
|
|
|
|
|
|
30 |
} else {
|
31 |
esc_html_e( 'Add New Snippet', 'code-snippets' );
|
32 |
}
|
33 |
+
?></h1>
|
34 |
|
35 |
<form method="post" action="" style="margin-top: 10px;">
|
36 |
<?php
|
50 |
</div>
|
51 |
</div>
|
52 |
|
53 |
+
<h3><label for="snippet_code">
|
54 |
+
<?php _e( 'Code', 'code-snippets' ); ?>
|
55 |
+
</label></h3>
|
56 |
|
57 |
<textarea id="snippet_code" name="snippet_code" rows="20" spellcheck="false" style="font-family: monospace; width: 100%;"><?php echo esc_textarea( $snippet->code ); ?></textarea>
|
58 |
|
59 |
<?php
|
60 |
+
/* Allow plugins to add fields and content to this page */
|
61 |
do_action( 'code_snippets/admin/single', $snippet );
|
62 |
|
63 |
/* Add a nonce for security */
|
68 |
<?php
|
69 |
|
70 |
/* Make the 'Save and Activate' button the default if the setting is enabled */
|
71 |
+
|
72 |
+
if ( $snippet->shared_network && get_current_screen()->in_admin( 'network' ) ) {
|
73 |
+
|
74 |
+
submit_button( null, 'primary', 'save_snippet', false );
|
75 |
+
|
76 |
+
} elseif ( ! $snippet->active && code_snippets_get_setting( 'general', 'activate_by_default' ) ) {
|
77 |
|
78 |
submit_button(
|
79 |
__( 'Save Changes and Activate', 'code-snippets' ),
|
127 |
?>
|
128 |
</p>
|
129 |
|
130 |
+
<?php if ( has_action( 'code_snippets/admin/single/settings' ) ) : ?>
|
131 |
+
|
132 |
+
<h3><?php _e( 'Settings', 'code-snippets' ); ?></h3>
|
133 |
+
<table class="form-table">
|
134 |
+
<?php do_action( 'code_snippets/admin/single/settings', $snippet ); ?>
|
135 |
+
</table>
|
136 |
+
|
137 |
+
<?php endif; ?>
|
138 |
+
|
139 |
</form>
|
140 |
</div>
|
141 |
|
149 |
$atts = array( 'mode' => 'text/x-php' );
|
150 |
echo code_snippets_get_editor_atts( $atts, true );
|
151 |
?>;
|
152 |
+
CodeMirror.fromTextArea(document.getElementById('snippet_code'), atts);
|
153 |
})();
|
154 |
</script>
|
includes/{import/admin.php → views/import.php}
RENAMED
@@ -4,7 +4,7 @@
|
|
4 |
* HTML code for the Import Snippets page
|
5 |
*
|
6 |
* @package Code_Snippets
|
7 |
-
* @subpackage
|
8 |
*/
|
9 |
|
10 |
/* Bail if accessed directly */
|
@@ -14,8 +14,7 @@ if ( ! defined( 'ABSPATH' ) ) {
|
|
14 |
|
15 |
?>
|
16 |
<div class="wrap">
|
17 |
-
|
18 |
-
<h2><?php _e( 'Import Snippets', 'code-snippets' ); ?></h2>
|
19 |
|
20 |
<div class="narrow">
|
21 |
|
@@ -39,7 +38,6 @@ if ( ! defined( 'ABSPATH' ) ) {
|
|
39 |
do_action( 'code_snippets/admin/import_form' );
|
40 |
submit_button( __( 'Upload file and import', 'code-snippets' ) );
|
41 |
?>
|
42 |
-
|
43 |
</form>
|
44 |
</div>
|
45 |
</div>
|
4 |
* HTML code for the Import Snippets page
|
5 |
*
|
6 |
* @package Code_Snippets
|
7 |
+
* @subpackage Views
|
8 |
*/
|
9 |
|
10 |
/* Bail if accessed directly */
|
14 |
|
15 |
?>
|
16 |
<div class="wrap">
|
17 |
+
<h1><?php _e( 'Import Snippets', 'code-snippets' ); ?></h1>
|
|
|
18 |
|
19 |
<div class="narrow">
|
20 |
|
38 |
do_action( 'code_snippets/admin/import_form' );
|
39 |
submit_button( __( 'Upload file and import', 'code-snippets' ) );
|
40 |
?>
|
|
|
41 |
</form>
|
42 |
</div>
|
43 |
</div>
|
includes/views/manage.php
ADDED
@@ -0,0 +1,45 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
|
3 |
+
/**
|
4 |
+
* HTML code for the Manage Snippets page
|
5 |
+
*
|
6 |
+
* @package Code_Snippets
|
7 |
+
* @subpackage Views
|
8 |
+
*/
|
9 |
+
|
10 |
+
/* Bail if accessed directly */
|
11 |
+
if ( ! defined( 'ABSPATH' ) ) {
|
12 |
+
return;
|
13 |
+
}
|
14 |
+
|
15 |
+
?>
|
16 |
+
|
17 |
+
<div class="wrap">
|
18 |
+
<h1><?php
|
19 |
+
esc_html_e( 'Snippets', 'code-snippets' );
|
20 |
+
|
21 |
+
printf( '<a href="%2$s" class="page-title-action add-new-h2">%1$s</a>',
|
22 |
+
esc_html_x( 'Add New', 'snippet', 'code-snippets' ),
|
23 |
+
code_snippets_get_menu_url( 'add' )
|
24 |
+
);
|
25 |
+
|
26 |
+
$this->list_table->search_notice();
|
27 |
+
?></h1>
|
28 |
+
|
29 |
+
<?php $this->list_table->views(); ?>
|
30 |
+
|
31 |
+
<form method="get" action="">
|
32 |
+
<?php
|
33 |
+
$this->list_table->required_form_fields( 'search_box' );
|
34 |
+
$this->list_table->search_box( __( 'Search Installed Snippets', 'code-snippets' ), 'search_id' );
|
35 |
+
?>
|
36 |
+
</form>
|
37 |
+
<form method="post" action="">
|
38 |
+
<?php
|
39 |
+
$this->list_table->required_form_fields();
|
40 |
+
$this->list_table->display();
|
41 |
+
?>
|
42 |
+
</form>
|
43 |
+
|
44 |
+
<?php do_action( 'code_snippets/admin/manage' ); ?>
|
45 |
+
</div>
|
js/min/codemirror.js
CHANGED
@@ -1,6 +1,6 @@
|
|
1 |
-
!function(a){if("object"==typeof exports&&"object"==typeof module)module.exports=a();else{if("function"==typeof define&&define.amd)return define([],a);this.CodeMirror=a()}}(function(){"use strict";function a(c,d){if(!(this instanceof a))return new a(c,d);this.options=d=d?Fe(d):{},Fe(Tf,d,!1),n(d);var e=d.value;"string"==typeof e&&(e=new pg(e,d.mode)),this.doc=e;var f=new a.inputStyles[d.inputStyle](this),g=this.display=new b(c,e,f);g.wrapper.CodeMirror=this,j(this),h(this),d.lineWrapping&&(this.display.wrapper.className+=" CodeMirror-wrap"),d.autofocus&&!vf&&g.input.focus(),r(this),this.state={keyMaps:[],overlays:[],modeGen:0,overwrite:!1,delayingBlurEvent:!1,focused:!1,suppressEdits:!1,pasteIncoming:!1,cutIncoming:!1,draggingText:!1,highlight:new xe,keySeq:null,specialChars:null};var i=this;lf&&11>mf&&setTimeout(function(){i.display.input.reset(!0)},20),Nb(this),Re(),rb(this),this.curOp.forceUpdate=!0,Sd(this,e),d.autofocus&&!vf||i.hasFocus()?setTimeout(Ge(lc,this),20):mc(this);for(var k in Uf)Uf.hasOwnProperty(k)&&Uf[k](this,d[k],Vf);w(this),d.finishInit&&d.finishInit(this);for(var l=0;l<Zf.length;++l)Zf[l](this);tb(this),nf&&d.lineWrapping&&"optimizelegibility"==getComputedStyle(g.lineDiv).textRendering&&(g.lineDiv.style.textRendering="auto")}function b(a,b,c){var d=this;this.input=c,d.scrollbarFiller=Ke("div",null,"CodeMirror-scrollbar-filler"),d.scrollbarFiller.setAttribute("cm-not-content","true"),d.gutterFiller=Ke("div",null,"CodeMirror-gutter-filler"),d.gutterFiller.setAttribute("cm-not-content","true"),d.lineDiv=Ke("div",null,"CodeMirror-code"),d.selectionDiv=Ke("div",null,null,"position: relative; z-index: 1"),d.cursorDiv=Ke("div",null,"CodeMirror-cursors"),d.measure=Ke("div",null,"CodeMirror-measure"),d.lineMeasure=Ke("div",null,"CodeMirror-measure"),d.lineSpace=Ke("div",[d.measure,d.lineMeasure,d.selectionDiv,d.cursorDiv,d.lineDiv],null,"position: relative; outline: none"),d.mover=Ke("div",[Ke("div",[d.lineSpace],"CodeMirror-lines")],null,"position: relative"),d.sizer=Ke("div",[d.mover],"CodeMirror-sizer"),d.sizerWidth=null,d.heightForcer=Ke("div",null,null,"position: absolute; height: "+zg+"px; width: 1px;"),d.gutters=Ke("div",null,"CodeMirror-gutters"),d.lineGutter=null,d.scroller=Ke("div",[d.sizer,d.heightForcer,d.gutters],"CodeMirror-scroll"),d.scroller.setAttribute("tabIndex","-1"),d.wrapper=Ke("div",[d.scrollbarFiller,d.gutterFiller,d.scroller],"CodeMirror"),lf&&8>mf&&(d.gutters.style.zIndex=-1,d.scroller.style.paddingRight=0),nf||hf&&vf||(d.scroller.draggable=!0),a&&(a.appendChild?a.appendChild(d.wrapper):a(d.wrapper)),d.viewFrom=d.viewTo=b.first,d.reportedViewFrom=d.reportedViewTo=b.first,d.view=[],d.renderedView=null,d.externalMeasured=null,d.viewOffset=0,d.lastWrapHeight=d.lastWrapWidth=0,d.updateLineNumbers=null,d.nativeBarWidth=d.barHeight=d.barWidth=0,d.scrollbarsClipped=!1,d.lineNumWidth=d.lineNumInnerWidth=d.lineNumChars=null,d.alignWidgets=!1,d.cachedCharWidth=d.cachedTextHeight=d.cachedPaddingH=null,d.maxLine=null,d.maxLineLength=0,d.maxLineChanged=!1,d.wheelDX=d.wheelDY=d.wheelStartX=d.wheelStartY=null,d.shift=!1,d.selForContextMenu=null,d.activeTouch=null,c.init(d)}function c(b){b.doc.mode=a.getMode(b.options,b.doc.modeOption),d(b)}function d(a){a.doc.iter(function(a){a.stateAfter&&(a.stateAfter=null),a.styles&&(a.styles=null)}),a.doc.frontier=a.doc.first,Ka(a,100),a.state.modeGen++,a.curOp&&Gb(a)}function e(a){a.options.lineWrapping?(Pg(a.display.wrapper,"CodeMirror-wrap"),a.display.sizer.style.minWidth="",a.display.sizerWidth=null):(Og(a.display.wrapper,"CodeMirror-wrap"),m(a)),g(a),Gb(a),eb(a),setTimeout(function(){s(a)},100)}function f(a){var b=pb(a.display),c=a.options.lineWrapping,d=c&&Math.max(5,a.display.scroller.clientWidth/qb(a.display)-3);return function(e){if(qd(a.doc,e))return 0;var f=0;if(e.widgets)for(var g=0;g<e.widgets.length;g++)e.widgets[g].height&&(f+=e.widgets[g].height);return c?f+(Math.ceil(e.text.length/d)||1)*b:f+b}}function g(a){var b=a.doc,c=f(a);b.iter(function(a){var b=c(a);b!=a.height&&Wd(a,b)})}function h(a){a.display.wrapper.className=a.display.wrapper.className.replace(/\s*cm-s-\S+/g,"")+a.options.theme.replace(/(^|\s)\s*/g," cm-s-"),eb(a)}function i(a){j(a),Gb(a),setTimeout(function(){v(a)},20)}function j(a){var b=a.display.gutters,c=a.options.gutters;Le(b);for(var d=0;d<c.length;++d){var e=c[d],f=b.appendChild(Ke("div",null,"CodeMirror-gutter "+e));"CodeMirror-linenumbers"==e&&(a.display.lineGutter=f,f.style.width=(a.display.lineNumWidth||1)+"px")}b.style.display=d?"":"none",k(a)}function k(a){var b=a.display.gutters.offsetWidth;a.display.sizer.style.marginLeft=b+"px"}function l(a){if(0==a.height)return 0;for(var b,c=a.text.length,d=a;b=jd(d);){var e=b.find(0,!0);d=e.from.line,c+=e.from.ch-e.to.ch}for(d=a;b=kd(d);){var e=b.find(0,!0);c-=d.text.length-e.from.ch,d=e.to.line,c+=d.text.length-e.to.ch}return c}function m(a){var b=a.display,c=a.doc;b.maxLine=Td(c,c.first),b.maxLineLength=l(b.maxLine),b.maxLineChanged=!0,c.iter(function(a){var c=l(a);c>b.maxLineLength&&(b.maxLineLength=c,b.maxLine=a)})}function n(a){var b=Be(a.gutters,"CodeMirror-linenumbers");-1==b&&a.lineNumbers?a.gutters=a.gutters.concat(["CodeMirror-linenumbers"]):b>-1&&!a.lineNumbers&&(a.gutters=a.gutters.slice(0),a.gutters.splice(b,1))}function o(a){var b=a.display,c=b.gutters.offsetWidth,d=Math.round(a.doc.height+Pa(a.display));return{clientHeight:b.scroller.clientHeight,viewHeight:b.wrapper.clientHeight,scrollWidth:b.scroller.scrollWidth,clientWidth:b.scroller.clientWidth,viewWidth:b.wrapper.clientWidth,barLeft:a.options.fixedGutter?c:0,docHeight:d,scrollHeight:d+Ra(a)+b.barHeight,nativeBarWidth:b.nativeBarWidth,gutterWidth:c}}function p(a,b,c){this.cm=c;var d=this.vert=Ke("div",[Ke("div",null,null,"min-width: 1px")],"CodeMirror-vscrollbar"),e=this.horiz=Ke("div",[Ke("div",null,null,"height: 100%; min-height: 1px")],"CodeMirror-hscrollbar");a(d),a(e),vg(d,"scroll",function(){d.clientHeight&&b(d.scrollTop,"vertical")}),vg(e,"scroll",function(){e.clientWidth&&b(e.scrollLeft,"horizontal")}),this.checkedOverlay=!1,lf&&8>mf&&(this.horiz.style.minHeight=this.vert.style.minWidth="18px")}function q(){}function r(b){b.display.scrollbars&&(b.display.scrollbars.clear(),b.display.scrollbars.addClass&&Og(b.display.wrapper,b.display.scrollbars.addClass)),b.display.scrollbars=new a.scrollbarModel[b.options.scrollbarStyle](function(a){b.display.wrapper.insertBefore(a,b.display.scrollbarFiller),vg(a,"mousedown",function(){b.state.focused&&setTimeout(function(){b.display.input.focus()},0)}),a.setAttribute("cm-not-content","true")},function(a,c){"horizontal"==c?_b(b,a):$b(b,a)},b),b.display.scrollbars.addClass&&Pg(b.display.wrapper,b.display.scrollbars.addClass)}function s(a,b){b||(b=o(a));var c=a.display.barWidth,d=a.display.barHeight;t(a,b);for(var e=0;4>e&&c!=a.display.barWidth||d!=a.display.barHeight;e++)c!=a.display.barWidth&&a.options.lineWrapping&&F(a),t(a,o(a)),c=a.display.barWidth,d=a.display.barHeight}function t(a,b){var c=a.display,d=c.scrollbars.update(b);c.sizer.style.paddingRight=(c.barWidth=d.right)+"px",c.sizer.style.paddingBottom=(c.barHeight=d.bottom)+"px",d.right&&d.bottom?(c.scrollbarFiller.style.display="block",c.scrollbarFiller.style.height=d.bottom+"px",c.scrollbarFiller.style.width=d.right+"px"):c.scrollbarFiller.style.display="",d.bottom&&a.options.coverGutterNextToScrollbar&&a.options.fixedGutter?(c.gutterFiller.style.display="block",c.gutterFiller.style.height=d.bottom+"px",c.gutterFiller.style.width=b.gutterWidth+"px"):c.gutterFiller.style.display=""}function u(a,b,c){var d=c&&null!=c.top?Math.max(0,c.top):a.scroller.scrollTop;d=Math.floor(d-Oa(a));var e=c&&null!=c.bottom?c.bottom:d+a.wrapper.clientHeight,f=Yd(b,d),g=Yd(b,e);if(c&&c.ensure){var h=c.ensure.from.line,i=c.ensure.to.line;f>h?(f=h,g=Yd(b,Zd(Td(b,h))+a.wrapper.clientHeight)):Math.min(i,b.lastLine())>=g&&(f=Yd(b,Zd(Td(b,i))-a.wrapper.clientHeight),g=i)}return{from:f,to:Math.max(g,f+1)}}function v(a){var b=a.display,c=b.view;if(b.alignWidgets||b.gutters.firstChild&&a.options.fixedGutter){for(var d=y(b)-b.scroller.scrollLeft+a.doc.scrollLeft,e=b.gutters.offsetWidth,f=d+"px",g=0;g<c.length;g++)if(!c[g].hidden){a.options.fixedGutter&&c[g].gutter&&(c[g].gutter.style.left=f);var h=c[g].alignable;if(h)for(var i=0;i<h.length;i++)h[i].style.left=f}a.options.fixedGutter&&(b.gutters.style.left=d+e+"px")}}function w(a){if(!a.options.lineNumbers)return!1;var b=a.doc,c=x(a.options,b.first+b.size-1),d=a.display;if(c.length!=d.lineNumChars){var e=d.measure.appendChild(Ke("div",[Ke("div",c)],"CodeMirror-linenumber CodeMirror-gutter-elt")),f=e.firstChild.offsetWidth,g=e.offsetWidth-f;return d.lineGutter.style.width="",d.lineNumInnerWidth=Math.max(f,d.lineGutter.offsetWidth-g)+1,d.lineNumWidth=d.lineNumInnerWidth+g,d.lineNumChars=d.lineNumInnerWidth?c.length:-1,d.lineGutter.style.width=d.lineNumWidth+"px",k(a),!0}return!1}function x(a,b){return String(a.lineNumberFormatter(b+a.firstLineNumber))}function y(a){return a.scroller.getBoundingClientRect().left-a.sizer.getBoundingClientRect().left}function z(a,b,c){var d=a.display;this.viewport=b,this.visible=u(d,a.doc,b),this.editorIsHidden=!d.wrapper.offsetWidth,this.wrapperHeight=d.wrapper.clientHeight,this.wrapperWidth=d.wrapper.clientWidth,this.oldDisplayWidth=Sa(a),this.force=c,this.dims=H(a),this.events=[]}function A(a){var b=a.display;!b.scrollbarsClipped&&b.scroller.offsetWidth&&(b.nativeBarWidth=b.scroller.offsetWidth-b.scroller.clientWidth,b.heightForcer.style.height=Ra(a)+"px",b.sizer.style.marginBottom=-b.nativeBarWidth+"px",b.sizer.style.borderRightWidth=Ra(a)+"px",b.scrollbarsClipped=!0)}function B(a,b){var c=a.display,d=a.doc;if(b.editorIsHidden)return Ib(a),!1;if(!b.force&&b.visible.from>=c.viewFrom&&b.visible.to<=c.viewTo&&(null==c.updateLineNumbers||c.updateLineNumbers>=c.viewTo)&&c.renderedView==c.view&&0==Mb(a))return!1;w(a)&&(Ib(a),b.dims=H(a));var e=d.first+d.size,f=Math.max(b.visible.from-a.options.viewportMargin,d.first),g=Math.min(e,b.visible.to+a.options.viewportMargin);c.viewFrom<f&&f-c.viewFrom<20&&(f=Math.max(d.first,c.viewFrom)),c.viewTo>g&&c.viewTo-g<20&&(g=Math.min(e,c.viewTo)),Cf&&(f=od(a.doc,f),g=pd(a.doc,g));var h=f!=c.viewFrom||g!=c.viewTo||c.lastWrapHeight!=b.wrapperHeight||c.lastWrapWidth!=b.wrapperWidth;Lb(a,f,g),c.viewOffset=Zd(Td(a.doc,c.viewFrom)),a.display.mover.style.top=c.viewOffset+"px";var i=Mb(a);if(!h&&0==i&&!b.force&&c.renderedView==c.view&&(null==c.updateLineNumbers||c.updateLineNumbers>=c.viewTo))return!1;var j=Ne();return i>4&&(c.lineDiv.style.display="none"),I(a,c.updateLineNumbers,b.dims),i>4&&(c.lineDiv.style.display=""),c.renderedView=c.view,j&&Ne()!=j&&j.offsetHeight&&j.focus(),Le(c.cursorDiv),Le(c.selectionDiv),c.gutters.style.height=0,h&&(c.lastWrapHeight=b.wrapperHeight,c.lastWrapWidth=b.wrapperWidth,Ka(a,400)),c.updateLineNumbers=null,!0}function C(a,b){for(var c=b.force,d=b.viewport,e=!0;;e=!1){if(e&&a.options.lineWrapping&&b.oldDisplayWidth!=Sa(a))c=!0;else if(c=!1,d&&null!=d.top&&(d={top:Math.min(a.doc.height+Pa(a.display)-Ta(a),d.top)}),b.visible=u(a.display,a.doc,d),b.visible.from>=a.display.viewFrom&&b.visible.to<=a.display.viewTo)break;if(!B(a,b))break;F(a);var f=o(a);Fa(a),E(a,f),s(a,f)}b.signal(a,"update",a),(a.display.viewFrom!=a.display.reportedViewFrom||a.display.viewTo!=a.display.reportedViewTo)&&(b.signal(a,"viewportChange",a,a.display.viewFrom,a.display.viewTo),a.display.reportedViewFrom=a.display.viewFrom,a.display.reportedViewTo=a.display.viewTo)}function D(a,b){var c=new z(a,b);if(B(a,c)){F(a),C(a,c);var d=o(a);Fa(a),E(a,d),s(a,d),c.finish()}}function E(a,b){a.display.sizer.style.minHeight=b.docHeight+"px";var c=b.docHeight+a.display.barHeight;a.display.heightForcer.style.top=c+"px",a.display.gutters.style.height=Math.max(c+Ra(a),b.clientHeight)+"px"}function F(a){for(var b=a.display,c=b.lineDiv.offsetTop,d=0;d<b.view.length;d++){var e,f=b.view[d];if(!f.hidden){if(lf&&8>mf){var g=f.node.offsetTop+f.node.offsetHeight;e=g-c,c=g}else{var h=f.node.getBoundingClientRect();e=h.bottom-h.top}var i=f.line.height-e;if(2>e&&(e=pb(b)),(i>.001||-.001>i)&&(Wd(f.line,e),G(f.line),f.rest))for(var j=0;j<f.rest.length;j++)G(f.rest[j])}}}function G(a){if(a.widgets)for(var b=0;b<a.widgets.length;++b)a.widgets[b].height=a.widgets[b].node.offsetHeight}function H(a){for(var b=a.display,c={},d={},e=b.gutters.clientLeft,f=b.gutters.firstChild,g=0;f;f=f.nextSibling,++g)c[a.options.gutters[g]]=f.offsetLeft+f.clientLeft+e,d[a.options.gutters[g]]=f.clientWidth;return{fixedPos:y(b),gutterTotalWidth:b.gutters.offsetWidth,gutterLeft:c,gutterWidth:d,wrapperWidth:b.wrapper.clientWidth}}function I(a,b,c){function d(b){var c=b.nextSibling;return nf&&wf&&a.display.currentWheelTarget==b?b.style.display="none":b.parentNode.removeChild(b),c}for(var e=a.display,f=a.options.lineNumbers,g=e.lineDiv,h=g.firstChild,i=e.view,j=e.viewFrom,k=0;k<i.length;k++){var l=i[k];if(l.hidden);else if(l.node&&l.node.parentNode==g){for(;h!=l.node;)h=d(h);var m=f&&null!=b&&j>=b&&l.lineNumber;l.changes&&(Be(l.changes,"gutter")>-1&&(m=!1),J(a,l,j,c)),m&&(Le(l.lineNumber),l.lineNumber.appendChild(document.createTextNode(x(a.options,j)))),h=l.node.nextSibling}else{var n=R(a,l,j,c);g.insertBefore(n,h)}j+=l.size}for(;h;)h=d(h)}function J(a,b,c,d){for(var e=0;e<b.changes.length;e++){var f=b.changes[e];"text"==f?N(a,b):"gutter"==f?P(a,b,c,d):"class"==f?O(b):"widget"==f&&Q(a,b,d)}b.changes=null}function K(a){return a.node==a.text&&(a.node=Ke("div",null,null,"position: relative"),a.text.parentNode&&a.text.parentNode.replaceChild(a.node,a.text),a.node.appendChild(a.text),lf&&8>mf&&(a.node.style.zIndex=2)),a.node}function L(a){var b=a.bgClass?a.bgClass+" "+(a.line.bgClass||""):a.line.bgClass;if(b&&(b+=" CodeMirror-linebackground"),a.background)b?a.background.className=b:(a.background.parentNode.removeChild(a.background),a.background=null);else if(b){var c=K(a);a.background=c.insertBefore(Ke("div",null,b),c.firstChild)}}function M(a,b){var c=a.display.externalMeasured;return c&&c.line==b.line?(a.display.externalMeasured=null,b.measure=c.measure,c.built):Gd(a,b)}function N(a,b){var c=b.text.className,d=M(a,b);b.text==b.node&&(b.node=d.pre),b.text.parentNode.replaceChild(d.pre,b.text),b.text=d.pre,d.bgClass!=b.bgClass||d.textClass!=b.textClass?(b.bgClass=d.bgClass,b.textClass=d.textClass,O(b)):c&&(b.text.className=c)}function O(a){L(a),a.line.wrapClass?K(a).className=a.line.wrapClass:a.node!=a.text&&(a.node.className="");var b=a.textClass?a.textClass+" "+(a.line.textClass||""):a.line.textClass;a.text.className=b||""}function P(a,b,c,d){b.gutter&&(b.node.removeChild(b.gutter),b.gutter=null);var e=b.line.gutterMarkers;if(a.options.lineNumbers||e){var f=K(b),g=b.gutter=Ke("div",null,"CodeMirror-gutter-wrapper","left: "+(a.options.fixedGutter?d.fixedPos:-d.gutterTotalWidth)+"px; width: "+d.gutterTotalWidth+"px");if(a.display.input.setUneditable(g),f.insertBefore(g,b.text),b.line.gutterClass&&(g.className+=" "+b.line.gutterClass),!a.options.lineNumbers||e&&e["CodeMirror-linenumbers"]||(b.lineNumber=g.appendChild(Ke("div",x(a.options,c),"CodeMirror-linenumber CodeMirror-gutter-elt","left: "+d.gutterLeft["CodeMirror-linenumbers"]+"px; width: "+a.display.lineNumInnerWidth+"px"))),e)for(var h=0;h<a.options.gutters.length;++h){var i=a.options.gutters[h],j=e.hasOwnProperty(i)&&e[i];j&&g.appendChild(Ke("div",[j],"CodeMirror-gutter-elt","left: "+d.gutterLeft[i]+"px; width: "+d.gutterWidth[i]+"px"))}}}function Q(a,b,c){b.alignable&&(b.alignable=null);for(var d,e=b.node.firstChild;e;e=d){var d=e.nextSibling;"CodeMirror-linewidget"==e.className&&b.node.removeChild(e)}S(a,b,c)}function R(a,b,c,d){var e=M(a,b);return b.text=b.node=e.pre,e.bgClass&&(b.bgClass=e.bgClass),e.textClass&&(b.textClass=e.textClass),O(b),P(a,b,c,d),S(a,b,d),b.node}function S(a,b,c){if(T(a,b.line,b,c,!0),b.rest)for(var d=0;d<b.rest.length;d++)T(a,b.rest[d],b,c,!1)}function T(a,b,c,d,e){if(b.widgets)for(var f=K(c),g=0,h=b.widgets;g<h.length;++g){var i=h[g],j=Ke("div",[i.node],"CodeMirror-linewidget");i.handleMouseEvents||j.setAttribute("cm-ignore-events","true"),U(i,j,c,d),a.display.input.setUneditable(j),e&&i.above?f.insertBefore(j,c.gutter||c.text):f.appendChild(j),re(i,"redraw")}}function U(a,b,c,d){if(a.noHScroll){(c.alignable||(c.alignable=[])).push(b);var e=d.wrapperWidth;b.style.left=d.fixedPos+"px",a.coverGutter||(e-=d.gutterTotalWidth,b.style.paddingLeft=d.gutterTotalWidth+"px"),b.style.width=e+"px"}a.coverGutter&&(b.style.zIndex=5,b.style.position="relative",a.noHScroll||(b.style.marginLeft=-d.gutterTotalWidth+"px"))}function V(a){return Df(a.line,a.ch)}function W(a,b){return Ef(a,b)<0?b:a}function X(a,b){return Ef(a,b)<0?a:b}function Y(a){a.state.focused||(a.display.input.focus(),lc(a))}function Z(a){return a.options.readOnly||a.doc.cantEdit}function $(a,b,c,d,e){var f=a.doc;a.display.shift=!1,d||(d=f.sel);var g=Sg(b),h=null;a.state.pasteIncoming&&d.ranges.length>1&&(Ff&&Ff.join("\n")==b?h=d.ranges.length%Ff.length==0&&Ce(Ff,Sg):g.length==d.ranges.length&&(h=Ce(g,function(a){return[a]})));for(var i=d.ranges.length-1;i>=0;i--){var j=d.ranges[i],k=j.from(),l=j.to();j.empty()&&(c&&c>0?k=Df(k.line,k.ch-c):a.state.overwrite&&!a.state.pasteIncoming&&(l=Df(l.line,Math.min(Td(f,l.line).text.length,l.ch+Ae(g).length))));var m=a.curOp.updateInput,n={from:k,to:l,text:h?h[i%h.length]:g,origin:e||(a.state.pasteIncoming?"paste":a.state.cutIncoming?"cut":"+input")};if(uc(a.doc,n),re(a,"inputRead",a,n),b&&!a.state.pasteIncoming&&a.options.electricChars&&a.options.smartIndent&&j.head.ch<100&&(!i||d.ranges[i-1].head.line!=j.head.line)){var o=a.getModeAt(j.head),p=Sf(n),q=!1;if(o.electricChars){for(var r=0;r<o.electricChars.length;r++)if(b.indexOf(o.electricChars.charAt(r))>-1){q=Ic(a,p.line,"smart");break}}else o.electricInput&&o.electricInput.test(Td(f,p.line).text.slice(0,p.ch))&&(q=Ic(a,p.line,"smart"));q&&re(a,"electricInput",a,p.line)}}Gc(a),a.curOp.updateInput=m,a.curOp.typing=!0,a.state.pasteIncoming=a.state.cutIncoming=!1}function _(a){for(var b=[],c=[],d=0;d<a.doc.sel.ranges.length;d++){var e=a.doc.sel.ranges[d].head.line,f={anchor:Df(e,0),head:Df(e+1,0)};c.push(f),b.push(a.getRange(f.anchor,f.head))}return{text:b,ranges:c}}function aa(a){a.setAttribute("autocorrect","off"),a.setAttribute("autocapitalize","off"),a.setAttribute("spellcheck","false")}function ba(a){this.cm=a,this.prevInput="",this.pollingFast=!1,this.polling=new xe,this.inaccurateSelection=!1,this.hasSelection=!1,this.composing=null}function ca(){var a=Ke("textarea",null,null,"position: absolute; padding: 0; width: 1px; height: 1em; outline: none"),b=Ke("div",[a],null,"overflow: hidden; position: relative; width: 3px; height: 0px;");return nf?a.style.width="1000px":a.setAttribute("wrap","off"),uf&&(a.style.border="1px solid black"),aa(a),b}function da(a){this.cm=a,this.lastAnchorNode=this.lastAnchorOffset=this.lastFocusNode=this.lastFocusOffset=null,this.polling=new xe,this.gracePeriod=!1}function ea(a,b){var c=Ya(a,b.line);if(!c||c.hidden)return null;var d=Td(a.doc,b.line),e=Va(c,d,b.line),f=$d(d),g="left";if(f){var h=df(f,b.ch);g=h%2?"right":"left"}var i=_a(e.map,b.ch,"left");return i.offset="right"==i.collapse?i.end:i.start,i}function fa(a,b){return b&&(a.bad=!0),a}function ga(a,b,c){var d;if(b==a.display.lineDiv){if(d=a.display.lineDiv.childNodes[c],!d)return fa(a.clipPos(Df(a.display.viewTo-1)),!0);b=null,c=0}else for(d=b;;d=d.parentNode){if(!d||d==a.display.lineDiv)return null;if(d.parentNode&&d.parentNode==a.display.lineDiv)break}for(var e=0;e<a.display.view.length;e++){var f=a.display.view[e];if(f.node==d)return ha(f,b,c)}}function ha(a,b,c){function d(b,c,d){for(var e=-1;e<(k?k.length:0);e++)for(var f=0>e?j.map:k[e],g=0;g<f.length;g+=3){var h=f[g+2];if(h==b||h==c){var i=Xd(0>e?a.line:a.rest[e]),l=f[g]+d;return(0>d||h!=b)&&(l=f[g+(d?1:0)]),Df(i,l)}}}var e=a.text.firstChild,f=!1;if(!b||!Lg(e,b))return fa(Df(Xd(a.line),0),!0);if(b==e&&(f=!0,b=e.childNodes[c],c=0,!b)){var g=a.rest?Ae(a.rest):a.line;return fa(Df(Xd(g),g.text.length),f)}var h=3==b.nodeType?b:null,i=b;for(h||1!=b.childNodes.length||3!=b.firstChild.nodeType||(h=b.firstChild,c&&(c=h.nodeValue.length));i.parentNode!=e;)i=i.parentNode;var j=a.measure,k=j.maps,l=d(h,i,c);if(l)return fa(l,f);for(var m=i.nextSibling,n=h?h.nodeValue.length-c:0;m;m=m.nextSibling){if(l=d(m,m.firstChild,0))return fa(Df(l.line,l.ch-n),f);n+=m.textContent.length}for(var o=i.previousSibling,n=c;o;o=o.previousSibling){if(l=d(o,o.firstChild,-1))return fa(Df(l.line,l.ch+n),f);n+=m.textContent.length}}function ia(a,b,c,d,e){function f(a){return function(b){return b.id==a}}function g(b){if(1==b.nodeType){var c=b.getAttribute("cm-text");if(null!=c)return""==c&&(c=b.textContent.replace(/\u200b/g,"")),void(h+=c);var j,k=b.getAttribute("cm-marker");if(k){var l=a.findMarks(Df(d,0),Df(e+1,0),f(+k));return void(l.length&&(j=l[0].find())&&(h+=Ud(a.doc,j.from,j.to).join("\n")))}if("false"==b.getAttribute("contenteditable"))return;for(var m=0;m<b.childNodes.length;m++)g(b.childNodes[m]);/^(pre|div|p)$/i.test(b.nodeName)&&(i=!0)}else if(3==b.nodeType){var n=b.nodeValue;if(!n)return;i&&(h+="\n",i=!1),h+=n}}for(var h="",i=!1;g(b),b!=c;)b=b.nextSibling;return h}function ja(a,b){this.ranges=a,this.primIndex=b}function ka(a,b){this.anchor=a,this.head=b}function la(a,b){var c=a[b];a.sort(function(a,b){return Ef(a.from(),b.from())}),b=Be(a,c);for(var d=1;d<a.length;d++){var e=a[d],f=a[d-1];if(Ef(f.to(),e.from())>=0){var g=X(f.from(),e.from()),h=W(f.to(),e.to()),i=f.empty()?e.from()==e.head:f.from()==f.head;b>=d&&--b,a.splice(--d,2,new ka(i?h:g,i?g:h))}}return new ja(a,b)}function ma(a,b){return new ja([new ka(a,b||a)],0)}function na(a,b){return Math.max(a.first,Math.min(b,a.first+a.size-1))}function oa(a,b){if(b.line<a.first)return Df(a.first,0);var c=a.first+a.size-1;return b.line>c?Df(c,Td(a,c).text.length):pa(b,Td(a,b.line).text.length)}function pa(a,b){var c=a.ch;return null==c||c>b?Df(a.line,b):0>c?Df(a.line,0):a}function qa(a,b){return b>=a.first&&b<a.first+a.size}function ra(a,b){for(var c=[],d=0;d<b.length;d++)c[d]=oa(a,b[d]);return c}function sa(a,b,c,d){if(a.cm&&a.cm.display.shift||a.extend){var e=b.anchor;if(d){var f=Ef(c,e)<0;f!=Ef(d,e)<0?(e=c,c=d):f!=Ef(c,d)<0&&(c=d)}return new ka(e,c)}return new ka(d||c,c)}function ta(a,b,c,d){za(a,new ja([sa(a,a.sel.primary(),b,c)],0),d)}function ua(a,b,c){for(var d=[],e=0;e<a.sel.ranges.length;e++)d[e]=sa(a,a.sel.ranges[e],b[e],null);var f=la(d,a.sel.primIndex);za(a,f,c)}function va(a,b,c,d){var e=a.sel.ranges.slice(0);e[b]=c,za(a,la(e,a.sel.primIndex),d)}function wa(a,b,c,d){za(a,ma(b,c),d)}function xa(a,b){var c={ranges:b.ranges,update:function(b){this.ranges=[];for(var c=0;c<b.length;c++)this.ranges[c]=new ka(oa(a,b[c].anchor),oa(a,b[c].head))}};return xg(a,"beforeSelectionChange",a,c),a.cm&&xg(a.cm,"beforeSelectionChange",a.cm,c),c.ranges!=b.ranges?la(c.ranges,c.ranges.length-1):b}function ya(a,b,c){var d=a.history.done,e=Ae(d);e&&e.ranges?(d[d.length-1]=b,Aa(a,b,c)):za(a,b,c)}function za(a,b,c){Aa(a,b,c),fe(a,a.sel,a.cm?a.cm.curOp.id:NaN,c)}function Aa(a,b,c){(ve(a,"beforeSelectionChange")||a.cm&&ve(a.cm,"beforeSelectionChange"))&&(b=xa(a,b));var d=c&&c.bias||(Ef(b.primary().head,a.sel.primary().head)<0?-1:1);Ba(a,Da(a,b,d,!0)),c&&c.scroll===!1||!a.cm||Gc(a.cm)}function Ba(a,b){b.equals(a.sel)||(a.sel=b,a.cm&&(a.cm.curOp.updateInput=a.cm.curOp.selectionChanged=!0,ue(a.cm)),re(a,"cursorActivity",a))}function Ca(a){Ba(a,Da(a,a.sel,null,!1),Bg)}function Da(a,b,c,d){for(var e,f=0;f<b.ranges.length;f++){var g=b.ranges[f],h=Ea(a,g.anchor,c,d),i=Ea(a,g.head,c,d);(e||h!=g.anchor||i!=g.head)&&(e||(e=b.ranges.slice(0,f)),e[f]=new ka(h,i))}return e?la(e,b.primIndex):b}function Ea(a,b,c,d){var e=!1,f=b,g=c||1;a.cantEdit=!1;a:for(;;){var h=Td(a,f.line);if(h.markedSpans)for(var i=0;i<h.markedSpans.length;++i){var j=h.markedSpans[i],k=j.marker;if((null==j.from||(k.inclusiveLeft?j.from<=f.ch:j.from<f.ch))&&(null==j.to||(k.inclusiveRight?j.to>=f.ch:j.to>f.ch))){if(d&&(xg(k,"beforeCursorEnter"),k.explicitlyCleared)){if(h.markedSpans){--i;continue}break}if(!k.atomic)continue;var l=k.find(0>g?-1:1);if(0==Ef(l,f)&&(l.ch+=g,l.ch<0?l=l.line>a.first?oa(a,Df(l.line-1)):null:l.ch>h.text.length&&(l=l.line<a.first+a.size-1?Df(l.line+1,0):null),!l)){if(e)return d?(a.cantEdit=!0,Df(a.first,0)):Ea(a,b,c,!0);e=!0,l=b,g=-g}f=l;continue a}}return f}}function Fa(a){a.display.input.showSelection(a.display.input.prepareSelection())}function Ga(a,b){for(var c=a.doc,d={},e=d.cursors=document.createDocumentFragment(),f=d.selection=document.createDocumentFragment(),g=0;g<c.sel.ranges.length;g++)if(b!==!1||g!=c.sel.primIndex){var h=c.sel.ranges[g],i=h.empty();(i||a.options.showCursorWhenSelecting)&&Ha(a,h,e),i||Ia(a,h,f)}return d}function Ha(a,b,c){var d=kb(a,b.head,"div",null,null,!a.options.singleCursorHeightPerLine),e=c.appendChild(Ke("div"," ","CodeMirror-cursor"));if(e.style.left=d.left+"px",e.style.top=d.top+"px",e.style.height=Math.max(0,d.bottom-d.top)*a.options.cursorHeight+"px",d.other){var f=c.appendChild(Ke("div"," ","CodeMirror-cursor CodeMirror-secondarycursor"));f.style.display="",f.style.left=d.other.left+"px",f.style.top=d.other.top+"px",f.style.height=.85*(d.other.bottom-d.other.top)+"px"}}function Ia(a,b,c){function d(a,b,c,d){0>b&&(b=0),b=Math.round(b),d=Math.round(d),h.appendChild(Ke("div",null,"CodeMirror-selected","position: absolute; left: "+a+"px; top: "+b+"px; width: "+(null==c?k-a:c)+"px; height: "+(d-b)+"px"))}function e(b,c,e){function f(c,d){return jb(a,Df(b,c),"div",l,d)}var h,i,l=Td(g,b),m=l.text.length;return We($d(l),c||0,null==e?m:e,function(a,b,g){var l,n,o,p=f(a,"left");if(a==b)l=p,n=o=p.left;else{if(l=f(b-1,"right"),"rtl"==g){var q=p;p=l,l=q}n=p.left,o=l.right}null==c&&0==a&&(n=j),l.top-p.top>3&&(d(n,p.top,null,p.bottom),n=j,p.bottom<l.top&&d(n,p.bottom,null,l.top)),null==e&&b==m&&(o=k),(!h||p.top<h.top||p.top==h.top&&p.left<h.left)&&(h=p),(!i||l.bottom>i.bottom||l.bottom==i.bottom&&l.right>i.right)&&(i=l),j+1>n&&(n=j),d(n,l.top,o-n,l.bottom)}),{start:h,end:i}}var f=a.display,g=a.doc,h=document.createDocumentFragment(),i=Qa(a.display),j=i.left,k=Math.max(f.sizerWidth,Sa(a)-f.sizer.offsetLeft)-i.right,l=b.from(),m=b.to();if(l.line==m.line)e(l.line,l.ch,m.ch);else{var n=Td(g,l.line),o=Td(g,m.line),p=md(n)==md(o),q=e(l.line,l.ch,p?n.text.length+1:null).end,r=e(m.line,p?0:null,m.ch).start;p&&(q.top<r.top-2?(d(q.right,q.top,null,q.bottom),d(j,r.top,r.left,r.bottom)):d(q.right,q.top,r.left-q.right,q.bottom)),q.bottom<r.top&&d(j,q.bottom,null,r.top)}c.appendChild(h)}function Ja(a){if(a.state.focused){var b=a.display;clearInterval(b.blinker);var c=!0;b.cursorDiv.style.visibility="",a.options.cursorBlinkRate>0?b.blinker=setInterval(function(){b.cursorDiv.style.visibility=(c=!c)?"":"hidden"},a.options.cursorBlinkRate):a.options.cursorBlinkRate<0&&(b.cursorDiv.style.visibility="hidden")}}function Ka(a,b){a.doc.mode.startState&&a.doc.frontier<a.display.viewTo&&a.state.highlight.set(b,Ge(La,a))}function La(a){var b=a.doc;if(b.frontier<b.first&&(b.frontier=b.first),!(b.frontier>=a.display.viewTo)){var c=+new Date+a.options.workTime,d=_f(b.mode,Na(a,b.frontier)),e=[];b.iter(b.frontier,Math.min(b.first+b.size,a.display.viewTo+500),function(f){if(b.frontier>=a.display.viewFrom){var g=f.styles,h=Cd(a,f,d,!0);f.styles=h.styles;var i=f.styleClasses,j=h.classes;j?f.styleClasses=j:i&&(f.styleClasses=null);for(var k=!g||g.length!=f.styles.length||i!=j&&(!i||!j||i.bgClass!=j.bgClass||i.textClass!=j.textClass),l=0;!k&&l<g.length;++l)k=g[l]!=f.styles[l];k&&e.push(b.frontier),f.stateAfter=_f(b.mode,d)}else Ed(a,f.text,d),f.stateAfter=b.frontier%5==0?_f(b.mode,d):null;return++b.frontier,+new Date>c?(Ka(a,a.options.workDelay),!0):void 0}),e.length&&Ab(a,function(){for(var b=0;b<e.length;b++)Hb(a,e[b],"text")})}}function Ma(a,b,c){for(var d,e,f=a.doc,g=c?-1:b-(a.doc.mode.innerMode?1e3:100),h=b;h>g;--h){if(h<=f.first)return f.first;var i=Td(f,h-1);if(i.stateAfter&&(!c||h<=f.frontier))return h;var j=Eg(i.text,null,a.options.tabSize);(null==e||d>j)&&(e=h-1,d=j)}return e}function Na(a,b,c){var d=a.doc,e=a.display;if(!d.mode.startState)return!0;var f=Ma(a,b,c),g=f>d.first&&Td(d,f-1).stateAfter;return g=g?_f(d.mode,g):ag(d.mode),d.iter(f,b,function(c){Ed(a,c.text,g);var h=f==b-1||f%5==0||f>=e.viewFrom&&f<e.viewTo;c.stateAfter=h?_f(d.mode,g):null,++f}),c&&(d.frontier=f),g}function Oa(a){return a.lineSpace.offsetTop}function Pa(a){return a.mover.offsetHeight-a.lineSpace.offsetHeight}function Qa(a){if(a.cachedPaddingH)return a.cachedPaddingH;var b=Me(a.measure,Ke("pre","x")),c=window.getComputedStyle?window.getComputedStyle(b):b.currentStyle,d={left:parseInt(c.paddingLeft),right:parseInt(c.paddingRight)};return isNaN(d.left)||isNaN(d.right)||(a.cachedPaddingH=d),d}function Ra(a){return zg-a.display.nativeBarWidth}function Sa(a){return a.display.scroller.clientWidth-Ra(a)-a.display.barWidth}function Ta(a){return a.display.scroller.clientHeight-Ra(a)-a.display.barHeight}function Ua(a,b,c){var d=a.options.lineWrapping,e=d&&Sa(a);if(!b.measure.heights||d&&b.measure.width!=e){var f=b.measure.heights=[];if(d){b.measure.width=e;for(var g=b.text.firstChild.getClientRects(),h=0;h<g.length-1;h++){var i=g[h],j=g[h+1];Math.abs(i.bottom-j.bottom)>2&&f.push((i.bottom+j.top)/2-c.top)}}f.push(c.bottom-c.top)}}function Va(a,b,c){if(a.line==b)return{map:a.measure.map,cache:a.measure.cache};for(var d=0;d<a.rest.length;d++)if(a.rest[d]==b)return{map:a.measure.maps[d],cache:a.measure.caches[d]};for(var d=0;d<a.rest.length;d++)if(Xd(a.rest[d])>c)return{map:a.measure.maps[d],cache:a.measure.caches[d],before:!0}}function Wa(a,b){b=md(b);var c=Xd(b),d=a.display.externalMeasured=new Eb(a.doc,b,c);d.lineN=c;var e=d.built=Gd(a,d);return d.text=e.pre,Me(a.display.lineMeasure,e.pre),d}function Xa(a,b,c,d){return $a(a,Za(a,b),c,d)}function Ya(a,b){if(b>=a.display.viewFrom&&b<a.display.viewTo)return a.display.view[Jb(a,b)];var c=a.display.externalMeasured;return c&&b>=c.lineN&&b<c.lineN+c.size?c:void 0}function Za(a,b){var c=Xd(b),d=Ya(a,c);d&&!d.text?d=null:d&&d.changes&&J(a,d,c,H(a)),d||(d=Wa(a,b));var e=Va(d,b,c);return{line:b,view:d,rect:null,map:e.map,cache:e.cache,before:e.before,hasHeights:!1}}function $a(a,b,c,d,e){b.before&&(c=-1);var f,g=c+(d||"");return b.cache.hasOwnProperty(g)?f=b.cache[g]:(b.rect||(b.rect=b.view.text.getBoundingClientRect()),b.hasHeights||(Ua(a,b.view,b.rect),b.hasHeights=!0),f=ab(a,b,c,d),f.bogus||(b.cache[g]=f)),{left:f.left,right:f.right,top:e?f.rtop:f.top,bottom:e?f.rbottom:f.bottom}}function _a(a,b,c){for(var d,e,f,g,h=0;h<a.length;h+=3){var i=a[h],j=a[h+1];if(i>b?(e=0,f=1,g="left"):j>b?(e=b-i,f=e+1):(h==a.length-3||b==j&&a[h+3]>b)&&(f=j-i,e=f-1,b>=j&&(g="right")),null!=e){if(d=a[h+2],i==j&&c==(d.insertLeft?"left":"right")&&(g=c),"left"==c&&0==e)for(;h&&a[h-2]==a[h-3]&&a[h-1].insertLeft;)d=a[(h-=3)+2],g="left";if("right"==c&&e==j-i)for(;h<a.length-3&&a[h+3]==a[h+4]&&!a[h+5].insertLeft;)d=a[(h+=3)+2],g="right";break}}return{node:d,start:e,end:f,collapse:g,coverStart:i,coverEnd:j}}function ab(a,b,c,d){var e,f=_a(b.map,c,d),g=f.node,h=f.start,i=f.end,j=f.collapse;if(3==g.nodeType){for(var k=0;4>k;k++){for(;h&&Je(b.line.text.charAt(f.coverStart+h));)--h;for(;f.coverStart+i<f.coverEnd&&Je(b.line.text.charAt(f.coverStart+i));)++i;if(lf&&9>mf&&0==h&&i==f.coverEnd-f.coverStart)e=g.parentNode.getBoundingClientRect();else if(lf&&a.options.lineWrapping){var l=Hg(g,h,i).getClientRects();e=l.length?l["right"==d?l.length-1:0]:Jf}else e=Hg(g,h,i).getBoundingClientRect()||Jf;if(e.left||e.right||0==h)break;i=h,h-=1,j="right"}lf&&11>mf&&(e=bb(a.display.measure,e))}else{h>0&&(j=d="right");var l;e=a.options.lineWrapping&&(l=g.getClientRects()).length>1?l["right"==d?l.length-1:0]:g.getBoundingClientRect()}if(lf&&9>mf&&!h&&(!e||!e.left&&!e.right)){var m=g.parentNode.getClientRects()[0];e=m?{left:m.left,right:m.left+qb(a.display),top:m.top,bottom:m.bottom}:Jf}for(var n=e.top-b.rect.top,o=e.bottom-b.rect.top,p=(n+o)/2,q=b.view.measure.heights,k=0;k<q.length-1&&!(p<q[k]);k++);var r=k?q[k-1]:0,s=q[k],t={left:("right"==j?e.right:e.left)-b.rect.left,
|
2 |
-
right:("left"==j?e.left:e.right)-b.rect.left,top:r,bottom:s};return e.left||e.right||(t.bogus=!0),a.options.singleCursorHeightPerLine||(t.rtop=n,t.rbottom=o),t}function bb(a,b){if(!window.screen||null==screen.logicalXDPI||screen.logicalXDPI==screen.deviceXDPI||!Ve(a))return b;var c=screen.logicalXDPI/screen.deviceXDPI,d=screen.logicalYDPI/screen.deviceYDPI;return{left:b.left*c,right:b.right*c,top:b.top*d,bottom:b.bottom*d}}function cb(a){if(a.measure&&(a.measure.cache={},a.measure.heights=null,a.rest))for(var b=0;b<a.rest.length;b++)a.measure.caches[b]={}}function db(a){a.display.externalMeasure=null,Le(a.display.lineMeasure);for(var b=0;b<a.display.view.length;b++)cb(a.display.view[b])}function eb(a){db(a),a.display.cachedCharWidth=a.display.cachedTextHeight=a.display.cachedPaddingH=null,a.options.lineWrapping||(a.display.maxLineChanged=!0),a.display.lineNumChars=null}function fb(){return window.pageXOffset||(document.documentElement||document.body).scrollLeft}function gb(){return window.pageYOffset||(document.documentElement||document.body).scrollTop}function hb(a,b,c,d){if(b.widgets)for(var e=0;e<b.widgets.length;++e)if(b.widgets[e].above){var f=td(b.widgets[e]);c.top+=f,c.bottom+=f}if("line"==d)return c;d||(d="local");var g=Zd(b);if("local"==d?g+=Oa(a.display):g-=a.display.viewOffset,"page"==d||"window"==d){var h=a.display.lineSpace.getBoundingClientRect();g+=h.top+("window"==d?0:gb());var i=h.left+("window"==d?0:fb());c.left+=i,c.right+=i}return c.top+=g,c.bottom+=g,c}function ib(a,b,c){if("div"==c)return b;var d=b.left,e=b.top;if("page"==c)d-=fb(),e-=gb();else if("local"==c||!c){var f=a.display.sizer.getBoundingClientRect();d+=f.left,e+=f.top}var g=a.display.lineSpace.getBoundingClientRect();return{left:d-g.left,top:e-g.top}}function jb(a,b,c,d,e){return d||(d=Td(a.doc,b.line)),hb(a,d,Xa(a,d,b.ch,e),c)}function kb(a,b,c,d,e,f){function g(b,g){var h=$a(a,e,b,g?"right":"left",f);return g?h.left=h.right:h.right=h.left,hb(a,d,h,c)}function h(a,b){var c=i[b],d=c.level%2;return a==Xe(c)&&b&&c.level<i[b-1].level?(c=i[--b],a=Ye(c)-(c.level%2?0:1),d=!0):a==Ye(c)&&b<i.length-1&&c.level<i[b+1].level&&(c=i[++b],a=Xe(c)-c.level%2,d=!1),d&&a==c.to&&a>c.from?g(a-1):g(a,d)}d=d||Td(a.doc,b.line),e||(e=Za(a,d));var i=$d(d),j=b.ch;if(!i)return g(j);var k=df(i,j),l=h(j,k);return null!=Xg&&(l.other=h(j,Xg)),l}function lb(a,b){var c=0,b=oa(a.doc,b);a.options.lineWrapping||(c=qb(a.display)*b.ch);var d=Td(a.doc,b.line),e=Zd(d)+Oa(a.display);return{left:c,right:c,top:e,bottom:e+d.height}}function mb(a,b,c,d){var e=Df(a,b);return e.xRel=d,c&&(e.outside=!0),e}function nb(a,b,c){var d=a.doc;if(c+=a.display.viewOffset,0>c)return mb(d.first,0,!0,-1);var e=Yd(d,c),f=d.first+d.size-1;if(e>f)return mb(d.first+d.size-1,Td(d,f).text.length,!0,1);0>b&&(b=0);for(var g=Td(d,e);;){var h=ob(a,g,e,b,c),i=kd(g),j=i&&i.find(0,!0);if(!i||!(h.ch>j.from.ch||h.ch==j.from.ch&&h.xRel>0))return h;e=Xd(g=j.to.line)}}function ob(a,b,c,d,e){function f(d){var e=kb(a,Df(c,d),"line",b,j);return h=!0,g>e.bottom?e.left-i:g<e.top?e.left+i:(h=!1,e.left)}var g=e-Zd(b),h=!1,i=2*a.display.wrapper.clientWidth,j=Za(a,b),k=$d(b),l=b.text.length,m=Ze(b),n=$e(b),o=f(m),p=h,q=f(n),r=h;if(d>q)return mb(c,n,r,1);for(;;){if(k?n==m||n==ff(b,m,1):1>=n-m){for(var s=o>d||q-d>=d-o?m:n,t=d-(s==m?o:q);Je(b.text.charAt(s));)++s;var u=mb(c,s,s==m?p:r,-1>t?-1:t>1?1:0);return u}var v=Math.ceil(l/2),w=m+v;if(k){w=m;for(var x=0;v>x;++x)w=ff(b,w,1)}var y=f(w);y>d?(n=w,q=y,(r=h)&&(q+=1e3),l=v):(m=w,o=y,p=h,l-=v)}}function pb(a){if(null!=a.cachedTextHeight)return a.cachedTextHeight;if(null==Gf){Gf=Ke("pre");for(var b=0;49>b;++b)Gf.appendChild(document.createTextNode("x")),Gf.appendChild(Ke("br"));Gf.appendChild(document.createTextNode("x"))}Me(a.measure,Gf);var c=Gf.offsetHeight/50;return c>3&&(a.cachedTextHeight=c),Le(a.measure),c||1}function qb(a){if(null!=a.cachedCharWidth)return a.cachedCharWidth;var b=Ke("span","xxxxxxxxxx"),c=Ke("pre",[b]);Me(a.measure,c);var d=b.getBoundingClientRect(),e=(d.right-d.left)/10;return e>2&&(a.cachedCharWidth=e),e||10}function rb(a){a.curOp={cm:a,viewChanged:!1,startHeight:a.doc.height,forceUpdate:!1,updateInput:null,typing:!1,changeObjs:null,cursorActivityHandlers:null,cursorActivityCalled:0,selectionChanged:!1,updateMaxLine:!1,scrollLeft:null,scrollTop:null,scrollToPos:null,focus:!1,id:++Lf},Kf?Kf.ops.push(a.curOp):a.curOp.ownsGroup=Kf={ops:[a.curOp],delayedCallbacks:[]}}function sb(a){var b=a.delayedCallbacks,c=0;do{for(;c<b.length;c++)b[c]();for(var d=0;d<a.ops.length;d++){var e=a.ops[d];if(e.cursorActivityHandlers)for(;e.cursorActivityCalled<e.cursorActivityHandlers.length;)e.cursorActivityHandlers[e.cursorActivityCalled++](e.cm)}}while(c<b.length)}function tb(a){var b=a.curOp,c=b.ownsGroup;if(c)try{sb(c)}finally{Kf=null;for(var d=0;d<c.ops.length;d++)c.ops[d].cm.curOp=null;ub(c)}}function ub(a){for(var b=a.ops,c=0;c<b.length;c++)vb(b[c]);for(var c=0;c<b.length;c++)wb(b[c]);for(var c=0;c<b.length;c++)xb(b[c]);for(var c=0;c<b.length;c++)yb(b[c]);for(var c=0;c<b.length;c++)zb(b[c])}function vb(a){var b=a.cm,c=b.display;A(b),a.updateMaxLine&&m(b),a.mustUpdate=a.viewChanged||a.forceUpdate||null!=a.scrollTop||a.scrollToPos&&(a.scrollToPos.from.line<c.viewFrom||a.scrollToPos.to.line>=c.viewTo)||c.maxLineChanged&&b.options.lineWrapping,a.update=a.mustUpdate&&new z(b,a.mustUpdate&&{top:a.scrollTop,ensure:a.scrollToPos},a.forceUpdate)}function wb(a){a.updatedDisplay=a.mustUpdate&&B(a.cm,a.update)}function xb(a){var b=a.cm,c=b.display;a.updatedDisplay&&F(b),a.barMeasure=o(b),c.maxLineChanged&&!b.options.lineWrapping&&(a.adjustWidthTo=Xa(b,c.maxLine,c.maxLine.text.length).left+3,b.display.sizerWidth=a.adjustWidthTo,a.barMeasure.scrollWidth=Math.max(c.scroller.clientWidth,c.sizer.offsetLeft+a.adjustWidthTo+Ra(b)+b.display.barWidth),a.maxScrollLeft=Math.max(0,c.sizer.offsetLeft+a.adjustWidthTo-Sa(b))),(a.updatedDisplay||a.selectionChanged)&&(a.preparedSelection=c.input.prepareSelection())}function yb(a){var b=a.cm;null!=a.adjustWidthTo&&(b.display.sizer.style.minWidth=a.adjustWidthTo+"px",a.maxScrollLeft<b.doc.scrollLeft&&_b(b,Math.min(b.display.scroller.scrollLeft,a.maxScrollLeft),!0),b.display.maxLineChanged=!1),a.preparedSelection&&b.display.input.showSelection(a.preparedSelection),a.updatedDisplay&&E(b,a.barMeasure),(a.updatedDisplay||a.startHeight!=b.doc.height)&&s(b,a.barMeasure),a.selectionChanged&&Ja(b),b.state.focused&&a.updateInput&&b.display.input.reset(a.typing),a.focus&&a.focus==Ne()&&Y(a.cm)}function zb(a){var b=a.cm,c=b.display,d=b.doc;if(a.updatedDisplay&&C(b,a.update),null==c.wheelStartX||null==a.scrollTop&&null==a.scrollLeft&&!a.scrollToPos||(c.wheelStartX=c.wheelStartY=null),null==a.scrollTop||c.scroller.scrollTop==a.scrollTop&&!a.forceScroll||(d.scrollTop=Math.max(0,Math.min(c.scroller.scrollHeight-c.scroller.clientHeight,a.scrollTop)),c.scrollbars.setScrollTop(d.scrollTop),c.scroller.scrollTop=d.scrollTop),null==a.scrollLeft||c.scroller.scrollLeft==a.scrollLeft&&!a.forceScroll||(d.scrollLeft=Math.max(0,Math.min(c.scroller.scrollWidth-Sa(b),a.scrollLeft)),c.scrollbars.setScrollLeft(d.scrollLeft),c.scroller.scrollLeft=d.scrollLeft,v(b)),a.scrollToPos){var e=Cc(b,oa(d,a.scrollToPos.from),oa(d,a.scrollToPos.to),a.scrollToPos.margin);a.scrollToPos.isCursor&&b.state.focused&&Bc(b,e)}var f=a.maybeHiddenMarkers,g=a.maybeUnhiddenMarkers;if(f)for(var h=0;h<f.length;++h)f[h].lines.length||xg(f[h],"hide");if(g)for(var h=0;h<g.length;++h)g[h].lines.length&&xg(g[h],"unhide");c.wrapper.offsetHeight&&(d.scrollTop=b.display.scroller.scrollTop),a.changeObjs&&xg(b,"changes",b,a.changeObjs),a.update&&a.update.finish()}function Ab(a,b){if(a.curOp)return b();rb(a);try{return b()}finally{tb(a)}}function Bb(a,b){return function(){if(a.curOp)return b.apply(a,arguments);rb(a);try{return b.apply(a,arguments)}finally{tb(a)}}}function Cb(a){return function(){if(this.curOp)return a.apply(this,arguments);rb(this);try{return a.apply(this,arguments)}finally{tb(this)}}}function Db(a){return function(){var b=this.cm;if(!b||b.curOp)return a.apply(this,arguments);rb(b);try{return a.apply(this,arguments)}finally{tb(b)}}}function Eb(a,b,c){this.line=b,this.rest=nd(b),this.size=this.rest?Xd(Ae(this.rest))-c+1:1,this.node=this.text=null,this.hidden=qd(a,b)}function Fb(a,b,c){for(var d,e=[],f=b;c>f;f=d){var g=new Eb(a.doc,Td(a.doc,f),f);d=f+g.size,e.push(g)}return e}function Gb(a,b,c,d){null==b&&(b=a.doc.first),null==c&&(c=a.doc.first+a.doc.size),d||(d=0);var e=a.display;if(d&&c<e.viewTo&&(null==e.updateLineNumbers||e.updateLineNumbers>b)&&(e.updateLineNumbers=b),a.curOp.viewChanged=!0,b>=e.viewTo)Cf&&od(a.doc,b)<e.viewTo&&Ib(a);else if(c<=e.viewFrom)Cf&&pd(a.doc,c+d)>e.viewFrom?Ib(a):(e.viewFrom+=d,e.viewTo+=d);else if(b<=e.viewFrom&&c>=e.viewTo)Ib(a);else if(b<=e.viewFrom){var f=Kb(a,c,c+d,1);f?(e.view=e.view.slice(f.index),e.viewFrom=f.lineN,e.viewTo+=d):Ib(a)}else if(c>=e.viewTo){var f=Kb(a,b,b,-1);f?(e.view=e.view.slice(0,f.index),e.viewTo=f.lineN):Ib(a)}else{var g=Kb(a,b,b,-1),h=Kb(a,c,c+d,1);g&&h?(e.view=e.view.slice(0,g.index).concat(Fb(a,g.lineN,h.lineN)).concat(e.view.slice(h.index)),e.viewTo+=d):Ib(a)}var i=e.externalMeasured;i&&(c<i.lineN?i.lineN+=d:b<i.lineN+i.size&&(e.externalMeasured=null))}function Hb(a,b,c){a.curOp.viewChanged=!0;var d=a.display,e=a.display.externalMeasured;if(e&&b>=e.lineN&&b<e.lineN+e.size&&(d.externalMeasured=null),!(b<d.viewFrom||b>=d.viewTo)){var f=d.view[Jb(a,b)];if(null!=f.node){var g=f.changes||(f.changes=[]);-1==Be(g,c)&&g.push(c)}}}function Ib(a){a.display.viewFrom=a.display.viewTo=a.doc.first,a.display.view=[],a.display.viewOffset=0}function Jb(a,b){if(b>=a.display.viewTo)return null;if(b-=a.display.viewFrom,0>b)return null;for(var c=a.display.view,d=0;d<c.length;d++)if(b-=c[d].size,0>b)return d}function Kb(a,b,c,d){var e,f=Jb(a,b),g=a.display.view;if(!Cf||c==a.doc.first+a.doc.size)return{index:f,lineN:c};for(var h=0,i=a.display.viewFrom;f>h;h++)i+=g[h].size;if(i!=b){if(d>0){if(f==g.length-1)return null;e=i+g[f].size-b,f++}else e=i-b;b+=e,c+=e}for(;od(a.doc,c)!=c;){if(f==(0>d?0:g.length-1))return null;c+=d*g[f-(0>d?1:0)].size,f+=d}return{index:f,lineN:c}}function Lb(a,b,c){var d=a.display,e=d.view;0==e.length||b>=d.viewTo||c<=d.viewFrom?(d.view=Fb(a,b,c),d.viewFrom=b):(d.viewFrom>b?d.view=Fb(a,b,d.viewFrom).concat(d.view):d.viewFrom<b&&(d.view=d.view.slice(Jb(a,b))),d.viewFrom=b,d.viewTo<c?d.view=d.view.concat(Fb(a,d.viewTo,c)):d.viewTo>c&&(d.view=d.view.slice(0,Jb(a,c)))),d.viewTo=c}function Mb(a){for(var b=a.display.view,c=0,d=0;d<b.length;d++){var e=b[d];e.hidden||e.node&&!e.changes||++c}return c}function Nb(a){function b(){e.activeTouch&&(f=setTimeout(function(){e.activeTouch=null},1e3),g=e.activeTouch,g.end=+new Date)}function c(a){if(1!=a.touches.length)return!1;var b=a.touches[0];return b.radiusX<=1&&b.radiusY<=1}function d(a,b){if(null==b.left)return!0;var c=b.left-a.left,d=b.top-a.top;return c*c+d*d>400}var e=a.display;vg(e.scroller,"mousedown",Bb(a,Sb)),lf&&11>mf?vg(e.scroller,"dblclick",Bb(a,function(b){if(!te(a,b)){var c=Rb(a,b);if(c&&!Xb(a,b)&&!Qb(a.display,b)){sg(b);var d=a.findWordAt(c);ta(a.doc,d.anchor,d.head)}}})):vg(e.scroller,"dblclick",function(b){te(a,b)||sg(b)}),Af||vg(e.scroller,"contextmenu",function(b){nc(a,b)});var f,g={end:0};vg(e.scroller,"touchstart",function(a){if(!c(a)){clearTimeout(f);var b=+new Date;e.activeTouch={start:b,moved:!1,prev:b-g.end<=300?g:null},1==a.touches.length&&(e.activeTouch.left=a.touches[0].pageX,e.activeTouch.top=a.touches[0].pageY)}}),vg(e.scroller,"touchmove",function(){e.activeTouch&&(e.activeTouch.moved=!0)}),vg(e.scroller,"touchend",function(c){var f=e.activeTouch;if(f&&!Qb(e,c)&&null!=f.left&&!f.moved&&new Date-f.start<300){var g,h=a.coordsChar(e.activeTouch,"page");g=!f.prev||d(f,f.prev)?new ka(h,h):!f.prev.prev||d(f,f.prev.prev)?a.findWordAt(h):new ka(Df(h.line,0),oa(a.doc,Df(h.line+1,0))),a.setSelection(g.anchor,g.head),a.focus(),sg(c)}b()}),vg(e.scroller,"touchcancel",b),vg(e.scroller,"scroll",function(){e.scroller.clientHeight&&($b(a,e.scroller.scrollTop),_b(a,e.scroller.scrollLeft,!0),xg(a,"scroll",a))}),vg(e.scroller,"mousewheel",function(b){ac(a,b)}),vg(e.scroller,"DOMMouseScroll",function(b){ac(a,b)}),vg(e.wrapper,"scroll",function(){e.wrapper.scrollTop=e.wrapper.scrollLeft=0}),e.dragFunctions={simple:function(b){te(a,b)||ug(b)},start:function(b){Zb(a,b)},drop:Bb(a,Yb)};var h=e.input.getField();vg(h,"keyup",function(b){ic.call(a,b)}),vg(h,"keydown",Bb(a,gc)),vg(h,"keypress",Bb(a,jc)),vg(h,"focus",Ge(lc,a)),vg(h,"blur",Ge(mc,a))}function Ob(b,c,d){var e=d&&d!=a.Init;if(!c!=!e){var f=b.display.dragFunctions,g=c?vg:wg;g(b.display.scroller,"dragstart",f.start),g(b.display.scroller,"dragenter",f.simple),g(b.display.scroller,"dragover",f.simple),g(b.display.scroller,"drop",f.drop)}}function Pb(a){var b=a.display;(b.lastWrapHeight!=b.wrapper.clientHeight||b.lastWrapWidth!=b.wrapper.clientWidth)&&(b.cachedCharWidth=b.cachedTextHeight=b.cachedPaddingH=null,b.scrollbarsClipped=!1,a.setSize())}function Qb(a,b){for(var c=pe(b);c!=a.wrapper;c=c.parentNode)if(!c||1==c.nodeType&&"true"==c.getAttribute("cm-ignore-events")||c.parentNode==a.sizer&&c!=a.mover)return!0}function Rb(a,b,c,d){var e=a.display;if(!c&&"true"==pe(b).getAttribute("cm-not-content"))return null;var f,g,h=e.lineSpace.getBoundingClientRect();try{f=b.clientX-h.left,g=b.clientY-h.top}catch(b){return null}var i,j=nb(a,f,g);if(d&&1==j.xRel&&(i=Td(a.doc,j.line).text).length==j.ch){var k=Eg(i,i.length,a.options.tabSize)-i.length;j=Df(j.line,Math.max(0,Math.round((f-Qa(a.display).left)/qb(a.display))-k))}return j}function Sb(a){var b=this,c=b.display;if(!(c.activeTouch&&c.input.supportsTouch()||te(b,a))){if(c.shift=a.shiftKey,Qb(c,a))return void(nf||(c.scroller.draggable=!1,setTimeout(function(){c.scroller.draggable=!0},100)));if(!Xb(b,a)){var d=Rb(b,a);switch(window.focus(),qe(a)){case 1:d?Tb(b,a,d):pe(a)==c.scroller&&sg(a);break;case 2:nf&&(b.state.lastMiddleDown=+new Date),d&&ta(b.doc,d),setTimeout(function(){c.input.focus()},20),sg(a);break;case 3:Af?nc(b,a):kc(b)}}}}function Tb(a,b,c){lf?setTimeout(Ge(Y,a),0):a.curOp.focus=Ne();var d,e=+new Date;If&&If.time>e-400&&0==Ef(If.pos,c)?d="triple":Hf&&Hf.time>e-400&&0==Ef(Hf.pos,c)?(d="double",If={time:e,pos:c}):(d="single",Hf={time:e,pos:c});var f,g=a.doc.sel,h=wf?b.metaKey:b.ctrlKey;a.options.dragDrop&&Rg&&!Z(a)&&"single"==d&&(f=g.contains(c))>-1&&!g.ranges[f].empty()?Ub(a,b,c,h):Vb(a,b,c,d,h)}function Ub(a,b,c,d){var e=a.display,f=+new Date,g=Bb(a,function(h){nf&&(e.scroller.draggable=!1),a.state.draggingText=!1,wg(document,"mouseup",g),wg(e.scroller,"drop",g),Math.abs(b.clientX-h.clientX)+Math.abs(b.clientY-h.clientY)<10&&(sg(h),!d&&+new Date-200<f&&ta(a.doc,c),nf||lf&&9==mf?setTimeout(function(){document.body.focus(),e.input.focus()},20):e.input.focus())});nf&&(e.scroller.draggable=!0),a.state.draggingText=g,e.scroller.dragDrop&&e.scroller.dragDrop(),vg(document,"mouseup",g),vg(e.scroller,"drop",g)}function Vb(a,b,c,d,e){function f(b){if(0!=Ef(q,b))if(q=b,"rect"==d){for(var e=[],f=a.options.tabSize,g=Eg(Td(j,c.line).text,c.ch,f),h=Eg(Td(j,b.line).text,b.ch,f),i=Math.min(g,h),n=Math.max(g,h),o=Math.min(c.line,b.line),p=Math.min(a.lastLine(),Math.max(c.line,b.line));p>=o;o++){var r=Td(j,o).text,s=ye(r,i,f);i==n?e.push(new ka(Df(o,s),Df(o,s))):r.length>s&&e.push(new ka(Df(o,s),Df(o,ye(r,n,f))))}e.length||e.push(new ka(c,c)),za(j,la(m.ranges.slice(0,l).concat(e),l),{origin:"*mouse",scroll:!1}),a.scrollIntoView(b)}else{var t=k,u=t.anchor,v=b;if("single"!=d){if("double"==d)var w=a.findWordAt(b);else var w=new ka(Df(b.line,0),oa(j,Df(b.line+1,0)));Ef(w.anchor,u)>0?(v=w.head,u=X(t.from(),w.anchor)):(v=w.anchor,u=W(t.to(),w.head))}var e=m.ranges.slice(0);e[l]=new ka(oa(j,u),v),za(j,la(e,l),Cg)}}function g(b){var c=++s,e=Rb(a,b,!0,"rect"==d);if(e)if(0!=Ef(e,q)){a.curOp.focus=Ne(),f(e);var h=u(i,j);(e.line>=h.to||e.line<h.from)&&setTimeout(Bb(a,function(){s==c&&g(b)}),150)}else{var k=b.clientY<r.top?-20:b.clientY>r.bottom?20:0;k&&setTimeout(Bb(a,function(){s==c&&(i.scroller.scrollTop+=k,g(b))}),50)}}function h(a){s=1/0,sg(a),i.input.focus(),wg(document,"mousemove",t),wg(document,"mouseup",v),j.history.lastSelOrigin=null}var i=a.display,j=a.doc;sg(b);var k,l,m=j.sel,n=m.ranges;if(e&&!b.shiftKey?(l=j.sel.contains(c),k=l>-1?n[l]:new ka(c,c)):(k=j.sel.primary(),l=j.sel.primIndex),b.altKey)d="rect",e||(k=new ka(c,c)),c=Rb(a,b,!0,!0),l=-1;else if("double"==d){var o=a.findWordAt(c);k=a.display.shift||j.extend?sa(j,k,o.anchor,o.head):o}else if("triple"==d){var p=new ka(Df(c.line,0),oa(j,Df(c.line+1,0)));k=a.display.shift||j.extend?sa(j,k,p.anchor,p.head):p}else k=sa(j,k,c);e?-1==l?(l=n.length,za(j,la(n.concat([k]),l),{scroll:!1,origin:"*mouse"})):n.length>1&&n[l].empty()&&"single"==d&&!b.shiftKey?(za(j,la(n.slice(0,l).concat(n.slice(l+1)),0)),m=j.sel):va(j,l,k,Cg):(l=0,za(j,new ja([k],0),Cg),m=j.sel);var q=c,r=i.wrapper.getBoundingClientRect(),s=0,t=Bb(a,function(a){qe(a)?g(a):h(a)}),v=Bb(a,h);vg(document,"mousemove",t),vg(document,"mouseup",v)}function Wb(a,b,c,d,e){try{var f=b.clientX,g=b.clientY}catch(b){return!1}if(f>=Math.floor(a.display.gutters.getBoundingClientRect().right))return!1;d&&sg(b);var h=a.display,i=h.lineDiv.getBoundingClientRect();if(g>i.bottom||!ve(a,c))return oe(b);g-=i.top-h.viewOffset;for(var j=0;j<a.options.gutters.length;++j){var k=h.gutters.childNodes[j];if(k&&k.getBoundingClientRect().right>=f){var l=Yd(a.doc,g),m=a.options.gutters[j];return e(a,c,a,l,m,b),oe(b)}}}function Xb(a,b){return Wb(a,b,"gutterClick",!0,re)}function Yb(a){var b=this;if(!te(b,a)&&!Qb(b.display,a)){sg(a),lf&&(Mf=+new Date);var c=Rb(b,a,!0),d=a.dataTransfer.files;if(c&&!Z(b))if(d&&d.length&&window.FileReader&&window.File)for(var e=d.length,f=Array(e),g=0,h=function(a,d){var h=new FileReader;h.onload=Bb(b,function(){if(f[d]=h.result,++g==e){c=oa(b.doc,c);var a={from:c,to:c,text:Sg(f.join("\n")),origin:"paste"};uc(b.doc,a),ya(b.doc,ma(c,Sf(a)))}}),h.readAsText(a)},i=0;e>i;++i)h(d[i],i);else{if(b.state.draggingText&&b.doc.sel.contains(c)>-1)return b.state.draggingText(a),void setTimeout(function(){b.display.input.focus()},20);try{var f=a.dataTransfer.getData("Text");if(f){if(b.state.draggingText&&!(wf?a.altKey:a.ctrlKey))var j=b.listSelections();if(Aa(b.doc,ma(c,c)),j)for(var i=0;i<j.length;++i)Ac(b.doc,"",j[i].anchor,j[i].head,"drag");b.replaceSelection(f,"around","paste"),b.display.input.focus()}}catch(a){}}}}function Zb(a,b){if(lf&&(!a.state.draggingText||+new Date-Mf<100))return void ug(b);if(!te(a,b)&&!Qb(a.display,b)&&(b.dataTransfer.setData("Text",a.getSelection()),b.dataTransfer.setDragImage&&!rf)){var c=Ke("img",null,null,"position: fixed; left: 0; top: 0;");c.src="data:image/gif;base64,R0lGODlhAQABAAAAACH5BAEKAAEALAAAAAABAAEAAAICTAEAOw==",qf&&(c.width=c.height=1,a.display.wrapper.appendChild(c),c._top=c.offsetTop),b.dataTransfer.setDragImage(c,0,0),qf&&c.parentNode.removeChild(c)}}function $b(a,b){Math.abs(a.doc.scrollTop-b)<2||(a.doc.scrollTop=b,hf||D(a,{top:b}),a.display.scroller.scrollTop!=b&&(a.display.scroller.scrollTop=b),a.display.scrollbars.setScrollTop(b),hf&&D(a),Ka(a,100))}function _b(a,b,c){(c?b==a.doc.scrollLeft:Math.abs(a.doc.scrollLeft-b)<2)||(b=Math.min(b,a.display.scroller.scrollWidth-a.display.scroller.clientWidth),a.doc.scrollLeft=b,v(a),a.display.scroller.scrollLeft!=b&&(a.display.scroller.scrollLeft=b),a.display.scrollbars.setScrollLeft(b))}function ac(a,b){var c=Pf(b),d=c.x,e=c.y,f=a.display,g=f.scroller;if(d&&g.scrollWidth>g.clientWidth||e&&g.scrollHeight>g.clientHeight){if(e&&wf&&nf)a:for(var h=b.target,i=f.view;h!=g;h=h.parentNode)for(var j=0;j<i.length;j++)if(i[j].node==h){a.display.currentWheelTarget=h;break a}if(d&&!hf&&!qf&&null!=Of)return e&&$b(a,Math.max(0,Math.min(g.scrollTop+e*Of,g.scrollHeight-g.clientHeight))),_b(a,Math.max(0,Math.min(g.scrollLeft+d*Of,g.scrollWidth-g.clientWidth))),sg(b),void(f.wheelStartX=null);if(e&&null!=Of){var k=e*Of,l=a.doc.scrollTop,m=l+f.wrapper.clientHeight;0>k?l=Math.max(0,l+k-50):m=Math.min(a.doc.height,m+k+50),D(a,{top:l,bottom:m})}20>Nf&&(null==f.wheelStartX?(f.wheelStartX=g.scrollLeft,f.wheelStartY=g.scrollTop,f.wheelDX=d,f.wheelDY=e,setTimeout(function(){if(null!=f.wheelStartX){var a=g.scrollLeft-f.wheelStartX,b=g.scrollTop-f.wheelStartY,c=b&&f.wheelDY&&b/f.wheelDY||a&&f.wheelDX&&a/f.wheelDX;f.wheelStartX=f.wheelStartY=null,c&&(Of=(Of*Nf+c)/(Nf+1),++Nf)}},200)):(f.wheelDX+=d,f.wheelDY+=e))}}function bc(a,b,c){if("string"==typeof b&&(b=bg[b],!b))return!1;a.display.input.ensurePolled();var d=a.display.shift,e=!1;try{Z(a)&&(a.state.suppressEdits=!0),c&&(a.display.shift=!1),e=b(a)!=Ag}finally{a.display.shift=d,a.state.suppressEdits=!1}return e}function cc(a,b,c){for(var d=0;d<a.state.keyMaps.length;d++){var e=dg(b,a.state.keyMaps[d],c,a);if(e)return e}return a.options.extraKeys&&dg(b,a.options.extraKeys,c,a)||dg(b,a.options.keyMap,c,a)}function dc(a,b,c,d){var e=a.state.keySeq;if(e){if(eg(b))return"handled";Qf.set(50,function(){a.state.keySeq==e&&(a.state.keySeq=null,a.display.input.reset())}),b=e+" "+b}var f=cc(a,b,d);return"multi"==f&&(a.state.keySeq=b),"handled"==f&&re(a,"keyHandled",a,b,c),("handled"==f||"multi"==f)&&(sg(c),Ja(a)),e&&!f&&/\'$/.test(b)?(sg(c),!0):!!f}function ec(a,b){var c=fg(b,!0);return c?b.shiftKey&&!a.state.keySeq?dc(a,"Shift-"+c,b,function(b){return bc(a,b,!0)})||dc(a,c,b,function(b){return("string"==typeof b?/^go[A-Z]/.test(b):b.motion)?bc(a,b):void 0}):dc(a,c,b,function(b){return bc(a,b)}):!1}function fc(a,b,c){return dc(a,"'"+c+"'",b,function(b){return bc(a,b,!0)})}function gc(a){var b=this;if(b.curOp.focus=Ne(),!te(b,a)){lf&&11>mf&&27==a.keyCode&&(a.returnValue=!1);var c=a.keyCode;b.display.shift=16==c||a.shiftKey;var d=ec(b,a);qf&&(Rf=d?c:null,!d&&88==c&&!Ug&&(wf?a.metaKey:a.ctrlKey)&&b.replaceSelection("",null,"cut")),18!=c||/\bCodeMirror-crosshair\b/.test(b.display.lineDiv.className)||hc(b)}}function hc(a){function b(a){18!=a.keyCode&&a.altKey||(Og(c,"CodeMirror-crosshair"),wg(document,"keyup",b),wg(document,"mouseover",b))}var c=a.display.lineDiv;Pg(c,"CodeMirror-crosshair"),vg(document,"keyup",b),vg(document,"mouseover",b)}function ic(a){16==a.keyCode&&(this.doc.sel.shift=!1),te(this,a)}function jc(a){var b=this;if(!(Qb(b.display,a)||te(b,a)||a.ctrlKey&&!a.altKey||wf&&a.metaKey)){var c=a.keyCode,d=a.charCode;if(qf&&c==Rf)return Rf=null,void sg(a);if(!qf||a.which&&!(a.which<10)||!ec(b,a)){var e=String.fromCharCode(null==d?c:d);fc(b,a,e)||b.display.input.onKeyPress(a)}}}function kc(a){a.state.delayingBlurEvent=!0,setTimeout(function(){a.state.delayingBlurEvent&&(a.state.delayingBlurEvent=!1,mc(a))},100)}function lc(a){a.state.delayingBlurEvent&&(a.state.delayingBlurEvent=!1),"nocursor"!=a.options.readOnly&&(a.state.focused||(xg(a,"focus",a),a.state.focused=!0,Pg(a.display.wrapper,"CodeMirror-focused"),a.curOp||a.display.selForContextMenu==a.doc.sel||(a.display.input.reset(),nf&&setTimeout(function(){a.display.input.reset(!0)},20)),a.display.input.receivedFocus()),Ja(a))}function mc(a){a.state.delayingBlurEvent||(a.state.focused&&(xg(a,"blur",a),a.state.focused=!1,Og(a.display.wrapper,"CodeMirror-focused")),clearInterval(a.display.blinker),setTimeout(function(){a.state.focused||(a.display.shift=!1)},150))}function nc(a,b){Qb(a.display,b)||oc(a,b)||a.display.input.onContextMenu(b)}function oc(a,b){return ve(a,"gutterContextMenu")?Wb(a,b,"gutterContextMenu",!1,xg):!1}function pc(a,b){if(Ef(a,b.from)<0)return a;if(Ef(a,b.to)<=0)return Sf(b);var c=a.line+b.text.length-(b.to.line-b.from.line)-1,d=a.ch;return a.line==b.to.line&&(d+=Sf(b).ch-b.to.ch),Df(c,d)}function qc(a,b){for(var c=[],d=0;d<a.sel.ranges.length;d++){var e=a.sel.ranges[d];c.push(new ka(pc(e.anchor,b),pc(e.head,b)))}return la(c,a.sel.primIndex)}function rc(a,b,c){return a.line==b.line?Df(c.line,a.ch-b.ch+c.ch):Df(c.line+(a.line-b.line),a.ch)}function sc(a,b,c){for(var d=[],e=Df(a.first,0),f=e,g=0;g<b.length;g++){var h=b[g],i=rc(h.from,e,f),j=rc(Sf(h),e,f);if(e=h.to,f=j,"around"==c){var k=a.sel.ranges[g],l=Ef(k.head,k.anchor)<0;d[g]=new ka(l?j:i,l?i:j)}else d[g]=new ka(i,i)}return new ja(d,a.sel.primIndex)}function tc(a,b,c){var d={canceled:!1,from:b.from,to:b.to,text:b.text,origin:b.origin,cancel:function(){this.canceled=!0}};return c&&(d.update=function(b,c,d,e){b&&(this.from=oa(a,b)),c&&(this.to=oa(a,c)),d&&(this.text=d),void 0!==e&&(this.origin=e)}),xg(a,"beforeChange",a,d),a.cm&&xg(a.cm,"beforeChange",a.cm,d),d.canceled?null:{from:d.from,to:d.to,text:d.text,origin:d.origin}}function uc(a,b,c){if(a.cm){if(!a.cm.curOp)return Bb(a.cm,uc)(a,b,c);if(a.cm.state.suppressEdits)return}if(!(ve(a,"beforeChange")||a.cm&&ve(a.cm,"beforeChange"))||(b=tc(a,b,!0))){var d=Bf&&!c&&cd(a,b.from,b.to);if(d)for(var e=d.length-1;e>=0;--e)vc(a,{from:d[e].from,to:d[e].to,text:e?[""]:b.text});else vc(a,b)}}function vc(a,b){if(1!=b.text.length||""!=b.text[0]||0!=Ef(b.from,b.to)){var c=qc(a,b);de(a,b,c,a.cm?a.cm.curOp.id:NaN),yc(a,b,c,_c(a,b));var d=[];Rd(a,function(a,c){c||-1!=Be(d,a.history)||(ne(a.history,b),d.push(a.history)),yc(a,b,null,_c(a,b))})}}function wc(a,b,c){if(!a.cm||!a.cm.state.suppressEdits){for(var d,e=a.history,f=a.sel,g="undo"==b?e.done:e.undone,h="undo"==b?e.undone:e.done,i=0;i<g.length&&(d=g[i],c?!d.ranges||d.equals(a.sel):d.ranges);i++);if(i!=g.length){for(e.lastOrigin=e.lastSelOrigin=null;d=g.pop(),d.ranges;){if(ge(d,h),c&&!d.equals(a.sel))return void za(a,d,{clearRedo:!1});f=d}var j=[];ge(f,h),h.push({changes:j,generation:e.generation}),e.generation=d.generation||++e.maxGeneration;for(var k=ve(a,"beforeChange")||a.cm&&ve(a.cm,"beforeChange"),i=d.changes.length-1;i>=0;--i){var l=d.changes[i];if(l.origin=b,k&&!tc(a,l,!1))return void(g.length=0);j.push(ae(a,l));var m=i?qc(a,l):Ae(g);yc(a,l,m,bd(a,l)),!i&&a.cm&&a.cm.scrollIntoView({from:l.from,to:Sf(l)});var n=[];Rd(a,function(a,b){b||-1!=Be(n,a.history)||(ne(a.history,l),n.push(a.history)),yc(a,l,null,bd(a,l))})}}}}function xc(a,b){if(0!=b&&(a.first+=b,a.sel=new ja(Ce(a.sel.ranges,function(a){return new ka(Df(a.anchor.line+b,a.anchor.ch),Df(a.head.line+b,a.head.ch))}),a.sel.primIndex),a.cm)){Gb(a.cm,a.first,a.first-b,b);for(var c=a.cm.display,d=c.viewFrom;d<c.viewTo;d++)Hb(a.cm,d,"gutter")}}function yc(a,b,c,d){if(a.cm&&!a.cm.curOp)return Bb(a.cm,yc)(a,b,c,d);if(b.to.line<a.first)return void xc(a,b.text.length-1-(b.to.line-b.from.line));if(!(b.from.line>a.lastLine())){if(b.from.line<a.first){var e=b.text.length-1-(a.first-b.from.line);xc(a,e),b={from:Df(a.first,0),to:Df(b.to.line+e,b.to.ch),text:[Ae(b.text)],origin:b.origin}}var f=a.lastLine();b.to.line>f&&(b={from:b.from,to:Df(f,Td(a,f).text.length),text:[b.text[0]],origin:b.origin}),b.removed=Ud(a,b.from,b.to),c||(c=qc(a,b)),a.cm?zc(a.cm,b,d):Od(a,b,d),Aa(a,c,Bg)}}function zc(a,b,c){var d=a.doc,e=a.display,g=b.from,h=b.to,i=!1,j=g.line;a.options.lineWrapping||(j=Xd(md(Td(d,g.line))),d.iter(j,h.line+1,function(a){return a==e.maxLine?(i=!0,!0):void 0})),d.sel.contains(b.from,b.to)>-1&&ue(a),Od(d,b,c,f(a)),a.options.lineWrapping||(d.iter(j,g.line+b.text.length,function(a){var b=l(a);b>e.maxLineLength&&(e.maxLine=a,e.maxLineLength=b,e.maxLineChanged=!0,i=!1)}),i&&(a.curOp.updateMaxLine=!0)),d.frontier=Math.min(d.frontier,g.line),Ka(a,400);var k=b.text.length-(h.line-g.line)-1;b.full?Gb(a):g.line!=h.line||1!=b.text.length||Nd(a.doc,b)?Gb(a,g.line,h.line+1,k):Hb(a,g.line,"text");var m=ve(a,"changes"),n=ve(a,"change");if(n||m){var o={from:g,to:h,text:b.text,removed:b.removed,origin:b.origin};n&&re(a,"change",a,o),m&&(a.curOp.changeObjs||(a.curOp.changeObjs=[])).push(o)}a.display.selForContextMenu=null}function Ac(a,b,c,d,e){if(d||(d=c),Ef(d,c)<0){var f=d;d=c,c=f}"string"==typeof b&&(b=Sg(b)),uc(a,{from:c,to:d,text:b,origin:e})}function Bc(a,b){if(!te(a,"scrollCursorIntoView")){var c=a.display,d=c.sizer.getBoundingClientRect(),e=null;if(b.top+d.top<0?e=!0:b.bottom+d.top>(window.innerHeight||document.documentElement.clientHeight)&&(e=!1),null!=e&&!tf){var f=Ke("div","",null,"position: absolute; top: "+(b.top-c.viewOffset-Oa(a.display))+"px; height: "+(b.bottom-b.top+Ra(a)+c.barHeight)+"px; left: "+b.left+"px; width: 2px;");a.display.lineSpace.appendChild(f),f.scrollIntoView(e),a.display.lineSpace.removeChild(f)}}}function Cc(a,b,c,d){null==d&&(d=0);for(var e=0;5>e;e++){var f=!1,g=kb(a,b),h=c&&c!=b?kb(a,c):g,i=Ec(a,Math.min(g.left,h.left),Math.min(g.top,h.top)-d,Math.max(g.left,h.left),Math.max(g.bottom,h.bottom)+d),j=a.doc.scrollTop,k=a.doc.scrollLeft;if(null!=i.scrollTop&&($b(a,i.scrollTop),Math.abs(a.doc.scrollTop-j)>1&&(f=!0)),null!=i.scrollLeft&&(_b(a,i.scrollLeft),Math.abs(a.doc.scrollLeft-k)>1&&(f=!0)),!f)break}return g}function Dc(a,b,c,d,e){var f=Ec(a,b,c,d,e);null!=f.scrollTop&&$b(a,f.scrollTop),null!=f.scrollLeft&&_b(a,f.scrollLeft)}function Ec(a,b,c,d,e){var f=a.display,g=pb(a.display);0>c&&(c=0);var h=a.curOp&&null!=a.curOp.scrollTop?a.curOp.scrollTop:f.scroller.scrollTop,i=Ta(a),j={};e-c>i&&(e=c+i);var k=a.doc.height+Pa(f),l=g>c,m=e>k-g;if(h>c)j.scrollTop=l?0:c;else if(e>h+i){var n=Math.min(c,(m?k:e)-i);n!=h&&(j.scrollTop=n)}var o=a.curOp&&null!=a.curOp.scrollLeft?a.curOp.scrollLeft:f.scroller.scrollLeft,p=Sa(a)-(a.options.fixedGutter?f.gutters.offsetWidth:0),q=d-b>p;return q&&(d=b+p),10>b?j.scrollLeft=0:o>b?j.scrollLeft=Math.max(0,b-(q?0:10)):d>p+o-3&&(j.scrollLeft=d+(q?0:10)-p),j}function Fc(a,b,c){(null!=b||null!=c)&&Hc(a),null!=b&&(a.curOp.scrollLeft=(null==a.curOp.scrollLeft?a.doc.scrollLeft:a.curOp.scrollLeft)+b),null!=c&&(a.curOp.scrollTop=(null==a.curOp.scrollTop?a.doc.scrollTop:a.curOp.scrollTop)+c)}function Gc(a){Hc(a);var b=a.getCursor(),c=b,d=b;a.options.lineWrapping||(c=b.ch?Df(b.line,b.ch-1):b,d=Df(b.line,b.ch+1)),a.curOp.scrollToPos={from:c,to:d,margin:a.options.cursorScrollMargin,isCursor:!0}}function Hc(a){var b=a.curOp.scrollToPos;if(b){a.curOp.scrollToPos=null;var c=lb(a,b.from),d=lb(a,b.to),e=Ec(a,Math.min(c.left,d.left),Math.min(c.top,d.top)-b.margin,Math.max(c.right,d.right),Math.max(c.bottom,d.bottom)+b.margin);a.scrollTo(e.scrollLeft,e.scrollTop)}}function Ic(a,b,c,d){var e,f=a.doc;null==c&&(c="add"),"smart"==c&&(f.mode.indent?e=Na(a,b):c="prev");var g=a.options.tabSize,h=Td(f,b),i=Eg(h.text,null,g);h.stateAfter&&(h.stateAfter=null);var j,k=h.text.match(/^\s*/)[0];if(d||/\S/.test(h.text)){if("smart"==c&&(j=f.mode.indent(e,h.text.slice(k.length),h.text),j==Ag||j>150)){if(!d)return;c="prev"}}else j=0,c="not";"prev"==c?j=b>f.first?Eg(Td(f,b-1).text,null,g):0:"add"==c?j=i+a.options.indentUnit:"subtract"==c?j=i-a.options.indentUnit:"number"==typeof c&&(j=i+c),j=Math.max(0,j);var l="",m=0;if(a.options.indentWithTabs)for(var n=Math.floor(j/g);n;--n)m+=g,l+=" ";if(j>m&&(l+=ze(j-m)),l!=k)return Ac(f,l,Df(b,0),Df(b,k.length),"+input"),h.stateAfter=null,!0;for(var n=0;n<f.sel.ranges.length;n++){var o=f.sel.ranges[n];if(o.head.line==b&&o.head.ch<k.length){var m=Df(b,k.length);va(f,n,new ka(m,m));break}}}function Jc(a,b,c,d){var e=b,f=b;return"number"==typeof b?f=Td(a,na(a,b)):e=Xd(b),null==e?null:(d(f,e)&&a.cm&&Hb(a.cm,e,c),f)}function Kc(a,b){for(var c=a.doc.sel.ranges,d=[],e=0;e<c.length;e++){for(var f=b(c[e]);d.length&&Ef(f.from,Ae(d).to)<=0;){var g=d.pop();if(Ef(g.from,f.from)<0){f.from=g.from;break}}d.push(f)}Ab(a,function(){for(var b=d.length-1;b>=0;b--)Ac(a.doc,"",d[b].from,d[b].to,"+delete");Gc(a)})}function Lc(a,b,c,d,e){function f(){var b=h+c;return b<a.first||b>=a.first+a.size?l=!1:(h=b,k=Td(a,b))}function g(a){var b=(e?ff:gf)(k,i,c,!0);if(null==b){if(a||!f())return l=!1;i=e?(0>c?$e:Ze)(k):0>c?k.text.length:0}else i=b;return!0}var h=b.line,i=b.ch,j=c,k=Td(a,h),l=!0;if("char"==d)g();else if("column"==d)g(!0);else if("word"==d||"group"==d)for(var m=null,n="group"==d,o=a.cm&&a.cm.getHelper(b,"wordChars"),p=!0;!(0>c)||g(!p);p=!1){var q=k.text.charAt(i)||"\n",r=He(q,o)?"w":n&&"\n"==q?"n":!n||/\s/.test(q)?null:"p";if(!n||p||r||(r="s"),m&&m!=r){0>c&&(c=1,g());break}if(r&&(m=r),c>0&&!g(!p))break}var s=Ea(a,Df(h,i),j,!0);return l||(s.hitSide=!0),s}function Mc(a,b,c,d){var e,f=a.doc,g=b.left;if("page"==d){var h=Math.min(a.display.wrapper.clientHeight,window.innerHeight||document.documentElement.clientHeight);
|
3 |
-
e=b.top+c*(h-(0>c?1.5:.5)*pb(a.display))}else"line"==d&&(e=c>0?b.bottom+3:b.top-3);for(;;){var i=nb(a,g,e);if(!i.outside)break;if(0>c?0>=e:e>=f.height){i.hitSide=!0;break}e+=5*c}return i}function Nc(b,c,d,e){a.defaults[b]=c,d&&(Uf[b]=e?function(a,b,c){c!=Vf&&d(a,b,c)}:d)}function Oc(a){for(var b,c,d,e,f=a.split(/-(?!$)/),a=f[f.length-1],g=0;g<f.length-1;g++){var h=f[g];if(/^(cmd|meta|m)$/i.test(h))e=!0;else if(/^a(lt)?$/i.test(h))b=!0;else if(/^(c|ctrl|control)$/i.test(h))c=!0;else{if(!/^s(hift)$/i.test(h))throw new Error("Unrecognized modifier name: "+h);d=!0}}return b&&(a="Alt-"+a),c&&(a="Ctrl-"+a),e&&(a="Cmd-"+a),d&&(a="Shift-"+a),a}function Pc(a){return"string"==typeof a?cg[a]:a}function Qc(a,b,c,d,e){if(d&&d.shared)return Rc(a,b,c,d,e);if(a.cm&&!a.cm.curOp)return Bb(a.cm,Qc)(a,b,c,d,e);var f=new ig(a,e),g=Ef(b,c);if(d&&Fe(d,f,!1),g>0||0==g&&f.clearWhenEmpty!==!1)return f;if(f.replacedWith&&(f.collapsed=!0,f.widgetNode=Ke("span",[f.replacedWith],"CodeMirror-widget"),d.handleMouseEvents||f.widgetNode.setAttribute("cm-ignore-events","true"),d.insertLeft&&(f.widgetNode.insertLeft=!0)),f.collapsed){if(ld(a,b.line,b,c,f)||b.line!=c.line&&ld(a,c.line,b,c,f))throw new Error("Inserting collapsed marker partially overlapping an existing one");Cf=!0}f.addToHistory&&de(a,{from:b,to:c,origin:"markText"},a.sel,NaN);var h,i=b.line,j=a.cm;if(a.iter(i,c.line+1,function(a){j&&f.collapsed&&!j.options.lineWrapping&&md(a)==j.display.maxLine&&(h=!0),f.collapsed&&i!=b.line&&Wd(a,0),Yc(a,new Vc(f,i==b.line?b.ch:null,i==c.line?c.ch:null)),++i}),f.collapsed&&a.iter(b.line,c.line+1,function(b){qd(a,b)&&Wd(b,0)}),f.clearOnEnter&&vg(f,"beforeCursorEnter",function(){f.clear()}),f.readOnly&&(Bf=!0,(a.history.done.length||a.history.undone.length)&&a.clearHistory()),f.collapsed&&(f.id=++hg,f.atomic=!0),j){if(h&&(j.curOp.updateMaxLine=!0),f.collapsed)Gb(j,b.line,c.line+1);else if(f.className||f.title||f.startStyle||f.endStyle||f.css)for(var k=b.line;k<=c.line;k++)Hb(j,k,"text");f.atomic&&Ca(j.doc),re(j,"markerAdded",j,f)}return f}function Rc(a,b,c,d,e){d=Fe(d),d.shared=!1;var f=[Qc(a,b,c,d,e)],g=f[0],h=d.widgetNode;return Rd(a,function(a){h&&(d.widgetNode=h.cloneNode(!0)),f.push(Qc(a,oa(a,b),oa(a,c),d,e));for(var i=0;i<a.linked.length;++i)if(a.linked[i].isParent)return;g=Ae(f)}),new jg(f,g)}function Sc(a){return a.findMarks(Df(a.first,0),a.clipPos(Df(a.lastLine())),function(a){return a.parent})}function Tc(a,b){for(var c=0;c<b.length;c++){var d=b[c],e=d.find(),f=a.clipPos(e.from),g=a.clipPos(e.to);if(Ef(f,g)){var h=Qc(a,f,g,d.primary,d.primary.type);d.markers.push(h),h.parent=d}}}function Uc(a){for(var b=0;b<a.length;b++){var c=a[b],d=[c.primary.doc];Rd(c.primary.doc,function(a){d.push(a)});for(var e=0;e<c.markers.length;e++){var f=c.markers[e];-1==Be(d,f.doc)&&(f.parent=null,c.markers.splice(e--,1))}}}function Vc(a,b,c){this.marker=a,this.from=b,this.to=c}function Wc(a,b){if(a)for(var c=0;c<a.length;++c){var d=a[c];if(d.marker==b)return d}}function Xc(a,b){for(var c,d=0;d<a.length;++d)a[d]!=b&&(c||(c=[])).push(a[d]);return c}function Yc(a,b){a.markedSpans=a.markedSpans?a.markedSpans.concat([b]):[b],b.marker.attachLine(a)}function Zc(a,b,c){if(a)for(var d,e=0;e<a.length;++e){var f=a[e],g=f.marker,h=null==f.from||(g.inclusiveLeft?f.from<=b:f.from<b);if(h||f.from==b&&"bookmark"==g.type&&(!c||!f.marker.insertLeft)){var i=null==f.to||(g.inclusiveRight?f.to>=b:f.to>b);(d||(d=[])).push(new Vc(g,f.from,i?null:f.to))}}return d}function $c(a,b,c){if(a)for(var d,e=0;e<a.length;++e){var f=a[e],g=f.marker,h=null==f.to||(g.inclusiveRight?f.to>=b:f.to>b);if(h||f.from==b&&"bookmark"==g.type&&(!c||f.marker.insertLeft)){var i=null==f.from||(g.inclusiveLeft?f.from<=b:f.from<b);(d||(d=[])).push(new Vc(g,i?null:f.from-b,null==f.to?null:f.to-b))}}return d}function _c(a,b){if(b.full)return null;var c=qa(a,b.from.line)&&Td(a,b.from.line).markedSpans,d=qa(a,b.to.line)&&Td(a,b.to.line).markedSpans;if(!c&&!d)return null;var e=b.from.ch,f=b.to.ch,g=0==Ef(b.from,b.to),h=Zc(c,e,g),i=$c(d,f,g),j=1==b.text.length,k=Ae(b.text).length+(j?e:0);if(h)for(var l=0;l<h.length;++l){var m=h[l];if(null==m.to){var n=Wc(i,m.marker);n?j&&(m.to=null==n.to?null:n.to+k):m.to=e}}if(i)for(var l=0;l<i.length;++l){var m=i[l];if(null!=m.to&&(m.to+=k),null==m.from){var n=Wc(h,m.marker);n||(m.from=k,j&&(h||(h=[])).push(m))}else m.from+=k,j&&(h||(h=[])).push(m)}h&&(h=ad(h)),i&&i!=h&&(i=ad(i));var o=[h];if(!j){var p,q=b.text.length-2;if(q>0&&h)for(var l=0;l<h.length;++l)null==h[l].to&&(p||(p=[])).push(new Vc(h[l].marker,null,null));for(var l=0;q>l;++l)o.push(p);o.push(i)}return o}function ad(a){for(var b=0;b<a.length;++b){var c=a[b];null!=c.from&&c.from==c.to&&c.marker.clearWhenEmpty!==!1&&a.splice(b--,1)}return a.length?a:null}function bd(a,b){var c=je(a,b),d=_c(a,b);if(!c)return d;if(!d)return c;for(var e=0;e<c.length;++e){var f=c[e],g=d[e];if(f&&g)a:for(var h=0;h<g.length;++h){for(var i=g[h],j=0;j<f.length;++j)if(f[j].marker==i.marker)continue a;f.push(i)}else g&&(c[e]=g)}return c}function cd(a,b,c){var d=null;if(a.iter(b.line,c.line+1,function(a){if(a.markedSpans)for(var b=0;b<a.markedSpans.length;++b){var c=a.markedSpans[b].marker;!c.readOnly||d&&-1!=Be(d,c)||(d||(d=[])).push(c)}}),!d)return null;for(var e=[{from:b,to:c}],f=0;f<d.length;++f)for(var g=d[f],h=g.find(0),i=0;i<e.length;++i){var j=e[i];if(!(Ef(j.to,h.from)<0||Ef(j.from,h.to)>0)){var k=[i,1],l=Ef(j.from,h.from),m=Ef(j.to,h.to);(0>l||!g.inclusiveLeft&&!l)&&k.push({from:j.from,to:h.from}),(m>0||!g.inclusiveRight&&!m)&&k.push({from:h.to,to:j.to}),e.splice.apply(e,k),i+=k.length-1}}return e}function dd(a){var b=a.markedSpans;if(b){for(var c=0;c<b.length;++c)b[c].marker.detachLine(a);a.markedSpans=null}}function ed(a,b){if(b){for(var c=0;c<b.length;++c)b[c].marker.attachLine(a);a.markedSpans=b}}function fd(a){return a.inclusiveLeft?-1:0}function gd(a){return a.inclusiveRight?1:0}function hd(a,b){var c=a.lines.length-b.lines.length;if(0!=c)return c;var d=a.find(),e=b.find(),f=Ef(d.from,e.from)||fd(a)-fd(b);if(f)return-f;var g=Ef(d.to,e.to)||gd(a)-gd(b);return g?g:b.id-a.id}function id(a,b){var c,d=Cf&&a.markedSpans;if(d)for(var e,f=0;f<d.length;++f)e=d[f],e.marker.collapsed&&null==(b?e.from:e.to)&&(!c||hd(c,e.marker)<0)&&(c=e.marker);return c}function jd(a){return id(a,!0)}function kd(a){return id(a,!1)}function ld(a,b,c,d,e){var f=Td(a,b),g=Cf&&f.markedSpans;if(g)for(var h=0;h<g.length;++h){var i=g[h];if(i.marker.collapsed){var j=i.marker.find(0),k=Ef(j.from,c)||fd(i.marker)-fd(e),l=Ef(j.to,d)||gd(i.marker)-gd(e);if(!(k>=0&&0>=l||0>=k&&l>=0)&&(0>=k&&(Ef(j.to,c)>0||i.marker.inclusiveRight&&e.inclusiveLeft)||k>=0&&(Ef(j.from,d)<0||i.marker.inclusiveLeft&&e.inclusiveRight)))return!0}}}function md(a){for(var b;b=jd(a);)a=b.find(-1,!0).line;return a}function nd(a){for(var b,c;b=kd(a);)a=b.find(1,!0).line,(c||(c=[])).push(a);return c}function od(a,b){var c=Td(a,b),d=md(c);return c==d?b:Xd(d)}function pd(a,b){if(b>a.lastLine())return b;var c,d=Td(a,b);if(!qd(a,d))return b;for(;c=kd(d);)d=c.find(1,!0).line;return Xd(d)+1}function qd(a,b){var c=Cf&&b.markedSpans;if(c)for(var d,e=0;e<c.length;++e)if(d=c[e],d.marker.collapsed){if(null==d.from)return!0;if(!d.marker.widgetNode&&0==d.from&&d.marker.inclusiveLeft&&rd(a,b,d))return!0}}function rd(a,b,c){if(null==c.to){var d=c.marker.find(1,!0);return rd(a,d.line,Wc(d.line.markedSpans,c.marker))}if(c.marker.inclusiveRight&&c.to==b.text.length)return!0;for(var e,f=0;f<b.markedSpans.length;++f)if(e=b.markedSpans[f],e.marker.collapsed&&!e.marker.widgetNode&&e.from==c.to&&(null==e.to||e.to!=c.from)&&(e.marker.inclusiveLeft||c.marker.inclusiveRight)&&rd(a,b,e))return!0}function sd(a,b,c){Zd(b)<(a.curOp&&a.curOp.scrollTop||a.doc.scrollTop)&&Fc(a,null,c)}function td(a){if(null!=a.height)return a.height;var b=a.doc.cm;if(!b)return 0;if(!Lg(document.body,a.node)){var c="position: relative;";a.coverGutter&&(c+="margin-left: -"+b.display.gutters.offsetWidth+"px;"),a.noHScroll&&(c+="width: "+b.display.wrapper.clientWidth+"px;"),Me(b.display.measure,Ke("div",[a.node],null,c))}return a.height=a.node.offsetHeight}function ud(a,b,c,d){var e=new kg(a,c,d),f=a.cm;return f&&e.noHScroll&&(f.display.alignWidgets=!0),Jc(a,b,"widget",function(b){var c=b.widgets||(b.widgets=[]);if(null==e.insertAt?c.push(e):c.splice(Math.min(c.length-1,Math.max(0,e.insertAt)),0,e),e.line=b,f&&!qd(a,b)){var d=Zd(b)<a.scrollTop;Wd(b,b.height+td(e)),d&&Fc(f,null,e.height),f.curOp.forceUpdate=!0}return!0}),e}function vd(a,b,c,d){a.text=b,a.stateAfter&&(a.stateAfter=null),a.styles&&(a.styles=null),null!=a.order&&(a.order=null),dd(a),ed(a,c);var e=d?d(a):1;e!=a.height&&Wd(a,e)}function wd(a){a.parent=null,dd(a)}function xd(a,b){if(a)for(;;){var c=a.match(/(?:^|\s+)line-(background-)?(\S+)/);if(!c)break;a=a.slice(0,c.index)+a.slice(c.index+c[0].length);var d=c[1]?"bgClass":"textClass";null==b[d]?b[d]=c[2]:new RegExp("(?:^|s)"+c[2]+"(?:$|s)").test(b[d])||(b[d]+=" "+c[2])}return a}function yd(b,c){if(b.blankLine)return b.blankLine(c);if(b.innerMode){var d=a.innerMode(b,c);return d.mode.blankLine?d.mode.blankLine(d.state):void 0}}function zd(b,c,d,e){for(var f=0;10>f;f++){e&&(e[0]=a.innerMode(b,d).mode);var g=b.token(c,d);if(c.pos>c.start)return g}throw new Error("Mode "+b.name+" failed to advance stream.")}function Ad(a,b,c,d){function e(a){return{start:l.start,end:l.pos,string:l.current(),type:f||null,state:a?_f(g.mode,k):k}}var f,g=a.doc,h=g.mode;b=oa(g,b);var i,j=Td(g,b.line),k=Na(a,b.line,c),l=new gg(j.text,a.options.tabSize);for(d&&(i=[]);(d||l.pos<b.ch)&&!l.eol();)l.start=l.pos,f=zd(h,l,k),d&&i.push(e(!0));return d?i:e()}function Bd(a,b,c,d,e,f,g){var h=c.flattenSpans;null==h&&(h=a.options.flattenSpans);var i,j=0,k=null,l=new gg(b,a.options.tabSize),m=a.options.addModeClass&&[null];for(""==b&&xd(yd(c,d),f);!l.eol();){if(l.pos>a.options.maxHighlightLength?(h=!1,g&&Ed(a,b,d,l.pos),l.pos=b.length,i=null):i=xd(zd(c,l,d,m),f),m){var n=m[0].name;n&&(i="m-"+(i?n+" "+i:n))}if(!h||k!=i){for(;j<l.start;)j=Math.min(l.start,j+5e4),e(j,k);k=i}l.start=l.pos}for(;j<l.pos;){var o=Math.min(l.pos,j+5e4);e(o,k),j=o}}function Cd(a,b,c,d){var e=[a.state.modeGen],f={};Bd(a,b.text,a.doc.mode,c,function(a,b){e.push(a,b)},f,d);for(var g=0;g<a.state.overlays.length;++g){var h=a.state.overlays[g],i=1,j=0;Bd(a,b.text,h.mode,!0,function(a,b){for(var c=i;a>j;){var d=e[i];d>a&&e.splice(i,1,a,e[i+1],d),i+=2,j=Math.min(a,d)}if(b)if(h.opaque)e.splice(c,i-c,a,"cm-overlay "+b),i=c+2;else for(;i>c;c+=2){var f=e[c+1];e[c+1]=(f?f+" ":"")+"cm-overlay "+b}},f)}return{styles:e,classes:f.bgClass||f.textClass?f:null}}function Dd(a,b,c){if(!b.styles||b.styles[0]!=a.state.modeGen){var d=Cd(a,b,b.stateAfter=Na(a,Xd(b)));b.styles=d.styles,d.classes?b.styleClasses=d.classes:b.styleClasses&&(b.styleClasses=null),c===a.doc.frontier&&a.doc.frontier++}return b.styles}function Ed(a,b,c,d){var e=a.doc.mode,f=new gg(b,a.options.tabSize);for(f.start=f.pos=d||0,""==b&&yd(e,c);!f.eol()&&f.pos<=a.options.maxHighlightLength;)zd(e,f,c),f.start=f.pos}function Fd(a,b){if(!a||/^\s*$/.test(a))return null;var c=b.addModeClass?ng:mg;return c[a]||(c[a]=a.replace(/\S+/g,"cm-$&"))}function Gd(a,b){var c=Ke("span",null,null,nf?"padding-right: .1px":null),d={pre:Ke("pre",[c]),content:c,col:0,pos:0,cm:a,splitSpaces:(lf||nf)&&a.getOption("lineWrapping")};b.measure={};for(var e=0;e<=(b.rest?b.rest.length:0);e++){var f,g=e?b.rest[e-1]:b.line;d.pos=0,d.addToken=Id,Ue(a.display.measure)&&(f=$d(g))&&(d.addToken=Kd(d.addToken,f)),d.map=[];var h=b!=a.display.externalMeasured&&Xd(g);Md(g,d,Dd(a,g,h)),g.styleClasses&&(g.styleClasses.bgClass&&(d.bgClass=Pe(g.styleClasses.bgClass,d.bgClass||"")),g.styleClasses.textClass&&(d.textClass=Pe(g.styleClasses.textClass,d.textClass||""))),0==d.map.length&&d.map.push(0,0,d.content.appendChild(Te(a.display.measure))),0==e?(b.measure.map=d.map,b.measure.cache={}):((b.measure.maps||(b.measure.maps=[])).push(d.map),(b.measure.caches||(b.measure.caches=[])).push({}))}return nf&&/\bcm-tab\b/.test(d.content.lastChild.className)&&(d.content.className="cm-tab-wrap-hack"),xg(a,"renderLine",a,b.line,d.pre),d.pre.className&&(d.textClass=Pe(d.pre.className,d.textClass||"")),d}function Hd(a){var b=Ke("span","•","cm-invalidchar");return b.title="\\u"+a.charCodeAt(0).toString(16),b.setAttribute("aria-label",b.title),b}function Id(a,b,c,d,e,f,g){if(b){var h=a.splitSpaces?b.replace(/ {3,}/g,Jd):b,i=a.cm.state.specialChars,j=!1;if(i.test(b))for(var k=document.createDocumentFragment(),l=0;;){i.lastIndex=l;var m=i.exec(b),n=m?m.index-l:b.length-l;if(n){var o=document.createTextNode(h.slice(l,l+n));k.appendChild(lf&&9>mf?Ke("span",[o]):o),a.map.push(a.pos,a.pos+n,o),a.col+=n,a.pos+=n}if(!m)break;if(l+=n+1," "==m[0]){var p=a.cm.options.tabSize,q=p-a.col%p,o=k.appendChild(Ke("span",ze(q),"cm-tab"));o.setAttribute("role","presentation"),o.setAttribute("cm-text"," "),a.col+=q}else{var o=a.cm.options.specialCharPlaceholder(m[0]);o.setAttribute("cm-text",m[0]),k.appendChild(lf&&9>mf?Ke("span",[o]):o),a.col+=1}a.map.push(a.pos,a.pos+1,o),a.pos++}else{a.col+=b.length;var k=document.createTextNode(h);a.map.push(a.pos,a.pos+b.length,k),lf&&9>mf&&(j=!0),a.pos+=b.length}if(c||d||e||j||g){var r=c||"";d&&(r+=d),e&&(r+=e);var s=Ke("span",[k],r,g);return f&&(s.title=f),a.content.appendChild(s)}a.content.appendChild(k)}}function Jd(a){for(var b=" ",c=0;c<a.length-2;++c)b+=c%2?" ":" ";return b+=" "}function Kd(a,b){return function(c,d,e,f,g,h,i){e=e?e+" cm-force-border":"cm-force-border";for(var j=c.pos,k=j+d.length;;){for(var l=0;l<b.length;l++){var m=b[l];if(m.to>j&&m.from<=j)break}if(m.to>=k)return a(c,d,e,f,g,h,i);a(c,d.slice(0,m.to-j),e,f,null,h,i),f=null,d=d.slice(m.to-j),j=m.to}}}function Ld(a,b,c,d){var e=!d&&c.widgetNode;e&&a.map.push(a.pos,a.pos+b,e),!d&&a.cm.display.input.needsContentAttribute&&(e||(e=a.content.appendChild(document.createElement("span"))),e.setAttribute("cm-marker",c.id)),e&&(a.cm.display.input.setUneditable(e),a.content.appendChild(e)),a.pos+=b}function Md(a,b,c){var d=a.markedSpans,e=a.text,f=0;if(d)for(var g,h,i,j,k,l,m,n=e.length,o=0,p=1,q="",r=0;;){if(r==o){i=j=k=l=h="",m=null,r=1/0;for(var s=[],t=0;t<d.length;++t){var u=d[t],v=u.marker;"bookmark"==v.type&&u.from==o&&v.widgetNode?s.push(v):u.from<=o&&(null==u.to||u.to>o||v.collapsed&&u.to==o&&u.from==o)?(null!=u.to&&u.to!=o&&r>u.to&&(r=u.to,j=""),v.className&&(i+=" "+v.className),v.css&&(h=v.css),v.startStyle&&u.from==o&&(k+=" "+v.startStyle),v.endStyle&&u.to==r&&(j+=" "+v.endStyle),v.title&&!l&&(l=v.title),v.collapsed&&(!m||hd(m.marker,v)<0)&&(m=u)):u.from>o&&r>u.from&&(r=u.from)}if(m&&(m.from||0)==o){if(Ld(b,(null==m.to?n+1:m.to)-o,m.marker,null==m.from),null==m.to)return;m.to==o&&(m=!1)}if(!m&&s.length)for(var t=0;t<s.length;++t)Ld(b,0,s[t])}if(o>=n)break;for(var w=Math.min(n,r);;){if(q){var x=o+q.length;if(!m){var y=x>w?q.slice(0,w-o):q;b.addToken(b,y,g?g+i:i,k,o+y.length==r?j:"",l,h)}if(x>=w){q=q.slice(w-o),o=w;break}o=x,k=""}q=e.slice(f,f=c[p++]),g=Fd(c[p++],b.cm.options)}}else for(var p=1;p<c.length;p+=2)b.addToken(b,e.slice(f,f=c[p]),Fd(c[p+1],b.cm.options))}function Nd(a,b){return 0==b.from.ch&&0==b.to.ch&&""==Ae(b.text)&&(!a.cm||a.cm.options.wholeLineUpdateBefore)}function Od(a,b,c,d){function e(a){return c?c[a]:null}function f(a,c,e){vd(a,c,e,d),re(a,"change",a,b)}function g(a,b){for(var c=a,f=[];b>c;++c)f.push(new lg(j[c],e(c),d));return f}var h=b.from,i=b.to,j=b.text,k=Td(a,h.line),l=Td(a,i.line),m=Ae(j),n=e(j.length-1),o=i.line-h.line;if(b.full)a.insert(0,g(0,j.length)),a.remove(j.length,a.size-j.length);else if(Nd(a,b)){var p=g(0,j.length-1);f(l,l.text,n),o&&a.remove(h.line,o),p.length&&a.insert(h.line,p)}else if(k==l)if(1==j.length)f(k,k.text.slice(0,h.ch)+m+k.text.slice(i.ch),n);else{var p=g(1,j.length-1);p.push(new lg(m+k.text.slice(i.ch),n,d)),f(k,k.text.slice(0,h.ch)+j[0],e(0)),a.insert(h.line+1,p)}else if(1==j.length)f(k,k.text.slice(0,h.ch)+j[0]+l.text.slice(i.ch),e(0)),a.remove(h.line+1,o);else{f(k,k.text.slice(0,h.ch)+j[0],e(0)),f(l,m+l.text.slice(i.ch),n);var p=g(1,j.length-1);o>1&&a.remove(h.line+1,o-1),a.insert(h.line+1,p)}re(a,"change",a,b)}function Pd(a){this.lines=a,this.parent=null;for(var b=0,c=0;b<a.length;++b)a[b].parent=this,c+=a[b].height;this.height=c}function Qd(a){this.children=a;for(var b=0,c=0,d=0;d<a.length;++d){var e=a[d];b+=e.chunkSize(),c+=e.height,e.parent=this}this.size=b,this.height=c,this.parent=null}function Rd(a,b,c){function d(a,e,f){if(a.linked)for(var g=0;g<a.linked.length;++g){var h=a.linked[g];if(h.doc!=e){var i=f&&h.sharedHist;(!c||i)&&(b(h.doc,i),d(h.doc,a,i))}}}d(a,null,!0)}function Sd(a,b){if(b.cm)throw new Error("This document is already in use.");a.doc=b,b.cm=a,g(a),c(a),a.options.lineWrapping||m(a),a.options.mode=b.modeOption,Gb(a)}function Td(a,b){if(b-=a.first,0>b||b>=a.size)throw new Error("There is no line "+(b+a.first)+" in the document.");for(var c=a;!c.lines;)for(var d=0;;++d){var e=c.children[d],f=e.chunkSize();if(f>b){c=e;break}b-=f}return c.lines[b]}function Ud(a,b,c){var d=[],e=b.line;return a.iter(b.line,c.line+1,function(a){var f=a.text;e==c.line&&(f=f.slice(0,c.ch)),e==b.line&&(f=f.slice(b.ch)),d.push(f),++e}),d}function Vd(a,b,c){var d=[];return a.iter(b,c,function(a){d.push(a.text)}),d}function Wd(a,b){var c=b-a.height;if(c)for(var d=a;d;d=d.parent)d.height+=c}function Xd(a){if(null==a.parent)return null;for(var b=a.parent,c=Be(b.lines,a),d=b.parent;d;b=d,d=d.parent)for(var e=0;d.children[e]!=b;++e)c+=d.children[e].chunkSize();return c+b.first}function Yd(a,b){var c=a.first;a:do{for(var d=0;d<a.children.length;++d){var e=a.children[d],f=e.height;if(f>b){a=e;continue a}b-=f,c+=e.chunkSize()}return c}while(!a.lines);for(var d=0;d<a.lines.length;++d){var g=a.lines[d],h=g.height;if(h>b)break;b-=h}return c+d}function Zd(a){a=md(a);for(var b=0,c=a.parent,d=0;d<c.lines.length;++d){var e=c.lines[d];if(e==a)break;b+=e.height}for(var f=c.parent;f;c=f,f=c.parent)for(var d=0;d<f.children.length;++d){var g=f.children[d];if(g==c)break;b+=g.height}return b}function $d(a){var b=a.order;return null==b&&(b=a.order=Yg(a.text)),b}function _d(a){this.done=[],this.undone=[],this.undoDepth=1/0,this.lastModTime=this.lastSelTime=0,this.lastOp=this.lastSelOp=null,this.lastOrigin=this.lastSelOrigin=null,this.generation=this.maxGeneration=a||1}function ae(a,b){var c={from:V(b.from),to:Sf(b),text:Ud(a,b.from,b.to)};return he(a,c,b.from.line,b.to.line+1),Rd(a,function(a){he(a,c,b.from.line,b.to.line+1)},!0),c}function be(a){for(;a.length;){var b=Ae(a);if(!b.ranges)break;a.pop()}}function ce(a,b){return b?(be(a.done),Ae(a.done)):a.done.length&&!Ae(a.done).ranges?Ae(a.done):a.done.length>1&&!a.done[a.done.length-2].ranges?(a.done.pop(),Ae(a.done)):void 0}function de(a,b,c,d){var e=a.history;e.undone.length=0;var f,g=+new Date;if((e.lastOp==d||e.lastOrigin==b.origin&&b.origin&&("+"==b.origin.charAt(0)&&a.cm&&e.lastModTime>g-a.cm.options.historyEventDelay||"*"==b.origin.charAt(0)))&&(f=ce(e,e.lastOp==d))){var h=Ae(f.changes);0==Ef(b.from,b.to)&&0==Ef(b.from,h.to)?h.to=Sf(b):f.changes.push(ae(a,b))}else{var i=Ae(e.done);for(i&&i.ranges||ge(a.sel,e.done),f={changes:[ae(a,b)],generation:e.generation},e.done.push(f);e.done.length>e.undoDepth;)e.done.shift(),e.done[0].ranges||e.done.shift()}e.done.push(c),e.generation=++e.maxGeneration,e.lastModTime=e.lastSelTime=g,e.lastOp=e.lastSelOp=d,e.lastOrigin=e.lastSelOrigin=b.origin,h||xg(a,"historyAdded")}function ee(a,b,c,d){var e=b.charAt(0);return"*"==e||"+"==e&&c.ranges.length==d.ranges.length&&c.somethingSelected()==d.somethingSelected()&&new Date-a.history.lastSelTime<=(a.cm?a.cm.options.historyEventDelay:500)}function fe(a,b,c,d){var e=a.history,f=d&&d.origin;c==e.lastSelOp||f&&e.lastSelOrigin==f&&(e.lastModTime==e.lastSelTime&&e.lastOrigin==f||ee(a,f,Ae(e.done),b))?e.done[e.done.length-1]=b:ge(b,e.done),e.lastSelTime=+new Date,e.lastSelOrigin=f,e.lastSelOp=c,d&&d.clearRedo!==!1&&be(e.undone)}function ge(a,b){var c=Ae(b);c&&c.ranges&&c.equals(a)||b.push(a)}function he(a,b,c,d){var e=b["spans_"+a.id],f=0;a.iter(Math.max(a.first,c),Math.min(a.first+a.size,d),function(c){c.markedSpans&&((e||(e=b["spans_"+a.id]={}))[f]=c.markedSpans),++f})}function ie(a){if(!a)return null;for(var b,c=0;c<a.length;++c)a[c].marker.explicitlyCleared?b||(b=a.slice(0,c)):b&&b.push(a[c]);return b?b.length?b:null:a}function je(a,b){var c=b["spans_"+a.id];if(!c)return null;for(var d=0,e=[];d<b.text.length;++d)e.push(ie(c[d]));return e}function ke(a,b,c){for(var d=0,e=[];d<a.length;++d){var f=a[d];if(f.ranges)e.push(c?ja.prototype.deepCopy.call(f):f);else{var g=f.changes,h=[];e.push({changes:h});for(var i=0;i<g.length;++i){var j,k=g[i];if(h.push({from:k.from,to:k.to,text:k.text}),b)for(var l in k)(j=l.match(/^spans_(\d+)$/))&&Be(b,Number(j[1]))>-1&&(Ae(h)[l]=k[l],delete k[l])}}}return e}function le(a,b,c,d){c<a.line?a.line+=d:b<a.line&&(a.line=b,a.ch=0)}function me(a,b,c,d){for(var e=0;e<a.length;++e){var f=a[e],g=!0;if(f.ranges){f.copied||(f=a[e]=f.deepCopy(),f.copied=!0);for(var h=0;h<f.ranges.length;h++)le(f.ranges[h].anchor,b,c,d),le(f.ranges[h].head,b,c,d)}else{for(var h=0;h<f.changes.length;++h){var i=f.changes[h];if(c<i.from.line)i.from=Df(i.from.line+d,i.from.ch),i.to=Df(i.to.line+d,i.to.ch);else if(b<=i.to.line){g=!1;break}}g||(a.splice(0,e+1),e=0)}}}function ne(a,b){var c=b.from.line,d=b.to.line,e=b.text.length-(d-c)-1;me(a.done,c,d,e),me(a.undone,c,d,e)}function oe(a){return null!=a.defaultPrevented?a.defaultPrevented:0==a.returnValue}function pe(a){return a.target||a.srcElement}function qe(a){var b=a.which;return null==b&&(1&a.button?b=1:2&a.button?b=3:4&a.button&&(b=2)),wf&&a.ctrlKey&&1==b&&(b=3),b}function re(a,b){function c(a){return function(){a.apply(null,f)}}var d=a._handlers&&a._handlers[b];if(d){var e,f=Array.prototype.slice.call(arguments,2);Kf?e=Kf.delayedCallbacks:yg?e=yg:(e=yg=[],setTimeout(se,0));for(var g=0;g<d.length;++g)e.push(c(d[g]))}}function se(){var a=yg;yg=null;for(var b=0;b<a.length;++b)a[b]()}function te(a,b,c){return"string"==typeof b&&(b={type:b,preventDefault:function(){this.defaultPrevented=!0}}),xg(a,c||b.type,a,b),oe(b)||b.codemirrorIgnore}function ue(a){var b=a._handlers&&a._handlers.cursorActivity;if(b)for(var c=a.curOp.cursorActivityHandlers||(a.curOp.cursorActivityHandlers=[]),d=0;d<b.length;++d)-1==Be(c,b[d])&&c.push(b[d])}function ve(a,b){var c=a._handlers&&a._handlers[b];return c&&c.length>0}function we(a){a.prototype.on=function(a,b){vg(this,a,b)},a.prototype.off=function(a,b){wg(this,a,b)}}function xe(){this.id=null}function ye(a,b,c){for(var d=0,e=0;;){var f=a.indexOf(" ",d);-1==f&&(f=a.length);var g=f-d;if(f==a.length||e+g>=b)return d+Math.min(g,b-e);if(e+=f-d,e+=c-e%c,d=f+1,e>=b)return d}}function ze(a){for(;Fg.length<=a;)Fg.push(Ae(Fg)+" ");return Fg[a]}function Ae(a){return a[a.length-1]}function Be(a,b){for(var c=0;c<a.length;++c)if(a[c]==b)return c;return-1}function Ce(a,b){for(var c=[],d=0;d<a.length;d++)c[d]=b(a[d],d);return c}function De(){}function Ee(a,b){var c;return Object.create?c=Object.create(a):(De.prototype=a,c=new De),b&&Fe(b,c),c}function Fe(a,b,c){b||(b={});for(var d in a)!a.hasOwnProperty(d)||c===!1&&b.hasOwnProperty(d)||(b[d]=a[d]);return b}function Ge(a){var b=Array.prototype.slice.call(arguments,1);return function(){return a.apply(null,b)}}function He(a,b){return b?b.source.indexOf("\\w")>-1&&Jg(a)?!0:b.test(a):Jg(a)}function Ie(a){for(var b in a)if(a.hasOwnProperty(b)&&a[b])return!1;return!0}function Je(a){return a.charCodeAt(0)>=768&&Kg.test(a)}function Ke(a,b,c,d){var e=document.createElement(a);if(c&&(e.className=c),d&&(e.style.cssText=d),"string"==typeof b)e.appendChild(document.createTextNode(b));else if(b)for(var f=0;f<b.length;++f)e.appendChild(b[f]);return e}function Le(a){for(var b=a.childNodes.length;b>0;--b)a.removeChild(a.firstChild);return a}function Me(a,b){return Le(a).appendChild(b)}function Ne(){return document.activeElement}function Oe(a){return new RegExp("(^|\\s)"+a+"(?:$|\\s)\\s*")}function Pe(a,b){for(var c=a.split(" "),d=0;d<c.length;d++)c[d]&&!Oe(c[d]).test(b)&&(b+=" "+c[d]);return b}function Qe(a){if(document.body.getElementsByClassName)for(var b=document.body.getElementsByClassName("CodeMirror"),c=0;c<b.length;c++){var d=b[c].CodeMirror;d&&a(d)}}function Re(){Qg||(Se(),Qg=!0)}function Se(){var a;vg(window,"resize",function(){null==a&&(a=setTimeout(function(){a=null,Qe(Pb)},100))}),vg(window,"blur",function(){Qe(mc)})}function Te(a){if(null==Mg){var b=Ke("span","");Me(a,Ke("span",[b,document.createTextNode("x")])),0!=a.firstChild.offsetHeight&&(Mg=b.offsetWidth<=1&&b.offsetHeight>2&&!(lf&&8>mf))}var c=Mg?Ke("span",""):Ke("span"," ",null,"display: inline-block; width: 1px; margin-right: -1px");return c.setAttribute("cm-text",""),c}function Ue(a){if(null!=Ng)return Ng;var b=Me(a,document.createTextNode("AخA")),c=Hg(b,0,1).getBoundingClientRect();if(!c||c.left==c.right)return!1;var d=Hg(b,1,2).getBoundingClientRect();return Ng=d.right-c.right<3}function Ve(a){if(null!=Vg)return Vg;var b=Me(a,Ke("span","x")),c=b.getBoundingClientRect(),d=Hg(b,0,1).getBoundingClientRect();return Vg=Math.abs(c.left-d.left)>1}function We(a,b,c,d){if(!a)return d(b,c,"ltr");for(var e=!1,f=0;f<a.length;++f){var g=a[f];(g.from<c&&g.to>b||b==c&&g.to==b)&&(d(Math.max(g.from,b),Math.min(g.to,c),1==g.level?"rtl":"ltr"),e=!0)}e||d(b,c,"ltr")}function Xe(a){return a.level%2?a.to:a.from}function Ye(a){return a.level%2?a.from:a.to}function Ze(a){var b=$d(a);return b?Xe(b[0]):0}function $e(a){var b=$d(a);return b?Ye(Ae(b)):a.text.length}function _e(a,b){var c=Td(a.doc,b),d=md(c);d!=c&&(b=Xd(d));var e=$d(d),f=e?e[0].level%2?$e(d):Ze(d):0;return Df(b,f)}function af(a,b){for(var c,d=Td(a.doc,b);c=kd(d);)d=c.find(1,!0).line,b=null;var e=$d(d),f=e?e[0].level%2?Ze(d):$e(d):d.text.length;return Df(null==b?Xd(d):b,f)}function bf(a,b){var c=_e(a,b.line),d=Td(a.doc,c.line),e=$d(d);if(!e||0==e[0].level){var f=Math.max(0,d.text.search(/\S/)),g=b.line==c.line&&b.ch<=f&&b.ch;return Df(c.line,g?0:f)}return c}function cf(a,b,c){var d=a[0].level;return b==d?!0:c==d?!1:c>b}function df(a,b){Xg=null;for(var c,d=0;d<a.length;++d){var e=a[d];if(e.from<b&&e.to>b)return d;if(e.from==b||e.to==b){if(null!=c)return cf(a,e.level,a[c].level)?(e.from!=e.to&&(Xg=c),d):(e.from!=e.to&&(Xg=d),c);c=d}}return c}function ef(a,b,c,d){if(!d)return b+c;do b+=c;while(b>0&&Je(a.text.charAt(b)));return b}function ff(a,b,c,d){var e=$d(a);if(!e)return gf(a,b,c,d);for(var f=df(e,b),g=e[f],h=ef(a,b,g.level%2?-c:c,d);;){if(h>g.from&&h<g.to)return h;if(h==g.from||h==g.to)return df(e,h)==f?h:(g=e[f+=c],c>0==g.level%2?g.to:g.from);if(g=e[f+=c],!g)return null;h=c>0==g.level%2?ef(a,g.to,-1,d):ef(a,g.from,1,d)}}function gf(a,b,c,d){var e=b+c;if(d)for(;e>0&&Je(a.text.charAt(e));)e+=c;return 0>e||e>a.text.length?null:e}var hf=/gecko\/\d/i.test(navigator.userAgent),jf=/MSIE \d/.test(navigator.userAgent),kf=/Trident\/(?:[7-9]|\d{2,})\..*rv:(\d+)/.exec(navigator.userAgent),lf=jf||kf,mf=lf&&(jf?document.documentMode||6:kf[1]),nf=/WebKit\//.test(navigator.userAgent),of=nf&&/Qt\/\d+\.\d+/.test(navigator.userAgent),pf=/Chrome\//.test(navigator.userAgent),qf=/Opera\//.test(navigator.userAgent),rf=/Apple Computer/.test(navigator.vendor),sf=/Mac OS X 1\d\D([8-9]|\d\d)\D/.test(navigator.userAgent),tf=/PhantomJS/.test(navigator.userAgent),uf=/AppleWebKit/.test(navigator.userAgent)&&/Mobile\/\w+/.test(navigator.userAgent),vf=uf||/Android|webOS|BlackBerry|Opera Mini|Opera Mobi|IEMobile/i.test(navigator.userAgent),wf=uf||/Mac/.test(navigator.platform),xf=/win/i.test(navigator.platform),yf=qf&&navigator.userAgent.match(/Version\/(\d*\.\d*)/);yf&&(yf=Number(yf[1])),yf&&yf>=15&&(qf=!1,nf=!0);var zf=wf&&(of||qf&&(null==yf||12.11>yf)),Af=hf||lf&&mf>=9,Bf=!1,Cf=!1;p.prototype=Fe({update:function(a){var b=a.scrollWidth>a.clientWidth+1,c=a.scrollHeight>a.clientHeight+1,d=a.nativeBarWidth;if(c){this.vert.style.display="block",this.vert.style.bottom=b?d+"px":"0";var e=a.viewHeight-(b?d:0);this.vert.firstChild.style.height=Math.max(0,a.scrollHeight-a.clientHeight+e)+"px"}else this.vert.style.display="",this.vert.firstChild.style.height="0";if(b){this.horiz.style.display="block",this.horiz.style.right=c?d+"px":"0",this.horiz.style.left=a.barLeft+"px";var f=a.viewWidth-a.barLeft-(c?d:0);this.horiz.firstChild.style.width=a.scrollWidth-a.clientWidth+f+"px"}else this.horiz.style.display="",this.horiz.firstChild.style.width="0";return!this.checkedOverlay&&a.clientHeight>0&&(0==d&&this.overlayHack(),this.checkedOverlay=!0),{right:c?d:0,bottom:b?d:0}},setScrollLeft:function(a){this.horiz.scrollLeft!=a&&(this.horiz.scrollLeft=a)},setScrollTop:function(a){this.vert.scrollTop!=a&&(this.vert.scrollTop=a)},overlayHack:function(){var a=wf&&!sf?"12px":"18px";this.horiz.style.minHeight=this.vert.style.minWidth=a;var b=this,c=function(a){pe(a)!=b.vert&&pe(a)!=b.horiz&&Bb(b.cm,Sb)(a)};vg(this.vert,"mousedown",c),vg(this.horiz,"mousedown",c)},clear:function(){var a=this.horiz.parentNode;a.removeChild(this.horiz),a.removeChild(this.vert)}},p.prototype),q.prototype=Fe({update:function(){return{bottom:0,right:0}},setScrollLeft:function(){},setScrollTop:function(){},clear:function(){}},q.prototype),a.scrollbarModel={"native":p,"null":q},z.prototype.signal=function(a,b){ve(a,b)&&this.events.push(arguments)},z.prototype.finish=function(){for(var a=0;a<this.events.length;a++)xg.apply(null,this.events[a])};var Df=a.Pos=function(a,b){return this instanceof Df?(this.line=a,void(this.ch=b)):new Df(a,b)},Ef=a.cmpPos=function(a,b){return a.line-b.line||a.ch-b.ch},Ff=null;ba.prototype=Fe({init:function(a){function b(a){if(d.somethingSelected())Ff=d.getSelections(),c.inaccurateSelection&&(c.prevInput="",c.inaccurateSelection=!1,f.value=Ff.join("\n"),Gg(f));else{if(!d.options.lineWiseCopyCut)return;var b=_(d);Ff=b.text,"cut"==a.type?d.setSelections(b.ranges,null,Bg):(c.prevInput="",f.value=b.text.join("\n"),Gg(f))}"cut"==a.type&&(d.state.cutIncoming=!0)}var c=this,d=this.cm,e=this.wrapper=ca(),f=this.textarea=e.firstChild;a.wrapper.insertBefore(e,a.wrapper.firstChild),uf&&(f.style.width="0px"),vg(f,"input",function(){lf&&mf>=9&&c.hasSelection&&(c.hasSelection=null),c.poll()}),vg(f,"paste",function(){if(nf&&!d.state.fakedLastChar&&!(new Date-d.state.lastMiddleDown<200)){var a=f.selectionStart,b=f.selectionEnd;f.value+="$",f.selectionEnd=b,f.selectionStart=a,d.state.fakedLastChar=!0}d.state.pasteIncoming=!0,c.fastPoll()}),vg(f,"cut",b),vg(f,"copy",b),vg(a.scroller,"paste",function(b){Qb(a,b)||(d.state.pasteIncoming=!0,c.focus())}),vg(a.lineSpace,"selectstart",function(b){Qb(a,b)||sg(b)}),vg(f,"compositionstart",function(){var a=d.getCursor("from");c.composing={start:a,range:d.markText(a,d.getCursor("to"),{className:"CodeMirror-composing"})}}),vg(f,"compositionend",function(){c.composing&&(c.poll(),c.composing.range.clear(),c.composing=null)})},prepareSelection:function(){var a=this.cm,b=a.display,c=a.doc,d=Ga(a);if(a.options.moveInputWithCursor){var e=kb(a,c.sel.primary().head,"div"),f=b.wrapper.getBoundingClientRect(),g=b.lineDiv.getBoundingClientRect();d.teTop=Math.max(0,Math.min(b.wrapper.clientHeight-10,e.top+g.top-f.top)),d.teLeft=Math.max(0,Math.min(b.wrapper.clientWidth-10,e.left+g.left-f.left))}return d},showSelection:function(a){var b=this.cm,c=b.display;Me(c.cursorDiv,a.cursors),Me(c.selectionDiv,a.selection),null!=a.teTop&&(this.wrapper.style.top=a.teTop+"px",this.wrapper.style.left=a.teLeft+"px")},reset:function(a){if(!this.contextMenuPending){var b,c,d=this.cm,e=d.doc;if(d.somethingSelected()){this.prevInput="";var f=e.sel.primary();b=Ug&&(f.to().line-f.from().line>100||(c=d.getSelection()).length>1e3);var g=b?"-":c||d.getSelection();this.textarea.value=g,d.state.focused&&Gg(this.textarea),lf&&mf>=9&&(this.hasSelection=g)}else a||(this.prevInput=this.textarea.value="",lf&&mf>=9&&(this.hasSelection=null));this.inaccurateSelection=b}},getField:function(){return this.textarea},supportsTouch:function(){return!1},focus:function(){if("nocursor"!=this.cm.options.readOnly&&(!vf||Ne()!=this.textarea))try{this.textarea.focus()}catch(a){}},blur:function(){this.textarea.blur()},resetPosition:function(){
|
4 |
-
this.wrapper.style.top=this.wrapper.style.left=0},receivedFocus:function(){this.slowPoll()},slowPoll:function(){var a=this;a.pollingFast||a.polling.set(this.cm.options.pollInterval,function(){a.poll(),a.cm.state.focused&&a.slowPoll()})},fastPoll:function(){function a(){var d=c.poll();d||b?(c.pollingFast=!1,c.slowPoll()):(b=!0,c.polling.set(60,a))}var b=!1,c=this;c.pollingFast=!0,c.polling.set(20,a)},poll:function(){var a=this.cm,b=this.textarea,c=this.prevInput;if(!a.state.focused||Tg(b)&&!c||Z(a)||a.options.disableInput||a.state.keySeq)return!1;a.state.pasteIncoming&&a.state.fakedLastChar&&(b.value=b.value.substring(0,b.value.length-1),a.state.fakedLastChar=!1);var d=b.value;if(d==c&&!a.somethingSelected())return!1;if(lf&&mf>=9&&this.hasSelection===d||wf&&/[\uf700-\uf7ff]/.test(d))return a.display.input.reset(),!1;if(a.doc.sel==a.display.selForContextMenu){var e=d.charCodeAt(0);if(8203!=e||c||(c=""),8666==e)return this.reset(),this.cm.execCommand("undo")}for(var f=0,g=Math.min(c.length,d.length);g>f&&c.charCodeAt(f)==d.charCodeAt(f);)++f;var h=this;return Ab(a,function(){$(a,d.slice(f),c.length-f,null,h.composing?"*compose":null),d.length>1e3||d.indexOf("\n")>-1?b.value=h.prevInput="":h.prevInput=d,h.composing&&(h.composing.range.clear(),h.composing.range=a.markText(h.composing.start,a.getCursor("to"),{className:"CodeMirror-composing"}))}),!0},ensurePolled:function(){this.pollingFast&&this.poll()&&(this.pollingFast=!1)},onKeyPress:function(){lf&&mf>=9&&(this.hasSelection=null),this.fastPoll()},onContextMenu:function(a){function b(){if(null!=g.selectionStart){var a=e.somethingSelected(),b=""+(a?g.value:"");g.value="⇚",g.value=b,d.prevInput=a?"":"",g.selectionStart=1,g.selectionEnd=b.length,f.selForContextMenu=e.doc.sel}}function c(){if(d.contextMenuPending=!1,d.wrapper.style.position="relative",g.style.cssText=k,lf&&9>mf&&f.scrollbars.setScrollTop(f.scroller.scrollTop=i),null!=g.selectionStart){(!lf||lf&&9>mf)&&b();var a=0,c=function(){f.selForContextMenu==e.doc.sel&&0==g.selectionStart&&g.selectionEnd>0&&""==d.prevInput?Bb(e,bg.selectAll)(e):a++<10?f.detectingSelectAll=setTimeout(c,500):f.input.reset()};f.detectingSelectAll=setTimeout(c,200)}}var d=this,e=d.cm,f=e.display,g=d.textarea,h=Rb(e,a),i=f.scroller.scrollTop;if(h&&!qf){var j=e.options.resetSelectionOnContextMenu;j&&-1==e.doc.sel.contains(h)&&Bb(e,za)(e.doc,ma(h),Bg);var k=g.style.cssText;if(d.wrapper.style.position="absolute",g.style.cssText="position: fixed; width: 30px; height: 30px; top: "+(a.clientY-5)+"px; left: "+(a.clientX-5)+"px; z-index: 1000; background: "+(lf?"rgba(255, 255, 255, .05)":"transparent")+"; outline: none; border-width: 0; outline: none; overflow: hidden; opacity: .05; filter: alpha(opacity=5);",nf)var l=window.scrollY;if(f.input.focus(),nf&&window.scrollTo(null,l),f.input.reset(),e.somethingSelected()||(g.value=d.prevInput=" "),d.contextMenuPending=!0,f.selForContextMenu=e.doc.sel,clearTimeout(f.detectingSelectAll),lf&&mf>=9&&b(),Af){ug(a);var m=function(){wg(window,"mouseup",m),setTimeout(c,20)};vg(window,"mouseup",m)}else setTimeout(c,50)}},setUneditable:De,needsContentAttribute:!1},ba.prototype),da.prototype=Fe({init:function(a){function b(a){if(d.somethingSelected())Ff=d.getSelections(),"cut"==a.type&&d.replaceSelection("",null,"cut");else{if(!d.options.lineWiseCopyCut)return;var b=_(d);Ff=b.text,"cut"==a.type&&d.operation(function(){d.setSelections(b.ranges,0,Bg),d.replaceSelection("",null,"cut")})}if(a.clipboardData&&!uf)a.preventDefault(),a.clipboardData.clearData(),a.clipboardData.setData("text/plain",Ff.join("\n"));else{var c=ca(),e=c.firstChild;d.display.lineSpace.insertBefore(c,d.display.lineSpace.firstChild),e.value=Ff.join("\n");var f=document.activeElement;Gg(e),setTimeout(function(){d.display.lineSpace.removeChild(c),f.focus()},50)}}var c=this,d=c.cm,e=c.div=a.lineDiv;e.contentEditable="true",aa(e),vg(e,"paste",function(a){var b=a.clipboardData&&a.clipboardData.getData("text/plain");b&&(a.preventDefault(),d.replaceSelection(b,null,"paste"))}),vg(e,"compositionstart",function(a){var b=a.data;if(c.composing={sel:d.doc.sel,data:b,startData:b},b){var e=d.doc.sel.primary(),f=d.getLine(e.head.line),g=f.indexOf(b,Math.max(0,e.head.ch-b.length));g>-1&&g<=e.head.ch&&(c.composing.sel=ma(Df(e.head.line,g),Df(e.head.line,g+b.length)))}}),vg(e,"compositionupdate",function(a){c.composing.data=a.data}),vg(e,"compositionend",function(a){var b=c.composing;b&&(a.data==b.startData||/\u200b/.test(a.data)||(b.data=a.data),setTimeout(function(){b.handled||c.applyComposition(b),c.composing==b&&(c.composing=null)},50))}),vg(e,"touchstart",function(){c.forceCompositionEnd()}),vg(e,"input",function(){c.composing||c.pollContent()||Ab(c.cm,function(){Gb(d)})}),vg(e,"copy",b),vg(e,"cut",b)},prepareSelection:function(){var a=Ga(this.cm,!1);return a.focus=this.cm.state.focused,a},showSelection:function(a){a&&this.cm.display.view.length&&(a.focus&&this.showPrimarySelection(),this.showMultipleSelections(a))},showPrimarySelection:function(){var a=window.getSelection(),b=this.cm.doc.sel.primary(),c=ga(this.cm,a.anchorNode,a.anchorOffset),d=ga(this.cm,a.focusNode,a.focusOffset);if(!c||c.bad||!d||d.bad||0!=Ef(X(c,d),b.from())||0!=Ef(W(c,d),b.to())){var e=ea(this.cm,b.from()),f=ea(this.cm,b.to());if(e||f){var g=this.cm.display.view,h=a.rangeCount&&a.getRangeAt(0);if(e){if(!f){var i=g[g.length-1].measure,j=i.maps?i.maps[i.maps.length-1]:i.map;f={node:j[j.length-1],offset:j[j.length-2]-j[j.length-3]}}}else e={node:g[0].measure.map[2],offset:0};try{var k=Hg(e.node,e.offset,f.offset,f.node)}catch(l){}k&&(a.removeAllRanges(),a.addRange(k),h&&null==a.anchorNode?a.addRange(h):hf&&this.startGracePeriod()),this.rememberSelection()}}},startGracePeriod:function(){var a=this;clearTimeout(this.gracePeriod),this.gracePeriod=setTimeout(function(){a.gracePeriod=!1,a.selectionChanged()&&a.cm.operation(function(){a.cm.curOp.selectionChanged=!0})},20)},showMultipleSelections:function(a){Me(this.cm.display.cursorDiv,a.cursors),Me(this.cm.display.selectionDiv,a.selection)},rememberSelection:function(){var a=window.getSelection();this.lastAnchorNode=a.anchorNode,this.lastAnchorOffset=a.anchorOffset,this.lastFocusNode=a.focusNode,this.lastFocusOffset=a.focusOffset},selectionInEditor:function(){var a=window.getSelection();if(!a.rangeCount)return!1;var b=a.getRangeAt(0).commonAncestorContainer;return Lg(this.div,b)},focus:function(){"nocursor"!=this.cm.options.readOnly&&this.div.focus()},blur:function(){this.div.blur()},getField:function(){return this.div},supportsTouch:function(){return!0},receivedFocus:function(){function a(){b.cm.state.focused&&(b.pollSelection(),b.polling.set(b.cm.options.pollInterval,a))}var b=this;this.selectionInEditor()?this.pollSelection():Ab(this.cm,function(){b.cm.curOp.selectionChanged=!0}),this.polling.set(this.cm.options.pollInterval,a)},selectionChanged:function(){var a=window.getSelection();return a.anchorNode!=this.lastAnchorNode||a.anchorOffset!=this.lastAnchorOffset||a.focusNode!=this.lastFocusNode||a.focusOffset!=this.lastFocusOffset},pollSelection:function(){if(!this.composing&&!this.gracePeriod&&this.selectionChanged()){var a=window.getSelection(),b=this.cm;this.rememberSelection();var c=ga(b,a.anchorNode,a.anchorOffset),d=ga(b,a.focusNode,a.focusOffset);c&&d&&Ab(b,function(){za(b.doc,ma(c,d),Bg),(c.bad||d.bad)&&(b.curOp.selectionChanged=!0)})}},pollContent:function(){var a=this.cm,b=a.display,c=a.doc.sel.primary(),d=c.from(),e=c.to();if(d.line<b.viewFrom||e.line>b.viewTo-1)return!1;var f;if(d.line==b.viewFrom||0==(f=Jb(a,d.line)))var g=Xd(b.view[0].line),h=b.view[0].node;else var g=Xd(b.view[f].line),h=b.view[f-1].node.nextSibling;var i=Jb(a,e.line);if(i==b.view.length-1)var j=b.viewTo-1,k=b.view[i].node;else var j=Xd(b.view[i+1].line)-1,k=b.view[i+1].node.previousSibling;for(var l=Sg(ia(a,h,k,g,j)),m=Ud(a.doc,Df(g,0),Df(j,Td(a.doc,j).text.length));l.length>1&&m.length>1;)if(Ae(l)==Ae(m))l.pop(),m.pop(),j--;else{if(l[0]!=m[0])break;l.shift(),m.shift(),g++}for(var n=0,o=0,p=l[0],q=m[0],r=Math.min(p.length,q.length);r>n&&p.charCodeAt(n)==q.charCodeAt(n);)++n;for(var s=Ae(l),t=Ae(m),u=Math.min(s.length-(1==l.length?n:0),t.length-(1==m.length?n:0));u>o&&s.charCodeAt(s.length-o-1)==t.charCodeAt(t.length-o-1);)++o;l[l.length-1]=s.slice(0,s.length-o),l[0]=l[0].slice(n);var v=Df(g,n),w=Df(j,m.length?Ae(m).length-o:0);return l.length>1||l[0]||Ef(v,w)?(Ac(a.doc,l,v,w,"+input"),!0):void 0},ensurePolled:function(){this.forceCompositionEnd()},reset:function(){this.forceCompositionEnd()},forceCompositionEnd:function(){this.composing&&!this.composing.handled&&(this.applyComposition(this.composing),this.composing.handled=!0,this.div.blur(),this.div.focus())},applyComposition:function(a){a.data&&a.data!=a.startData&&Bb(this.cm,$)(this.cm,a.data,0,a.sel)},setUneditable:function(a){a.setAttribute("contenteditable","false")},onKeyPress:function(a){a.preventDefault(),Bb(this.cm,$)(this.cm,String.fromCharCode(null==a.charCode?a.keyCode:a.charCode),0)},onContextMenu:De,resetPosition:De,needsContentAttribute:!0},da.prototype),a.inputStyles={textarea:ba,contenteditable:da},ja.prototype={primary:function(){return this.ranges[this.primIndex]},equals:function(a){if(a==this)return!0;if(a.primIndex!=this.primIndex||a.ranges.length!=this.ranges.length)return!1;for(var b=0;b<this.ranges.length;b++){var c=this.ranges[b],d=a.ranges[b];if(0!=Ef(c.anchor,d.anchor)||0!=Ef(c.head,d.head))return!1}return!0},deepCopy:function(){for(var a=[],b=0;b<this.ranges.length;b++)a[b]=new ka(V(this.ranges[b].anchor),V(this.ranges[b].head));return new ja(a,this.primIndex)},somethingSelected:function(){for(var a=0;a<this.ranges.length;a++)if(!this.ranges[a].empty())return!0;return!1},contains:function(a,b){b||(b=a);for(var c=0;c<this.ranges.length;c++){var d=this.ranges[c];if(Ef(b,d.from())>=0&&Ef(a,d.to())<=0)return c}return-1}},ka.prototype={from:function(){return X(this.anchor,this.head)},to:function(){return W(this.anchor,this.head)},empty:function(){return this.head.line==this.anchor.line&&this.head.ch==this.anchor.ch}};var Gf,Hf,If,Jf={left:0,right:0,top:0,bottom:0},Kf=null,Lf=0,Mf=0,Nf=0,Of=null;lf?Of=-.53:hf?Of=15:pf?Of=-.7:rf&&(Of=-1/3);var Pf=function(a){var b=a.wheelDeltaX,c=a.wheelDeltaY;return null==b&&a.detail&&a.axis==a.HORIZONTAL_AXIS&&(b=a.detail),null==c&&a.detail&&a.axis==a.VERTICAL_AXIS?c=a.detail:null==c&&(c=a.wheelDelta),{x:b,y:c}};a.wheelEventPixels=function(a){var b=Pf(a);return b.x*=Of,b.y*=Of,b};var Qf=new xe,Rf=null,Sf=a.changeEnd=function(a){return a.text?Df(a.from.line+a.text.length-1,Ae(a.text).length+(1==a.text.length?a.from.ch:0)):a.to};a.prototype={constructor:a,focus:function(){window.focus(),this.display.input.focus()},setOption:function(a,b){var c=this.options,d=c[a];(c[a]!=b||"mode"==a)&&(c[a]=b,Uf.hasOwnProperty(a)&&Bb(this,Uf[a])(this,b,d))},getOption:function(a){return this.options[a]},getDoc:function(){return this.doc},addKeyMap:function(a,b){this.state.keyMaps[b?"push":"unshift"](Pc(a))},removeKeyMap:function(a){for(var b=this.state.keyMaps,c=0;c<b.length;++c)if(b[c]==a||b[c].name==a)return b.splice(c,1),!0},addOverlay:Cb(function(b,c){var d=b.token?b:a.getMode(this.options,b);if(d.startState)throw new Error("Overlays may not be stateful.");this.state.overlays.push({mode:d,modeSpec:b,opaque:c&&c.opaque}),this.state.modeGen++,Gb(this)}),removeOverlay:Cb(function(a){for(var b=this.state.overlays,c=0;c<b.length;++c){var d=b[c].modeSpec;if(d==a||"string"==typeof a&&d.name==a)return b.splice(c,1),this.state.modeGen++,void Gb(this)}}),indentLine:Cb(function(a,b,c){"string"!=typeof b&&"number"!=typeof b&&(b=null==b?this.options.smartIndent?"smart":"prev":b?"add":"subtract"),qa(this.doc,a)&&Ic(this,a,b,c)}),indentSelection:Cb(function(a){for(var b=this.doc.sel.ranges,c=-1,d=0;d<b.length;d++){var e=b[d];if(e.empty())e.head.line>c&&(Ic(this,e.head.line,a,!0),c=e.head.line,d==this.doc.sel.primIndex&&Gc(this));else{var f=e.from(),g=e.to(),h=Math.max(c,f.line);c=Math.min(this.lastLine(),g.line-(g.ch?0:1))+1;for(var i=h;c>i;++i)Ic(this,i,a);var j=this.doc.sel.ranges;0==f.ch&&b.length==j.length&&j[d].from().ch>0&&va(this.doc,d,new ka(f,j[d].to()),Bg)}}}),getTokenAt:function(a,b){return Ad(this,a,b)},getLineTokens:function(a,b){return Ad(this,Df(a),b,!0)},getTokenTypeAt:function(a){a=oa(this.doc,a);var b,c=Dd(this,Td(this.doc,a.line)),d=0,e=(c.length-1)/2,f=a.ch;if(0==f)b=c[2];else for(;;){var g=d+e>>1;if((g?c[2*g-1]:0)>=f)e=g;else{if(!(c[2*g+1]<f)){b=c[2*g+2];break}d=g+1}}var h=b?b.indexOf("cm-overlay "):-1;return 0>h?b:0==h?null:b.slice(0,h-1)},getModeAt:function(b){var c=this.doc.mode;return c.innerMode?a.innerMode(c,this.getTokenAt(b).state).mode:c},getHelper:function(a,b){return this.getHelpers(a,b)[0]},getHelpers:function(a,b){var c=[];if(!$f.hasOwnProperty(b))return c;var d=$f[b],e=this.getModeAt(a);if("string"==typeof e[b])d[e[b]]&&c.push(d[e[b]]);else if(e[b])for(var f=0;f<e[b].length;f++){var g=d[e[b][f]];g&&c.push(g)}else e.helperType&&d[e.helperType]?c.push(d[e.helperType]):d[e.name]&&c.push(d[e.name]);for(var f=0;f<d._global.length;f++){var h=d._global[f];h.pred(e,this)&&-1==Be(c,h.val)&&c.push(h.val)}return c},getStateAfter:function(a,b){var c=this.doc;return a=na(c,null==a?c.first+c.size-1:a),Na(this,a+1,b)},cursorCoords:function(a,b){var c,d=this.doc.sel.primary();return c=null==a?d.head:"object"==typeof a?oa(this.doc,a):a?d.from():d.to(),kb(this,c,b||"page")},charCoords:function(a,b){return jb(this,oa(this.doc,a),b||"page")},coordsChar:function(a,b){return a=ib(this,a,b||"page"),nb(this,a.left,a.top)},lineAtHeight:function(a,b){return a=ib(this,{top:a,left:0},b||"page").top,Yd(this.doc,a+this.display.viewOffset)},heightAtLine:function(a,b){var c,d=!1;if("number"==typeof a){var e=this.doc.first+this.doc.size-1;a<this.doc.first?a=this.doc.first:a>e&&(a=e,d=!0),c=Td(this.doc,a)}else c=a;return hb(this,c,{top:0,left:0},b||"page").top+(d?this.doc.height-Zd(c):0)},defaultTextHeight:function(){return pb(this.display)},defaultCharWidth:function(){return qb(this.display)},setGutterMarker:Cb(function(a,b,c){return Jc(this.doc,a,"gutter",function(a){var d=a.gutterMarkers||(a.gutterMarkers={});return d[b]=c,!c&&Ie(d)&&(a.gutterMarkers=null),!0})}),clearGutter:Cb(function(a){var b=this,c=b.doc,d=c.first;c.iter(function(c){c.gutterMarkers&&c.gutterMarkers[a]&&(c.gutterMarkers[a]=null,Hb(b,d,"gutter"),Ie(c.gutterMarkers)&&(c.gutterMarkers=null)),++d})}),lineInfo:function(a){if("number"==typeof a){if(!qa(this.doc,a))return null;var b=a;if(a=Td(this.doc,a),!a)return null}else{var b=Xd(a);if(null==b)return null}return{line:b,handle:a,text:a.text,gutterMarkers:a.gutterMarkers,textClass:a.textClass,bgClass:a.bgClass,wrapClass:a.wrapClass,widgets:a.widgets}},getViewport:function(){return{from:this.display.viewFrom,to:this.display.viewTo}},addWidget:function(a,b,c,d,e){var f=this.display;a=kb(this,oa(this.doc,a));var g=a.bottom,h=a.left;if(b.style.position="absolute",b.setAttribute("cm-ignore-events","true"),this.display.input.setUneditable(b),f.sizer.appendChild(b),"over"==d)g=a.top;else if("above"==d||"near"==d){var i=Math.max(f.wrapper.clientHeight,this.doc.height),j=Math.max(f.sizer.clientWidth,f.lineSpace.clientWidth);("above"==d||a.bottom+b.offsetHeight>i)&&a.top>b.offsetHeight?g=a.top-b.offsetHeight:a.bottom+b.offsetHeight<=i&&(g=a.bottom),h+b.offsetWidth>j&&(h=j-b.offsetWidth)}b.style.top=g+"px",b.style.left=b.style.right="","right"==e?(h=f.sizer.clientWidth-b.offsetWidth,b.style.right="0px"):("left"==e?h=0:"middle"==e&&(h=(f.sizer.clientWidth-b.offsetWidth)/2),b.style.left=h+"px"),c&&Dc(this,h,g,h+b.offsetWidth,g+b.offsetHeight)},triggerOnKeyDown:Cb(gc),triggerOnKeyPress:Cb(jc),triggerOnKeyUp:ic,execCommand:function(a){return bg.hasOwnProperty(a)?bg[a](this):void 0},findPosH:function(a,b,c,d){var e=1;0>b&&(e=-1,b=-b);for(var f=0,g=oa(this.doc,a);b>f&&(g=Lc(this.doc,g,e,c,d),!g.hitSide);++f);return g},moveH:Cb(function(a,b){var c=this;c.extendSelectionsBy(function(d){return c.display.shift||c.doc.extend||d.empty()?Lc(c.doc,d.head,a,b,c.options.rtlMoveVisually):0>a?d.from():d.to()},Dg)}),deleteH:Cb(function(a,b){var c=this.doc.sel,d=this.doc;c.somethingSelected()?d.replaceSelection("",null,"+delete"):Kc(this,function(c){var e=Lc(d,c.head,a,b,!1);return 0>a?{from:e,to:c.head}:{from:c.head,to:e}})}),findPosV:function(a,b,c,d){var e=1,f=d;0>b&&(e=-1,b=-b);for(var g=0,h=oa(this.doc,a);b>g;++g){var i=kb(this,h,"div");if(null==f?f=i.left:i.left=f,h=Mc(this,i,e,c),h.hitSide)break}return h},moveV:Cb(function(a,b){var c=this,d=this.doc,e=[],f=!c.display.shift&&!d.extend&&d.sel.somethingSelected();if(d.extendSelectionsBy(function(g){if(f)return 0>a?g.from():g.to();var h=kb(c,g.head,"div");null!=g.goalColumn&&(h.left=g.goalColumn),e.push(h.left);var i=Mc(c,h,a,b);return"page"==b&&g==d.sel.primary()&&Fc(c,null,jb(c,i,"div").top-h.top),i},Dg),e.length)for(var g=0;g<d.sel.ranges.length;g++)d.sel.ranges[g].goalColumn=e[g]}),findWordAt:function(a){var b=this.doc,c=Td(b,a.line).text,d=a.ch,e=a.ch;if(c){var f=this.getHelper(a,"wordChars");(a.xRel<0||e==c.length)&&d?--d:++e;for(var g=c.charAt(d),h=He(g,f)?function(a){return He(a,f)}:/\s/.test(g)?function(a){return/\s/.test(a)}:function(a){return!/\s/.test(a)&&!He(a)};d>0&&h(c.charAt(d-1));)--d;for(;e<c.length&&h(c.charAt(e));)++e}return new ka(Df(a.line,d),Df(a.line,e))},toggleOverwrite:function(a){(null==a||a!=this.state.overwrite)&&((this.state.overwrite=!this.state.overwrite)?Pg(this.display.cursorDiv,"CodeMirror-overwrite"):Og(this.display.cursorDiv,"CodeMirror-overwrite"),xg(this,"overwriteToggle",this,this.state.overwrite))},hasFocus:function(){return this.display.input.getField()==Ne()},scrollTo:Cb(function(a,b){(null!=a||null!=b)&&Hc(this),null!=a&&(this.curOp.scrollLeft=a),null!=b&&(this.curOp.scrollTop=b)}),getScrollInfo:function(){var a=this.display.scroller;return{left:a.scrollLeft,top:a.scrollTop,height:a.scrollHeight-Ra(this)-this.display.barHeight,width:a.scrollWidth-Ra(this)-this.display.barWidth,clientHeight:Ta(this),clientWidth:Sa(this)}},scrollIntoView:Cb(function(a,b){if(null==a?(a={from:this.doc.sel.primary().head,to:null},null==b&&(b=this.options.cursorScrollMargin)):"number"==typeof a?a={from:Df(a,0),to:null}:null==a.from&&(a={from:a,to:null}),a.to||(a.to=a.from),a.margin=b||0,null!=a.from.line)Hc(this),this.curOp.scrollToPos=a;else{var c=Ec(this,Math.min(a.from.left,a.to.left),Math.min(a.from.top,a.to.top)-a.margin,Math.max(a.from.right,a.to.right),Math.max(a.from.bottom,a.to.bottom)+a.margin);this.scrollTo(c.scrollLeft,c.scrollTop)}}),setSize:Cb(function(a,b){function c(a){return"number"==typeof a||/^\d+$/.test(String(a))?a+"px":a}var d=this;null!=a&&(d.display.wrapper.style.width=c(a)),null!=b&&(d.display.wrapper.style.height=c(b)),d.options.lineWrapping&&db(this);var e=d.display.viewFrom;d.doc.iter(e,d.display.viewTo,function(a){if(a.widgets)for(var b=0;b<a.widgets.length;b++)if(a.widgets[b].noHScroll){Hb(d,e,"widget");break}++e}),d.curOp.forceUpdate=!0,xg(d,"refresh",this)}),operation:function(a){return Ab(this,a)},refresh:Cb(function(){var a=this.display.cachedTextHeight;Gb(this),this.curOp.forceUpdate=!0,eb(this),this.scrollTo(this.doc.scrollLeft,this.doc.scrollTop),k(this),(null==a||Math.abs(a-pb(this.display))>.5)&&g(this),xg(this,"refresh",this)}),swapDoc:Cb(function(a){var b=this.doc;return b.cm=null,Sd(this,a),eb(this),this.display.input.reset(),this.scrollTo(a.scrollLeft,a.scrollTop),this.curOp.forceScroll=!0,re(this,"swapDoc",this,b),b}),getInputField:function(){return this.display.input.getField()},getWrapperElement:function(){return this.display.wrapper},getScrollerElement:function(){return this.display.scroller},getGutterElement:function(){return this.display.gutters}},we(a);var Tf=a.defaults={},Uf=a.optionHandlers={},Vf=a.Init={toString:function(){return"CodeMirror.Init"}};Nc("value","",function(a,b){a.setValue(b)},!0),Nc("mode",null,function(a,b){a.doc.modeOption=b,c(a)},!0),Nc("indentUnit",2,c,!0),Nc("indentWithTabs",!1),Nc("smartIndent",!0),Nc("tabSize",4,function(a){d(a),eb(a),Gb(a)},!0),Nc("specialChars",/[\t\u0000-\u0019\u00ad\u200b-\u200f\u2028\u2029\ufeff]/g,function(b,c,d){b.state.specialChars=new RegExp(c.source+(c.test(" ")?"":"| "),"g"),d!=a.Init&&b.refresh()}),Nc("specialCharPlaceholder",Hd,function(a){a.refresh()},!0),Nc("electricChars",!0),Nc("inputStyle",vf?"contenteditable":"textarea",function(){throw new Error("inputStyle can not (yet) be changed in a running editor")},!0),Nc("rtlMoveVisually",!xf),Nc("wholeLineUpdateBefore",!0),Nc("theme","default",function(a){h(a),i(a)},!0),Nc("keyMap","default",function(b,c,d){var e=Pc(c),f=d!=a.Init&&Pc(d);f&&f.detach&&f.detach(b,e),e.attach&&e.attach(b,f||null)}),Nc("extraKeys",null),Nc("lineWrapping",!1,e,!0),Nc("gutters",[],function(a){n(a.options),i(a)},!0),Nc("fixedGutter",!0,function(a,b){a.display.gutters.style.left=b?y(a.display)+"px":"0",a.refresh()},!0),Nc("coverGutterNextToScrollbar",!1,function(a){s(a)},!0),Nc("scrollbarStyle","native",function(a){r(a),s(a),a.display.scrollbars.setScrollTop(a.doc.scrollTop),a.display.scrollbars.setScrollLeft(a.doc.scrollLeft)},!0),Nc("lineNumbers",!1,function(a){n(a.options),i(a)},!0),Nc("firstLineNumber",1,i,!0),Nc("lineNumberFormatter",function(a){return a},i,!0),Nc("showCursorWhenSelecting",!1,Fa,!0),Nc("resetSelectionOnContextMenu",!0),Nc("lineWiseCopyCut",!0),Nc("readOnly",!1,function(a,b){"nocursor"==b?(mc(a),a.display.input.blur(),a.display.disabled=!0):(a.display.disabled=!1,b||a.display.input.reset())}),Nc("disableInput",!1,function(a,b){b||a.display.input.reset()},!0),Nc("dragDrop",!0,Ob),Nc("cursorBlinkRate",530),Nc("cursorScrollMargin",0),Nc("cursorHeight",1,Fa,!0),Nc("singleCursorHeightPerLine",!0,Fa,!0),Nc("workTime",100),Nc("workDelay",100),Nc("flattenSpans",!0,d,!0),Nc("addModeClass",!1,d,!0),Nc("pollInterval",100),Nc("undoDepth",200,function(a,b){a.doc.history.undoDepth=b}),Nc("historyEventDelay",1250),Nc("viewportMargin",10,function(a){a.refresh()},!0),Nc("maxHighlightLength",1e4,d,!0),Nc("moveInputWithCursor",!0,function(a,b){b||a.display.input.resetPosition()}),Nc("tabindex",null,function(a,b){a.display.input.getField().tabIndex=b||""}),Nc("autofocus",null);var Wf=a.modes={},Xf=a.mimeModes={};a.defineMode=function(b,c){a.defaults.mode||"null"==b||(a.defaults.mode=b),arguments.length>2&&(c.dependencies=Array.prototype.slice.call(arguments,2)),Wf[b]=c},a.defineMIME=function(a,b){Xf[a]=b},a.resolveMode=function(b){if("string"==typeof b&&Xf.hasOwnProperty(b))b=Xf[b];else if(b&&"string"==typeof b.name&&Xf.hasOwnProperty(b.name)){var c=Xf[b.name];"string"==typeof c&&(c={name:c}),b=Ee(c,b),b.name=c.name}else if("string"==typeof b&&/^[\w\-]+\/[\w\-]+\+xml$/.test(b))return a.resolveMode("application/xml");return"string"==typeof b?{name:b}:b||{name:"null"}},a.getMode=function(b,c){var c=a.resolveMode(c),d=Wf[c.name];if(!d)return a.getMode(b,"text/plain");var e=d(b,c);if(Yf.hasOwnProperty(c.name)){var f=Yf[c.name];for(var g in f)f.hasOwnProperty(g)&&(e.hasOwnProperty(g)&&(e["_"+g]=e[g]),e[g]=f[g])}if(e.name=c.name,c.helperType&&(e.helperType=c.helperType),c.modeProps)for(var g in c.modeProps)e[g]=c.modeProps[g];return e},a.defineMode("null",function(){return{token:function(a){a.skipToEnd()}}}),a.defineMIME("text/plain","null");var Yf=a.modeExtensions={};a.extendMode=function(a,b){var c=Yf.hasOwnProperty(a)?Yf[a]:Yf[a]={};Fe(b,c)},a.defineExtension=function(b,c){a.prototype[b]=c},a.defineDocExtension=function(a,b){pg.prototype[a]=b},a.defineOption=Nc;var Zf=[];a.defineInitHook=function(a){Zf.push(a)};var $f=a.helpers={};a.registerHelper=function(b,c,d){$f.hasOwnProperty(b)||($f[b]=a[b]={_global:[]}),$f[b][c]=d},a.registerGlobalHelper=function(b,c,d,e){a.registerHelper(b,c,e),$f[b]._global.push({pred:d,val:e})};var _f=a.copyState=function(a,b){if(b===!0)return b;if(a.copyState)return a.copyState(b);var c={};for(var d in b){var e=b[d];e instanceof Array&&(e=e.concat([])),c[d]=e}return c},ag=a.startState=function(a,b,c){return a.startState?a.startState(b,c):!0};a.innerMode=function(a,b){for(;a.innerMode;){var c=a.innerMode(b);if(!c||c.mode==a)break;b=c.state,a=c.mode}return c||{mode:a,state:b}};var bg=a.commands={selectAll:function(a){a.setSelection(Df(a.firstLine(),0),Df(a.lastLine()),Bg)},singleSelection:function(a){a.setSelection(a.getCursor("anchor"),a.getCursor("head"),Bg)},killLine:function(a){Kc(a,function(b){if(b.empty()){var c=Td(a.doc,b.head.line).text.length;return b.head.ch==c&&b.head.line<a.lastLine()?{from:b.head,to:Df(b.head.line+1,0)}:{from:b.head,to:Df(b.head.line,c)}}return{from:b.from(),to:b.to()}})},deleteLine:function(a){Kc(a,function(b){return{from:Df(b.from().line,0),to:oa(a.doc,Df(b.to().line+1,0))}})},delLineLeft:function(a){Kc(a,function(a){return{from:Df(a.from().line,0),to:a.from()}})},delWrappedLineLeft:function(a){Kc(a,function(b){var c=a.charCoords(b.head,"div").top+5,d=a.coordsChar({left:0,top:c},"div");return{from:d,to:b.from()}})},delWrappedLineRight:function(a){Kc(a,function(b){var c=a.charCoords(b.head,"div").top+5,d=a.coordsChar({left:a.display.lineDiv.offsetWidth+100,top:c},"div");return{from:b.from(),to:d}})},undo:function(a){a.undo()},redo:function(a){a.redo()},undoSelection:function(a){a.undoSelection()},redoSelection:function(a){a.redoSelection()},goDocStart:function(a){a.extendSelection(Df(a.firstLine(),0))},goDocEnd:function(a){a.extendSelection(Df(a.lastLine()))},goLineStart:function(a){a.extendSelectionsBy(function(b){return _e(a,b.head.line)},{origin:"+move",bias:1})},goLineStartSmart:function(a){a.extendSelectionsBy(function(b){return bf(a,b.head)},{origin:"+move",bias:1})},goLineEnd:function(a){a.extendSelectionsBy(function(b){return af(a,b.head.line)},{origin:"+move",bias:-1})},goLineRight:function(a){a.extendSelectionsBy(function(b){var c=a.charCoords(b.head,"div").top+5;return a.coordsChar({left:a.display.lineDiv.offsetWidth+100,top:c},"div")},Dg)},goLineLeft:function(a){a.extendSelectionsBy(function(b){var c=a.charCoords(b.head,"div").top+5;return a.coordsChar({left:0,top:c},"div")},Dg)},goLineLeftSmart:function(a){a.extendSelectionsBy(function(b){var c=a.charCoords(b.head,"div").top+5,d=a.coordsChar({left:0,top:c},"div");return d.ch<a.getLine(d.line).search(/\S/)?bf(a,b.head):d},Dg)},goLineUp:function(a){a.moveV(-1,"line")},goLineDown:function(a){a.moveV(1,"line")},goPageUp:function(a){a.moveV(-1,"page")},goPageDown:function(a){a.moveV(1,"page")},goCharLeft:function(a){a.moveH(-1,"char")},goCharRight:function(a){a.moveH(1,"char")},goColumnLeft:function(a){a.moveH(-1,"column")},goColumnRight:function(a){a.moveH(1,"column")},goWordLeft:function(a){a.moveH(-1,"word")},goGroupRight:function(a){a.moveH(1,"group")},goGroupLeft:function(a){a.moveH(-1,"group")},goWordRight:function(a){a.moveH(1,"word")},delCharBefore:function(a){a.deleteH(-1,"char")},delCharAfter:function(a){a.deleteH(1,"char")},delWordBefore:function(a){a.deleteH(-1,"word")},delWordAfter:function(a){a.deleteH(1,"word")},delGroupBefore:function(a){a.deleteH(-1,"group")},delGroupAfter:function(a){a.deleteH(1,"group")},indentAuto:function(a){a.indentSelection("smart")},indentMore:function(a){a.indentSelection("add")},indentLess:function(a){a.indentSelection("subtract")},insertTab:function(a){a.replaceSelection(" ")},insertSoftTab:function(a){for(var b=[],c=a.listSelections(),d=a.options.tabSize,e=0;e<c.length;e++){var f=c[e].from(),g=Eg(a.getLine(f.line),f.ch,d);b.push(new Array(d-g%d+1).join(" "))}a.replaceSelections(b)},defaultTab:function(a){a.somethingSelected()?a.indentSelection("add"):a.execCommand("insertTab")},transposeChars:function(a){Ab(a,function(){for(var b=a.listSelections(),c=[],d=0;d<b.length;d++){var e=b[d].head,f=Td(a.doc,e.line).text;if(f)if(e.ch==f.length&&(e=new Df(e.line,e.ch-1)),e.ch>0)e=new Df(e.line,e.ch+1),a.replaceRange(f.charAt(e.ch-1)+f.charAt(e.ch-2),Df(e.line,e.ch-2),e,"+transpose");else if(e.line>a.doc.first){var g=Td(a.doc,e.line-1).text;g&&a.replaceRange(f.charAt(0)+"\n"+g.charAt(g.length-1),Df(e.line-1,g.length-1),Df(e.line,1),"+transpose")}c.push(new ka(e,e))}a.setSelections(c)})},newlineAndIndent:function(a){Ab(a,function(){for(var b=a.listSelections().length,c=0;b>c;c++){var d=a.listSelections()[c];a.replaceRange("\n",d.anchor,d.head,"+input"),a.indentLine(d.from().line+1,null,!0),Gc(a)}})},toggleOverwrite:function(a){a.toggleOverwrite()}},cg=a.keyMap={};cg.basic={Left:"goCharLeft",Right:"goCharRight",Up:"goLineUp",Down:"goLineDown",End:"goLineEnd",Home:"goLineStartSmart",PageUp:"goPageUp",PageDown:"goPageDown",Delete:"delCharAfter",Backspace:"delCharBefore","Shift-Backspace":"delCharBefore",Tab:"defaultTab","Shift-Tab":"indentAuto",Enter:"newlineAndIndent",Insert:"toggleOverwrite",Esc:"singleSelection"},cg.pcDefault={"Ctrl-A":"selectAll","Ctrl-D":"deleteLine","Ctrl-Z":"undo","Shift-Ctrl-Z":"redo","Ctrl-Y":"redo","Ctrl-Home":"goDocStart","Ctrl-End":"goDocEnd","Ctrl-Up":"goLineUp","Ctrl-Down":"goLineDown","Ctrl-Left":"goGroupLeft","Ctrl-Right":"goGroupRight","Alt-Left":"goLineStart","Alt-Right":"goLineEnd","Ctrl-Backspace":"delGroupBefore","Ctrl-Delete":"delGroupAfter","Ctrl-S":"save","Ctrl-F":"find","Ctrl-G":"findNext","Shift-Ctrl-G":"findPrev","Shift-Ctrl-F":"replace","Shift-Ctrl-R":"replaceAll","Ctrl-[":"indentLess","Ctrl-]":"indentMore","Ctrl-U":"undoSelection","Shift-Ctrl-U":"redoSelection","Alt-U":"redoSelection",fallthrough:"basic"},cg.emacsy={"Ctrl-F":"goCharRight","Ctrl-B":"goCharLeft","Ctrl-P":"goLineUp","Ctrl-N":"goLineDown","Alt-F":"goWordRight","Alt-B":"goWordLeft","Ctrl-A":"goLineStart","Ctrl-E":"goLineEnd","Ctrl-V":"goPageDown","Shift-Ctrl-V":"goPageUp","Ctrl-D":"delCharAfter","Ctrl-H":"delCharBefore","Alt-D":"delWordAfter","Alt-Backspace":"delWordBefore","Ctrl-K":"killLine","Ctrl-T":"transposeChars"},cg.macDefault={"Cmd-A":"selectAll","Cmd-D":"deleteLine","Cmd-Z":"undo","Shift-Cmd-Z":"redo","Cmd-Y":"redo","Cmd-Home":"goDocStart","Cmd-Up":"goDocStart","Cmd-End":"goDocEnd","Cmd-Down":"goDocEnd","Alt-Left":"goGroupLeft","Alt-Right":"goGroupRight","Cmd-Left":"goLineLeft","Cmd-Right":"goLineRight","Alt-Backspace":"delGroupBefore","Ctrl-Alt-Backspace":"delGroupAfter","Alt-Delete":"delGroupAfter","Cmd-S":"save","Cmd-F":"find","Cmd-G":"findNext","Shift-Cmd-G":"findPrev","Cmd-Alt-F":"replace","Shift-Cmd-Alt-F":"replaceAll","Cmd-[":"indentLess","Cmd-]":"indentMore","Cmd-Backspace":"delWrappedLineLeft","Cmd-Delete":"delWrappedLineRight","Cmd-U":"undoSelection","Shift-Cmd-U":"redoSelection","Ctrl-Up":"goDocStart","Ctrl-Down":"goDocEnd",fallthrough:["basic","emacsy"]},cg["default"]=wf?cg.macDefault:cg.pcDefault,a.normalizeKeyMap=function(a){var b={};for(var c in a)if(a.hasOwnProperty(c)){var d=a[c];if(/^(name|fallthrough|(de|at)tach)$/.test(c))continue;if("..."==d){delete a[c];continue}for(var e=Ce(c.split(" "),Oc),f=0;f<e.length;f++){var g,h;f==e.length-1?(h=c,g=d):(h=e.slice(0,f+1).join(" "),g="...");var i=b[h];if(i){if(i!=g)throw new Error("Inconsistent bindings for "+h)}else b[h]=g}delete a[c]}for(var j in b)a[j]=b[j];return a};var dg=a.lookupKey=function(a,b,c,d){b=Pc(b);var e=b.call?b.call(a,d):b[a];if(e===!1)return"nothing";if("..."===e)return"multi";if(null!=e&&c(e))return"handled";if(b.fallthrough){if("[object Array]"!=Object.prototype.toString.call(b.fallthrough))return dg(a,b.fallthrough,c,d);for(var f=0;f<b.fallthrough.length;f++){var g=dg(a,b.fallthrough[f],c,d);if(g)return g}}},eg=a.isModifierKey=function(a){var b="string"==typeof a?a:Wg[a.keyCode];return"Ctrl"==b||"Alt"==b||"Shift"==b||"Mod"==b},fg=a.keyName=function(a,b){if(qf&&34==a.keyCode&&a["char"])return!1;var c=Wg[a.keyCode],d=c;return null==d||a.altGraphKey?!1:(a.altKey&&"Alt"!=c&&(d="Alt-"+d),(zf?a.metaKey:a.ctrlKey)&&"Ctrl"!=c&&(d="Ctrl-"+d),(zf?a.ctrlKey:a.metaKey)&&"Cmd"!=c&&(d="Cmd-"+d),!b&&a.shiftKey&&"Shift"!=c&&(d="Shift-"+d),d)};a.fromTextArea=function(b,c){function d(){b.value=j.getValue()}if(c=c?Fe(c):{},c.value=b.value,!c.tabindex&&b.tabIndex&&(c.tabindex=b.tabIndex),!c.placeholder&&b.placeholder&&(c.placeholder=b.placeholder),null==c.autofocus){var e=Ne();c.autofocus=e==b||null!=b.getAttribute("autofocus")&&e==document.body;
|
5 |
-
}if(b.form&&(vg(b.form,"submit",d),!c.leaveSubmitMethodAlone)){var f=b.form,g=f.submit;try{var h=f.submit=function(){d(),f.submit=g,f.submit(),f.submit=h}}catch(i){}}c.finishInit=function(a){a.save=d,a.getTextArea=function(){return b},a.toTextArea=function(){a.toTextArea=isNaN,d(),b.parentNode.removeChild(a.getWrapperElement()),b.style.display="",b.form&&(wg(b.form,"submit",d),"function"==typeof b.form.submit&&(b.form.submit=g))}},b.style.display="none";var j=a(function(a){b.parentNode.insertBefore(a,b.nextSibling)},c);return j};var gg=a.StringStream=function(a,b){this.pos=this.start=0,this.string=a,this.tabSize=b||8,this.lastColumnPos=this.lastColumnValue=0,this.lineStart=0};gg.prototype={eol:function(){return this.pos>=this.string.length},sol:function(){return this.pos==this.lineStart},peek:function(){return this.string.charAt(this.pos)||void 0},next:function(){return this.pos<this.string.length?this.string.charAt(this.pos++):void 0},eat:function(a){var b=this.string.charAt(this.pos);if("string"==typeof a)var c=b==a;else var c=b&&(a.test?a.test(b):a(b));return c?(++this.pos,b):void 0},eatWhile:function(a){for(var b=this.pos;this.eat(a););return this.pos>b},eatSpace:function(){for(var a=this.pos;/[\s\u00a0]/.test(this.string.charAt(this.pos));)++this.pos;return this.pos>a},skipToEnd:function(){this.pos=this.string.length},skipTo:function(a){var b=this.string.indexOf(a,this.pos);return b>-1?(this.pos=b,!0):void 0},backUp:function(a){this.pos-=a},column:function(){return this.lastColumnPos<this.start&&(this.lastColumnValue=Eg(this.string,this.start,this.tabSize,this.lastColumnPos,this.lastColumnValue),this.lastColumnPos=this.start),this.lastColumnValue-(this.lineStart?Eg(this.string,this.lineStart,this.tabSize):0)},indentation:function(){return Eg(this.string,null,this.tabSize)-(this.lineStart?Eg(this.string,this.lineStart,this.tabSize):0)},match:function(a,b,c){if("string"!=typeof a){var d=this.string.slice(this.pos).match(a);return d&&d.index>0?null:(d&&b!==!1&&(this.pos+=d[0].length),d)}var e=function(a){return c?a.toLowerCase():a},f=this.string.substr(this.pos,a.length);return e(f)==e(a)?(b!==!1&&(this.pos+=a.length),!0):void 0},current:function(){return this.string.slice(this.start,this.pos)},hideFirstChars:function(a,b){this.lineStart+=a;try{return b()}finally{this.lineStart-=a}}};var hg=0,ig=a.TextMarker=function(a,b){this.lines=[],this.type=b,this.doc=a,this.id=++hg};we(ig),ig.prototype.clear=function(){if(!this.explicitlyCleared){var a=this.doc.cm,b=a&&!a.curOp;if(b&&rb(a),ve(this,"clear")){var c=this.find();c&&re(this,"clear",c.from,c.to)}for(var d=null,e=null,f=0;f<this.lines.length;++f){var g=this.lines[f],h=Wc(g.markedSpans,this);a&&!this.collapsed?Hb(a,Xd(g),"text"):a&&(null!=h.to&&(e=Xd(g)),null!=h.from&&(d=Xd(g))),g.markedSpans=Xc(g.markedSpans,h),null==h.from&&this.collapsed&&!qd(this.doc,g)&&a&&Wd(g,pb(a.display))}if(a&&this.collapsed&&!a.options.lineWrapping)for(var f=0;f<this.lines.length;++f){var i=md(this.lines[f]),j=l(i);j>a.display.maxLineLength&&(a.display.maxLine=i,a.display.maxLineLength=j,a.display.maxLineChanged=!0)}null!=d&&a&&this.collapsed&&Gb(a,d,e+1),this.lines.length=0,this.explicitlyCleared=!0,this.atomic&&this.doc.cantEdit&&(this.doc.cantEdit=!1,a&&Ca(a.doc)),a&&re(a,"markerCleared",a,this),b&&tb(a),this.parent&&this.parent.clear()}},ig.prototype.find=function(a,b){null==a&&"bookmark"==this.type&&(a=1);for(var c,d,e=0;e<this.lines.length;++e){var f=this.lines[e],g=Wc(f.markedSpans,this);if(null!=g.from&&(c=Df(b?f:Xd(f),g.from),-1==a))return c;if(null!=g.to&&(d=Df(b?f:Xd(f),g.to),1==a))return d}return c&&{from:c,to:d}},ig.prototype.changed=function(){var a=this.find(-1,!0),b=this,c=this.doc.cm;a&&c&&Ab(c,function(){var d=a.line,e=Xd(a.line),f=Ya(c,e);if(f&&(cb(f),c.curOp.selectionChanged=c.curOp.forceUpdate=!0),c.curOp.updateMaxLine=!0,!qd(b.doc,d)&&null!=b.height){var g=b.height;b.height=null;var h=td(b)-g;h&&Wd(d,d.height+h)}})},ig.prototype.attachLine=function(a){if(!this.lines.length&&this.doc.cm){var b=this.doc.cm.curOp;b.maybeHiddenMarkers&&-1!=Be(b.maybeHiddenMarkers,this)||(b.maybeUnhiddenMarkers||(b.maybeUnhiddenMarkers=[])).push(this)}this.lines.push(a)},ig.prototype.detachLine=function(a){if(this.lines.splice(Be(this.lines,a),1),!this.lines.length&&this.doc.cm){var b=this.doc.cm.curOp;(b.maybeHiddenMarkers||(b.maybeHiddenMarkers=[])).push(this)}};var hg=0,jg=a.SharedTextMarker=function(a,b){this.markers=a,this.primary=b;for(var c=0;c<a.length;++c)a[c].parent=this};we(jg),jg.prototype.clear=function(){if(!this.explicitlyCleared){this.explicitlyCleared=!0;for(var a=0;a<this.markers.length;++a)this.markers[a].clear();re(this,"clear")}},jg.prototype.find=function(a,b){return this.primary.find(a,b)};var kg=a.LineWidget=function(a,b,c){if(c)for(var d in c)c.hasOwnProperty(d)&&(this[d]=c[d]);this.doc=a,this.node=b};we(kg),kg.prototype.clear=function(){var a=this.doc.cm,b=this.line.widgets,c=this.line,d=Xd(c);if(null!=d&&b){for(var e=0;e<b.length;++e)b[e]==this&&b.splice(e--,1);b.length||(c.widgets=null);var f=td(this);Wd(c,Math.max(0,c.height-f)),a&&Ab(a,function(){sd(a,c,-f),Hb(a,d,"widget")})}},kg.prototype.changed=function(){var a=this.height,b=this.doc.cm,c=this.line;this.height=null;var d=td(this)-a;d&&(Wd(c,c.height+d),b&&Ab(b,function(){b.curOp.forceUpdate=!0,sd(b,c,d)}))};var lg=a.Line=function(a,b,c){this.text=a,ed(this,b),this.height=c?c(this):1};we(lg),lg.prototype.lineNo=function(){return Xd(this)};var mg={},ng={};Pd.prototype={chunkSize:function(){return this.lines.length},removeInner:function(a,b){for(var c=a,d=a+b;d>c;++c){var e=this.lines[c];this.height-=e.height,wd(e),re(e,"delete")}this.lines.splice(a,b)},collapse:function(a){a.push.apply(a,this.lines)},insertInner:function(a,b,c){this.height+=c,this.lines=this.lines.slice(0,a).concat(b).concat(this.lines.slice(a));for(var d=0;d<b.length;++d)b[d].parent=this},iterN:function(a,b,c){for(var d=a+b;d>a;++a)if(c(this.lines[a]))return!0}},Qd.prototype={chunkSize:function(){return this.size},removeInner:function(a,b){this.size-=b;for(var c=0;c<this.children.length;++c){var d=this.children[c],e=d.chunkSize();if(e>a){var f=Math.min(b,e-a),g=d.height;if(d.removeInner(a,f),this.height-=g-d.height,e==f&&(this.children.splice(c--,1),d.parent=null),0==(b-=f))break;a=0}else a-=e}if(this.size-b<25&&(this.children.length>1||!(this.children[0]instanceof Pd))){var h=[];this.collapse(h),this.children=[new Pd(h)],this.children[0].parent=this}},collapse:function(a){for(var b=0;b<this.children.length;++b)this.children[b].collapse(a)},insertInner:function(a,b,c){this.size+=b.length,this.height+=c;for(var d=0;d<this.children.length;++d){var e=this.children[d],f=e.chunkSize();if(f>=a){if(e.insertInner(a,b,c),e.lines&&e.lines.length>50){for(;e.lines.length>50;){var g=e.lines.splice(e.lines.length-25,25),h=new Pd(g);e.height-=h.height,this.children.splice(d+1,0,h),h.parent=this}this.maybeSpill()}break}a-=f}},maybeSpill:function(){if(!(this.children.length<=10)){var a=this;do{var b=a.children.splice(a.children.length-5,5),c=new Qd(b);if(a.parent){a.size-=c.size,a.height-=c.height;var d=Be(a.parent.children,a);a.parent.children.splice(d+1,0,c)}else{var e=new Qd(a.children);e.parent=a,a.children=[e,c],a=e}c.parent=a.parent}while(a.children.length>10);a.parent.maybeSpill()}},iterN:function(a,b,c){for(var d=0;d<this.children.length;++d){var e=this.children[d],f=e.chunkSize();if(f>a){var g=Math.min(b,f-a);if(e.iterN(a,g,c))return!0;if(0==(b-=g))break;a=0}else a-=f}}};var og=0,pg=a.Doc=function(a,b,c){if(!(this instanceof pg))return new pg(a,b,c);null==c&&(c=0),Qd.call(this,[new Pd([new lg("",null)])]),this.first=c,this.scrollTop=this.scrollLeft=0,this.cantEdit=!1,this.cleanGeneration=1,this.frontier=c;var d=Df(c,0);this.sel=ma(d),this.history=new _d(null),this.id=++og,this.modeOption=b,"string"==typeof a&&(a=Sg(a)),Od(this,{from:d,to:d,text:a}),za(this,ma(d),Bg)};pg.prototype=Ee(Qd.prototype,{constructor:pg,iter:function(a,b,c){c?this.iterN(a-this.first,b-a,c):this.iterN(this.first,this.first+this.size,a)},insert:function(a,b){for(var c=0,d=0;d<b.length;++d)c+=b[d].height;this.insertInner(a-this.first,b,c)},remove:function(a,b){this.removeInner(a-this.first,b)},getValue:function(a){var b=Vd(this,this.first,this.first+this.size);return a===!1?b:b.join(a||"\n")},setValue:Db(function(a){var b=Df(this.first,0),c=this.first+this.size-1;uc(this,{from:b,to:Df(c,Td(this,c).text.length),text:Sg(a),origin:"setValue",full:!0},!0),za(this,ma(b))}),replaceRange:function(a,b,c,d){b=oa(this,b),c=c?oa(this,c):b,Ac(this,a,b,c,d)},getRange:function(a,b,c){var d=Ud(this,oa(this,a),oa(this,b));return c===!1?d:d.join(c||"\n")},getLine:function(a){var b=this.getLineHandle(a);return b&&b.text},getLineHandle:function(a){return qa(this,a)?Td(this,a):void 0},getLineNumber:function(a){return Xd(a)},getLineHandleVisualStart:function(a){return"number"==typeof a&&(a=Td(this,a)),md(a)},lineCount:function(){return this.size},firstLine:function(){return this.first},lastLine:function(){return this.first+this.size-1},clipPos:function(a){return oa(this,a)},getCursor:function(a){var b,c=this.sel.primary();return b=null==a||"head"==a?c.head:"anchor"==a?c.anchor:"end"==a||"to"==a||a===!1?c.to():c.from()},listSelections:function(){return this.sel.ranges},somethingSelected:function(){return this.sel.somethingSelected()},setCursor:Db(function(a,b,c){wa(this,oa(this,"number"==typeof a?Df(a,b||0):a),null,c)}),setSelection:Db(function(a,b,c){wa(this,oa(this,a),oa(this,b||a),c)}),extendSelection:Db(function(a,b,c){ta(this,oa(this,a),b&&oa(this,b),c)}),extendSelections:Db(function(a,b){ua(this,ra(this,a,b))}),extendSelectionsBy:Db(function(a,b){ua(this,Ce(this.sel.ranges,a),b)}),setSelections:Db(function(a,b,c){if(a.length){for(var d=0,e=[];d<a.length;d++)e[d]=new ka(oa(this,a[d].anchor),oa(this,a[d].head));null==b&&(b=Math.min(a.length-1,this.sel.primIndex)),za(this,la(e,b),c)}}),addSelection:Db(function(a,b,c){var d=this.sel.ranges.slice(0);d.push(new ka(oa(this,a),oa(this,b||a))),za(this,la(d,d.length-1),c)}),getSelection:function(a){for(var b,c=this.sel.ranges,d=0;d<c.length;d++){var e=Ud(this,c[d].from(),c[d].to());b=b?b.concat(e):e}return a===!1?b:b.join(a||"\n")},getSelections:function(a){for(var b=[],c=this.sel.ranges,d=0;d<c.length;d++){var e=Ud(this,c[d].from(),c[d].to());a!==!1&&(e=e.join(a||"\n")),b[d]=e}return b},replaceSelection:function(a,b,c){for(var d=[],e=0;e<this.sel.ranges.length;e++)d[e]=a;this.replaceSelections(d,b,c||"+input")},replaceSelections:Db(function(a,b,c){for(var d=[],e=this.sel,f=0;f<e.ranges.length;f++){var g=e.ranges[f];d[f]={from:g.from(),to:g.to(),text:Sg(a[f]),origin:c}}for(var h=b&&"end"!=b&&sc(this,d,b),f=d.length-1;f>=0;f--)uc(this,d[f]);h?ya(this,h):this.cm&&Gc(this.cm)}),undo:Db(function(){wc(this,"undo")}),redo:Db(function(){wc(this,"redo")}),undoSelection:Db(function(){wc(this,"undo",!0)}),redoSelection:Db(function(){wc(this,"redo",!0)}),setExtending:function(a){this.extend=a},getExtending:function(){return this.extend},historySize:function(){for(var a=this.history,b=0,c=0,d=0;d<a.done.length;d++)a.done[d].ranges||++b;for(var d=0;d<a.undone.length;d++)a.undone[d].ranges||++c;return{undo:b,redo:c}},clearHistory:function(){this.history=new _d(this.history.maxGeneration)},markClean:function(){this.cleanGeneration=this.changeGeneration(!0)},changeGeneration:function(a){return a&&(this.history.lastOp=this.history.lastSelOp=this.history.lastOrigin=null),this.history.generation},isClean:function(a){return this.history.generation==(a||this.cleanGeneration)},getHistory:function(){return{done:ke(this.history.done),undone:ke(this.history.undone)}},setHistory:function(a){var b=this.history=new _d(this.history.maxGeneration);b.done=ke(a.done.slice(0),null,!0),b.undone=ke(a.undone.slice(0),null,!0)},addLineClass:Db(function(a,b,c){return Jc(this,a,"gutter"==b?"gutter":"class",function(a){var d="text"==b?"textClass":"background"==b?"bgClass":"gutter"==b?"gutterClass":"wrapClass";if(a[d]){if(Oe(c).test(a[d]))return!1;a[d]+=" "+c}else a[d]=c;return!0})}),removeLineClass:Db(function(a,b,c){return Jc(this,a,"gutter"==b?"gutter":"class",function(a){var d="text"==b?"textClass":"background"==b?"bgClass":"gutter"==b?"gutterClass":"wrapClass",e=a[d];if(!e)return!1;if(null==c)a[d]=null;else{var f=e.match(Oe(c));if(!f)return!1;var g=f.index+f[0].length;a[d]=e.slice(0,f.index)+(f.index&&g!=e.length?" ":"")+e.slice(g)||null}return!0})}),addLineWidget:Db(function(a,b,c){return ud(this,a,b,c)}),removeLineWidget:function(a){a.clear()},markText:function(a,b,c){return Qc(this,oa(this,a),oa(this,b),c,"range")},setBookmark:function(a,b){var c={replacedWith:b&&(null==b.nodeType?b.widget:b),insertLeft:b&&b.insertLeft,clearWhenEmpty:!1,shared:b&&b.shared,handleMouseEvents:b&&b.handleMouseEvents};return a=oa(this,a),Qc(this,a,a,c,"bookmark")},findMarksAt:function(a){a=oa(this,a);var b=[],c=Td(this,a.line).markedSpans;if(c)for(var d=0;d<c.length;++d){var e=c[d];(null==e.from||e.from<=a.ch)&&(null==e.to||e.to>=a.ch)&&b.push(e.marker.parent||e.marker)}return b},findMarks:function(a,b,c){a=oa(this,a),b=oa(this,b);var d=[],e=a.line;return this.iter(a.line,b.line+1,function(f){var g=f.markedSpans;if(g)for(var h=0;h<g.length;h++){var i=g[h];e==a.line&&a.ch>i.to||null==i.from&&e!=a.line||e==b.line&&i.from>b.ch||c&&!c(i.marker)||d.push(i.marker.parent||i.marker)}++e}),d},getAllMarks:function(){var a=[];return this.iter(function(b){var c=b.markedSpans;if(c)for(var d=0;d<c.length;++d)null!=c[d].from&&a.push(c[d].marker)}),a},posFromIndex:function(a){var b,c=this.first;return this.iter(function(d){var e=d.text.length+1;return e>a?(b=a,!0):(a-=e,void++c)}),oa(this,Df(c,b))},indexFromPos:function(a){a=oa(this,a);var b=a.ch;return a.line<this.first||a.ch<0?0:(this.iter(this.first,a.line,function(a){b+=a.text.length+1}),b)},copy:function(a){var b=new pg(Vd(this,this.first,this.first+this.size),this.modeOption,this.first);return b.scrollTop=this.scrollTop,b.scrollLeft=this.scrollLeft,b.sel=this.sel,b.extend=!1,a&&(b.history.undoDepth=this.history.undoDepth,b.setHistory(this.getHistory())),b},linkedDoc:function(a){a||(a={});var b=this.first,c=this.first+this.size;null!=a.from&&a.from>b&&(b=a.from),null!=a.to&&a.to<c&&(c=a.to);var d=new pg(Vd(this,b,c),a.mode||this.modeOption,b);return a.sharedHist&&(d.history=this.history),(this.linked||(this.linked=[])).push({doc:d,sharedHist:a.sharedHist}),d.linked=[{doc:this,isParent:!0,sharedHist:a.sharedHist}],Tc(d,Sc(this)),d},unlinkDoc:function(b){if(b instanceof a&&(b=b.doc),this.linked)for(var c=0;c<this.linked.length;++c){var d=this.linked[c];if(d.doc==b){this.linked.splice(c,1),b.unlinkDoc(this),Uc(Sc(this));break}}if(b.history==this.history){var e=[b.id];Rd(b,function(a){e.push(a.id)},!0),b.history=new _d(null),b.history.done=ke(this.history.done,e),b.history.undone=ke(this.history.undone,e)}},iterLinkedDocs:function(a){Rd(this,a)},getMode:function(){return this.mode},getEditor:function(){return this.cm}}),pg.prototype.eachLine=pg.prototype.iter;var qg="iter insert remove copy getEditor".split(" ");for(var rg in pg.prototype)pg.prototype.hasOwnProperty(rg)&&Be(qg,rg)<0&&(a.prototype[rg]=function(a){return function(){return a.apply(this.doc,arguments)}}(pg.prototype[rg]));we(pg);var sg=a.e_preventDefault=function(a){a.preventDefault?a.preventDefault():a.returnValue=!1},tg=a.e_stopPropagation=function(a){a.stopPropagation?a.stopPropagation():a.cancelBubble=!0},ug=a.e_stop=function(a){sg(a),tg(a)},vg=a.on=function(a,b,c){if(a.addEventListener)a.addEventListener(b,c,!1);else if(a.attachEvent)a.attachEvent("on"+b,c);else{var d=a._handlers||(a._handlers={}),e=d[b]||(d[b]=[]);e.push(c)}},wg=a.off=function(a,b,c){if(a.removeEventListener)a.removeEventListener(b,c,!1);else if(a.detachEvent)a.detachEvent("on"+b,c);else{var d=a._handlers&&a._handlers[b];if(!d)return;for(var e=0;e<d.length;++e)if(d[e]==c){d.splice(e,1);break}}},xg=a.signal=function(a,b){var c=a._handlers&&a._handlers[b];if(c)for(var d=Array.prototype.slice.call(arguments,2),e=0;e<c.length;++e)c[e].apply(null,d)},yg=null,zg=30,Ag=a.Pass={toString:function(){return"CodeMirror.Pass"}},Bg={scroll:!1},Cg={origin:"*mouse"},Dg={origin:"+move"};xe.prototype.set=function(a,b){clearTimeout(this.id),this.id=setTimeout(b,a)};var Eg=a.countColumn=function(a,b,c,d,e){null==b&&(b=a.search(/[^\s\u00a0]/),-1==b&&(b=a.length));for(var f=d||0,g=e||0;;){var h=a.indexOf(" ",f);if(0>h||h>=b)return g+(b-f);g+=h-f,g+=c-g%c,f=h+1}},Fg=[""],Gg=function(a){a.select()};uf?Gg=function(a){a.selectionStart=0,a.selectionEnd=a.value.length}:lf&&(Gg=function(a){try{a.select()}catch(b){}});var Hg,Ig=/[\u00df\u0587\u0590-\u05f4\u0600-\u06ff\u3040-\u309f\u30a0-\u30ff\u3400-\u4db5\u4e00-\u9fcc\uac00-\ud7af]/,Jg=a.isWordChar=function(a){return/\w/.test(a)||a>""&&(a.toUpperCase()!=a.toLowerCase()||Ig.test(a))},Kg=/[\u0300-\u036f\u0483-\u0489\u0591-\u05bd\u05bf\u05c1\u05c2\u05c4\u05c5\u05c7\u0610-\u061a\u064b-\u065e\u0670\u06d6-\u06dc\u06de-\u06e4\u06e7\u06e8\u06ea-\u06ed\u0711\u0730-\u074a\u07a6-\u07b0\u07eb-\u07f3\u0816-\u0819\u081b-\u0823\u0825-\u0827\u0829-\u082d\u0900-\u0902\u093c\u0941-\u0948\u094d\u0951-\u0955\u0962\u0963\u0981\u09bc\u09be\u09c1-\u09c4\u09cd\u09d7\u09e2\u09e3\u0a01\u0a02\u0a3c\u0a41\u0a42\u0a47\u0a48\u0a4b-\u0a4d\u0a51\u0a70\u0a71\u0a75\u0a81\u0a82\u0abc\u0ac1-\u0ac5\u0ac7\u0ac8\u0acd\u0ae2\u0ae3\u0b01\u0b3c\u0b3e\u0b3f\u0b41-\u0b44\u0b4d\u0b56\u0b57\u0b62\u0b63\u0b82\u0bbe\u0bc0\u0bcd\u0bd7\u0c3e-\u0c40\u0c46-\u0c48\u0c4a-\u0c4d\u0c55\u0c56\u0c62\u0c63\u0cbc\u0cbf\u0cc2\u0cc6\u0ccc\u0ccd\u0cd5\u0cd6\u0ce2\u0ce3\u0d3e\u0d41-\u0d44\u0d4d\u0d57\u0d62\u0d63\u0dca\u0dcf\u0dd2-\u0dd4\u0dd6\u0ddf\u0e31\u0e34-\u0e3a\u0e47-\u0e4e\u0eb1\u0eb4-\u0eb9\u0ebb\u0ebc\u0ec8-\u0ecd\u0f18\u0f19\u0f35\u0f37\u0f39\u0f71-\u0f7e\u0f80-\u0f84\u0f86\u0f87\u0f90-\u0f97\u0f99-\u0fbc\u0fc6\u102d-\u1030\u1032-\u1037\u1039\u103a\u103d\u103e\u1058\u1059\u105e-\u1060\u1071-\u1074\u1082\u1085\u1086\u108d\u109d\u135f\u1712-\u1714\u1732-\u1734\u1752\u1753\u1772\u1773\u17b7-\u17bd\u17c6\u17c9-\u17d3\u17dd\u180b-\u180d\u18a9\u1920-\u1922\u1927\u1928\u1932\u1939-\u193b\u1a17\u1a18\u1a56\u1a58-\u1a5e\u1a60\u1a62\u1a65-\u1a6c\u1a73-\u1a7c\u1a7f\u1b00-\u1b03\u1b34\u1b36-\u1b3a\u1b3c\u1b42\u1b6b-\u1b73\u1b80\u1b81\u1ba2-\u1ba5\u1ba8\u1ba9\u1c2c-\u1c33\u1c36\u1c37\u1cd0-\u1cd2\u1cd4-\u1ce0\u1ce2-\u1ce8\u1ced\u1dc0-\u1de6\u1dfd-\u1dff\u200c\u200d\u20d0-\u20f0\u2cef-\u2cf1\u2de0-\u2dff\u302a-\u302f\u3099\u309a\ua66f-\ua672\ua67c\ua67d\ua6f0\ua6f1\ua802\ua806\ua80b\ua825\ua826\ua8c4\ua8e0-\ua8f1\ua926-\ua92d\ua947-\ua951\ua980-\ua982\ua9b3\ua9b6-\ua9b9\ua9bc\uaa29-\uaa2e\uaa31\uaa32\uaa35\uaa36\uaa43\uaa4c\uaab0\uaab2-\uaab4\uaab7\uaab8\uaabe\uaabf\uaac1\uabe5\uabe8\uabed\udc00-\udfff\ufb1e\ufe00-\ufe0f\ufe20-\ufe26\uff9e\uff9f]/;Hg=document.createRange?function(a,b,c,d){var e=document.createRange();return e.setEnd(d||a,c),e.setStart(a,b),e}:function(a,b,c){var d=document.body.createTextRange();try{d.moveToElementText(a.parentNode)}catch(e){return d}return d.collapse(!0),d.moveEnd("character",c),d.moveStart("character",b),d};var Lg=a.contains=function(a,b){if(3==b.nodeType&&(b=b.parentNode),a.contains)return a.contains(b);do if(11==b.nodeType&&(b=b.host),b==a)return!0;while(b=b.parentNode)};lf&&11>mf&&(Ne=function(){try{return document.activeElement}catch(a){return document.body}});var Mg,Ng,Og=a.rmClass=function(a,b){var c=a.className,d=Oe(b).exec(c);if(d){var e=c.slice(d.index+d[0].length);a.className=c.slice(0,d.index)+(e?d[1]+e:"")}},Pg=a.addClass=function(a,b){var c=a.className;Oe(b).test(c)||(a.className+=(c?" ":"")+b)},Qg=!1,Rg=function(){if(lf&&9>mf)return!1;var a=Ke("div");return"draggable"in a||"dragDrop"in a}(),Sg=a.splitLines=3!="\n\nb".split(/\n/).length?function(a){for(var b=0,c=[],d=a.length;d>=b;){var e=a.indexOf("\n",b);-1==e&&(e=a.length);var f=a.slice(b,"\r"==a.charAt(e-1)?e-1:e),g=f.indexOf("\r");-1!=g?(c.push(f.slice(0,g)),b+=g+1):(c.push(f),b=e+1)}return c}:function(a){return a.split(/\r\n?|\n/)},Tg=window.getSelection?function(a){try{return a.selectionStart!=a.selectionEnd}catch(b){return!1}}:function(a){try{var b=a.ownerDocument.selection.createRange()}catch(c){}return b&&b.parentElement()==a?0!=b.compareEndPoints("StartToEnd",b):!1},Ug=function(){var a=Ke("div");return"oncopy"in a?!0:(a.setAttribute("oncopy","return;"),"function"==typeof a.oncopy)}(),Vg=null,Wg={3:"Enter",8:"Backspace",9:"Tab",13:"Enter",16:"Shift",17:"Ctrl",18:"Alt",19:"Pause",20:"CapsLock",27:"Esc",32:"Space",33:"PageUp",34:"PageDown",35:"End",36:"Home",37:"Left",38:"Up",39:"Right",40:"Down",44:"PrintScrn",45:"Insert",46:"Delete",59:";",61:"=",91:"Mod",92:"Mod",93:"Mod",107:"=",109:"-",127:"Delete",173:"-",186:";",187:"=",188:",",189:"-",190:".",191:"/",192:"`",219:"[",220:"\\",221:"]",222:"'",63232:"Up",63233:"Down",63234:"Left",63235:"Right",63272:"Delete",63273:"Home",63275:"End",63276:"PageUp",63277:"PageDown",63302:"Insert"};a.keyNames=Wg,function(){for(var a=0;10>a;a++)Wg[a+48]=Wg[a+96]=String(a);for(var a=65;90>=a;a++)Wg[a]=String.fromCharCode(a);for(var a=1;12>=a;a++)Wg[a+111]=Wg[a+63235]="F"+a}();var Xg,Yg=function(){function a(a){return 247>=a?c.charAt(a):a>=1424&&1524>=a?"R":a>=1536&&1773>=a?d.charAt(a-1536):a>=1774&&2220>=a?"r":a>=8192&&8203>=a?"w":8204==a?"b":"L"}function b(a,b,c){this.level=a,this.from=b,this.to=c}var c="bbbbbbbbbtstwsbbbbbbbbbbbbbbssstwNN%%%NNNNNN,N,N1111111111NNNNNNNLLLLLLLLLLLLLLLLLLLLLLLLLLNNNNNNLLLLLLLLLLLLLLLLLLLLLLLLLLNNNNbbbbbbsbbbbbbbbbbbbbbbbbbbbbbbbbb,N%%%%NNNNLNNNNN%%11NLNNN1LNNNNNLLLLLLLLLLLLLLLLLLLLLLLNLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLN",d="rrrrrrrrrrrr,rNNmmmmmmrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrmmmmmmmmmmmmmmrrrrrrrnnnnnnnnnn%nnrrrmrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrmmmmmmmmmmmmmmmmmmmNmmmm",e=/[\u0590-\u05f4\u0600-\u06ff\u0700-\u08ac]/,f=/[stwN]/,g=/[LRr]/,h=/[Lb1n]/,i=/[1n]/,j="L";return function(c){if(!e.test(c))return!1;for(var d,k=c.length,l=[],m=0;k>m;++m)l.push(d=a(c.charCodeAt(m)));for(var m=0,n=j;k>m;++m){var d=l[m];"m"==d?l[m]=n:n=d}for(var m=0,o=j;k>m;++m){var d=l[m];"1"==d&&"r"==o?l[m]="n":g.test(d)&&(o=d,"r"==d&&(l[m]="R"))}for(var m=1,n=l[0];k-1>m;++m){var d=l[m];"+"==d&&"1"==n&&"1"==l[m+1]?l[m]="1":","!=d||n!=l[m+1]||"1"!=n&&"n"!=n||(l[m]=n),n=d}for(var m=0;k>m;++m){var d=l[m];if(","==d)l[m]="N";else if("%"==d){for(var p=m+1;k>p&&"%"==l[p];++p);for(var q=m&&"!"==l[m-1]||k>p&&"1"==l[p]?"1":"N",r=m;p>r;++r)l[r]=q;m=p-1}}for(var m=0,o=j;k>m;++m){var d=l[m];"L"==o&&"1"==d?l[m]="L":g.test(d)&&(o=d)}for(var m=0;k>m;++m)if(f.test(l[m])){for(var p=m+1;k>p&&f.test(l[p]);++p);for(var s="L"==(m?l[m-1]:j),t="L"==(k>p?l[p]:j),q=s||t?"L":"R",r=m;p>r;++r)l[r]=q;m=p-1}for(var u,v=[],m=0;k>m;)if(h.test(l[m])){var w=m;for(++m;k>m&&h.test(l[m]);++m);v.push(new b(0,w,m))}else{var x=m,y=v.length;for(++m;k>m&&"L"!=l[m];++m);for(var r=x;m>r;)if(i.test(l[r])){r>x&&v.splice(y,0,new b(1,x,r));var z=r;for(++r;m>r&&i.test(l[r]);++r);v.splice(y,0,new b(2,z,r)),x=r}else++r;m>x&&v.splice(y,0,new b(1,x,m))}return 1==v[0].level&&(u=c.match(/^\s+/))&&(v[0].from=u[0].length,v.unshift(new b(0,0,u[0].length))),1==Ae(v).level&&(u=c.match(/\s+$/))&&(Ae(v).to-=u[0].length,v.push(new b(0,k-u[0].length,k))),2==v[0].level&&v.unshift(new b(1,v[0].to,v[0].to)),v[0].level!=Ae(v).level&&v.push(new b(v[0].level,k,k)),v}}();return a.version="5.2.0",a}),function(a){"object"==typeof exports&&"object"==typeof module?a(require("../../lib/codemirror")):"function"==typeof define&&define.amd?define(["../../lib/codemirror"],a):a(CodeMirror)}(function(a){"use strict";function b(a){for(var b={},c=a.split(" "),d=0;d<c.length;++d)b[c[d]]=!0;return b}function c(a,b){if(!b.startOfLine)return!1;for(;;){if(!a.skipTo("\\")){a.skipToEnd(),b.tokenize=null;break}if(a.next(),a.eol()){b.tokenize=c;break}}return"meta"}function d(a,b){if(a.backUp(1),a.match(/(R|u8R|uR|UR|LR)/)){var c=a.match(/"([^\s\\()]{0,16})\(/);return c?(b.cpp11RawStringDelim=c[1],b.tokenize=f,f(a,b)):!1}return a.match(/(u8|u|U|L)/)?a.match(/["']/,!1)?"string":!1:(a.next(),!1)}function e(a,b){for(var c;null!=(c=a.next());)if('"'==c&&!a.eat('"')){b.tokenize=null;break}return"string"}function f(a,b){var c=b.cpp11RawStringDelim.replace(/[^\w\s]/g,"\\$&"),d=a.match(new RegExp(".*?\\)"+c+'"'));return d?b.tokenize=null:a.skipToEnd(),"string"}function g(b,c){function d(a){if(a)for(var b in a)a.hasOwnProperty(b)&&e.push(b)}"string"==typeof b&&(b=[b]);var e=[];d(c.keywords),d(c.builtin),d(c.atoms),e.length&&(c.helperType=b[0],a.registerHelper("hintWords",b[0],e));for(var f=0;f<b.length;++f)a.defineMIME(b[f],c)}function h(a,b){for(var c=!1;!a.eol();){if(!c&&a.match('"""')){b.tokenize=null;break}c="\\"==a.next()&&!c}return"string"}a.defineMode("clike",function(b,c){function d(a,b){var c=a.next();if(r[c]){var d=r[c](a,b);if(d!==!1)return d}if('"'==c||"'"==c)return b.tokenize=e(c),b.tokenize(a,b);if(/[\[\]{}\(\),;\:\.]/.test(c))return j=c,null;if(/\d/.test(c))return a.eatWhile(/[\w\.]/),"number";if("/"==c){if(a.eat("*"))return b.tokenize=f,f(a,b);if(a.eat("/"))return a.skipToEnd(),"comment"}if(u.test(c))return a.eatWhile(u),"operator";a.eatWhile(/[\w\$_\xa1-\uffff]/);var g=a.current();return n.propertyIsEnumerable(g)?(p.propertyIsEnumerable(g)&&(j="newstatement"),"keyword"):o.propertyIsEnumerable(g)?(p.propertyIsEnumerable(g)&&(j="newstatement"),"builtin"):q.propertyIsEnumerable(g)?"atom":"variable"}function e(a){return function(b,c){for(var d,e=!1,f=!1;null!=(d=b.next());){if(d==a&&!e){f=!0;break}e=!e&&"\\"==d}return(f||!e&&!s)&&(c.tokenize=null),"string"}}function f(a,b){for(var c,d=!1;c=a.next();){if("/"==c&&d){b.tokenize=null;break}d="*"==c}return"comment"}function g(a,b,c,d,e){this.indented=a,this.column=b,this.type=c,this.align=d,this.prev=e}function h(a,b,c){var d=a.indented;return a.context&&"statement"==a.context.type&&(d=a.context.indented),a.context=new g(d,b,c,null,a.context)}function i(a){var b=a.context.type;return(")"==b||"]"==b||"}"==b)&&(a.indented=a.context.indented),a.context=a.context.prev}var j,k=b.indentUnit,l=c.statementIndentUnit||k,m=c.dontAlignCalls,n=c.keywords||{},o=c.builtin||{},p=c.blockKeywords||{},q=c.atoms||{},r=c.hooks||{},s=c.multiLineStrings,t=c.indentStatements!==!1,u=/[+\-*&%=<>!?|\/]/;return{startState:function(a){return{tokenize:null,context:new g((a||0)-k,0,"top",!1),indented:0,startOfLine:!0}},token:function(a,b){var c=b.context;if(a.sol()&&(null==c.align&&(c.align=!1),b.indented=a.indentation(),b.startOfLine=!0),a.eatSpace())return null;j=null;var e=(b.tokenize||d)(a,b);if("comment"==e||"meta"==e)return e;if(null==c.align&&(c.align=!0),";"!=j&&":"!=j&&","!=j||"statement"!=c.type)if("{"==j)h(b,a.column(),"}");else if("["==j)h(b,a.column(),"]");else if("("==j)h(b,a.column(),")");else if("}"==j){for(;"statement"==c.type;)c=i(b);for("}"==c.type&&(c=i(b));"statement"==c.type;)c=i(b)}else j==c.type?i(b):t&&(("}"==c.type||"top"==c.type)&&";"!=j||"statement"==c.type&&"newstatement"==j)&&h(b,a.column(),"statement");else i(b);return b.startOfLine=!1,e},indent:function(b,c){if(b.tokenize!=d&&null!=b.tokenize)return a.Pass;var e=b.context,f=c&&c.charAt(0);"statement"==e.type&&"}"==f&&(e=e.prev);var g=f==e.type;return"statement"==e.type?e.indented+("{"==f?0:l):!e.align||m&&")"==e.type?")"!=e.type||g?e.indented+(g?0:k):e.indented+l:e.column+(g?0:1)},electricChars:"{}",blockCommentStart:"/*",blockCommentEnd:"*/",lineComment:"//",fold:"brace"}});var i="auto if break int case long char register continue return default short do sizeof double static else struct switch extern typedef float union for unsigned goto while enum void const signed volatile";g(["text/x-csrc","text/x-c","text/x-chdr"],{name:"clike",keywords:b(i),blockKeywords:b("case do else for if switch while struct"),atoms:b("null"),hooks:{"#":c},modeProps:{fold:["brace","include"]}}),g(["text/x-c++src","text/x-c++hdr"],{name:"clike",keywords:b(i+" asm dynamic_cast namespace reinterpret_cast try bool explicit new static_cast typeid catch operator template typename class friend private this using const_cast inline public throw virtual delete mutable protected wchar_t alignas alignof constexpr decltype nullptr noexcept thread_local final static_assert override"),blockKeywords:b("catch class do else finally for if struct switch try while"),atoms:b("true false null"),hooks:{"#":c,u:d,U:d,L:d,R:d},modeProps:{fold:["brace","include"]}}),g("text/x-java",{name:"clike",keywords:b("abstract assert boolean break byte case catch char class const continue default do double else enum extends final finally float for goto if implements import instanceof int interface long native new package private protected public return short static strictfp super switch synchronized this throw throws transient try void volatile while"),blockKeywords:b("catch class do else finally for if switch try while"),atoms:b("true false null"),hooks:{"@":function(a){return a.eatWhile(/[\w\$_]/),"meta"}},modeProps:{fold:["brace","import"]}}),g("text/x-csharp",{name:"clike",keywords:b("abstract as base break case catch checked class const continue default delegate do else enum event explicit extern finally fixed for foreach goto if implicit in interface internal is lock namespace new operator out override params private protected public readonly ref return sealed sizeof stackalloc static struct switch this throw try typeof unchecked unsafe using virtual void volatile while add alias ascending descending dynamic from get global group into join let orderby partial remove select set value var yield"),blockKeywords:b("catch class do else finally for foreach if struct switch try while"),builtin:b("Boolean Byte Char DateTime DateTimeOffset Decimal Double Guid Int16 Int32 Int64 Object SByte Single String TimeSpan UInt16 UInt32 UInt64 bool byte char decimal double short int long object sbyte float string ushort uint ulong"),atoms:b("true false null"),hooks:{"@":function(a,b){return a.eat('"')?(b.tokenize=e,e(a,b)):(a.eatWhile(/[\w\$_]/),"meta")}}}),g("text/x-scala",{name:"clike",keywords:b("abstract case catch class def do else extends false final finally for forSome if implicit import lazy match new null object override package private protected return sealed super this throw trait try trye type val var while with yield _ : = => <- <: <% >: # @ assert assume require print println printf readLine readBoolean readByte readShort readChar readInt readLong readFloat readDouble AnyVal App Application Array BufferedIterator BigDecimal BigInt Char Console Either Enumeration Equiv Error Exception Fractional Function IndexedSeq Integral Iterable Iterator List Map Numeric Nil NotNull Option Ordered Ordering PartialFunction PartialOrdering Product Proxy Range Responder Seq Serializable Set Specializable Stream StringBuilder StringContext Symbol Throwable Traversable TraversableOnce Tuple Unit Vector :: #:: Boolean Byte Character CharSequence Class ClassLoader Cloneable Comparable Compiler Double Exception Float Integer Long Math Number Object Package Pair Process Runtime Runnable SecurityManager Short StackTraceElement StrictMath String StringBuffer System Thread ThreadGroup ThreadLocal Throwable Triple Void"),multiLineStrings:!0,blockKeywords:b("catch class do else finally for forSome if match switch try while"),atoms:b("true false null"),indentStatements:!1,hooks:{"@":function(a){return a.eatWhile(/[\w\$_]/),"meta"},'"':function(a,b){return a.match('""')?(b.tokenize=h,b.tokenize(a,b)):!1},"'":function(a){return a.eatWhile(/[\w\$_\xa1-\uffff]/),"atom"}},modeProps:{closeBrackets:{triples:'"'}}}),g(["x-shader/x-vertex","x-shader/x-fragment"],{name:"clike",keywords:b("float int bool void vec2 vec3 vec4 ivec2 ivec3 ivec4 bvec2 bvec3 bvec4 mat2 mat3 mat4 sampler1D sampler2D sampler3D samplerCube sampler1DShadow sampler2DShadow const attribute uniform varying break continue discard return for while do if else struct in out inout"),blockKeywords:b("for while do if else struct"),builtin:b("radians degrees sin cos tan asin acos atan pow exp log exp2 sqrt inversesqrt abs sign floor ceil fract mod min max clamp mix step smoothstep length distance dot cross normalize ftransform faceforward reflect refract matrixCompMult lessThan lessThanEqual greaterThan greaterThanEqual equal notEqual any all not texture1D texture1DProj texture1DLod texture1DProjLod texture2D texture2DProj texture2DLod texture2DProjLod texture3D texture3DProj texture3DLod texture3DProjLod textureCube textureCubeLod shadow1D shadow2D shadow1DProj shadow2DProj shadow1DLod shadow2DLod shadow1DProjLod shadow2DProjLod dFdx dFdy fwidth noise1 noise2 noise3 noise4"),
|
6 |
-
atoms:b("true false gl_FragColor gl_SecondaryColor gl_Normal gl_Vertex gl_MultiTexCoord0 gl_MultiTexCoord1 gl_MultiTexCoord2 gl_MultiTexCoord3 gl_MultiTexCoord4 gl_MultiTexCoord5 gl_MultiTexCoord6 gl_MultiTexCoord7 gl_FogCoord gl_PointCoord gl_Position gl_PointSize gl_ClipVertex gl_FrontColor gl_BackColor gl_FrontSecondaryColor gl_BackSecondaryColor gl_TexCoord gl_FogFragCoord gl_FragCoord gl_FrontFacing gl_FragData gl_FragDepth gl_ModelViewMatrix gl_ProjectionMatrix gl_ModelViewProjectionMatrix gl_TextureMatrix gl_NormalMatrix gl_ModelViewMatrixInverse gl_ProjectionMatrixInverse gl_ModelViewProjectionMatrixInverse gl_TexureMatrixTranspose gl_ModelViewMatrixInverseTranspose gl_ProjectionMatrixInverseTranspose gl_ModelViewProjectionMatrixInverseTranspose gl_TextureMatrixInverseTranspose gl_NormalScale gl_DepthRange gl_ClipPlane gl_Point gl_FrontMaterial gl_BackMaterial gl_LightSource gl_LightModel gl_FrontLightModelProduct gl_BackLightModelProduct gl_TextureColor gl_EyePlaneS gl_EyePlaneT gl_EyePlaneR gl_EyePlaneQ gl_FogParameters gl_MaxLights gl_MaxClipPlanes gl_MaxTextureUnits gl_MaxTextureCoords gl_MaxVertexAttribs gl_MaxVertexUniformComponents gl_MaxVaryingFloats gl_MaxVertexTextureImageUnits gl_MaxTextureImageUnits gl_MaxFragmentUniformComponents gl_MaxCombineTextureImageUnits gl_MaxDrawBuffers"),hooks:{"#":c},modeProps:{fold:["brace","include"]}}),g("text/x-nesc",{name:"clike",keywords:b(i+"as atomic async call command component components configuration event generic implementation includes interface module new norace nx_struct nx_union post provides signal task uses abstract extends"),blockKeywords:b("case do else for if switch while struct"),atoms:b("null"),hooks:{"#":c},modeProps:{fold:["brace","include"]}}),g("text/x-objectivec",{name:"clike",keywords:b(i+"inline restrict _Bool _Complex _Imaginery BOOL Class bycopy byref id IMP in inout nil oneway out Protocol SEL self super atomic nonatomic retain copy readwrite readonly"),atoms:b("YES NO NULL NILL ON OFF"),hooks:{"@":function(a){return a.eatWhile(/[\w\$]/),"keyword"},"#":c},modeProps:{fold:"brace"}})}),function(a){"object"==typeof exports&&"object"==typeof module?a(require("../../lib/codemirror"),require("../htmlmixed/htmlmixed"),require("../clike/clike")):"function"==typeof define&&define.amd?define(["../../lib/codemirror","../htmlmixed/htmlmixed","../clike/clike"],a):a(CodeMirror)}(function(a){"use strict";function b(a){for(var b={},c=a.split(" "),d=0;d<c.length;++d)b[c[d]]=!0;return b}function c(a,b){return 0==a.length?d(b):function(e,f){for(var g=a[0],h=0;h<g.length;h++)if(e.match(g[h][0]))return f.tokenize=c(a.slice(1),b),g[h][1];return f.tokenize=d(b),"string"}}function d(a){return function(b,c){return e(b,c,a)}}function e(a,b,d){if(a.match("${",!1)||a.match("{$",!1))return b.tokenize=null,"string";if(a.match(/^\$[a-zA-Z_][a-zA-Z0-9_]*/))return a.match("[",!1)&&(b.tokenize=c([[["[",null]],[[/\d[\w\.]*/,"number"],[/\$[a-zA-Z_][a-zA-Z0-9_]*/,"variable-2"],[/[\w\$]+/,"variable"]],[["]",null]]],d)),a.match(/\-\>\w/,!1)&&(b.tokenize=c([[["->",null]],[[/[\w]+/,"variable"]]],d)),"variable-2";for(var e=!1;!a.eol()&&(e||!a.match("{$",!1)&&!a.match(/^(\$[a-zA-Z_][a-zA-Z0-9_]*|\$\{)/,!1));){if(!e&&a.match(d)){b.tokenize=null,b.tokStack.pop(),b.tokStack.pop();break}e="\\"==a.next()&&!e}return"string"}var f="abstract and array as break case catch class clone const continue declare default do else elseif enddeclare endfor endforeach endif endswitch endwhile extends final for foreach function global goto if implements interface instanceof namespace new or private protected public static switch throw trait try use var while xor die echo empty exit eval include include_once isset list require require_once return print unset __halt_compiler self static parent yield insteadof finally",g="true false null TRUE FALSE NULL __CLASS__ __DIR__ __FILE__ __LINE__ __METHOD__ __FUNCTION__ __NAMESPACE__ __TRAIT__",h="func_num_args func_get_arg func_get_args strlen strcmp strncmp strcasecmp strncasecmp each error_reporting define defined trigger_error user_error set_error_handler restore_error_handler get_declared_classes get_loaded_extensions extension_loaded get_extension_funcs debug_backtrace constant bin2hex hex2bin sleep usleep time mktime gmmktime strftime gmstrftime strtotime date gmdate getdate localtime checkdate flush wordwrap htmlspecialchars htmlentities html_entity_decode md5 md5_file crc32 getimagesize image_type_to_mime_type phpinfo phpversion phpcredits strnatcmp strnatcasecmp substr_count strspn strcspn strtok strtoupper strtolower strpos strrpos strrev hebrev hebrevc nl2br basename dirname pathinfo stripslashes stripcslashes strstr stristr strrchr str_shuffle str_word_count strcoll substr substr_replace quotemeta ucfirst ucwords strtr addslashes addcslashes rtrim str_replace str_repeat count_chars chunk_split trim ltrim strip_tags similar_text explode implode setlocale localeconv parse_str str_pad chop strchr sprintf printf vprintf vsprintf sscanf fscanf parse_url urlencode urldecode rawurlencode rawurldecode readlink linkinfo link unlink exec system escapeshellcmd escapeshellarg passthru shell_exec proc_open proc_close rand srand getrandmax mt_rand mt_srand mt_getrandmax base64_decode base64_encode abs ceil floor round is_finite is_nan is_infinite bindec hexdec octdec decbin decoct dechex base_convert number_format fmod ip2long long2ip getenv putenv getopt microtime gettimeofday getrusage uniqid quoted_printable_decode set_time_limit get_cfg_var magic_quotes_runtime set_magic_quotes_runtime get_magic_quotes_gpc get_magic_quotes_runtime import_request_variables error_log serialize unserialize memory_get_usage var_dump var_export debug_zval_dump print_r highlight_file show_source highlight_string ini_get ini_get_all ini_set ini_alter ini_restore get_include_path set_include_path restore_include_path setcookie header headers_sent connection_aborted connection_status ignore_user_abort parse_ini_file is_uploaded_file move_uploaded_file intval floatval doubleval strval gettype settype is_null is_resource is_bool is_long is_float is_int is_integer is_double is_real is_numeric is_string is_array is_object is_scalar ereg ereg_replace eregi eregi_replace split spliti join sql_regcase dl pclose popen readfile rewind rmdir umask fclose feof fgetc fgets fgetss fread fopen fpassthru ftruncate fstat fseek ftell fflush fwrite fputs mkdir rename copy tempnam tmpfile file file_get_contents stream_select stream_context_create stream_context_set_params stream_context_set_option stream_context_get_options stream_filter_prepend stream_filter_append fgetcsv flock get_meta_tags stream_set_write_buffer set_file_buffer set_socket_blocking stream_set_blocking socket_set_blocking stream_get_meta_data stream_register_wrapper stream_wrapper_register stream_set_timeout socket_set_timeout socket_get_status realpath fnmatch fsockopen pfsockopen pack unpack get_browser crypt opendir closedir chdir getcwd rewinddir readdir dir glob fileatime filectime filegroup fileinode filemtime fileowner fileperms filesize filetype file_exists is_writable is_writeable is_readable is_executable is_file is_dir is_link stat lstat chown touch clearstatcache mail ob_start ob_flush ob_clean ob_end_flush ob_end_clean ob_get_flush ob_get_clean ob_get_length ob_get_level ob_get_status ob_get_contents ob_implicit_flush ob_list_handlers ksort krsort natsort natcasesort asort arsort sort rsort usort uasort uksort shuffle array_walk count end prev next reset current key min max in_array array_search extract compact array_fill range array_multisort array_push array_pop array_shift array_unshift array_splice array_slice array_merge array_merge_recursive array_keys array_values array_count_values array_reverse array_reduce array_pad array_flip array_change_key_case array_rand array_unique array_intersect array_intersect_assoc array_diff array_diff_assoc array_sum array_filter array_map array_chunk array_key_exists pos sizeof key_exists assert assert_options version_compare ftok str_rot13 aggregate session_name session_module_name session_save_path session_id session_regenerate_id session_decode session_register session_unregister session_is_registered session_encode session_start session_destroy session_unset session_set_save_handler session_cache_limiter session_cache_expire session_set_cookie_params session_get_cookie_params session_write_close preg_match preg_match_all preg_replace preg_replace_callback preg_split preg_quote preg_grep overload ctype_alnum ctype_alpha ctype_cntrl ctype_digit ctype_lower ctype_graph ctype_print ctype_punct ctype_space ctype_upper ctype_xdigit virtual apache_request_headers apache_note apache_lookup_uri apache_child_terminate apache_setenv apache_response_headers apache_get_version getallheaders mysql_connect mysql_pconnect mysql_close mysql_select_db mysql_create_db mysql_drop_db mysql_query mysql_unbuffered_query mysql_db_query mysql_list_dbs mysql_list_tables mysql_list_fields mysql_list_processes mysql_error mysql_errno mysql_affected_rows mysql_insert_id mysql_result mysql_num_rows mysql_num_fields mysql_fetch_row mysql_fetch_array mysql_fetch_assoc mysql_fetch_object mysql_data_seek mysql_fetch_lengths mysql_fetch_field mysql_field_seek mysql_free_result mysql_field_name mysql_field_table mysql_field_len mysql_field_type mysql_field_flags mysql_escape_string mysql_real_escape_string mysql_stat mysql_thread_id mysql_client_encoding mysql_get_client_info mysql_get_host_info mysql_get_proto_info mysql_get_server_info mysql_info mysql mysql_fieldname mysql_fieldtable mysql_fieldlen mysql_fieldtype mysql_fieldflags mysql_selectdb mysql_createdb mysql_dropdb mysql_freeresult mysql_numfields mysql_numrows mysql_listdbs mysql_listtables mysql_listfields mysql_db_name mysql_dbname mysql_tablename mysql_table_name pg_connect pg_pconnect pg_close pg_connection_status pg_connection_busy pg_connection_reset pg_host pg_dbname pg_port pg_tty pg_options pg_ping pg_query pg_send_query pg_cancel_query pg_fetch_result pg_fetch_row pg_fetch_assoc pg_fetch_array pg_fetch_object pg_fetch_all pg_affected_rows pg_get_result pg_result_seek pg_result_status pg_free_result pg_last_oid pg_num_rows pg_num_fields pg_field_name pg_field_num pg_field_size pg_field_type pg_field_prtlen pg_field_is_null pg_get_notify pg_get_pid pg_result_error pg_last_error pg_last_notice pg_put_line pg_end_copy pg_copy_to pg_copy_from pg_trace pg_untrace pg_lo_create pg_lo_unlink pg_lo_open pg_lo_close pg_lo_read pg_lo_write pg_lo_read_all pg_lo_import pg_lo_export pg_lo_seek pg_lo_tell pg_escape_string pg_escape_bytea pg_unescape_bytea pg_client_encoding pg_set_client_encoding pg_meta_data pg_convert pg_insert pg_update pg_delete pg_select pg_exec pg_getlastoid pg_cmdtuples pg_errormessage pg_numrows pg_numfields pg_fieldname pg_fieldsize pg_fieldtype pg_fieldnum pg_fieldprtlen pg_fieldisnull pg_freeresult pg_result pg_loreadall pg_locreate pg_lounlink pg_loopen pg_loclose pg_loread pg_lowrite pg_loimport pg_loexport http_response_code get_declared_traits getimagesizefromstring socket_import_stream stream_set_chunk_size trait_exists header_register_callback class_uses session_status session_register_shutdown echo print global static exit array empty eval isset unset die include require include_once require_once json_decode json_encode json_last_error json_last_error_msg curl_close curl_copy_handle curl_errno curl_error curl_escape curl_exec curl_file_create curl_getinfo curl_init curl_multi_add_handle curl_multi_close curl_multi_exec curl_multi_getcontent curl_multi_info_read curl_multi_init curl_multi_remove_handle curl_multi_select curl_multi_setopt curl_multi_strerror curl_pause curl_reset curl_setopt_array curl_setopt curl_share_close curl_share_init curl_share_setopt curl_strerror curl_unescape curl_version mysqli_affected_rows mysqli_autocommit mysqli_change_user mysqli_character_set_name mysqli_close mysqli_commit mysqli_connect_errno mysqli_connect_error mysqli_connect mysqli_data_seek mysqli_debug mysqli_dump_debug_info mysqli_errno mysqli_error_list mysqli_error mysqli_fetch_all mysqli_fetch_array mysqli_fetch_assoc mysqli_fetch_field_direct mysqli_fetch_field mysqli_fetch_fields mysqli_fetch_lengths mysqli_fetch_object mysqli_fetch_row mysqli_field_count mysqli_field_seek mysqli_field_tell mysqli_free_result mysqli_get_charset mysqli_get_client_info mysqli_get_client_stats mysqli_get_client_version mysqli_get_connection_stats mysqli_get_host_info mysqli_get_proto_info mysqli_get_server_info mysqli_get_server_version mysqli_info mysqli_init mysqli_insert_id mysqli_kill mysqli_more_results mysqli_multi_query mysqli_next_result mysqli_num_fields mysqli_num_rows mysqli_options mysqli_ping mysqli_prepare mysqli_query mysqli_real_connect mysqli_real_escape_string mysqli_real_query mysqli_reap_async_query mysqli_refresh mysqli_rollback mysqli_select_db mysqli_set_charset mysqli_set_local_infile_default mysqli_set_local_infile_handler mysqli_sqlstate mysqli_ssl_set mysqli_stat mysqli_stmt_init mysqli_store_result mysqli_thread_id mysqli_thread_safe mysqli_use_result mysqli_warning_count";a.registerHelper("hintWords","php",[f,g,h].join(" ").split(" ")),a.registerHelper("wordChars","php",/[\w$]/);var i={name:"clike",helperType:"php",keywords:b(f),blockKeywords:b("catch do else elseif for foreach if switch try while finally"),atoms:b(g),builtin:b(h),multiLineStrings:!0,hooks:{$:function(a){return a.eatWhile(/[\w\$_]/),"variable-2"},"<":function(a,b){if(a.match(/<</)){a.eatWhile(/[\w\.]/);var c=a.current().slice(3);if(c)return(b.tokStack||(b.tokStack=[])).push(c,0),b.tokenize=d(c),"string"}return!1},"#":function(a){for(;!a.eol()&&!a.match("?>",!1);)a.next();return"comment"},"/":function(a){if(a.eat("/")){for(;!a.eol()&&!a.match("?>",!1);)a.next();return"comment"}return!1},'"':function(a,b){return(b.tokStack||(b.tokStack=[])).push('"',0),b.tokenize=d('"'),"string"},"{":function(a,b){return b.tokStack&&b.tokStack.length&&b.tokStack[b.tokStack.length-1]++,!1},"}":function(a,b){return b.tokStack&&b.tokStack.length>0&&!--b.tokStack[b.tokStack.length-1]&&(b.tokenize=d(b.tokStack[b.tokStack.length-2])),!1}}};a.defineMode("php",function(b,c){function d(a,b){var c=b.curMode==f;if(a.sol()&&b.pending&&'"'!=b.pending&&"'"!=b.pending&&(b.pending=null),c)return c&&null==b.php.tokenize&&a.match("?>")?(b.curMode=e,b.curState=b.html,"meta"):f.token(a,b.curState);if(a.match(/^<\?\w*/))return b.curMode=f,b.curState=b.php,"meta";if('"'==b.pending||"'"==b.pending){for(;!a.eol()&&a.next()!=b.pending;);var d="string"}else if(b.pending&&a.pos<b.pending.end){a.pos=b.pending.end;var d=b.pending.style}else var d=e.token(a,b.curState);b.pending&&(b.pending=null);var g,h=a.current(),i=h.search(/<\?/);return-1!=i&&("string"==d&&(g=h.match(/[\'\"]$/))&&!/\?>/.test(h)?b.pending=g[0]:b.pending={end:a.pos,style:d},a.backUp(h.length-i)),d}var e=a.getMode(b,"text/html"),f=a.getMode(b,i);return{startState:function(){var b=a.startState(e),d=a.startState(f);return{html:b,php:d,curMode:c.startOpen?f:e,curState:c.startOpen?d:b,pending:null}},copyState:function(b){var c,d=b.html,g=a.copyState(e,d),h=b.php,i=a.copyState(f,h);return c=b.curMode==e?g:i,{html:g,php:i,curMode:b.curMode,curState:c,pending:b.pending}},token:d,indent:function(a,b){return a.curMode!=f&&/^\s*<\//.test(b)||a.curMode==f&&/^\?>/.test(b)?e.indent(a.html,b):a.curMode.indent(a.curState,b)},blockCommentStart:"/*",blockCommentEnd:"*/",lineComment:"//",innerMode:function(a){return{state:a.curState,mode:a.curMode}}}},"htmlmixed","clike"),a.defineMIME("application/x-httpd-php","php"),a.defineMIME("application/x-httpd-php-open",{name:"php",startOpen:!0}),a.defineMIME("text/x-php",i)}),function(a){"object"==typeof exports&&"object"==typeof module?a(require("../../lib/codemirror")):"function"==typeof define&&define.amd?define(["../../lib/codemirror"],a):a(CodeMirror)}(function(a){"use strict";function b(a,b,e,f){if(this.atOccurrence=!1,this.doc=a,null==f&&"string"==typeof b&&(f=!1),e=e?a.clipPos(e):d(0,0),this.pos={from:e,to:e},"string"!=typeof b)b.global||(b=new RegExp(b.source,b.ignoreCase?"ig":"g")),this.matches=function(c,e){if(c){b.lastIndex=0;for(var f,g,h=a.getLine(e.line).slice(0,e.ch),i=0;;){b.lastIndex=i;var j=b.exec(h);if(!j)break;if(f=j,g=f.index,i=f.index+(f[0].length||1),i==h.length)break}var k=f&&f[0].length||0;k||(0==g&&0==h.length?f=void 0:g!=a.getLine(e.line).length&&k++)}else{b.lastIndex=e.ch;var h=a.getLine(e.line),f=b.exec(h),k=f&&f[0].length||0,g=f&&f.index;g+k==h.length||k||(k=1)}return f&&k?{from:d(e.line,g),to:d(e.line,g+k),match:f}:void 0};else{var g=b;f&&(b=b.toLowerCase());var h=f?function(a){return a.toLowerCase()}:function(a){return a},i=b.split("\n");if(1==i.length)b.length?this.matches=function(e,f){if(e){var i=a.getLine(f.line).slice(0,f.ch),j=h(i),k=j.lastIndexOf(b);if(k>-1)return k=c(i,j,k),{from:d(f.line,k),to:d(f.line,k+g.length)}}else{var i=a.getLine(f.line).slice(f.ch),j=h(i),k=j.indexOf(b);if(k>-1)return k=c(i,j,k)+f.ch,{from:d(f.line,k),to:d(f.line,k+g.length)}}}:this.matches=function(){};else{var j=g.split("\n");this.matches=function(b,c){var e=i.length-1;if(b){if(c.line-(i.length-1)<a.firstLine())return;if(h(a.getLine(c.line).slice(0,j[e].length))!=i[i.length-1])return;for(var f=d(c.line,j[e].length),g=c.line-1,k=e-1;k>=1;--k,--g)if(i[k]!=h(a.getLine(g)))return;var l=a.getLine(g),m=l.length-j[0].length;if(h(l.slice(m))!=i[0])return;return{from:d(g,m),to:f}}if(!(c.line+(i.length-1)>a.lastLine())){var l=a.getLine(c.line),m=l.length-j[0].length;if(h(l.slice(m))==i[0]){for(var n=d(c.line,m),g=c.line+1,k=1;e>k;++k,++g)if(i[k]!=h(a.getLine(g)))return;if(h(a.getLine(g).slice(0,j[e].length))==i[e])return{from:n,to:d(g,j[e].length)}}}}}}}function c(a,b,c){if(a.length==b.length)return c;for(var d=Math.min(c,a.length);;){var e=a.slice(0,d).toLowerCase().length;if(c>e)++d;else{if(!(e>c))return d;--d}}}var d=a.Pos;b.prototype={findNext:function(){return this.find(!1)},findPrevious:function(){return this.find(!0)},find:function(a){function b(a){var b=d(a,0);return c.pos={from:b,to:b},c.atOccurrence=!1,!1}for(var c=this,e=this.doc.clipPos(a?this.pos.from:this.pos.to);;){if(this.pos=this.matches(a,e))return this.atOccurrence=!0,this.pos.match||!0;if(a){if(!e.line)return b(0);e=d(e.line-1,this.doc.getLine(e.line-1).length)}else{var f=this.doc.lineCount();if(e.line==f-1)return b(f);e=d(e.line+1,0)}}},from:function(){return this.atOccurrence?this.pos.from:void 0},to:function(){return this.atOccurrence?this.pos.to:void 0},replace:function(b,c){if(this.atOccurrence){var e=a.splitLines(b);this.doc.replaceRange(e,this.pos.from,this.pos.to,c),this.pos.to=d(this.pos.from.line+e.length-1,e[e.length-1].length+(1==e.length?this.pos.from.ch:0))}}},a.defineExtension("getSearchCursor",function(a,c,d){return new b(this.doc,a,c,d)}),a.defineDocExtension("getSearchCursor",function(a,c,d){return new b(this,a,c,d)}),a.defineExtension("selectMatches",function(b,c){for(var d,e=[],f=this.getSearchCursor(b,this.getCursor("from"),c);(d=f.findNext())&&!(a.cmpPos(f.to(),this.getCursor("to"))>0);)e.push({anchor:f.from(),head:f.to()});e.length&&this.setSelections(e,0)})}),function(a){"object"==typeof exports&&"object"==typeof module?a(require("../../lib/codemirror"),require("./searchcursor"),require("../dialog/dialog")):"function"==typeof define&&define.amd?define(["../../lib/codemirror","./searchcursor","../dialog/dialog"],a):a(CodeMirror)}(function(a){"use strict";function b(a,b){return"string"==typeof a?a=new RegExp(a.replace(/[\-\[\]\/\{\}\(\)\*\+\?\.\\\^\$\|]/g,"\\$&"),b?"gi":"g"):a.global||(a=new RegExp(a.source,a.ignoreCase?"gi":"g")),{token:function(b){a.lastIndex=b.pos;var c=a.exec(b.string);return c&&c.index==b.pos?(b.pos+=c[0].length,"searching"):void(c?b.pos=c.index:b.skipToEnd())}}}function c(){this.posFrom=this.posTo=this.lastQuery=this.query=null,this.overlay=null}function d(a){return a.state.search||(a.state.search=new c)}function e(a){return"string"==typeof a&&a==a.toLowerCase()}function f(a,b,c){return a.getSearchCursor(b,c,e(b))}function g(a,b,c,d,e){a.openDialog?a.openDialog(b,e,{value:d,selectValueOnOpen:!0}):e(prompt(c,d))}function h(a,b,c,d){a.openConfirm?a.openConfirm(b,d):confirm(c)&&d[0]()}function i(a){var b=a.match(/^\/(.*)\/([a-z]*)$/);if(b)try{a=new RegExp(b[1],-1==b[2].indexOf("i")?"":"i")}catch(c){}return("string"==typeof a?""==a:a.test(""))&&(a=/x^/),a}function j(a,c){var f=d(a);if(f.query)return k(a,c);var h=a.getSelection()||f.lastQuery;g(a,n,"Search for:",h,function(d){a.operation(function(){d&&!f.query&&(f.query=i(d),a.removeOverlay(f.overlay,e(f.query)),f.overlay=b(f.query,e(f.query)),a.addOverlay(f.overlay),a.showMatchesOnScrollbar&&(f.annotate&&(f.annotate.clear(),f.annotate=null),f.annotate=a.showMatchesOnScrollbar(f.query,e(f.query))),f.posFrom=f.posTo=a.getCursor(),k(a,c))})})}function k(b,c){b.operation(function(){var e=d(b),g=f(b,e.query,c?e.posFrom:e.posTo);(g.find(c)||(g=f(b,e.query,c?a.Pos(b.lastLine()):a.Pos(b.firstLine(),0)),g.find(c)))&&(b.setSelection(g.from(),g.to()),b.scrollIntoView({from:g.from(),to:g.to()}),e.posFrom=g.from(),e.posTo=g.to())})}function l(a){a.operation(function(){var b=d(a);b.lastQuery=b.query,b.query&&(b.query=null,a.removeOverlay(b.overlay),b.annotate&&(b.annotate.clear(),b.annotate=null))})}function m(a,b){if(!a.getOption("readOnly")){var c=a.getSelection()||d().lastQuery;g(a,o,"Replace:",c,function(c){c&&(c=i(c),g(a,p,"Replace with:","",function(d){if(b)a.operation(function(){for(var b=f(a,c);b.findNext();)if("string"!=typeof c){var e=a.getRange(b.from(),b.to()).match(c);b.replace(d.replace(/\$(\d)/g,function(a,b){return e[b]}))}else b.replace(d)});else{l(a);var e=f(a,c,a.getCursor()),g=function(){var b,d=e.from();!(b=e.findNext())&&(e=f(a,c),!(b=e.findNext())||d&&e.from().line==d.line&&e.from().ch==d.ch)||(a.setSelection(e.from(),e.to()),a.scrollIntoView({from:e.from(),to:e.to()}),h(a,q,"Replace?",[function(){i(b)},g]))},i=function(a){e.replace("string"==typeof c?d:d.replace(/\$(\d)/g,function(b,c){return a[c]})),g()};g()}}))})}}var n='Search: <input type="text" style="width: 10em" class="CodeMirror-search-field"/> <span style="color: #888" class="CodeMirror-search-hint">(Use /re/ syntax for regexp search)</span>',o='Replace: <input type="text" style="width: 10em" class="CodeMirror-search-field"/> <span style="color: #888" class="CodeMirror-search-hint">(Use /re/ syntax for regexp search)</span>',p='With: <input type="text" style="width: 10em" class="CodeMirror-search-field"/>',q="Replace? <button>Yes</button> <button>No</button> <button>Stop</button>";a.commands.find=function(a){l(a),j(a)},a.commands.findNext=j,a.commands.findPrev=function(a){j(a,!0)},a.commands.clearSearch=l,a.commands.replace=m,a.commands.replaceAll=function(a){m(a,!0)}}),function(a){"object"==typeof exports&&"object"==typeof module?a(require("../../lib/codemirror")):"function"==typeof define&&define.amd?define(["../../lib/codemirror"],a):a(CodeMirror)}(function(a){function b(a,b,d,e){var f=a.getLineHandle(b.line),i=b.ch-1,j=i>=0&&h[f.text.charAt(i)]||h[f.text.charAt(++i)];if(!j)return null;var k=">"==j.charAt(1)?1:-1;if(d&&k>0!=(i==b.ch))return null;var l=a.getTokenTypeAt(g(b.line,i+1)),m=c(a,g(b.line,i+(k>0?1:0)),k,l||null,e);return null==m?null:{from:g(b.line,i),to:m&&m.pos,match:m&&m.ch==j.charAt(0),forward:k>0}}function c(a,b,c,d,e){for(var f=e&&e.maxScanLineLength||1e4,i=e&&e.maxScanLines||1e3,j=[],k=e&&e.bracketRegex?e.bracketRegex:/[(){}[\]]/,l=c>0?Math.min(b.line+i,a.lastLine()+1):Math.max(a.firstLine()-1,b.line-i),m=b.line;m!=l;m+=c){var n=a.getLine(m);if(n){var o=c>0?0:n.length-1,p=c>0?n.length:-1;if(!(n.length>f))for(m==b.line&&(o=b.ch-(0>c?1:0));o!=p;o+=c){var q=n.charAt(o);if(k.test(q)&&(void 0===d||a.getTokenTypeAt(g(m,o+1))==d)){var r=h[q];if(">"==r.charAt(1)==c>0)j.push(q);else{if(!j.length)return{pos:g(m,o),ch:q};j.pop()}}}}}return m-c==(c>0?a.lastLine():a.firstLine())?!1:null}function d(a,c,d){for(var e=a.state.matchBrackets.maxHighlightLineLength||1e3,h=[],i=a.listSelections(),j=0;j<i.length;j++){var k=i[j].empty()&&b(a,i[j].head,!1,d);if(k&&a.getLine(k.from.line).length<=e){var l=k.match?"CodeMirror-matchingbracket":"CodeMirror-nonmatchingbracket";h.push(a.markText(k.from,g(k.from.line,k.from.ch+1),{className:l})),k.to&&a.getLine(k.to.line).length<=e&&h.push(a.markText(k.to,g(k.to.line,k.to.ch+1),{className:l}))}}if(h.length){f&&a.state.focused&&a.focus();var m=function(){a.operation(function(){for(var a=0;a<h.length;a++)h[a].clear()})};if(!c)return m;setTimeout(m,800)}}function e(a){a.operation(function(){i&&(i(),i=null),i=d(a,!1,a.state.matchBrackets)})}var f=/MSIE \d/.test(navigator.userAgent)&&(null==document.documentMode||document.documentMode<8),g=a.Pos,h={"(":")>",")":"(<","[":"]>","]":"[<","{":"}>","}":"{<"},i=null;a.defineOption("matchBrackets",!1,function(b,c,d){d&&d!=a.Init&&b.off("cursorActivity",e),c&&(b.state.matchBrackets="object"==typeof c?c:{},b.on("cursorActivity",e))}),a.defineExtension("matchBrackets",function(){d(this,!0)}),a.defineExtension("findMatchingBracket",function(a,c,d){return b(this,a,c,d)}),a.defineExtension("scanForBracket",function(a,b,d,e){return c(this,a,b,d,e)})});
|
1 |
+
!function(a){if("object"==typeof exports&&"object"==typeof module)module.exports=a();else{if("function"==typeof define&&define.amd)return define([],a);this.CodeMirror=a()}}(function(){"use strict";function a(c,d){if(!(this instanceof a))return new a(c,d);this.options=d=d?Je(d):{},Je(Xf,d,!1),n(d);var e=d.value;"string"==typeof e&&(e=new tg(e,d.mode,null,d.lineSeparator)),this.doc=e;var f=new a.inputStyles[d.inputStyle](this),g=this.display=new b(c,e,f);g.wrapper.CodeMirror=this,j(this),h(this),d.lineWrapping&&(this.display.wrapper.className+=" CodeMirror-wrap"),d.autofocus&&!zf&&g.input.focus(),r(this),this.state={keyMaps:[],overlays:[],modeGen:0,overwrite:!1,delayingBlurEvent:!1,focused:!1,suppressEdits:!1,pasteIncoming:!1,cutIncoming:!1,selectingText:!1,draggingText:!1,highlight:new Be,keySeq:null,specialChars:null};var i=this;pf&&11>qf&&setTimeout(function(){i.display.input.reset(!0)},20),Pb(this),Ve(),tb(this),this.curOp.forceUpdate=!0,Wd(this,e),d.autofocus&&!zf||i.hasFocus()?setTimeout(Ke(pc,this),20):qc(this);for(var k in Yf)Yf.hasOwnProperty(k)&&Yf[k](this,d[k],Zf);w(this),d.finishInit&&d.finishInit(this);for(var l=0;l<bg.length;++l)bg[l](this);vb(this),rf&&d.lineWrapping&&"optimizelegibility"==getComputedStyle(g.lineDiv).textRendering&&(g.lineDiv.style.textRendering="auto")}function b(a,b,c){var d=this;this.input=c,d.scrollbarFiller=Oe("div",null,"CodeMirror-scrollbar-filler"),d.scrollbarFiller.setAttribute("cm-not-content","true"),d.gutterFiller=Oe("div",null,"CodeMirror-gutter-filler"),d.gutterFiller.setAttribute("cm-not-content","true"),d.lineDiv=Oe("div",null,"CodeMirror-code"),d.selectionDiv=Oe("div",null,null,"position: relative; z-index: 1"),d.cursorDiv=Oe("div",null,"CodeMirror-cursors"),d.measure=Oe("div",null,"CodeMirror-measure"),d.lineMeasure=Oe("div",null,"CodeMirror-measure"),d.lineSpace=Oe("div",[d.measure,d.lineMeasure,d.selectionDiv,d.cursorDiv,d.lineDiv],null,"position: relative; outline: none"),d.mover=Oe("div",[Oe("div",[d.lineSpace],"CodeMirror-lines")],null,"position: relative"),d.sizer=Oe("div",[d.mover],"CodeMirror-sizer"),d.sizerWidth=null,d.heightForcer=Oe("div",null,null,"position: absolute; height: "+Dg+"px; width: 1px;"),d.gutters=Oe("div",null,"CodeMirror-gutters"),d.lineGutter=null,d.scroller=Oe("div",[d.sizer,d.heightForcer,d.gutters],"CodeMirror-scroll"),d.scroller.setAttribute("tabIndex","-1"),d.wrapper=Oe("div",[d.scrollbarFiller,d.gutterFiller,d.scroller],"CodeMirror"),pf&&8>qf&&(d.gutters.style.zIndex=-1,d.scroller.style.paddingRight=0),rf||mf&&zf||(d.scroller.draggable=!0),a&&(a.appendChild?a.appendChild(d.wrapper):a(d.wrapper)),d.viewFrom=d.viewTo=b.first,d.reportedViewFrom=d.reportedViewTo=b.first,d.view=[],d.renderedView=null,d.externalMeasured=null,d.viewOffset=0,d.lastWrapHeight=d.lastWrapWidth=0,d.updateLineNumbers=null,d.nativeBarWidth=d.barHeight=d.barWidth=0,d.scrollbarsClipped=!1,d.lineNumWidth=d.lineNumInnerWidth=d.lineNumChars=null,d.alignWidgets=!1,d.cachedCharWidth=d.cachedTextHeight=d.cachedPaddingH=null,d.maxLine=null,d.maxLineLength=0,d.maxLineChanged=!1,d.wheelDX=d.wheelDY=d.wheelStartX=d.wheelStartY=null,d.shift=!1,d.selForContextMenu=null,d.activeTouch=null,c.init(d)}function c(b){b.doc.mode=a.getMode(b.options,b.doc.modeOption),d(b)}function d(a){a.doc.iter(function(a){a.stateAfter&&(a.stateAfter=null),a.styles&&(a.styles=null)}),a.doc.frontier=a.doc.first,Ma(a,100),a.state.modeGen++,a.curOp&&Ib(a)}function e(a){a.options.lineWrapping?(Tg(a.display.wrapper,"CodeMirror-wrap"),a.display.sizer.style.minWidth="",a.display.sizerWidth=null):(Sg(a.display.wrapper,"CodeMirror-wrap"),m(a)),g(a),Ib(a),gb(a),setTimeout(function(){s(a)},100)}function f(a){var b=rb(a.display),c=a.options.lineWrapping,d=c&&Math.max(5,a.display.scroller.clientWidth/sb(a.display)-3);return function(e){if(ud(a.doc,e))return 0;var f=0;if(e.widgets)for(var g=0;g<e.widgets.length;g++)e.widgets[g].height&&(f+=e.widgets[g].height);return c?f+(Math.ceil(e.text.length/d)||1)*b:f+b}}function g(a){var b=a.doc,c=f(a);b.iter(function(a){var b=c(a);b!=a.height&&$d(a,b)})}function h(a){a.display.wrapper.className=a.display.wrapper.className.replace(/\s*cm-s-\S+/g,"")+a.options.theme.replace(/(^|\s)\s*/g," cm-s-"),gb(a)}function i(a){j(a),Ib(a),setTimeout(function(){v(a)},20)}function j(a){var b=a.display.gutters,c=a.options.gutters;Pe(b);for(var d=0;d<c.length;++d){var e=c[d],f=b.appendChild(Oe("div",null,"CodeMirror-gutter "+e));"CodeMirror-linenumbers"==e&&(a.display.lineGutter=f,f.style.width=(a.display.lineNumWidth||1)+"px")}b.style.display=d?"":"none",k(a)}function k(a){var b=a.display.gutters.offsetWidth;a.display.sizer.style.marginLeft=b+"px"}function l(a){if(0==a.height)return 0;for(var b,c=a.text.length,d=a;b=nd(d);){var e=b.find(0,!0);d=e.from.line,c+=e.from.ch-e.to.ch}for(d=a;b=od(d);){var e=b.find(0,!0);c-=d.text.length-e.from.ch,d=e.to.line,c+=d.text.length-e.to.ch}return c}function m(a){var b=a.display,c=a.doc;b.maxLine=Xd(c,c.first),b.maxLineLength=l(b.maxLine),b.maxLineChanged=!0,c.iter(function(a){var c=l(a);c>b.maxLineLength&&(b.maxLineLength=c,b.maxLine=a)})}function n(a){var b=Fe(a.gutters,"CodeMirror-linenumbers");-1==b&&a.lineNumbers?a.gutters=a.gutters.concat(["CodeMirror-linenumbers"]):b>-1&&!a.lineNumbers&&(a.gutters=a.gutters.slice(0),a.gutters.splice(b,1))}function o(a){var b=a.display,c=b.gutters.offsetWidth,d=Math.round(a.doc.height+Ra(a.display));return{clientHeight:b.scroller.clientHeight,viewHeight:b.wrapper.clientHeight,scrollWidth:b.scroller.scrollWidth,clientWidth:b.scroller.clientWidth,viewWidth:b.wrapper.clientWidth,barLeft:a.options.fixedGutter?c:0,docHeight:d,scrollHeight:d+Ta(a)+b.barHeight,nativeBarWidth:b.nativeBarWidth,gutterWidth:c}}function p(a,b,c){this.cm=c;var d=this.vert=Oe("div",[Oe("div",null,null,"min-width: 1px")],"CodeMirror-vscrollbar"),e=this.horiz=Oe("div",[Oe("div",null,null,"height: 100%; min-height: 1px")],"CodeMirror-hscrollbar");a(d),a(e),zg(d,"scroll",function(){d.clientHeight&&b(d.scrollTop,"vertical")}),zg(e,"scroll",function(){e.clientWidth&&b(e.scrollLeft,"horizontal")}),this.checkedOverlay=!1,pf&&8>qf&&(this.horiz.style.minHeight=this.vert.style.minWidth="18px")}function q(){}function r(b){b.display.scrollbars&&(b.display.scrollbars.clear(),b.display.scrollbars.addClass&&Sg(b.display.wrapper,b.display.scrollbars.addClass)),b.display.scrollbars=new a.scrollbarModel[b.options.scrollbarStyle](function(a){b.display.wrapper.insertBefore(a,b.display.scrollbarFiller),zg(a,"mousedown",function(){b.state.focused&&setTimeout(function(){b.display.input.focus()},0)}),a.setAttribute("cm-not-content","true")},function(a,c){"horizontal"==c?dc(b,a):cc(b,a)},b),b.display.scrollbars.addClass&&Tg(b.display.wrapper,b.display.scrollbars.addClass)}function s(a,b){b||(b=o(a));var c=a.display.barWidth,d=a.display.barHeight;t(a,b);for(var e=0;4>e&&c!=a.display.barWidth||d!=a.display.barHeight;e++)c!=a.display.barWidth&&a.options.lineWrapping&&F(a),t(a,o(a)),c=a.display.barWidth,d=a.display.barHeight}function t(a,b){var c=a.display,d=c.scrollbars.update(b);c.sizer.style.paddingRight=(c.barWidth=d.right)+"px",c.sizer.style.paddingBottom=(c.barHeight=d.bottom)+"px",d.right&&d.bottom?(c.scrollbarFiller.style.display="block",c.scrollbarFiller.style.height=d.bottom+"px",c.scrollbarFiller.style.width=d.right+"px"):c.scrollbarFiller.style.display="",d.bottom&&a.options.coverGutterNextToScrollbar&&a.options.fixedGutter?(c.gutterFiller.style.display="block",c.gutterFiller.style.height=d.bottom+"px",c.gutterFiller.style.width=b.gutterWidth+"px"):c.gutterFiller.style.display=""}function u(a,b,c){var d=c&&null!=c.top?Math.max(0,c.top):a.scroller.scrollTop;d=Math.floor(d-Qa(a));var e=c&&null!=c.bottom?c.bottom:d+a.wrapper.clientHeight,f=ae(b,d),g=ae(b,e);if(c&&c.ensure){var h=c.ensure.from.line,i=c.ensure.to.line;f>h?(f=h,g=ae(b,be(Xd(b,h))+a.wrapper.clientHeight)):Math.min(i,b.lastLine())>=g&&(f=ae(b,be(Xd(b,i))-a.wrapper.clientHeight),g=i)}return{from:f,to:Math.max(g,f+1)}}function v(a){var b=a.display,c=b.view;if(b.alignWidgets||b.gutters.firstChild&&a.options.fixedGutter){for(var d=y(b)-b.scroller.scrollLeft+a.doc.scrollLeft,e=b.gutters.offsetWidth,f=d+"px",g=0;g<c.length;g++)if(!c[g].hidden){a.options.fixedGutter&&c[g].gutter&&(c[g].gutter.style.left=f);var h=c[g].alignable;if(h)for(var i=0;i<h.length;i++)h[i].style.left=f}a.options.fixedGutter&&(b.gutters.style.left=d+e+"px")}}function w(a){if(!a.options.lineNumbers)return!1;var b=a.doc,c=x(a.options,b.first+b.size-1),d=a.display;if(c.length!=d.lineNumChars){var e=d.measure.appendChild(Oe("div",[Oe("div",c)],"CodeMirror-linenumber CodeMirror-gutter-elt")),f=e.firstChild.offsetWidth,g=e.offsetWidth-f;return d.lineGutter.style.width="",d.lineNumInnerWidth=Math.max(f,d.lineGutter.offsetWidth-g)+1,d.lineNumWidth=d.lineNumInnerWidth+g,d.lineNumChars=d.lineNumInnerWidth?c.length:-1,d.lineGutter.style.width=d.lineNumWidth+"px",k(a),!0}return!1}function x(a,b){return String(a.lineNumberFormatter(b+a.firstLineNumber))}function y(a){return a.scroller.getBoundingClientRect().left-a.sizer.getBoundingClientRect().left}function z(a,b,c){var d=a.display;this.viewport=b,this.visible=u(d,a.doc,b),this.editorIsHidden=!d.wrapper.offsetWidth,this.wrapperHeight=d.wrapper.clientHeight,this.wrapperWidth=d.wrapper.clientWidth,this.oldDisplayWidth=Ua(a),this.force=c,this.dims=H(a),this.events=[]}function A(a){var b=a.display;!b.scrollbarsClipped&&b.scroller.offsetWidth&&(b.nativeBarWidth=b.scroller.offsetWidth-b.scroller.clientWidth,b.heightForcer.style.height=Ta(a)+"px",b.sizer.style.marginBottom=-b.nativeBarWidth+"px",b.sizer.style.borderRightWidth=Ta(a)+"px",b.scrollbarsClipped=!0)}function B(a,b){var c=a.display,d=a.doc;if(b.editorIsHidden)return Kb(a),!1;if(!b.force&&b.visible.from>=c.viewFrom&&b.visible.to<=c.viewTo&&(null==c.updateLineNumbers||c.updateLineNumbers>=c.viewTo)&&c.renderedView==c.view&&0==Ob(a))return!1;w(a)&&(Kb(a),b.dims=H(a));var e=d.first+d.size,f=Math.max(b.visible.from-a.options.viewportMargin,d.first),g=Math.min(e,b.visible.to+a.options.viewportMargin);c.viewFrom<f&&f-c.viewFrom<20&&(f=Math.max(d.first,c.viewFrom)),c.viewTo>g&&c.viewTo-g<20&&(g=Math.min(e,c.viewTo)),Gf&&(f=sd(a.doc,f),g=td(a.doc,g));var h=f!=c.viewFrom||g!=c.viewTo||c.lastWrapHeight!=b.wrapperHeight||c.lastWrapWidth!=b.wrapperWidth;Nb(a,f,g),c.viewOffset=be(Xd(a.doc,c.viewFrom)),a.display.mover.style.top=c.viewOffset+"px";var i=Ob(a);if(!h&&0==i&&!b.force&&c.renderedView==c.view&&(null==c.updateLineNumbers||c.updateLineNumbers>=c.viewTo))return!1;var j=Re();return i>4&&(c.lineDiv.style.display="none"),I(a,c.updateLineNumbers,b.dims),i>4&&(c.lineDiv.style.display=""),c.renderedView=c.view,j&&Re()!=j&&j.offsetHeight&&j.focus(),Pe(c.cursorDiv),Pe(c.selectionDiv),c.gutters.style.height=c.sizer.style.minHeight=0,h&&(c.lastWrapHeight=b.wrapperHeight,c.lastWrapWidth=b.wrapperWidth,Ma(a,400)),c.updateLineNumbers=null,!0}function C(a,b){for(var c=b.viewport,d=!0;(d&&a.options.lineWrapping&&b.oldDisplayWidth!=Ua(a)||(c&&null!=c.top&&(c={top:Math.min(a.doc.height+Ra(a.display)-Va(a),c.top)}),b.visible=u(a.display,a.doc,c),!(b.visible.from>=a.display.viewFrom&&b.visible.to<=a.display.viewTo)))&&B(a,b);d=!1){F(a);var e=o(a);Ha(a),E(a,e),s(a,e)}b.signal(a,"update",a),(a.display.viewFrom!=a.display.reportedViewFrom||a.display.viewTo!=a.display.reportedViewTo)&&(b.signal(a,"viewportChange",a,a.display.viewFrom,a.display.viewTo),a.display.reportedViewFrom=a.display.viewFrom,a.display.reportedViewTo=a.display.viewTo)}function D(a,b){var c=new z(a,b);if(B(a,c)){F(a),C(a,c);var d=o(a);Ha(a),E(a,d),s(a,d),c.finish()}}function E(a,b){a.display.sizer.style.minHeight=b.docHeight+"px";var c=b.docHeight+a.display.barHeight;a.display.heightForcer.style.top=c+"px",a.display.gutters.style.height=Math.max(c+Ta(a),b.clientHeight)+"px"}function F(a){for(var b=a.display,c=b.lineDiv.offsetTop,d=0;d<b.view.length;d++){var e,f=b.view[d];if(!f.hidden){if(pf&&8>qf){var g=f.node.offsetTop+f.node.offsetHeight;e=g-c,c=g}else{var h=f.node.getBoundingClientRect();e=h.bottom-h.top}var i=f.line.height-e;if(2>e&&(e=rb(b)),(i>.001||-.001>i)&&($d(f.line,e),G(f.line),f.rest))for(var j=0;j<f.rest.length;j++)G(f.rest[j])}}}function G(a){if(a.widgets)for(var b=0;b<a.widgets.length;++b)a.widgets[b].height=a.widgets[b].node.offsetHeight}function H(a){for(var b=a.display,c={},d={},e=b.gutters.clientLeft,f=b.gutters.firstChild,g=0;f;f=f.nextSibling,++g)c[a.options.gutters[g]]=f.offsetLeft+f.clientLeft+e,d[a.options.gutters[g]]=f.clientWidth;return{fixedPos:y(b),gutterTotalWidth:b.gutters.offsetWidth,gutterLeft:c,gutterWidth:d,wrapperWidth:b.wrapper.clientWidth}}function I(a,b,c){function d(b){var c=b.nextSibling;return rf&&Af&&a.display.currentWheelTarget==b?b.style.display="none":b.parentNode.removeChild(b),c}for(var e=a.display,f=a.options.lineNumbers,g=e.lineDiv,h=g.firstChild,i=e.view,j=e.viewFrom,k=0;k<i.length;k++){var l=i[k];if(l.hidden);else if(l.node&&l.node.parentNode==g){for(;h!=l.node;)h=d(h);var m=f&&null!=b&&j>=b&&l.lineNumber;l.changes&&(Fe(l.changes,"gutter")>-1&&(m=!1),J(a,l,j,c)),m&&(Pe(l.lineNumber),l.lineNumber.appendChild(document.createTextNode(x(a.options,j)))),h=l.node.nextSibling}else{var n=R(a,l,j,c);g.insertBefore(n,h)}j+=l.size}for(;h;)h=d(h)}function J(a,b,c,d){for(var e=0;e<b.changes.length;e++){var f=b.changes[e];"text"==f?N(a,b):"gutter"==f?P(a,b,c,d):"class"==f?O(b):"widget"==f&&Q(a,b,d)}b.changes=null}function K(a){return a.node==a.text&&(a.node=Oe("div",null,null,"position: relative"),a.text.parentNode&&a.text.parentNode.replaceChild(a.node,a.text),a.node.appendChild(a.text),pf&&8>qf&&(a.node.style.zIndex=2)),a.node}function L(a){var b=a.bgClass?a.bgClass+" "+(a.line.bgClass||""):a.line.bgClass;if(b&&(b+=" CodeMirror-linebackground"),a.background)b?a.background.className=b:(a.background.parentNode.removeChild(a.background),a.background=null);else if(b){var c=K(a);a.background=c.insertBefore(Oe("div",null,b),c.firstChild)}}function M(a,b){var c=a.display.externalMeasured;return c&&c.line==b.line?(a.display.externalMeasured=null,b.measure=c.measure,c.built):Kd(a,b)}function N(a,b){var c=b.text.className,d=M(a,b);b.text==b.node&&(b.node=d.pre),b.text.parentNode.replaceChild(d.pre,b.text),b.text=d.pre,d.bgClass!=b.bgClass||d.textClass!=b.textClass?(b.bgClass=d.bgClass,b.textClass=d.textClass,O(b)):c&&(b.text.className=c)}function O(a){L(a),a.line.wrapClass?K(a).className=a.line.wrapClass:a.node!=a.text&&(a.node.className="");var b=a.textClass?a.textClass+" "+(a.line.textClass||""):a.line.textClass;a.text.className=b||""}function P(a,b,c,d){if(b.gutter&&(b.node.removeChild(b.gutter),b.gutter=null),b.gutterBackground&&(b.node.removeChild(b.gutterBackground),b.gutterBackground=null),b.line.gutterClass){var e=K(b);b.gutterBackground=Oe("div",null,"CodeMirror-gutter-background "+b.line.gutterClass,"left: "+(a.options.fixedGutter?d.fixedPos:-d.gutterTotalWidth)+"px; width: "+d.gutterTotalWidth+"px"),e.insertBefore(b.gutterBackground,b.text)}var f=b.line.gutterMarkers;if(a.options.lineNumbers||f){var e=K(b),g=b.gutter=Oe("div",null,"CodeMirror-gutter-wrapper","left: "+(a.options.fixedGutter?d.fixedPos:-d.gutterTotalWidth)+"px");if(a.display.input.setUneditable(g),e.insertBefore(g,b.text),b.line.gutterClass&&(g.className+=" "+b.line.gutterClass),!a.options.lineNumbers||f&&f["CodeMirror-linenumbers"]||(b.lineNumber=g.appendChild(Oe("div",x(a.options,c),"CodeMirror-linenumber CodeMirror-gutter-elt","left: "+d.gutterLeft["CodeMirror-linenumbers"]+"px; width: "+a.display.lineNumInnerWidth+"px"))),f)for(var h=0;h<a.options.gutters.length;++h){var i=a.options.gutters[h],j=f.hasOwnProperty(i)&&f[i];j&&g.appendChild(Oe("div",[j],"CodeMirror-gutter-elt","left: "+d.gutterLeft[i]+"px; width: "+d.gutterWidth[i]+"px"))}}}function Q(a,b,c){b.alignable&&(b.alignable=null);for(var d,e=b.node.firstChild;e;e=d){var d=e.nextSibling;"CodeMirror-linewidget"==e.className&&b.node.removeChild(e)}S(a,b,c)}function R(a,b,c,d){var e=M(a,b);return b.text=b.node=e.pre,e.bgClass&&(b.bgClass=e.bgClass),e.textClass&&(b.textClass=e.textClass),O(b),P(a,b,c,d),S(a,b,d),b.node}function S(a,b,c){if(T(a,b.line,b,c,!0),b.rest)for(var d=0;d<b.rest.length;d++)T(a,b.rest[d],b,c,!1)}function T(a,b,c,d,e){if(b.widgets)for(var f=K(c),g=0,h=b.widgets;g<h.length;++g){var i=h[g],j=Oe("div",[i.node],"CodeMirror-linewidget");i.handleMouseEvents||j.setAttribute("cm-ignore-events","true"),U(i,j,c,d),a.display.input.setUneditable(j),e&&i.above?f.insertBefore(j,c.gutter||c.text):f.appendChild(j),ve(i,"redraw")}}function U(a,b,c,d){if(a.noHScroll){(c.alignable||(c.alignable=[])).push(b);var e=d.wrapperWidth;b.style.left=d.fixedPos+"px",a.coverGutter||(e-=d.gutterTotalWidth,b.style.paddingLeft=d.gutterTotalWidth+"px"),b.style.width=e+"px"}a.coverGutter&&(b.style.zIndex=5,b.style.position="relative",a.noHScroll||(b.style.marginLeft=-d.gutterTotalWidth+"px"))}function V(a){return Hf(a.line,a.ch)}function W(a,b){return If(a,b)<0?b:a}function X(a,b){return If(a,b)<0?a:b}function Y(a){a.state.focused||(a.display.input.focus(),pc(a))}function Z(a){return a.options.readOnly||a.doc.cantEdit}function $(a,b,c,d,e){var f=a.doc;a.display.shift=!1,d||(d=f.sel);var g=a.state.pasteIncoming||"paste"==e,h=f.splitLines(b),i=null;if(g&&d.ranges.length>1)if(Jf&&Jf.join("\n")==b){if(d.ranges.length%Jf.length==0){i=[];for(var j=0;j<Jf.length;j++)i.push(f.splitLines(Jf[j]))}}else h.length==d.ranges.length&&(i=Ge(h,function(a){return[a]}));for(var j=d.ranges.length-1;j>=0;j--){var k=d.ranges[j],l=k.from(),m=k.to();k.empty()&&(c&&c>0?l=Hf(l.line,l.ch-c):a.state.overwrite&&!g&&(m=Hf(m.line,Math.min(Xd(f,m.line).text.length,m.ch+Ee(h).length))));var n=a.curOp.updateInput,o={from:l,to:m,text:i?i[j%i.length]:h,origin:e||(g?"paste":a.state.cutIncoming?"cut":"+input")};yc(a.doc,o),ve(a,"inputRead",a,o)}b&&!g&&aa(a,b),Kc(a),a.curOp.updateInput=n,a.curOp.typing=!0,a.state.pasteIncoming=a.state.cutIncoming=!1}function _(a,b){var c=a.clipboardData&&a.clipboardData.getData("text/plain");return c?(a.preventDefault(),Z(b)||b.options.disableInput||Cb(b,function(){$(b,c,0,null,"paste")}),!0):void 0}function aa(a,b){if(a.options.electricChars&&a.options.smartIndent)for(var c=a.doc.sel,d=c.ranges.length-1;d>=0;d--){var e=c.ranges[d];if(!(e.head.ch>100||d&&c.ranges[d-1].head.line==e.head.line)){var f=a.getModeAt(e.head),g=!1;if(f.electricChars){for(var h=0;h<f.electricChars.length;h++)if(b.indexOf(f.electricChars.charAt(h))>-1){g=Mc(a,e.head.line,"smart");break}}else f.electricInput&&f.electricInput.test(Xd(a.doc,e.head.line).text.slice(0,e.head.ch))&&(g=Mc(a,e.head.line,"smart"));g&&ve(a,"electricInput",a,e.head.line)}}}function ba(a){for(var b=[],c=[],d=0;d<a.doc.sel.ranges.length;d++){var e=a.doc.sel.ranges[d].head.line,f={anchor:Hf(e,0),head:Hf(e+1,0)};c.push(f),b.push(a.getRange(f.anchor,f.head))}return{text:b,ranges:c}}function ca(a){a.setAttribute("autocorrect","off"),a.setAttribute("autocapitalize","off"),a.setAttribute("spellcheck","false")}function da(a){this.cm=a,this.prevInput="",this.pollingFast=!1,this.polling=new Be,this.inaccurateSelection=!1,this.hasSelection=!1,this.composing=null}function ea(){var a=Oe("textarea",null,null,"position: absolute; padding: 0; width: 1px; height: 1em; outline: none"),b=Oe("div",[a],null,"overflow: hidden; position: relative; width: 3px; height: 0px;");return rf?a.style.width="1000px":a.setAttribute("wrap","off"),yf&&(a.style.border="1px solid black"),ca(a),b}function fa(a){this.cm=a,this.lastAnchorNode=this.lastAnchorOffset=this.lastFocusNode=this.lastFocusOffset=null,this.polling=new Be,this.gracePeriod=!1}function ga(a,b){var c=$a(a,b.line);if(!c||c.hidden)return null;var d=Xd(a.doc,b.line),e=Xa(c,d,b.line),f=ce(d),g="left";if(f){var h=hf(f,b.ch);g=h%2?"right":"left"}var i=bb(e.map,b.ch,g);return i.offset="right"==i.collapse?i.end:i.start,i}function ha(a,b){return b&&(a.bad=!0),a}function ia(a,b,c){var d;if(b==a.display.lineDiv){if(d=a.display.lineDiv.childNodes[c],!d)return ha(a.clipPos(Hf(a.display.viewTo-1)),!0);b=null,c=0}else for(d=b;;d=d.parentNode){if(!d||d==a.display.lineDiv)return null;if(d.parentNode&&d.parentNode==a.display.lineDiv)break}for(var e=0;e<a.display.view.length;e++){var f=a.display.view[e];if(f.node==d)return ja(f,b,c)}}function ja(a,b,c){function d(b,c,d){for(var e=-1;e<(k?k.length:0);e++)for(var f=0>e?j.map:k[e],g=0;g<f.length;g+=3){var h=f[g+2];if(h==b||h==c){var i=_d(0>e?a.line:a.rest[e]),l=f[g]+d;return(0>d||h!=b)&&(l=f[g+(d?1:0)]),Hf(i,l)}}}var e=a.text.firstChild,f=!1;if(!b||!Pg(e,b))return ha(Hf(_d(a.line),0),!0);if(b==e&&(f=!0,b=e.childNodes[c],c=0,!b)){var g=a.rest?Ee(a.rest):a.line;return ha(Hf(_d(g),g.text.length),f)}var h=3==b.nodeType?b:null,i=b;for(h||1!=b.childNodes.length||3!=b.firstChild.nodeType||(h=b.firstChild,c&&(c=h.nodeValue.length));i.parentNode!=e;)i=i.parentNode;var j=a.measure,k=j.maps,l=d(h,i,c);if(l)return ha(l,f);for(var m=i.nextSibling,n=h?h.nodeValue.length-c:0;m;m=m.nextSibling){if(l=d(m,m.firstChild,0))return ha(Hf(l.line,l.ch-n),f);n+=m.textContent.length}for(var o=i.previousSibling,n=c;o;o=o.previousSibling){if(l=d(o,o.firstChild,-1))return ha(Hf(l.line,l.ch+n),f);n+=m.textContent.length}}function ka(a,b,c,d,e){function f(a){return function(b){return b.id==a}}function g(b){if(1==b.nodeType){var c=b.getAttribute("cm-text");if(null!=c)return""==c&&(c=b.textContent.replace(/\u200b/g,"")),void(h+=c);var k,l=b.getAttribute("cm-marker");if(l){var m=a.findMarks(Hf(d,0),Hf(e+1,0),f(+l));return void(m.length&&(k=m[0].find())&&(h+=Yd(a.doc,k.from,k.to).join(j)))}if("false"==b.getAttribute("contenteditable"))return;for(var n=0;n<b.childNodes.length;n++)g(b.childNodes[n]);/^(pre|div|p)$/i.test(b.nodeName)&&(i=!0)}else if(3==b.nodeType){var o=b.nodeValue;if(!o)return;i&&(h+=j,i=!1),h+=o}}for(var h="",i=!1,j=a.doc.lineSeparator();g(b),b!=c;)b=b.nextSibling;return h}function la(a,b){this.ranges=a,this.primIndex=b}function ma(a,b){this.anchor=a,this.head=b}function na(a,b){var c=a[b];a.sort(function(a,b){return If(a.from(),b.from())}),b=Fe(a,c);for(var d=1;d<a.length;d++){var e=a[d],f=a[d-1];if(If(f.to(),e.from())>=0){var g=X(f.from(),e.from()),h=W(f.to(),e.to()),i=f.empty()?e.from()==e.head:f.from()==f.head;b>=d&&--b,a.splice(--d,2,new ma(i?h:g,i?g:h))}}return new la(a,b)}function oa(a,b){return new la([new ma(a,b||a)],0)}function pa(a,b){return Math.max(a.first,Math.min(b,a.first+a.size-1))}function qa(a,b){if(b.line<a.first)return Hf(a.first,0);var c=a.first+a.size-1;return b.line>c?Hf(c,Xd(a,c).text.length):ra(b,Xd(a,b.line).text.length)}function ra(a,b){var c=a.ch;return null==c||c>b?Hf(a.line,b):0>c?Hf(a.line,0):a}function sa(a,b){return b>=a.first&&b<a.first+a.size}function ta(a,b){for(var c=[],d=0;d<b.length;d++)c[d]=qa(a,b[d]);return c}function ua(a,b,c,d){if(a.cm&&a.cm.display.shift||a.extend){var e=b.anchor;if(d){var f=If(c,e)<0;f!=If(d,e)<0?(e=c,c=d):f!=If(c,d)<0&&(c=d)}return new ma(e,c)}return new ma(d||c,c)}function va(a,b,c,d){Ba(a,new la([ua(a,a.sel.primary(),b,c)],0),d)}function wa(a,b,c){for(var d=[],e=0;e<a.sel.ranges.length;e++)d[e]=ua(a,a.sel.ranges[e],b[e],null);var f=na(d,a.sel.primIndex);Ba(a,f,c)}function xa(a,b,c,d){var e=a.sel.ranges.slice(0);e[b]=c,Ba(a,na(e,a.sel.primIndex),d)}function ya(a,b,c,d){Ba(a,oa(b,c),d)}function za(a,b){var c={ranges:b.ranges,update:function(b){this.ranges=[];for(var c=0;c<b.length;c++)this.ranges[c]=new ma(qa(a,b[c].anchor),qa(a,b[c].head))}};return Bg(a,"beforeSelectionChange",a,c),a.cm&&Bg(a.cm,"beforeSelectionChange",a.cm,c),c.ranges!=b.ranges?na(c.ranges,c.ranges.length-1):b}function Aa(a,b,c){var d=a.history.done,e=Ee(d);e&&e.ranges?(d[d.length-1]=b,Ca(a,b,c)):Ba(a,b,c)}function Ba(a,b,c){Ca(a,b,c),je(a,a.sel,a.cm?a.cm.curOp.id:NaN,c)}function Ca(a,b,c){(ze(a,"beforeSelectionChange")||a.cm&&ze(a.cm,"beforeSelectionChange"))&&(b=za(a,b));var d=c&&c.bias||(If(b.primary().head,a.sel.primary().head)<0?-1:1);Da(a,Fa(a,b,d,!0)),c&&c.scroll===!1||!a.cm||Kc(a.cm)}function Da(a,b){b.equals(a.sel)||(a.sel=b,a.cm&&(a.cm.curOp.updateInput=a.cm.curOp.selectionChanged=!0,ye(a.cm)),ve(a,"cursorActivity",a))}function Ea(a){Da(a,Fa(a,a.sel,null,!1),Fg)}function Fa(a,b,c,d){for(var e,f=0;f<b.ranges.length;f++){var g=b.ranges[f],h=Ga(a,g.anchor,c,d),i=Ga(a,g.head,c,d);(e||h!=g.anchor||i!=g.head)&&(e||(e=b.ranges.slice(0,f)),e[f]=new ma(h,i))}return e?na(e,b.primIndex):b}function Ga(a,b,c,d){var e=!1,f=b,g=c||1;a.cantEdit=!1;a:for(;;){var h=Xd(a,f.line);if(h.markedSpans)for(var i=0;i<h.markedSpans.length;++i){var j=h.markedSpans[i],k=j.marker;if((null==j.from||(k.inclusiveLeft?j.from<=f.ch:j.from<f.ch))&&(null==j.to||(k.inclusiveRight?j.to>=f.ch:j.to>f.ch))){if(d&&(Bg(k,"beforeCursorEnter"),k.explicitlyCleared)){if(h.markedSpans){--i;continue}break}if(!k.atomic)continue;var l=k.find(0>g?-1:1);if(0==If(l,f)&&(l.ch+=g,l.ch<0?l=l.line>a.first?qa(a,Hf(l.line-1)):null:l.ch>h.text.length&&(l=l.line<a.first+a.size-1?Hf(l.line+1,0):null),!l)){if(e)return d?(a.cantEdit=!0,Hf(a.first,0)):Ga(a,b,c,!0);e=!0,l=b,g=-g}f=l;continue a}}return f}}function Ha(a){a.display.input.showSelection(a.display.input.prepareSelection())}function Ia(a,b){for(var c=a.doc,d={},e=d.cursors=document.createDocumentFragment(),f=d.selection=document.createDocumentFragment(),g=0;g<c.sel.ranges.length;g++)if(b!==!1||g!=c.sel.primIndex){var h=c.sel.ranges[g],i=h.empty();(i||a.options.showCursorWhenSelecting)&&Ja(a,h.head,e),i||Ka(a,h,f)}return d}function Ja(a,b,c){var d=mb(a,b,"div",null,null,!a.options.singleCursorHeightPerLine),e=c.appendChild(Oe("div"," ","CodeMirror-cursor"));if(e.style.left=d.left+"px",e.style.top=d.top+"px",e.style.height=Math.max(0,d.bottom-d.top)*a.options.cursorHeight+"px",d.other){var f=c.appendChild(Oe("div"," ","CodeMirror-cursor CodeMirror-secondarycursor"));f.style.display="",f.style.left=d.other.left+"px",f.style.top=d.other.top+"px",f.style.height=.85*(d.other.bottom-d.other.top)+"px"}}function Ka(a,b,c){function d(a,b,c,d){0>b&&(b=0),b=Math.round(b),d=Math.round(d),h.appendChild(Oe("div",null,"CodeMirror-selected","position: absolute; left: "+a+"px; top: "+b+"px; width: "+(null==c?k-a:c)+"px; height: "+(d-b)+"px"))}function e(b,c,e){function f(c,d){return lb(a,Hf(b,c),"div",l,d)}var h,i,l=Xd(g,b),m=l.text.length;return $e(ce(l),c||0,null==e?m:e,function(a,b,g){var l,n,o,p=f(a,"left");if(a==b)l=p,n=o=p.left;else{if(l=f(b-1,"right"),"rtl"==g){var q=p;p=l,l=q}n=p.left,o=l.right}null==c&&0==a&&(n=j),l.top-p.top>3&&(d(n,p.top,null,p.bottom),n=j,p.bottom<l.top&&d(n,p.bottom,null,l.top)),null==e&&b==m&&(o=k),(!h||p.top<h.top||p.top==h.top&&p.left<h.left)&&(h=p),(!i||l.bottom>i.bottom||l.bottom==i.bottom&&l.right>i.right)&&(i=l),j+1>n&&(n=j),d(n,l.top,o-n,l.bottom)}),{start:h,end:i}}var f=a.display,g=a.doc,h=document.createDocumentFragment(),i=Sa(a.display),j=i.left,k=Math.max(f.sizerWidth,Ua(a)-f.sizer.offsetLeft)-i.right,l=b.from(),m=b.to();if(l.line==m.line)e(l.line,l.ch,m.ch);else{var n=Xd(g,l.line),o=Xd(g,m.line),p=qd(n)==qd(o),q=e(l.line,l.ch,p?n.text.length+1:null).end,r=e(m.line,p?0:null,m.ch).start;p&&(q.top<r.top-2?(d(q.right,q.top,null,q.bottom),d(j,r.top,r.left,r.bottom)):d(q.right,q.top,r.left-q.right,q.bottom)),q.bottom<r.top&&d(j,q.bottom,null,r.top)}c.appendChild(h)}function La(a){if(a.state.focused){var b=a.display;clearInterval(b.blinker);var c=!0;b.cursorDiv.style.visibility="",a.options.cursorBlinkRate>0?b.blinker=setInterval(function(){b.cursorDiv.style.visibility=(c=!c)?"":"hidden"},a.options.cursorBlinkRate):a.options.cursorBlinkRate<0&&(b.cursorDiv.style.visibility="hidden")}}function Ma(a,b){a.doc.mode.startState&&a.doc.frontier<a.display.viewTo&&a.state.highlight.set(b,Ke(Na,a))}function Na(a){var b=a.doc;if(b.frontier<b.first&&(b.frontier=b.first),!(b.frontier>=a.display.viewTo)){var c=+new Date+a.options.workTime,d=dg(b.mode,Pa(a,b.frontier)),e=[];b.iter(b.frontier,Math.min(b.first+b.size,a.display.viewTo+500),function(f){if(b.frontier>=a.display.viewFrom){var g=f.styles,h=f.text.length>a.options.maxHighlightLength,i=Gd(a,f,h?dg(b.mode,d):d,!0);f.styles=i.styles;var j=f.styleClasses,k=i.classes;k?f.styleClasses=k:j&&(f.styleClasses=null);for(var l=!g||g.length!=f.styles.length||j!=k&&(!j||!k||j.bgClass!=k.bgClass||j.textClass!=k.textClass),m=0;!l&&m<g.length;++m)l=g[m]!=f.styles[m];l&&e.push(b.frontier),f.stateAfter=h?d:dg(b.mode,d)}else f.text.length<=a.options.maxHighlightLength&&Id(a,f.text,d),f.stateAfter=b.frontier%5==0?dg(b.mode,d):null;return++b.frontier,+new Date>c?(Ma(a,a.options.workDelay),!0):void 0}),e.length&&Cb(a,function(){for(var b=0;b<e.length;b++)Jb(a,e[b],"text")})}}function Oa(a,b,c){for(var d,e,f=a.doc,g=c?-1:b-(a.doc.mode.innerMode?1e3:100),h=b;h>g;--h){if(h<=f.first)return f.first;var i=Xd(f,h-1);if(i.stateAfter&&(!c||h<=f.frontier))return h;var j=Ig(i.text,null,a.options.tabSize);(null==e||d>j)&&(e=h-1,d=j)}return e}function Pa(a,b,c){var d=a.doc,e=a.display;if(!d.mode.startState)return!0;var f=Oa(a,b,c),g=f>d.first&&Xd(d,f-1).stateAfter;return g=g?dg(d.mode,g):eg(d.mode),d.iter(f,b,function(c){Id(a,c.text,g);var h=f==b-1||f%5==0||f>=e.viewFrom&&f<e.viewTo;c.stateAfter=h?dg(d.mode,g):null,++f}),c&&(d.frontier=f),g}function Qa(a){return a.lineSpace.offsetTop}function Ra(a){return a.mover.offsetHeight-a.lineSpace.offsetHeight}function Sa(a){if(a.cachedPaddingH)return a.cachedPaddingH;var b=Qe(a.measure,Oe("pre","x")),c=window.getComputedStyle?window.getComputedStyle(b):b.currentStyle,d={left:parseInt(c.paddingLeft),right:parseInt(c.paddingRight)};return isNaN(d.left)||isNaN(d.right)||(a.cachedPaddingH=d),d}function Ta(a){return Dg-a.display.nativeBarWidth}function Ua(a){return a.display.scroller.clientWidth-Ta(a)-a.display.barWidth}function Va(a){return a.display.scroller.clientHeight-Ta(a)-a.display.barHeight}function Wa(a,b,c){var d=a.options.lineWrapping,e=d&&Ua(a);if(!b.measure.heights||d&&b.measure.width!=e){var f=b.measure.heights=[];if(d){b.measure.width=e;for(var g=b.text.firstChild.getClientRects(),h=0;h<g.length-1;h++){var i=g[h],j=g[h+1];Math.abs(i.bottom-j.bottom)>2&&f.push((i.bottom+j.top)/2-c.top)}}f.push(c.bottom-c.top)}}function Xa(a,b,c){if(a.line==b)return{map:a.measure.map,cache:a.measure.cache};for(var d=0;d<a.rest.length;d++)if(a.rest[d]==b)return{map:a.measure.maps[d],cache:a.measure.caches[d]};for(var d=0;d<a.rest.length;d++)if(_d(a.rest[d])>c)return{map:a.measure.maps[d],cache:a.measure.caches[d],before:!0}}function Ya(a,b){b=qd(b);var c=_d(b),d=a.display.externalMeasured=new Gb(a.doc,b,c);d.lineN=c;var e=d.built=Kd(a,d);return d.text=e.pre,Qe(a.display.lineMeasure,e.pre),d}function Za(a,b,c,d){return ab(a,_a(a,b),c,d)}function $a(a,b){if(b>=a.display.viewFrom&&b<a.display.viewTo)return a.display.view[Lb(a,b)];var c=a.display.externalMeasured;return c&&b>=c.lineN&&b<c.lineN+c.size?c:void 0}function _a(a,b){var c=_d(b),d=$a(a,c);d&&!d.text?d=null:d&&d.changes&&(J(a,d,c,H(a)),a.curOp.forceUpdate=!0),d||(d=Ya(a,b));var e=Xa(d,b,c);return{line:b,view:d,rect:null,map:e.map,cache:e.cache,before:e.before,hasHeights:!1}}function ab(a,b,c,d,e){b.before&&(c=-1);var f,g=c+(d||"");return b.cache.hasOwnProperty(g)?f=b.cache[g]:(b.rect||(b.rect=b.view.text.getBoundingClientRect()),b.hasHeights||(Wa(a,b.view,b.rect),b.hasHeights=!0),f=cb(a,b,c,d),f.bogus||(b.cache[g]=f)),{left:f.left,right:f.right,top:e?f.rtop:f.top,bottom:e?f.rbottom:f.bottom}}function bb(a,b,c){for(var d,e,f,g,h=0;h<a.length;h+=3){var i=a[h],j=a[h+1];if(i>b?(e=0,f=1,g="left"):j>b?(e=b-i,f=e+1):(h==a.length-3||b==j&&a[h+3]>b)&&(f=j-i,e=f-1,b>=j&&(g="right")),null!=e){if(d=a[h+2],i==j&&c==(d.insertLeft?"left":"right")&&(g=c),"left"==c&&0==e)for(;h&&a[h-2]==a[h-3]&&a[h-1].insertLeft;)d=a[(h-=3)+2],g="left";if("right"==c&&e==j-i)for(;h<a.length-3&&a[h+3]==a[h+4]&&!a[h+5].insertLeft;)d=a[(h+=3)+2],g="right";break}}return{node:d,start:e,end:f,collapse:g,coverStart:i,coverEnd:j}}function cb(a,b,c,d){var e,f=bb(b.map,c,d),g=f.node,h=f.start,i=f.end,j=f.collapse;if(3==g.nodeType){for(var k=0;4>k;k++){for(;h&&Ne(b.line.text.charAt(f.coverStart+h));)--h;for(;f.coverStart+i<f.coverEnd&&Ne(b.line.text.charAt(f.coverStart+i));)++i;
|
2 |
+
if(pf&&9>qf&&0==h&&i==f.coverEnd-f.coverStart)e=g.parentNode.getBoundingClientRect();else if(pf&&a.options.lineWrapping){var l=Lg(g,h,i).getClientRects();e=l.length?l["right"==d?l.length-1:0]:Nf}else e=Lg(g,h,i).getBoundingClientRect()||Nf;if(e.left||e.right||0==h)break;i=h,h-=1,j="right"}pf&&11>qf&&(e=db(a.display.measure,e))}else{h>0&&(j=d="right");var l;e=a.options.lineWrapping&&(l=g.getClientRects()).length>1?l["right"==d?l.length-1:0]:g.getBoundingClientRect()}if(pf&&9>qf&&!h&&(!e||!e.left&&!e.right)){var m=g.parentNode.getClientRects()[0];e=m?{left:m.left,right:m.left+sb(a.display),top:m.top,bottom:m.bottom}:Nf}for(var n=e.top-b.rect.top,o=e.bottom-b.rect.top,p=(n+o)/2,q=b.view.measure.heights,k=0;k<q.length-1&&!(p<q[k]);k++);var r=k?q[k-1]:0,s=q[k],t={left:("right"==j?e.right:e.left)-b.rect.left,right:("left"==j?e.left:e.right)-b.rect.left,top:r,bottom:s};return e.left||e.right||(t.bogus=!0),a.options.singleCursorHeightPerLine||(t.rtop=n,t.rbottom=o),t}function db(a,b){if(!window.screen||null==screen.logicalXDPI||screen.logicalXDPI==screen.deviceXDPI||!Ze(a))return b;var c=screen.logicalXDPI/screen.deviceXDPI,d=screen.logicalYDPI/screen.deviceYDPI;return{left:b.left*c,right:b.right*c,top:b.top*d,bottom:b.bottom*d}}function eb(a){if(a.measure&&(a.measure.cache={},a.measure.heights=null,a.rest))for(var b=0;b<a.rest.length;b++)a.measure.caches[b]={}}function fb(a){a.display.externalMeasure=null,Pe(a.display.lineMeasure);for(var b=0;b<a.display.view.length;b++)eb(a.display.view[b])}function gb(a){fb(a),a.display.cachedCharWidth=a.display.cachedTextHeight=a.display.cachedPaddingH=null,a.options.lineWrapping||(a.display.maxLineChanged=!0),a.display.lineNumChars=null}function hb(){return window.pageXOffset||(document.documentElement||document.body).scrollLeft}function ib(){return window.pageYOffset||(document.documentElement||document.body).scrollTop}function jb(a,b,c,d){if(b.widgets)for(var e=0;e<b.widgets.length;++e)if(b.widgets[e].above){var f=xd(b.widgets[e]);c.top+=f,c.bottom+=f}if("line"==d)return c;d||(d="local");var g=be(b);if("local"==d?g+=Qa(a.display):g-=a.display.viewOffset,"page"==d||"window"==d){var h=a.display.lineSpace.getBoundingClientRect();g+=h.top+("window"==d?0:ib());var i=h.left+("window"==d?0:hb());c.left+=i,c.right+=i}return c.top+=g,c.bottom+=g,c}function kb(a,b,c){if("div"==c)return b;var d=b.left,e=b.top;if("page"==c)d-=hb(),e-=ib();else if("local"==c||!c){var f=a.display.sizer.getBoundingClientRect();d+=f.left,e+=f.top}var g=a.display.lineSpace.getBoundingClientRect();return{left:d-g.left,top:e-g.top}}function lb(a,b,c,d,e){return d||(d=Xd(a.doc,b.line)),jb(a,d,Za(a,d,b.ch,e),c)}function mb(a,b,c,d,e,f){function g(b,g){var h=ab(a,e,b,g?"right":"left",f);return g?h.left=h.right:h.right=h.left,jb(a,d,h,c)}function h(a,b){var c=i[b],d=c.level%2;return a==_e(c)&&b&&c.level<i[b-1].level?(c=i[--b],a=af(c)-(c.level%2?0:1),d=!0):a==af(c)&&b<i.length-1&&c.level<i[b+1].level&&(c=i[++b],a=_e(c)-c.level%2,d=!1),d&&a==c.to&&a>c.from?g(a-1):g(a,d)}d=d||Xd(a.doc,b.line),e||(e=_a(a,d));var i=ce(d),j=b.ch;if(!i)return g(j);var k=hf(i,j),l=h(j,k);return null!=_g&&(l.other=h(j,_g)),l}function nb(a,b){var c=0,b=qa(a.doc,b);a.options.lineWrapping||(c=sb(a.display)*b.ch);var d=Xd(a.doc,b.line),e=be(d)+Qa(a.display);return{left:c,right:c,top:e,bottom:e+d.height}}function ob(a,b,c,d){var e=Hf(a,b);return e.xRel=d,c&&(e.outside=!0),e}function pb(a,b,c){var d=a.doc;if(c+=a.display.viewOffset,0>c)return ob(d.first,0,!0,-1);var e=ae(d,c),f=d.first+d.size-1;if(e>f)return ob(d.first+d.size-1,Xd(d,f).text.length,!0,1);0>b&&(b=0);for(var g=Xd(d,e);;){var h=qb(a,g,e,b,c),i=od(g),j=i&&i.find(0,!0);if(!i||!(h.ch>j.from.ch||h.ch==j.from.ch&&h.xRel>0))return h;e=_d(g=j.to.line)}}function qb(a,b,c,d,e){function f(d){var e=mb(a,Hf(c,d),"line",b,j);return h=!0,g>e.bottom?e.left-i:g<e.top?e.left+i:(h=!1,e.left)}var g=e-be(b),h=!1,i=2*a.display.wrapper.clientWidth,j=_a(a,b),k=ce(b),l=b.text.length,m=bf(b),n=cf(b),o=f(m),p=h,q=f(n),r=h;if(d>q)return ob(c,n,r,1);for(;;){if(k?n==m||n==kf(b,m,1):1>=n-m){for(var s=o>d||q-d>=d-o?m:n,t=d-(s==m?o:q);Ne(b.text.charAt(s));)++s;var u=ob(c,s,s==m?p:r,-1>t?-1:t>1?1:0);return u}var v=Math.ceil(l/2),w=m+v;if(k){w=m;for(var x=0;v>x;++x)w=kf(b,w,1)}var y=f(w);y>d?(n=w,q=y,(r=h)&&(q+=1e3),l=v):(m=w,o=y,p=h,l-=v)}}function rb(a){if(null!=a.cachedTextHeight)return a.cachedTextHeight;if(null==Kf){Kf=Oe("pre");for(var b=0;49>b;++b)Kf.appendChild(document.createTextNode("x")),Kf.appendChild(Oe("br"));Kf.appendChild(document.createTextNode("x"))}Qe(a.measure,Kf);var c=Kf.offsetHeight/50;return c>3&&(a.cachedTextHeight=c),Pe(a.measure),c||1}function sb(a){if(null!=a.cachedCharWidth)return a.cachedCharWidth;var b=Oe("span","xxxxxxxxxx"),c=Oe("pre",[b]);Qe(a.measure,c);var d=b.getBoundingClientRect(),e=(d.right-d.left)/10;return e>2&&(a.cachedCharWidth=e),e||10}function tb(a){a.curOp={cm:a,viewChanged:!1,startHeight:a.doc.height,forceUpdate:!1,updateInput:null,typing:!1,changeObjs:null,cursorActivityHandlers:null,cursorActivityCalled:0,selectionChanged:!1,updateMaxLine:!1,scrollLeft:null,scrollTop:null,scrollToPos:null,focus:!1,id:++Pf},Of?Of.ops.push(a.curOp):a.curOp.ownsGroup=Of={ops:[a.curOp],delayedCallbacks:[]}}function ub(a){var b=a.delayedCallbacks,c=0;do{for(;c<b.length;c++)b[c].call(null);for(var d=0;d<a.ops.length;d++){var e=a.ops[d];if(e.cursorActivityHandlers)for(;e.cursorActivityCalled<e.cursorActivityHandlers.length;)e.cursorActivityHandlers[e.cursorActivityCalled++].call(null,e.cm)}}while(c<b.length)}function vb(a){var b=a.curOp,c=b.ownsGroup;if(c)try{ub(c)}finally{Of=null;for(var d=0;d<c.ops.length;d++)c.ops[d].cm.curOp=null;wb(c)}}function wb(a){for(var b=a.ops,c=0;c<b.length;c++)xb(b[c]);for(var c=0;c<b.length;c++)yb(b[c]);for(var c=0;c<b.length;c++)zb(b[c]);for(var c=0;c<b.length;c++)Ab(b[c]);for(var c=0;c<b.length;c++)Bb(b[c])}function xb(a){var b=a.cm,c=b.display;A(b),a.updateMaxLine&&m(b),a.mustUpdate=a.viewChanged||a.forceUpdate||null!=a.scrollTop||a.scrollToPos&&(a.scrollToPos.from.line<c.viewFrom||a.scrollToPos.to.line>=c.viewTo)||c.maxLineChanged&&b.options.lineWrapping,a.update=a.mustUpdate&&new z(b,a.mustUpdate&&{top:a.scrollTop,ensure:a.scrollToPos},a.forceUpdate)}function yb(a){a.updatedDisplay=a.mustUpdate&&B(a.cm,a.update)}function zb(a){var b=a.cm,c=b.display;a.updatedDisplay&&F(b),a.barMeasure=o(b),c.maxLineChanged&&!b.options.lineWrapping&&(a.adjustWidthTo=Za(b,c.maxLine,c.maxLine.text.length).left+3,b.display.sizerWidth=a.adjustWidthTo,a.barMeasure.scrollWidth=Math.max(c.scroller.clientWidth,c.sizer.offsetLeft+a.adjustWidthTo+Ta(b)+b.display.barWidth),a.maxScrollLeft=Math.max(0,c.sizer.offsetLeft+a.adjustWidthTo-Ua(b))),(a.updatedDisplay||a.selectionChanged)&&(a.preparedSelection=c.input.prepareSelection())}function Ab(a){var b=a.cm;null!=a.adjustWidthTo&&(b.display.sizer.style.minWidth=a.adjustWidthTo+"px",a.maxScrollLeft<b.doc.scrollLeft&&dc(b,Math.min(b.display.scroller.scrollLeft,a.maxScrollLeft),!0),b.display.maxLineChanged=!1),a.preparedSelection&&b.display.input.showSelection(a.preparedSelection),a.updatedDisplay&&E(b,a.barMeasure),(a.updatedDisplay||a.startHeight!=b.doc.height)&&s(b,a.barMeasure),a.selectionChanged&&La(b),b.state.focused&&a.updateInput&&b.display.input.reset(a.typing),a.focus&&a.focus==Re()&&Y(a.cm)}function Bb(a){var b=a.cm,c=b.display,d=b.doc;if(a.updatedDisplay&&C(b,a.update),null==c.wheelStartX||null==a.scrollTop&&null==a.scrollLeft&&!a.scrollToPos||(c.wheelStartX=c.wheelStartY=null),null==a.scrollTop||c.scroller.scrollTop==a.scrollTop&&!a.forceScroll||(d.scrollTop=Math.max(0,Math.min(c.scroller.scrollHeight-c.scroller.clientHeight,a.scrollTop)),c.scrollbars.setScrollTop(d.scrollTop),c.scroller.scrollTop=d.scrollTop),null==a.scrollLeft||c.scroller.scrollLeft==a.scrollLeft&&!a.forceScroll||(d.scrollLeft=Math.max(0,Math.min(c.scroller.scrollWidth-Ua(b),a.scrollLeft)),c.scrollbars.setScrollLeft(d.scrollLeft),c.scroller.scrollLeft=d.scrollLeft,v(b)),a.scrollToPos){var e=Gc(b,qa(d,a.scrollToPos.from),qa(d,a.scrollToPos.to),a.scrollToPos.margin);a.scrollToPos.isCursor&&b.state.focused&&Fc(b,e)}var f=a.maybeHiddenMarkers,g=a.maybeUnhiddenMarkers;if(f)for(var h=0;h<f.length;++h)f[h].lines.length||Bg(f[h],"hide");if(g)for(var h=0;h<g.length;++h)g[h].lines.length&&Bg(g[h],"unhide");c.wrapper.offsetHeight&&(d.scrollTop=b.display.scroller.scrollTop),a.changeObjs&&Bg(b,"changes",b,a.changeObjs),a.update&&a.update.finish()}function Cb(a,b){if(a.curOp)return b();tb(a);try{return b()}finally{vb(a)}}function Db(a,b){return function(){if(a.curOp)return b.apply(a,arguments);tb(a);try{return b.apply(a,arguments)}finally{vb(a)}}}function Eb(a){return function(){if(this.curOp)return a.apply(this,arguments);tb(this);try{return a.apply(this,arguments)}finally{vb(this)}}}function Fb(a){return function(){var b=this.cm;if(!b||b.curOp)return a.apply(this,arguments);tb(b);try{return a.apply(this,arguments)}finally{vb(b)}}}function Gb(a,b,c){this.line=b,this.rest=rd(b),this.size=this.rest?_d(Ee(this.rest))-c+1:1,this.node=this.text=null,this.hidden=ud(a,b)}function Hb(a,b,c){for(var d,e=[],f=b;c>f;f=d){var g=new Gb(a.doc,Xd(a.doc,f),f);d=f+g.size,e.push(g)}return e}function Ib(a,b,c,d){null==b&&(b=a.doc.first),null==c&&(c=a.doc.first+a.doc.size),d||(d=0);var e=a.display;if(d&&c<e.viewTo&&(null==e.updateLineNumbers||e.updateLineNumbers>b)&&(e.updateLineNumbers=b),a.curOp.viewChanged=!0,b>=e.viewTo)Gf&&sd(a.doc,b)<e.viewTo&&Kb(a);else if(c<=e.viewFrom)Gf&&td(a.doc,c+d)>e.viewFrom?Kb(a):(e.viewFrom+=d,e.viewTo+=d);else if(b<=e.viewFrom&&c>=e.viewTo)Kb(a);else if(b<=e.viewFrom){var f=Mb(a,c,c+d,1);f?(e.view=e.view.slice(f.index),e.viewFrom=f.lineN,e.viewTo+=d):Kb(a)}else if(c>=e.viewTo){var f=Mb(a,b,b,-1);f?(e.view=e.view.slice(0,f.index),e.viewTo=f.lineN):Kb(a)}else{var g=Mb(a,b,b,-1),h=Mb(a,c,c+d,1);g&&h?(e.view=e.view.slice(0,g.index).concat(Hb(a,g.lineN,h.lineN)).concat(e.view.slice(h.index)),e.viewTo+=d):Kb(a)}var i=e.externalMeasured;i&&(c<i.lineN?i.lineN+=d:b<i.lineN+i.size&&(e.externalMeasured=null))}function Jb(a,b,c){a.curOp.viewChanged=!0;var d=a.display,e=a.display.externalMeasured;if(e&&b>=e.lineN&&b<e.lineN+e.size&&(d.externalMeasured=null),!(b<d.viewFrom||b>=d.viewTo)){var f=d.view[Lb(a,b)];if(null!=f.node){var g=f.changes||(f.changes=[]);-1==Fe(g,c)&&g.push(c)}}}function Kb(a){a.display.viewFrom=a.display.viewTo=a.doc.first,a.display.view=[],a.display.viewOffset=0}function Lb(a,b){if(b>=a.display.viewTo)return null;if(b-=a.display.viewFrom,0>b)return null;for(var c=a.display.view,d=0;d<c.length;d++)if(b-=c[d].size,0>b)return d}function Mb(a,b,c,d){var e,f=Lb(a,b),g=a.display.view;if(!Gf||c==a.doc.first+a.doc.size)return{index:f,lineN:c};for(var h=0,i=a.display.viewFrom;f>h;h++)i+=g[h].size;if(i!=b){if(d>0){if(f==g.length-1)return null;e=i+g[f].size-b,f++}else e=i-b;b+=e,c+=e}for(;sd(a.doc,c)!=c;){if(f==(0>d?0:g.length-1))return null;c+=d*g[f-(0>d?1:0)].size,f+=d}return{index:f,lineN:c}}function Nb(a,b,c){var d=a.display,e=d.view;0==e.length||b>=d.viewTo||c<=d.viewFrom?(d.view=Hb(a,b,c),d.viewFrom=b):(d.viewFrom>b?d.view=Hb(a,b,d.viewFrom).concat(d.view):d.viewFrom<b&&(d.view=d.view.slice(Lb(a,b))),d.viewFrom=b,d.viewTo<c?d.view=d.view.concat(Hb(a,d.viewTo,c)):d.viewTo>c&&(d.view=d.view.slice(0,Lb(a,c)))),d.viewTo=c}function Ob(a){for(var b=a.display.view,c=0,d=0;d<b.length;d++){var e=b[d];e.hidden||e.node&&!e.changes||++c}return c}function Pb(a){function b(){e.activeTouch&&(f=setTimeout(function(){e.activeTouch=null},1e3),g=e.activeTouch,g.end=+new Date)}function c(a){if(1!=a.touches.length)return!1;var b=a.touches[0];return b.radiusX<=1&&b.radiusY<=1}function d(a,b){if(null==b.left)return!0;var c=b.left-a.left,d=b.top-a.top;return c*c+d*d>400}var e=a.display;zg(e.scroller,"mousedown",Db(a,Ub)),pf&&11>qf?zg(e.scroller,"dblclick",Db(a,function(b){if(!xe(a,b)){var c=Tb(a,b);if(c&&!Zb(a,b)&&!Sb(a.display,b)){wg(b);var d=a.findWordAt(c);va(a.doc,d.anchor,d.head)}}})):zg(e.scroller,"dblclick",function(b){xe(a,b)||wg(b)}),Ef||zg(e.scroller,"contextmenu",function(b){rc(a,b)});var f,g={end:0};zg(e.scroller,"touchstart",function(a){if(!c(a)){clearTimeout(f);var b=+new Date;e.activeTouch={start:b,moved:!1,prev:b-g.end<=300?g:null},1==a.touches.length&&(e.activeTouch.left=a.touches[0].pageX,e.activeTouch.top=a.touches[0].pageY)}}),zg(e.scroller,"touchmove",function(){e.activeTouch&&(e.activeTouch.moved=!0)}),zg(e.scroller,"touchend",function(c){var f=e.activeTouch;if(f&&!Sb(e,c)&&null!=f.left&&!f.moved&&new Date-f.start<300){var g,h=a.coordsChar(e.activeTouch,"page");g=!f.prev||d(f,f.prev)?new ma(h,h):!f.prev.prev||d(f,f.prev.prev)?a.findWordAt(h):new ma(Hf(h.line,0),qa(a.doc,Hf(h.line+1,0))),a.setSelection(g.anchor,g.head),a.focus(),wg(c)}b()}),zg(e.scroller,"touchcancel",b),zg(e.scroller,"scroll",function(){e.scroller.clientHeight&&(cc(a,e.scroller.scrollTop),dc(a,e.scroller.scrollLeft,!0),Bg(a,"scroll",a))}),zg(e.scroller,"mousewheel",function(b){ec(a,b)}),zg(e.scroller,"DOMMouseScroll",function(b){ec(a,b)}),zg(e.wrapper,"scroll",function(){e.wrapper.scrollTop=e.wrapper.scrollLeft=0}),e.dragFunctions={enter:function(b){xe(a,b)||yg(b)},over:function(b){xe(a,b)||(ac(a,b),yg(b))},start:function(b){_b(a,b)},drop:Db(a,$b),leave:function(){bc(a)}};var h=e.input.getField();zg(h,"keyup",function(b){mc.call(a,b)}),zg(h,"keydown",Db(a,kc)),zg(h,"keypress",Db(a,nc)),zg(h,"focus",Ke(pc,a)),zg(h,"blur",Ke(qc,a))}function Qb(b,c,d){var e=d&&d!=a.Init;if(!c!=!e){var f=b.display.dragFunctions,g=c?zg:Ag;g(b.display.scroller,"dragstart",f.start),g(b.display.scroller,"dragenter",f.enter),g(b.display.scroller,"dragover",f.over),g(b.display.scroller,"dragleave",f.leave),g(b.display.scroller,"drop",f.drop)}}function Rb(a){var b=a.display;(b.lastWrapHeight!=b.wrapper.clientHeight||b.lastWrapWidth!=b.wrapper.clientWidth)&&(b.cachedCharWidth=b.cachedTextHeight=b.cachedPaddingH=null,b.scrollbarsClipped=!1,a.setSize())}function Sb(a,b){for(var c=te(b);c!=a.wrapper;c=c.parentNode)if(!c||1==c.nodeType&&"true"==c.getAttribute("cm-ignore-events")||c.parentNode==a.sizer&&c!=a.mover)return!0}function Tb(a,b,c,d){var e=a.display;if(!c&&"true"==te(b).getAttribute("cm-not-content"))return null;var f,g,h=e.lineSpace.getBoundingClientRect();try{f=b.clientX-h.left,g=b.clientY-h.top}catch(b){return null}var i,j=pb(a,f,g);if(d&&1==j.xRel&&(i=Xd(a.doc,j.line).text).length==j.ch){var k=Ig(i,i.length,a.options.tabSize)-i.length;j=Hf(j.line,Math.max(0,Math.round((f-Sa(a.display).left)/sb(a.display))-k))}return j}function Ub(a){var b=this,c=b.display;if(!(c.activeTouch&&c.input.supportsTouch()||xe(b,a))){if(c.shift=a.shiftKey,Sb(c,a))return void(rf||(c.scroller.draggable=!1,setTimeout(function(){c.scroller.draggable=!0},100)));if(!Zb(b,a)){var d=Tb(b,a);switch(window.focus(),ue(a)){case 1:b.state.selectingText?b.state.selectingText(a):d?Vb(b,a,d):te(a)==c.scroller&&wg(a);break;case 2:rf&&(b.state.lastMiddleDown=+new Date),d&&va(b.doc,d),setTimeout(function(){c.input.focus()},20),wg(a);break;case 3:Ef?rc(b,a):oc(b)}}}}function Vb(a,b,c){pf?setTimeout(Ke(Y,a),0):a.curOp.focus=Re();var d,e=+new Date;Mf&&Mf.time>e-400&&0==If(Mf.pos,c)?d="triple":Lf&&Lf.time>e-400&&0==If(Lf.pos,c)?(d="double",Mf={time:e,pos:c}):(d="single",Lf={time:e,pos:c});var f,g=a.doc.sel,h=Af?b.metaKey:b.ctrlKey;a.options.dragDrop&&Vg&&!Z(a)&&"single"==d&&(f=g.contains(c))>-1&&(If((f=g.ranges[f]).from(),c)<0||c.xRel>0)&&(If(f.to(),c)>0||c.xRel<0)?Wb(a,b,c,h):Xb(a,b,c,d,h)}function Wb(a,b,c,d){var e=a.display,f=+new Date,g=Db(a,function(h){rf&&(e.scroller.draggable=!1),a.state.draggingText=!1,Ag(document,"mouseup",g),Ag(e.scroller,"drop",g),Math.abs(b.clientX-h.clientX)+Math.abs(b.clientY-h.clientY)<10&&(wg(h),!d&&+new Date-200<f&&va(a.doc,c),rf||pf&&9==qf?setTimeout(function(){document.body.focus(),e.input.focus()},20):e.input.focus())});rf&&(e.scroller.draggable=!0),a.state.draggingText=g,e.scroller.dragDrop&&e.scroller.dragDrop(),zg(document,"mouseup",g),zg(e.scroller,"drop",g)}function Xb(a,b,c,d,e){function f(b){if(0!=If(q,b))if(q=b,"rect"==d){for(var e=[],f=a.options.tabSize,g=Ig(Xd(j,c.line).text,c.ch,f),h=Ig(Xd(j,b.line).text,b.ch,f),i=Math.min(g,h),n=Math.max(g,h),o=Math.min(c.line,b.line),p=Math.min(a.lastLine(),Math.max(c.line,b.line));p>=o;o++){var r=Xd(j,o).text,s=Ce(r,i,f);i==n?e.push(new ma(Hf(o,s),Hf(o,s))):r.length>s&&e.push(new ma(Hf(o,s),Hf(o,Ce(r,n,f))))}e.length||e.push(new ma(c,c)),Ba(j,na(m.ranges.slice(0,l).concat(e),l),{origin:"*mouse",scroll:!1}),a.scrollIntoView(b)}else{var t=k,u=t.anchor,v=b;if("single"!=d){if("double"==d)var w=a.findWordAt(b);else var w=new ma(Hf(b.line,0),qa(j,Hf(b.line+1,0)));If(w.anchor,u)>0?(v=w.head,u=X(t.from(),w.anchor)):(v=w.anchor,u=W(t.to(),w.head))}var e=m.ranges.slice(0);e[l]=new ma(qa(j,u),v),Ba(j,na(e,l),Gg)}}function g(b){var c=++s,e=Tb(a,b,!0,"rect"==d);if(e)if(0!=If(e,q)){a.curOp.focus=Re(),f(e);var h=u(i,j);(e.line>=h.to||e.line<h.from)&&setTimeout(Db(a,function(){s==c&&g(b)}),150)}else{var k=b.clientY<r.top?-20:b.clientY>r.bottom?20:0;k&&setTimeout(Db(a,function(){s==c&&(i.scroller.scrollTop+=k,g(b))}),50)}}function h(b){a.state.selectingText=!1,s=1/0,wg(b),i.input.focus(),Ag(document,"mousemove",t),Ag(document,"mouseup",v),j.history.lastSelOrigin=null}var i=a.display,j=a.doc;wg(b);var k,l,m=j.sel,n=m.ranges;if(e&&!b.shiftKey?(l=j.sel.contains(c),k=l>-1?n[l]:new ma(c,c)):(k=j.sel.primary(),l=j.sel.primIndex),b.altKey)d="rect",e||(k=new ma(c,c)),c=Tb(a,b,!0,!0),l=-1;else if("double"==d){var o=a.findWordAt(c);k=a.display.shift||j.extend?ua(j,k,o.anchor,o.head):o}else if("triple"==d){var p=new ma(Hf(c.line,0),qa(j,Hf(c.line+1,0)));k=a.display.shift||j.extend?ua(j,k,p.anchor,p.head):p}else k=ua(j,k,c);e?-1==l?(l=n.length,Ba(j,na(n.concat([k]),l),{scroll:!1,origin:"*mouse"})):n.length>1&&n[l].empty()&&"single"==d&&!b.shiftKey?(Ba(j,na(n.slice(0,l).concat(n.slice(l+1)),0),{scroll:!1,origin:"*mouse"}),m=j.sel):xa(j,l,k,Gg):(l=0,Ba(j,new la([k],0),Gg),m=j.sel);var q=c,r=i.wrapper.getBoundingClientRect(),s=0,t=Db(a,function(a){ue(a)?g(a):h(a)}),v=Db(a,h);a.state.selectingText=v,zg(document,"mousemove",t),zg(document,"mouseup",v)}function Yb(a,b,c,d,e){try{var f=b.clientX,g=b.clientY}catch(b){return!1}if(f>=Math.floor(a.display.gutters.getBoundingClientRect().right))return!1;d&&wg(b);var h=a.display,i=h.lineDiv.getBoundingClientRect();if(g>i.bottom||!ze(a,c))return se(b);g-=i.top-h.viewOffset;for(var j=0;j<a.options.gutters.length;++j){var k=h.gutters.childNodes[j];if(k&&k.getBoundingClientRect().right>=f){var l=ae(a.doc,g),m=a.options.gutters[j];return e(a,c,a,l,m,b),se(b)}}}function Zb(a,b){return Yb(a,b,"gutterClick",!0,ve)}function $b(a){var b=this;if(bc(b),!xe(b,a)&&!Sb(b.display,a)){wg(a),pf&&(Qf=+new Date);var c=Tb(b,a,!0),d=a.dataTransfer.files;if(c&&!Z(b))if(d&&d.length&&window.FileReader&&window.File)for(var e=d.length,f=Array(e),g=0,h=function(a,d){var h=new FileReader;h.onload=Db(b,function(){if(f[d]=h.result,++g==e){c=qa(b.doc,c);var a={from:c,to:c,text:b.doc.splitLines(f.join(b.doc.lineSeparator())),origin:"paste"};yc(b.doc,a),Aa(b.doc,oa(c,Wf(a)))}}),h.readAsText(a)},i=0;e>i;++i)h(d[i],i);else{if(b.state.draggingText&&b.doc.sel.contains(c)>-1)return b.state.draggingText(a),void setTimeout(function(){b.display.input.focus()},20);try{var f=a.dataTransfer.getData("Text");if(f){if(b.state.draggingText&&!(Af?a.altKey:a.ctrlKey))var j=b.listSelections();if(Ca(b.doc,oa(c,c)),j)for(var i=0;i<j.length;++i)Ec(b.doc,"",j[i].anchor,j[i].head,"drag");b.replaceSelection(f,"around","paste"),b.display.input.focus()}}catch(a){}}}}function _b(a,b){if(pf&&(!a.state.draggingText||+new Date-Qf<100))return void yg(b);if(!xe(a,b)&&!Sb(a.display,b)&&(b.dataTransfer.setData("Text",a.getSelection()),b.dataTransfer.setDragImage&&!vf)){var c=Oe("img",null,null,"position: fixed; left: 0; top: 0;");c.src="data:image/gif;base64,R0lGODlhAQABAAAAACH5BAEKAAEALAAAAAABAAEAAAICTAEAOw==",uf&&(c.width=c.height=1,a.display.wrapper.appendChild(c),c._top=c.offsetTop),b.dataTransfer.setDragImage(c,0,0),uf&&c.parentNode.removeChild(c)}}function ac(a,b){var c=Tb(a,b);if(c){var d=document.createDocumentFragment();Ja(a,c,d),a.display.dragCursor||(a.display.dragCursor=Oe("div",null,"CodeMirror-cursors CodeMirror-dragcursors"),a.display.lineSpace.insertBefore(a.display.dragCursor,a.display.cursorDiv)),Qe(a.display.dragCursor,d)}}function bc(a){a.display.dragCursor&&(a.display.lineSpace.removeChild(a.display.dragCursor),a.display.dragCursor=null)}function cc(a,b){Math.abs(a.doc.scrollTop-b)<2||(a.doc.scrollTop=b,mf||D(a,{top:b}),a.display.scroller.scrollTop!=b&&(a.display.scroller.scrollTop=b),a.display.scrollbars.setScrollTop(b),mf&&D(a),Ma(a,100))}function dc(a,b,c){(c?b==a.doc.scrollLeft:Math.abs(a.doc.scrollLeft-b)<2)||(b=Math.min(b,a.display.scroller.scrollWidth-a.display.scroller.clientWidth),a.doc.scrollLeft=b,v(a),a.display.scroller.scrollLeft!=b&&(a.display.scroller.scrollLeft=b),a.display.scrollbars.setScrollLeft(b))}function ec(a,b){var c=Tf(b),d=c.x,e=c.y,f=a.display,g=f.scroller;if(d&&g.scrollWidth>g.clientWidth||e&&g.scrollHeight>g.clientHeight){if(e&&Af&&rf)a:for(var h=b.target,i=f.view;h!=g;h=h.parentNode)for(var j=0;j<i.length;j++)if(i[j].node==h){a.display.currentWheelTarget=h;break a}if(d&&!mf&&!uf&&null!=Sf)return e&&cc(a,Math.max(0,Math.min(g.scrollTop+e*Sf,g.scrollHeight-g.clientHeight))),dc(a,Math.max(0,Math.min(g.scrollLeft+d*Sf,g.scrollWidth-g.clientWidth))),wg(b),void(f.wheelStartX=null);if(e&&null!=Sf){var k=e*Sf,l=a.doc.scrollTop,m=l+f.wrapper.clientHeight;0>k?l=Math.max(0,l+k-50):m=Math.min(a.doc.height,m+k+50),D(a,{top:l,bottom:m})}20>Rf&&(null==f.wheelStartX?(f.wheelStartX=g.scrollLeft,f.wheelStartY=g.scrollTop,f.wheelDX=d,f.wheelDY=e,setTimeout(function(){if(null!=f.wheelStartX){var a=g.scrollLeft-f.wheelStartX,b=g.scrollTop-f.wheelStartY,c=b&&f.wheelDY&&b/f.wheelDY||a&&f.wheelDX&&a/f.wheelDX;f.wheelStartX=f.wheelStartY=null,c&&(Sf=(Sf*Rf+c)/(Rf+1),++Rf)}},200)):(f.wheelDX+=d,f.wheelDY+=e))}}function fc(a,b,c){if("string"==typeof b&&(b=fg[b],!b))return!1;a.display.input.ensurePolled();var d=a.display.shift,e=!1;try{Z(a)&&(a.state.suppressEdits=!0),c&&(a.display.shift=!1),e=b(a)!=Eg}finally{a.display.shift=d,a.state.suppressEdits=!1}return e}function gc(a,b,c){for(var d=0;d<a.state.keyMaps.length;d++){var e=hg(b,a.state.keyMaps[d],c,a);if(e)return e}return a.options.extraKeys&&hg(b,a.options.extraKeys,c,a)||hg(b,a.options.keyMap,c,a)}function hc(a,b,c,d){var e=a.state.keySeq;if(e){if(ig(b))return"handled";Uf.set(50,function(){a.state.keySeq==e&&(a.state.keySeq=null,a.display.input.reset())}),b=e+" "+b}var f=gc(a,b,d);return"multi"==f&&(a.state.keySeq=b),"handled"==f&&ve(a,"keyHandled",a,b,c),("handled"==f||"multi"==f)&&(wg(c),La(a)),e&&!f&&/\'$/.test(b)?(wg(c),!0):!!f}function ic(a,b){var c=jg(b,!0);return c?b.shiftKey&&!a.state.keySeq?hc(a,"Shift-"+c,b,function(b){return fc(a,b,!0)})||hc(a,c,b,function(b){return("string"==typeof b?/^go[A-Z]/.test(b):b.motion)?fc(a,b):void 0}):hc(a,c,b,function(b){return fc(a,b)}):!1}function jc(a,b,c){return hc(a,"'"+c+"'",b,function(b){return fc(a,b,!0)})}function kc(a){var b=this;if(b.curOp.focus=Re(),!xe(b,a)){pf&&11>qf&&27==a.keyCode&&(a.returnValue=!1);var c=a.keyCode;b.display.shift=16==c||a.shiftKey;var d=ic(b,a);uf&&(Vf=d?c:null,!d&&88==c&&!Yg&&(Af?a.metaKey:a.ctrlKey)&&b.replaceSelection("",null,"cut")),18!=c||/\bCodeMirror-crosshair\b/.test(b.display.lineDiv.className)||lc(b)}}function lc(a){function b(a){18!=a.keyCode&&a.altKey||(Sg(c,"CodeMirror-crosshair"),Ag(document,"keyup",b),Ag(document,"mouseover",b))}var c=a.display.lineDiv;Tg(c,"CodeMirror-crosshair"),zg(document,"keyup",b),zg(document,"mouseover",b)}function mc(a){16==a.keyCode&&(this.doc.sel.shift=!1),xe(this,a)}function nc(a){var b=this;if(!(Sb(b.display,a)||xe(b,a)||a.ctrlKey&&!a.altKey||Af&&a.metaKey)){var c=a.keyCode,d=a.charCode;if(uf&&c==Vf)return Vf=null,void wg(a);if(!uf||a.which&&!(a.which<10)||!ic(b,a)){var e=String.fromCharCode(null==d?c:d);jc(b,a,e)||b.display.input.onKeyPress(a)}}}function oc(a){a.state.delayingBlurEvent=!0,setTimeout(function(){a.state.delayingBlurEvent&&(a.state.delayingBlurEvent=!1,qc(a))},100)}function pc(a){a.state.delayingBlurEvent&&(a.state.delayingBlurEvent=!1),"nocursor"!=a.options.readOnly&&(a.state.focused||(Bg(a,"focus",a),a.state.focused=!0,Tg(a.display.wrapper,"CodeMirror-focused"),a.curOp||a.display.selForContextMenu==a.doc.sel||(a.display.input.reset(),rf&&setTimeout(function(){a.display.input.reset(!0)},20)),a.display.input.receivedFocus()),La(a))}function qc(a){a.state.delayingBlurEvent||(a.state.focused&&(Bg(a,"blur",a),a.state.focused=!1,Sg(a.display.wrapper,"CodeMirror-focused")),clearInterval(a.display.blinker),setTimeout(function(){a.state.focused||(a.display.shift=!1)},150))}function rc(a,b){Sb(a.display,b)||sc(a,b)||a.display.input.onContextMenu(b)}function sc(a,b){return ze(a,"gutterContextMenu")?Yb(a,b,"gutterContextMenu",!1,Bg):!1}function tc(a,b){if(If(a,b.from)<0)return a;if(If(a,b.to)<=0)return Wf(b);var c=a.line+b.text.length-(b.to.line-b.from.line)-1,d=a.ch;return a.line==b.to.line&&(d+=Wf(b).ch-b.to.ch),Hf(c,d)}function uc(a,b){for(var c=[],d=0;d<a.sel.ranges.length;d++){var e=a.sel.ranges[d];c.push(new ma(tc(e.anchor,b),tc(e.head,b)))}return na(c,a.sel.primIndex)}function vc(a,b,c){return a.line==b.line?Hf(c.line,a.ch-b.ch+c.ch):Hf(c.line+(a.line-b.line),a.ch)}function wc(a,b,c){for(var d=[],e=Hf(a.first,0),f=e,g=0;g<b.length;g++){var h=b[g],i=vc(h.from,e,f),j=vc(Wf(h),e,f);if(e=h.to,f=j,"around"==c){var k=a.sel.ranges[g],l=If(k.head,k.anchor)<0;d[g]=new ma(l?j:i,l?i:j)}else d[g]=new ma(i,i)}return new la(d,a.sel.primIndex)}function xc(a,b,c){var d={canceled:!1,from:b.from,to:b.to,text:b.text,origin:b.origin,cancel:function(){this.canceled=!0}};return c&&(d.update=function(b,c,d,e){b&&(this.from=qa(a,b)),c&&(this.to=qa(a,c)),d&&(this.text=d),void 0!==e&&(this.origin=e)}),Bg(a,"beforeChange",a,d),a.cm&&Bg(a.cm,"beforeChange",a.cm,d),d.canceled?null:{from:d.from,to:d.to,text:d.text,origin:d.origin}}function yc(a,b,c){if(a.cm){if(!a.cm.curOp)return Db(a.cm,yc)(a,b,c);if(a.cm.state.suppressEdits)return}if(!(ze(a,"beforeChange")||a.cm&&ze(a.cm,"beforeChange"))||(b=xc(a,b,!0))){var d=Ff&&!c&&gd(a,b.from,b.to);if(d)for(var e=d.length-1;e>=0;--e)zc(a,{from:d[e].from,to:d[e].to,text:e?[""]:b.text});else zc(a,b)}}function zc(a,b){if(1!=b.text.length||""!=b.text[0]||0!=If(b.from,b.to)){var c=uc(a,b);he(a,b,c,a.cm?a.cm.curOp.id:NaN),Cc(a,b,c,dd(a,b));var d=[];Vd(a,function(a,c){c||-1!=Fe(d,a.history)||(re(a.history,b),d.push(a.history)),Cc(a,b,null,dd(a,b))})}}function Ac(a,b,c){if(!a.cm||!a.cm.state.suppressEdits){for(var d,e=a.history,f=a.sel,g="undo"==b?e.done:e.undone,h="undo"==b?e.undone:e.done,i=0;i<g.length&&(d=g[i],c?!d.ranges||d.equals(a.sel):d.ranges);i++);if(i!=g.length){for(e.lastOrigin=e.lastSelOrigin=null;d=g.pop(),d.ranges;){if(ke(d,h),c&&!d.equals(a.sel))return void Ba(a,d,{clearRedo:!1});f=d}var j=[];ke(f,h),h.push({changes:j,generation:e.generation}),e.generation=d.generation||++e.maxGeneration;for(var k=ze(a,"beforeChange")||a.cm&&ze(a.cm,"beforeChange"),i=d.changes.length-1;i>=0;--i){var l=d.changes[i];if(l.origin=b,k&&!xc(a,l,!1))return void(g.length=0);j.push(ee(a,l));var m=i?uc(a,l):Ee(g);Cc(a,l,m,fd(a,l)),!i&&a.cm&&a.cm.scrollIntoView({from:l.from,to:Wf(l)});var n=[];Vd(a,function(a,b){b||-1!=Fe(n,a.history)||(re(a.history,l),n.push(a.history)),Cc(a,l,null,fd(a,l))})}}}}function Bc(a,b){if(0!=b&&(a.first+=b,a.sel=new la(Ge(a.sel.ranges,function(a){return new ma(Hf(a.anchor.line+b,a.anchor.ch),Hf(a.head.line+b,a.head.ch))}),a.sel.primIndex),a.cm)){Ib(a.cm,a.first,a.first-b,b);for(var c=a.cm.display,d=c.viewFrom;d<c.viewTo;d++)Jb(a.cm,d,"gutter")}}function Cc(a,b,c,d){if(a.cm&&!a.cm.curOp)return Db(a.cm,Cc)(a,b,c,d);if(b.to.line<a.first)return void Bc(a,b.text.length-1-(b.to.line-b.from.line));if(!(b.from.line>a.lastLine())){if(b.from.line<a.first){var e=b.text.length-1-(a.first-b.from.line);Bc(a,e),b={from:Hf(a.first,0),to:Hf(b.to.line+e,b.to.ch),text:[Ee(b.text)],origin:b.origin}}var f=a.lastLine();b.to.line>f&&(b={from:b.from,to:Hf(f,Xd(a,f).text.length),text:[b.text[0]],origin:b.origin}),b.removed=Yd(a,b.from,b.to),c||(c=uc(a,b)),a.cm?Dc(a.cm,b,d):Sd(a,b,d),Ca(a,c,Fg)}}function Dc(a,b,c){var d=a.doc,e=a.display,g=b.from,h=b.to,i=!1,j=g.line;a.options.lineWrapping||(j=_d(qd(Xd(d,g.line))),d.iter(j,h.line+1,function(a){return a==e.maxLine?(i=!0,!0):void 0})),d.sel.contains(b.from,b.to)>-1&&ye(a),Sd(d,b,c,f(a)),a.options.lineWrapping||(d.iter(j,g.line+b.text.length,function(a){var b=l(a);b>e.maxLineLength&&(e.maxLine=a,e.maxLineLength=b,e.maxLineChanged=!0,i=!1)}),i&&(a.curOp.updateMaxLine=!0)),d.frontier=Math.min(d.frontier,g.line),Ma(a,400);var k=b.text.length-(h.line-g.line)-1;b.full?Ib(a):g.line!=h.line||1!=b.text.length||Rd(a.doc,b)?Ib(a,g.line,h.line+1,k):Jb(a,g.line,"text");var m=ze(a,"changes"),n=ze(a,"change");if(n||m){var o={from:g,to:h,text:b.text,removed:b.removed,origin:b.origin};n&&ve(a,"change",a,o),m&&(a.curOp.changeObjs||(a.curOp.changeObjs=[])).push(o)}a.display.selForContextMenu=null}function Ec(a,b,c,d,e){if(d||(d=c),If(d,c)<0){var f=d;d=c,c=f}"string"==typeof b&&(b=a.splitLines(b)),yc(a,{from:c,to:d,text:b,origin:e})}function Fc(a,b){if(!xe(a,"scrollCursorIntoView")){var c=a.display,d=c.sizer.getBoundingClientRect(),e=null;if(b.top+d.top<0?e=!0:b.bottom+d.top>(window.innerHeight||document.documentElement.clientHeight)&&(e=!1),null!=e&&!xf){var f=Oe("div","",null,"position: absolute; top: "+(b.top-c.viewOffset-Qa(a.display))+"px; height: "+(b.bottom-b.top+Ta(a)+c.barHeight)+"px; left: "+b.left+"px; width: 2px;");a.display.lineSpace.appendChild(f),f.scrollIntoView(e),a.display.lineSpace.removeChild(f)}}}function Gc(a,b,c,d){null==d&&(d=0);for(var e=0;5>e;e++){var f=!1,g=mb(a,b),h=c&&c!=b?mb(a,c):g,i=Ic(a,Math.min(g.left,h.left),Math.min(g.top,h.top)-d,Math.max(g.left,h.left),Math.max(g.bottom,h.bottom)+d),j=a.doc.scrollTop,k=a.doc.scrollLeft;if(null!=i.scrollTop&&(cc(a,i.scrollTop),Math.abs(a.doc.scrollTop-j)>1&&(f=!0)),null!=i.scrollLeft&&(dc(a,i.scrollLeft),Math.abs(a.doc.scrollLeft-k)>1&&(f=!0)),!f)break}return g}function Hc(a,b,c,d,e){var f=Ic(a,b,c,d,e);null!=f.scrollTop&&cc(a,f.scrollTop),null!=f.scrollLeft&&dc(a,f.scrollLeft)}function Ic(a,b,c,d,e){var f=a.display,g=rb(a.display);0>c&&(c=0);var h=a.curOp&&null!=a.curOp.scrollTop?a.curOp.scrollTop:f.scroller.scrollTop,i=Va(a),j={};e-c>i&&(e=c+i);var k=a.doc.height+Ra(f),l=g>c,m=e>k-g;if(h>c)j.scrollTop=l?0:c;else if(e>h+i){var n=Math.min(c,(m?k:e)-i);n!=h&&(j.scrollTop=n)}var o=a.curOp&&null!=a.curOp.scrollLeft?a.curOp.scrollLeft:f.scroller.scrollLeft,p=Ua(a)-(a.options.fixedGutter?f.gutters.offsetWidth:0),q=d-b>p;return q&&(d=b+p),10>b?j.scrollLeft=0:o>b?j.scrollLeft=Math.max(0,b-(q?0:10)):d>p+o-3&&(j.scrollLeft=d+(q?0:10)-p),j}function Jc(a,b,c){(null!=b||null!=c)&&Lc(a),null!=b&&(a.curOp.scrollLeft=(null==a.curOp.scrollLeft?a.doc.scrollLeft:a.curOp.scrollLeft)+b),null!=c&&(a.curOp.scrollTop=(null==a.curOp.scrollTop?a.doc.scrollTop:a.curOp.scrollTop)+c)}function Kc(a){Lc(a);var b=a.getCursor(),c=b,d=b;a.options.lineWrapping||(c=b.ch?Hf(b.line,b.ch-1):b,d=Hf(b.line,b.ch+1)),a.curOp.scrollToPos={from:c,to:d,margin:a.options.cursorScrollMargin,isCursor:!0}}function Lc(a){var b=a.curOp.scrollToPos;if(b){a.curOp.scrollToPos=null;var c=nb(a,b.from),d=nb(a,b.to),e=Ic(a,Math.min(c.left,d.left),Math.min(c.top,d.top)-b.margin,Math.max(c.right,d.right),Math.max(c.bottom,d.bottom)+b.margin);a.scrollTo(e.scrollLeft,e.scrollTop)}}function Mc(a,b,c,d){var e,f=a.doc;null==c&&(c="add"),"smart"==c&&(f.mode.indent?e=Pa(a,b):c="prev");var g=a.options.tabSize,h=Xd(f,b),i=Ig(h.text,null,g);h.stateAfter&&(h.stateAfter=null);var j,k=h.text.match(/^\s*/)[0];if(d||/\S/.test(h.text)){if("smart"==c&&(j=f.mode.indent(e,h.text.slice(k.length),h.text),j==Eg||j>150)){if(!d)return;c="prev"}}else j=0,c="not";"prev"==c?j=b>f.first?Ig(Xd(f,b-1).text,null,g):0:"add"==c?j=i+a.options.indentUnit:"subtract"==c?j=i-a.options.indentUnit:"number"==typeof c&&(j=i+c),
|
3 |
+
j=Math.max(0,j);var l="",m=0;if(a.options.indentWithTabs)for(var n=Math.floor(j/g);n;--n)m+=g,l+=" ";if(j>m&&(l+=De(j-m)),l!=k)return Ec(f,l,Hf(b,0),Hf(b,k.length),"+input"),h.stateAfter=null,!0;for(var n=0;n<f.sel.ranges.length;n++){var o=f.sel.ranges[n];if(o.head.line==b&&o.head.ch<k.length){var m=Hf(b,k.length);xa(f,n,new ma(m,m));break}}}function Nc(a,b,c,d){var e=b,f=b;return"number"==typeof b?f=Xd(a,pa(a,b)):e=_d(b),null==e?null:(d(f,e)&&a.cm&&Jb(a.cm,e,c),f)}function Oc(a,b){for(var c=a.doc.sel.ranges,d=[],e=0;e<c.length;e++){for(var f=b(c[e]);d.length&&If(f.from,Ee(d).to)<=0;){var g=d.pop();if(If(g.from,f.from)<0){f.from=g.from;break}}d.push(f)}Cb(a,function(){for(var b=d.length-1;b>=0;b--)Ec(a.doc,"",d[b].from,d[b].to,"+delete");Kc(a)})}function Pc(a,b,c,d,e){function f(){var b=h+c;return b<a.first||b>=a.first+a.size?l=!1:(h=b,k=Xd(a,b))}function g(a){var b=(e?kf:lf)(k,i,c,!0);if(null==b){if(a||!f())return l=!1;i=e?(0>c?cf:bf)(k):0>c?k.text.length:0}else i=b;return!0}var h=b.line,i=b.ch,j=c,k=Xd(a,h),l=!0;if("char"==d)g();else if("column"==d)g(!0);else if("word"==d||"group"==d)for(var m=null,n="group"==d,o=a.cm&&a.cm.getHelper(b,"wordChars"),p=!0;!(0>c)||g(!p);p=!1){var q=k.text.charAt(i)||"\n",r=Le(q,o)?"w":n&&"\n"==q?"n":!n||/\s/.test(q)?null:"p";if(!n||p||r||(r="s"),m&&m!=r){0>c&&(c=1,g());break}if(r&&(m=r),c>0&&!g(!p))break}var s=Ga(a,Hf(h,i),j,!0);return l||(s.hitSide=!0),s}function Qc(a,b,c,d){var e,f=a.doc,g=b.left;if("page"==d){var h=Math.min(a.display.wrapper.clientHeight,window.innerHeight||document.documentElement.clientHeight);e=b.top+c*(h-(0>c?1.5:.5)*rb(a.display))}else"line"==d&&(e=c>0?b.bottom+3:b.top-3);for(;;){var i=pb(a,g,e);if(!i.outside)break;if(0>c?0>=e:e>=f.height){i.hitSide=!0;break}e+=5*c}return i}function Rc(b,c,d,e){a.defaults[b]=c,d&&(Yf[b]=e?function(a,b,c){c!=Zf&&d(a,b,c)}:d)}function Sc(a){for(var b,c,d,e,f=a.split(/-(?!$)/),a=f[f.length-1],g=0;g<f.length-1;g++){var h=f[g];if(/^(cmd|meta|m)$/i.test(h))e=!0;else if(/^a(lt)?$/i.test(h))b=!0;else if(/^(c|ctrl|control)$/i.test(h))c=!0;else{if(!/^s(hift)$/i.test(h))throw new Error("Unrecognized modifier name: "+h);d=!0}}return b&&(a="Alt-"+a),c&&(a="Ctrl-"+a),e&&(a="Cmd-"+a),d&&(a="Shift-"+a),a}function Tc(a){return"string"==typeof a?gg[a]:a}function Uc(a,b,c,d,e){if(d&&d.shared)return Vc(a,b,c,d,e);if(a.cm&&!a.cm.curOp)return Db(a.cm,Uc)(a,b,c,d,e);var f=new mg(a,e),g=If(b,c);if(d&&Je(d,f,!1),g>0||0==g&&f.clearWhenEmpty!==!1)return f;if(f.replacedWith&&(f.collapsed=!0,f.widgetNode=Oe("span",[f.replacedWith],"CodeMirror-widget"),d.handleMouseEvents||f.widgetNode.setAttribute("cm-ignore-events","true"),d.insertLeft&&(f.widgetNode.insertLeft=!0)),f.collapsed){if(pd(a,b.line,b,c,f)||b.line!=c.line&&pd(a,c.line,b,c,f))throw new Error("Inserting collapsed marker partially overlapping an existing one");Gf=!0}f.addToHistory&&he(a,{from:b,to:c,origin:"markText"},a.sel,NaN);var h,i=b.line,j=a.cm;if(a.iter(i,c.line+1,function(a){j&&f.collapsed&&!j.options.lineWrapping&&qd(a)==j.display.maxLine&&(h=!0),f.collapsed&&i!=b.line&&$d(a,0),ad(a,new Zc(f,i==b.line?b.ch:null,i==c.line?c.ch:null)),++i}),f.collapsed&&a.iter(b.line,c.line+1,function(b){ud(a,b)&&$d(b,0)}),f.clearOnEnter&&zg(f,"beforeCursorEnter",function(){f.clear()}),f.readOnly&&(Ff=!0,(a.history.done.length||a.history.undone.length)&&a.clearHistory()),f.collapsed&&(f.id=++lg,f.atomic=!0),j){if(h&&(j.curOp.updateMaxLine=!0),f.collapsed)Ib(j,b.line,c.line+1);else if(f.className||f.title||f.startStyle||f.endStyle||f.css)for(var k=b.line;k<=c.line;k++)Jb(j,k,"text");f.atomic&&Ea(j.doc),ve(j,"markerAdded",j,f)}return f}function Vc(a,b,c,d,e){d=Je(d),d.shared=!1;var f=[Uc(a,b,c,d,e)],g=f[0],h=d.widgetNode;return Vd(a,function(a){h&&(d.widgetNode=h.cloneNode(!0)),f.push(Uc(a,qa(a,b),qa(a,c),d,e));for(var i=0;i<a.linked.length;++i)if(a.linked[i].isParent)return;g=Ee(f)}),new ng(f,g)}function Wc(a){return a.findMarks(Hf(a.first,0),a.clipPos(Hf(a.lastLine())),function(a){return a.parent})}function Xc(a,b){for(var c=0;c<b.length;c++){var d=b[c],e=d.find(),f=a.clipPos(e.from),g=a.clipPos(e.to);if(If(f,g)){var h=Uc(a,f,g,d.primary,d.primary.type);d.markers.push(h),h.parent=d}}}function Yc(a){for(var b=0;b<a.length;b++){var c=a[b],d=[c.primary.doc];Vd(c.primary.doc,function(a){d.push(a)});for(var e=0;e<c.markers.length;e++){var f=c.markers[e];-1==Fe(d,f.doc)&&(f.parent=null,c.markers.splice(e--,1))}}}function Zc(a,b,c){this.marker=a,this.from=b,this.to=c}function $c(a,b){if(a)for(var c=0;c<a.length;++c){var d=a[c];if(d.marker==b)return d}}function _c(a,b){for(var c,d=0;d<a.length;++d)a[d]!=b&&(c||(c=[])).push(a[d]);return c}function ad(a,b){a.markedSpans=a.markedSpans?a.markedSpans.concat([b]):[b],b.marker.attachLine(a)}function bd(a,b,c){if(a)for(var d,e=0;e<a.length;++e){var f=a[e],g=f.marker,h=null==f.from||(g.inclusiveLeft?f.from<=b:f.from<b);if(h||f.from==b&&"bookmark"==g.type&&(!c||!f.marker.insertLeft)){var i=null==f.to||(g.inclusiveRight?f.to>=b:f.to>b);(d||(d=[])).push(new Zc(g,f.from,i?null:f.to))}}return d}function cd(a,b,c){if(a)for(var d,e=0;e<a.length;++e){var f=a[e],g=f.marker,h=null==f.to||(g.inclusiveRight?f.to>=b:f.to>b);if(h||f.from==b&&"bookmark"==g.type&&(!c||f.marker.insertLeft)){var i=null==f.from||(g.inclusiveLeft?f.from<=b:f.from<b);(d||(d=[])).push(new Zc(g,i?null:f.from-b,null==f.to?null:f.to-b))}}return d}function dd(a,b){if(b.full)return null;var c=sa(a,b.from.line)&&Xd(a,b.from.line).markedSpans,d=sa(a,b.to.line)&&Xd(a,b.to.line).markedSpans;if(!c&&!d)return null;var e=b.from.ch,f=b.to.ch,g=0==If(b.from,b.to),h=bd(c,e,g),i=cd(d,f,g),j=1==b.text.length,k=Ee(b.text).length+(j?e:0);if(h)for(var l=0;l<h.length;++l){var m=h[l];if(null==m.to){var n=$c(i,m.marker);n?j&&(m.to=null==n.to?null:n.to+k):m.to=e}}if(i)for(var l=0;l<i.length;++l){var m=i[l];if(null!=m.to&&(m.to+=k),null==m.from){var n=$c(h,m.marker);n||(m.from=k,j&&(h||(h=[])).push(m))}else m.from+=k,j&&(h||(h=[])).push(m)}h&&(h=ed(h)),i&&i!=h&&(i=ed(i));var o=[h];if(!j){var p,q=b.text.length-2;if(q>0&&h)for(var l=0;l<h.length;++l)null==h[l].to&&(p||(p=[])).push(new Zc(h[l].marker,null,null));for(var l=0;q>l;++l)o.push(p);o.push(i)}return o}function ed(a){for(var b=0;b<a.length;++b){var c=a[b];null!=c.from&&c.from==c.to&&c.marker.clearWhenEmpty!==!1&&a.splice(b--,1)}return a.length?a:null}function fd(a,b){var c=ne(a,b),d=dd(a,b);if(!c)return d;if(!d)return c;for(var e=0;e<c.length;++e){var f=c[e],g=d[e];if(f&&g)a:for(var h=0;h<g.length;++h){for(var i=g[h],j=0;j<f.length;++j)if(f[j].marker==i.marker)continue a;f.push(i)}else g&&(c[e]=g)}return c}function gd(a,b,c){var d=null;if(a.iter(b.line,c.line+1,function(a){if(a.markedSpans)for(var b=0;b<a.markedSpans.length;++b){var c=a.markedSpans[b].marker;!c.readOnly||d&&-1!=Fe(d,c)||(d||(d=[])).push(c)}}),!d)return null;for(var e=[{from:b,to:c}],f=0;f<d.length;++f)for(var g=d[f],h=g.find(0),i=0;i<e.length;++i){var j=e[i];if(!(If(j.to,h.from)<0||If(j.from,h.to)>0)){var k=[i,1],l=If(j.from,h.from),m=If(j.to,h.to);(0>l||!g.inclusiveLeft&&!l)&&k.push({from:j.from,to:h.from}),(m>0||!g.inclusiveRight&&!m)&&k.push({from:h.to,to:j.to}),e.splice.apply(e,k),i+=k.length-1}}return e}function hd(a){var b=a.markedSpans;if(b){for(var c=0;c<b.length;++c)b[c].marker.detachLine(a);a.markedSpans=null}}function id(a,b){if(b){for(var c=0;c<b.length;++c)b[c].marker.attachLine(a);a.markedSpans=b}}function jd(a){return a.inclusiveLeft?-1:0}function kd(a){return a.inclusiveRight?1:0}function ld(a,b){var c=a.lines.length-b.lines.length;if(0!=c)return c;var d=a.find(),e=b.find(),f=If(d.from,e.from)||jd(a)-jd(b);if(f)return-f;var g=If(d.to,e.to)||kd(a)-kd(b);return g?g:b.id-a.id}function md(a,b){var c,d=Gf&&a.markedSpans;if(d)for(var e,f=0;f<d.length;++f)e=d[f],e.marker.collapsed&&null==(b?e.from:e.to)&&(!c||ld(c,e.marker)<0)&&(c=e.marker);return c}function nd(a){return md(a,!0)}function od(a){return md(a,!1)}function pd(a,b,c,d,e){var f=Xd(a,b),g=Gf&&f.markedSpans;if(g)for(var h=0;h<g.length;++h){var i=g[h];if(i.marker.collapsed){var j=i.marker.find(0),k=If(j.from,c)||jd(i.marker)-jd(e),l=If(j.to,d)||kd(i.marker)-kd(e);if(!(k>=0&&0>=l||0>=k&&l>=0)&&(0>=k&&(If(j.to,c)>0||i.marker.inclusiveRight&&e.inclusiveLeft)||k>=0&&(If(j.from,d)<0||i.marker.inclusiveLeft&&e.inclusiveRight)))return!0}}}function qd(a){for(var b;b=nd(a);)a=b.find(-1,!0).line;return a}function rd(a){for(var b,c;b=od(a);)a=b.find(1,!0).line,(c||(c=[])).push(a);return c}function sd(a,b){var c=Xd(a,b),d=qd(c);return c==d?b:_d(d)}function td(a,b){if(b>a.lastLine())return b;var c,d=Xd(a,b);if(!ud(a,d))return b;for(;c=od(d);)d=c.find(1,!0).line;return _d(d)+1}function ud(a,b){var c=Gf&&b.markedSpans;if(c)for(var d,e=0;e<c.length;++e)if(d=c[e],d.marker.collapsed){if(null==d.from)return!0;if(!d.marker.widgetNode&&0==d.from&&d.marker.inclusiveLeft&&vd(a,b,d))return!0}}function vd(a,b,c){if(null==c.to){var d=c.marker.find(1,!0);return vd(a,d.line,$c(d.line.markedSpans,c.marker))}if(c.marker.inclusiveRight&&c.to==b.text.length)return!0;for(var e,f=0;f<b.markedSpans.length;++f)if(e=b.markedSpans[f],e.marker.collapsed&&!e.marker.widgetNode&&e.from==c.to&&(null==e.to||e.to!=c.from)&&(e.marker.inclusiveLeft||c.marker.inclusiveRight)&&vd(a,b,e))return!0}function wd(a,b,c){be(b)<(a.curOp&&a.curOp.scrollTop||a.doc.scrollTop)&&Jc(a,null,c)}function xd(a){if(null!=a.height)return a.height;var b=a.doc.cm;if(!b)return 0;if(!Pg(document.body,a.node)){var c="position: relative;";a.coverGutter&&(c+="margin-left: -"+b.display.gutters.offsetWidth+"px;"),a.noHScroll&&(c+="width: "+b.display.wrapper.clientWidth+"px;"),Qe(b.display.measure,Oe("div",[a.node],null,c))}return a.height=a.node.offsetHeight}function yd(a,b,c,d){var e=new og(a,c,d),f=a.cm;return f&&e.noHScroll&&(f.display.alignWidgets=!0),Nc(a,b,"widget",function(b){var c=b.widgets||(b.widgets=[]);if(null==e.insertAt?c.push(e):c.splice(Math.min(c.length-1,Math.max(0,e.insertAt)),0,e),e.line=b,f&&!ud(a,b)){var d=be(b)<a.scrollTop;$d(b,b.height+xd(e)),d&&Jc(f,null,e.height),f.curOp.forceUpdate=!0}return!0}),e}function zd(a,b,c,d){a.text=b,a.stateAfter&&(a.stateAfter=null),a.styles&&(a.styles=null),null!=a.order&&(a.order=null),hd(a),id(a,c);var e=d?d(a):1;e!=a.height&&$d(a,e)}function Ad(a){a.parent=null,hd(a)}function Bd(a,b){if(a)for(;;){var c=a.match(/(?:^|\s+)line-(background-)?(\S+)/);if(!c)break;a=a.slice(0,c.index)+a.slice(c.index+c[0].length);var d=c[1]?"bgClass":"textClass";null==b[d]?b[d]=c[2]:new RegExp("(?:^|s)"+c[2]+"(?:$|s)").test(b[d])||(b[d]+=" "+c[2])}return a}function Cd(b,c){if(b.blankLine)return b.blankLine(c);if(b.innerMode){var d=a.innerMode(b,c);return d.mode.blankLine?d.mode.blankLine(d.state):void 0}}function Dd(b,c,d,e){for(var f=0;10>f;f++){e&&(e[0]=a.innerMode(b,d).mode);var g=b.token(c,d);if(c.pos>c.start)return g}throw new Error("Mode "+b.name+" failed to advance stream.")}function Ed(a,b,c,d){function e(a){return{start:l.start,end:l.pos,string:l.current(),type:f||null,state:a?dg(g.mode,k):k}}var f,g=a.doc,h=g.mode;b=qa(g,b);var i,j=Xd(g,b.line),k=Pa(a,b.line,c),l=new kg(j.text,a.options.tabSize);for(d&&(i=[]);(d||l.pos<b.ch)&&!l.eol();)l.start=l.pos,f=Dd(h,l,k),d&&i.push(e(!0));return d?i:e()}function Fd(a,b,c,d,e,f,g){var h=c.flattenSpans;null==h&&(h=a.options.flattenSpans);var i,j=0,k=null,l=new kg(b,a.options.tabSize),m=a.options.addModeClass&&[null];for(""==b&&Bd(Cd(c,d),f);!l.eol();){if(l.pos>a.options.maxHighlightLength?(h=!1,g&&Id(a,b,d,l.pos),l.pos=b.length,i=null):i=Bd(Dd(c,l,d,m),f),m){var n=m[0].name;n&&(i="m-"+(i?n+" "+i:n))}if(!h||k!=i){for(;j<l.start;)j=Math.min(l.start,j+5e4),e(j,k);k=i}l.start=l.pos}for(;j<l.pos;){var o=Math.min(l.pos,j+5e4);e(o,k),j=o}}function Gd(a,b,c,d){var e=[a.state.modeGen],f={};Fd(a,b.text,a.doc.mode,c,function(a,b){e.push(a,b)},f,d);for(var g=0;g<a.state.overlays.length;++g){var h=a.state.overlays[g],i=1,j=0;Fd(a,b.text,h.mode,!0,function(a,b){for(var c=i;a>j;){var d=e[i];d>a&&e.splice(i,1,a,e[i+1],d),i+=2,j=Math.min(a,d)}if(b)if(h.opaque)e.splice(c,i-c,a,"cm-overlay "+b),i=c+2;else for(;i>c;c+=2){var f=e[c+1];e[c+1]=(f?f+" ":"")+"cm-overlay "+b}},f)}return{styles:e,classes:f.bgClass||f.textClass?f:null}}function Hd(a,b,c){if(!b.styles||b.styles[0]!=a.state.modeGen){var d=Pa(a,_d(b)),e=Gd(a,b,b.text.length>a.options.maxHighlightLength?dg(a.doc.mode,d):d);b.stateAfter=d,b.styles=e.styles,e.classes?b.styleClasses=e.classes:b.styleClasses&&(b.styleClasses=null),c===a.doc.frontier&&a.doc.frontier++}return b.styles}function Id(a,b,c,d){var e=a.doc.mode,f=new kg(b,a.options.tabSize);for(f.start=f.pos=d||0,""==b&&Cd(e,c);!f.eol();)Dd(e,f,c),f.start=f.pos}function Jd(a,b){if(!a||/^\s*$/.test(a))return null;var c=b.addModeClass?rg:qg;return c[a]||(c[a]=a.replace(/\S+/g,"cm-$&"))}function Kd(a,b){var c=Oe("span",null,null,rf?"padding-right: .1px":null),d={pre:Oe("pre",[c],"CodeMirror-line"),content:c,col:0,pos:0,cm:a,splitSpaces:(pf||rf)&&a.getOption("lineWrapping")};b.measure={};for(var e=0;e<=(b.rest?b.rest.length:0);e++){var f,g=e?b.rest[e-1]:b.line;d.pos=0,d.addToken=Md,Ye(a.display.measure)&&(f=ce(g))&&(d.addToken=Od(d.addToken,f)),d.map=[];var h=b!=a.display.externalMeasured&&_d(g);Qd(g,d,Hd(a,g,h)),g.styleClasses&&(g.styleClasses.bgClass&&(d.bgClass=Te(g.styleClasses.bgClass,d.bgClass||"")),g.styleClasses.textClass&&(d.textClass=Te(g.styleClasses.textClass,d.textClass||""))),0==d.map.length&&d.map.push(0,0,d.content.appendChild(Xe(a.display.measure))),0==e?(b.measure.map=d.map,b.measure.cache={}):((b.measure.maps||(b.measure.maps=[])).push(d.map),(b.measure.caches||(b.measure.caches=[])).push({}))}return rf&&/\bcm-tab\b/.test(d.content.lastChild.className)&&(d.content.className="cm-tab-wrap-hack"),Bg(a,"renderLine",a,b.line,d.pre),d.pre.className&&(d.textClass=Te(d.pre.className,d.textClass||"")),d}function Ld(a){var b=Oe("span","•","cm-invalidchar");return b.title="\\u"+a.charCodeAt(0).toString(16),b.setAttribute("aria-label",b.title),b}function Md(a,b,c,d,e,f,g){if(b){var h=a.splitSpaces?b.replace(/ {3,}/g,Nd):b,i=a.cm.state.specialChars,j=!1;if(i.test(b))for(var k=document.createDocumentFragment(),l=0;;){i.lastIndex=l;var m=i.exec(b),n=m?m.index-l:b.length-l;if(n){var o=document.createTextNode(h.slice(l,l+n));k.appendChild(pf&&9>qf?Oe("span",[o]):o),a.map.push(a.pos,a.pos+n,o),a.col+=n,a.pos+=n}if(!m)break;if(l+=n+1," "==m[0]){var p=a.cm.options.tabSize,q=p-a.col%p,o=k.appendChild(Oe("span",De(q),"cm-tab"));o.setAttribute("role","presentation"),o.setAttribute("cm-text"," "),a.col+=q}else if("\r"==m[0]||"\n"==m[0]){var o=k.appendChild(Oe("span","\r"==m[0]?"␍":"","cm-invalidchar"));o.setAttribute("cm-text",m[0]),a.col+=1}else{var o=a.cm.options.specialCharPlaceholder(m[0]);o.setAttribute("cm-text",m[0]),k.appendChild(pf&&9>qf?Oe("span",[o]):o),a.col+=1}a.map.push(a.pos,a.pos+1,o),a.pos++}else{a.col+=b.length;var k=document.createTextNode(h);a.map.push(a.pos,a.pos+b.length,k),pf&&9>qf&&(j=!0),a.pos+=b.length}if(c||d||e||j||g){var r=c||"";d&&(r+=d),e&&(r+=e);var s=Oe("span",[k],r,g);return f&&(s.title=f),a.content.appendChild(s)}a.content.appendChild(k)}}function Nd(a){for(var b=" ",c=0;c<a.length-2;++c)b+=c%2?" ":" ";return b+=" "}function Od(a,b){return function(c,d,e,f,g,h,i){e=e?e+" cm-force-border":"cm-force-border";for(var j=c.pos,k=j+d.length;;){for(var l=0;l<b.length;l++){var m=b[l];if(m.to>j&&m.from<=j)break}if(m.to>=k)return a(c,d,e,f,g,h,i);a(c,d.slice(0,m.to-j),e,f,null,h,i),f=null,d=d.slice(m.to-j),j=m.to}}}function Pd(a,b,c,d){var e=!d&&c.widgetNode;e&&a.map.push(a.pos,a.pos+b,e),!d&&a.cm.display.input.needsContentAttribute&&(e||(e=a.content.appendChild(document.createElement("span"))),e.setAttribute("cm-marker",c.id)),e&&(a.cm.display.input.setUneditable(e),a.content.appendChild(e)),a.pos+=b}function Qd(a,b,c){var d=a.markedSpans,e=a.text,f=0;if(d)for(var g,h,i,j,k,l,m,n=e.length,o=0,p=1,q="",r=0;;){if(r==o){i=j=k=l=h="",m=null,r=1/0;for(var s=[],t=0;t<d.length;++t){var u=d[t],v=u.marker;"bookmark"==v.type&&u.from==o&&v.widgetNode?s.push(v):u.from<=o&&(null==u.to||u.to>o||v.collapsed&&u.to==o&&u.from==o)?(null!=u.to&&u.to!=o&&r>u.to&&(r=u.to,j=""),v.className&&(i+=" "+v.className),v.css&&(h=v.css),v.startStyle&&u.from==o&&(k+=" "+v.startStyle),v.endStyle&&u.to==r&&(j+=" "+v.endStyle),v.title&&!l&&(l=v.title),v.collapsed&&(!m||ld(m.marker,v)<0)&&(m=u)):u.from>o&&r>u.from&&(r=u.from)}if(m&&(m.from||0)==o){if(Pd(b,(null==m.to?n+1:m.to)-o,m.marker,null==m.from),null==m.to)return;m.to==o&&(m=!1)}if(!m&&s.length)for(var t=0;t<s.length;++t)Pd(b,0,s[t])}if(o>=n)break;for(var w=Math.min(n,r);;){if(q){var x=o+q.length;if(!m){var y=x>w?q.slice(0,w-o):q;b.addToken(b,y,g?g+i:i,k,o+y.length==r?j:"",l,h)}if(x>=w){q=q.slice(w-o),o=w;break}o=x,k=""}q=e.slice(f,f=c[p++]),g=Jd(c[p++],b.cm.options)}}else for(var p=1;p<c.length;p+=2)b.addToken(b,e.slice(f,f=c[p]),Jd(c[p+1],b.cm.options))}function Rd(a,b){return 0==b.from.ch&&0==b.to.ch&&""==Ee(b.text)&&(!a.cm||a.cm.options.wholeLineUpdateBefore)}function Sd(a,b,c,d){function e(a){return c?c[a]:null}function f(a,c,e){zd(a,c,e,d),ve(a,"change",a,b)}function g(a,b){for(var c=a,f=[];b>c;++c)f.push(new pg(j[c],e(c),d));return f}var h=b.from,i=b.to,j=b.text,k=Xd(a,h.line),l=Xd(a,i.line),m=Ee(j),n=e(j.length-1),o=i.line-h.line;if(b.full)a.insert(0,g(0,j.length)),a.remove(j.length,a.size-j.length);else if(Rd(a,b)){var p=g(0,j.length-1);f(l,l.text,n),o&&a.remove(h.line,o),p.length&&a.insert(h.line,p)}else if(k==l)if(1==j.length)f(k,k.text.slice(0,h.ch)+m+k.text.slice(i.ch),n);else{var p=g(1,j.length-1);p.push(new pg(m+k.text.slice(i.ch),n,d)),f(k,k.text.slice(0,h.ch)+j[0],e(0)),a.insert(h.line+1,p)}else if(1==j.length)f(k,k.text.slice(0,h.ch)+j[0]+l.text.slice(i.ch),e(0)),a.remove(h.line+1,o);else{f(k,k.text.slice(0,h.ch)+j[0],e(0)),f(l,m+l.text.slice(i.ch),n);var p=g(1,j.length-1);o>1&&a.remove(h.line+1,o-1),a.insert(h.line+1,p)}ve(a,"change",a,b)}function Td(a){this.lines=a,this.parent=null;for(var b=0,c=0;b<a.length;++b)a[b].parent=this,c+=a[b].height;this.height=c}function Ud(a){this.children=a;for(var b=0,c=0,d=0;d<a.length;++d){var e=a[d];b+=e.chunkSize(),c+=e.height,e.parent=this}this.size=b,this.height=c,this.parent=null}function Vd(a,b,c){function d(a,e,f){if(a.linked)for(var g=0;g<a.linked.length;++g){var h=a.linked[g];if(h.doc!=e){var i=f&&h.sharedHist;(!c||i)&&(b(h.doc,i),d(h.doc,a,i))}}}d(a,null,!0)}function Wd(a,b){if(b.cm)throw new Error("This document is already in use.");a.doc=b,b.cm=a,g(a),c(a),a.options.lineWrapping||m(a),a.options.mode=b.modeOption,Ib(a)}function Xd(a,b){if(b-=a.first,0>b||b>=a.size)throw new Error("There is no line "+(b+a.first)+" in the document.");for(var c=a;!c.lines;)for(var d=0;;++d){var e=c.children[d],f=e.chunkSize();if(f>b){c=e;break}b-=f}return c.lines[b]}function Yd(a,b,c){var d=[],e=b.line;return a.iter(b.line,c.line+1,function(a){var f=a.text;e==c.line&&(f=f.slice(0,c.ch)),e==b.line&&(f=f.slice(b.ch)),d.push(f),++e}),d}function Zd(a,b,c){var d=[];return a.iter(b,c,function(a){d.push(a.text)}),d}function $d(a,b){var c=b-a.height;if(c)for(var d=a;d;d=d.parent)d.height+=c}function _d(a){if(null==a.parent)return null;for(var b=a.parent,c=Fe(b.lines,a),d=b.parent;d;b=d,d=d.parent)for(var e=0;d.children[e]!=b;++e)c+=d.children[e].chunkSize();return c+b.first}function ae(a,b){var c=a.first;a:do{for(var d=0;d<a.children.length;++d){var e=a.children[d],f=e.height;if(f>b){a=e;continue a}b-=f,c+=e.chunkSize()}return c}while(!a.lines);for(var d=0;d<a.lines.length;++d){var g=a.lines[d],h=g.height;if(h>b)break;b-=h}return c+d}function be(a){a=qd(a);for(var b=0,c=a.parent,d=0;d<c.lines.length;++d){var e=c.lines[d];if(e==a)break;b+=e.height}for(var f=c.parent;f;c=f,f=c.parent)for(var d=0;d<f.children.length;++d){var g=f.children[d];if(g==c)break;b+=g.height}return b}function ce(a){var b=a.order;return null==b&&(b=a.order=ah(a.text)),b}function de(a){this.done=[],this.undone=[],this.undoDepth=1/0,this.lastModTime=this.lastSelTime=0,this.lastOp=this.lastSelOp=null,this.lastOrigin=this.lastSelOrigin=null,this.generation=this.maxGeneration=a||1}function ee(a,b){var c={from:V(b.from),to:Wf(b),text:Yd(a,b.from,b.to)};return le(a,c,b.from.line,b.to.line+1),Vd(a,function(a){le(a,c,b.from.line,b.to.line+1)},!0),c}function fe(a){for(;a.length;){var b=Ee(a);if(!b.ranges)break;a.pop()}}function ge(a,b){return b?(fe(a.done),Ee(a.done)):a.done.length&&!Ee(a.done).ranges?Ee(a.done):a.done.length>1&&!a.done[a.done.length-2].ranges?(a.done.pop(),Ee(a.done)):void 0}function he(a,b,c,d){var e=a.history;e.undone.length=0;var f,g=+new Date;if((e.lastOp==d||e.lastOrigin==b.origin&&b.origin&&("+"==b.origin.charAt(0)&&a.cm&&e.lastModTime>g-a.cm.options.historyEventDelay||"*"==b.origin.charAt(0)))&&(f=ge(e,e.lastOp==d))){var h=Ee(f.changes);0==If(b.from,b.to)&&0==If(b.from,h.to)?h.to=Wf(b):f.changes.push(ee(a,b))}else{var i=Ee(e.done);for(i&&i.ranges||ke(a.sel,e.done),f={changes:[ee(a,b)],generation:e.generation},e.done.push(f);e.done.length>e.undoDepth;)e.done.shift(),e.done[0].ranges||e.done.shift()}e.done.push(c),e.generation=++e.maxGeneration,e.lastModTime=e.lastSelTime=g,e.lastOp=e.lastSelOp=d,e.lastOrigin=e.lastSelOrigin=b.origin,h||Bg(a,"historyAdded")}function ie(a,b,c,d){var e=b.charAt(0);return"*"==e||"+"==e&&c.ranges.length==d.ranges.length&&c.somethingSelected()==d.somethingSelected()&&new Date-a.history.lastSelTime<=(a.cm?a.cm.options.historyEventDelay:500)}function je(a,b,c,d){var e=a.history,f=d&&d.origin;c==e.lastSelOp||f&&e.lastSelOrigin==f&&(e.lastModTime==e.lastSelTime&&e.lastOrigin==f||ie(a,f,Ee(e.done),b))?e.done[e.done.length-1]=b:ke(b,e.done),e.lastSelTime=+new Date,e.lastSelOrigin=f,e.lastSelOp=c,d&&d.clearRedo!==!1&&fe(e.undone)}function ke(a,b){var c=Ee(b);c&&c.ranges&&c.equals(a)||b.push(a)}function le(a,b,c,d){var e=b["spans_"+a.id],f=0;a.iter(Math.max(a.first,c),Math.min(a.first+a.size,d),function(c){c.markedSpans&&((e||(e=b["spans_"+a.id]={}))[f]=c.markedSpans),++f})}function me(a){if(!a)return null;for(var b,c=0;c<a.length;++c)a[c].marker.explicitlyCleared?b||(b=a.slice(0,c)):b&&b.push(a[c]);return b?b.length?b:null:a}function ne(a,b){var c=b["spans_"+a.id];if(!c)return null;for(var d=0,e=[];d<b.text.length;++d)e.push(me(c[d]));return e}function oe(a,b,c){for(var d=0,e=[];d<a.length;++d){var f=a[d];if(f.ranges)e.push(c?la.prototype.deepCopy.call(f):f);else{var g=f.changes,h=[];e.push({changes:h});for(var i=0;i<g.length;++i){var j,k=g[i];if(h.push({from:k.from,to:k.to,text:k.text}),b)for(var l in k)(j=l.match(/^spans_(\d+)$/))&&Fe(b,Number(j[1]))>-1&&(Ee(h)[l]=k[l],delete k[l])}}}return e}function pe(a,b,c,d){c<a.line?a.line+=d:b<a.line&&(a.line=b,a.ch=0)}function qe(a,b,c,d){for(var e=0;e<a.length;++e){var f=a[e],g=!0;if(f.ranges){f.copied||(f=a[e]=f.deepCopy(),f.copied=!0);for(var h=0;h<f.ranges.length;h++)pe(f.ranges[h].anchor,b,c,d),pe(f.ranges[h].head,b,c,d)}else{for(var h=0;h<f.changes.length;++h){var i=f.changes[h];if(c<i.from.line)i.from=Hf(i.from.line+d,i.from.ch),i.to=Hf(i.to.line+d,i.to.ch);else if(b<=i.to.line){g=!1;break}}g||(a.splice(0,e+1),e=0)}}}function re(a,b){var c=b.from.line,d=b.to.line,e=b.text.length-(d-c)-1;qe(a.done,c,d,e),qe(a.undone,c,d,e)}function se(a){return null!=a.defaultPrevented?a.defaultPrevented:0==a.returnValue}function te(a){return a.target||a.srcElement}function ue(a){var b=a.which;return null==b&&(1&a.button?b=1:2&a.button?b=3:4&a.button&&(b=2)),Af&&a.ctrlKey&&1==b&&(b=3),b}function ve(a,b){function c(a){return function(){a.apply(null,f)}}var d=a._handlers&&a._handlers[b];if(d){var e,f=Array.prototype.slice.call(arguments,2);Of?e=Of.delayedCallbacks:Cg?e=Cg:(e=Cg=[],setTimeout(we,0));for(var g=0;g<d.length;++g)e.push(c(d[g]))}}function we(){var a=Cg;Cg=null;for(var b=0;b<a.length;++b)a[b]()}function xe(a,b,c){return"string"==typeof b&&(b={type:b,preventDefault:function(){this.defaultPrevented=!0}}),Bg(a,c||b.type,a,b),se(b)||b.codemirrorIgnore}function ye(a){var b=a._handlers&&a._handlers.cursorActivity;if(b)for(var c=a.curOp.cursorActivityHandlers||(a.curOp.cursorActivityHandlers=[]),d=0;d<b.length;++d)-1==Fe(c,b[d])&&c.push(b[d])}function ze(a,b){var c=a._handlers&&a._handlers[b];return c&&c.length>0}function Ae(a){a.prototype.on=function(a,b){zg(this,a,b)},a.prototype.off=function(a,b){Ag(this,a,b)}}function Be(){this.id=null}function Ce(a,b,c){for(var d=0,e=0;;){var f=a.indexOf(" ",d);-1==f&&(f=a.length);var g=f-d;if(f==a.length||e+g>=b)return d+Math.min(g,b-e);if(e+=f-d,e+=c-e%c,d=f+1,e>=b)return d}}function De(a){for(;Jg.length<=a;)Jg.push(Ee(Jg)+" ");return Jg[a]}function Ee(a){return a[a.length-1]}function Fe(a,b){for(var c=0;c<a.length;++c)if(a[c]==b)return c;return-1}function Ge(a,b){for(var c=[],d=0;d<a.length;d++)c[d]=b(a[d],d);return c}function He(){}function Ie(a,b){var c;return Object.create?c=Object.create(a):(He.prototype=a,c=new He),b&&Je(b,c),c}function Je(a,b,c){b||(b={});for(var d in a)!a.hasOwnProperty(d)||c===!1&&b.hasOwnProperty(d)||(b[d]=a[d]);return b}function Ke(a){var b=Array.prototype.slice.call(arguments,1);return function(){return a.apply(null,b)}}function Le(a,b){return b?b.source.indexOf("\\w")>-1&&Ng(a)?!0:b.test(a):Ng(a)}function Me(a){for(var b in a)if(a.hasOwnProperty(b)&&a[b])return!1;return!0}function Ne(a){return a.charCodeAt(0)>=768&&Og.test(a)}function Oe(a,b,c,d){var e=document.createElement(a);if(c&&(e.className=c),d&&(e.style.cssText=d),"string"==typeof b)e.appendChild(document.createTextNode(b));else if(b)for(var f=0;f<b.length;++f)e.appendChild(b[f]);return e}function Pe(a){for(var b=a.childNodes.length;b>0;--b)a.removeChild(a.firstChild);return a}function Qe(a,b){return Pe(a).appendChild(b)}function Re(){for(var a=document.activeElement;a&&a.root&&a.root.activeElement;)a=a.root.activeElement;return a}function Se(a){return new RegExp("(^|\\s)"+a+"(?:$|\\s)\\s*")}function Te(a,b){for(var c=a.split(" "),d=0;d<c.length;d++)c[d]&&!Se(c[d]).test(b)&&(b+=" "+c[d]);return b}function Ue(a){if(document.body.getElementsByClassName)for(var b=document.body.getElementsByClassName("CodeMirror"),c=0;c<b.length;c++){var d=b[c].CodeMirror;d&&a(d)}}function Ve(){Ug||(We(),Ug=!0)}function We(){var a;zg(window,"resize",function(){null==a&&(a=setTimeout(function(){a=null,Ue(Rb)},100))}),zg(window,"blur",function(){Ue(qc)})}function Xe(a){if(null==Qg){var b=Oe("span","");Qe(a,Oe("span",[b,document.createTextNode("x")])),0!=a.firstChild.offsetHeight&&(Qg=b.offsetWidth<=1&&b.offsetHeight>2&&!(pf&&8>qf))}var c=Qg?Oe("span",""):Oe("span"," ",null,"display: inline-block; width: 1px; margin-right: -1px");return c.setAttribute("cm-text",""),c}function Ye(a){if(null!=Rg)return Rg;var b=Qe(a,document.createTextNode("AخA")),c=Lg(b,0,1).getBoundingClientRect();if(!c||c.left==c.right)return!1;var d=Lg(b,1,2).getBoundingClientRect();return Rg=d.right-c.right<3}function Ze(a){if(null!=Zg)return Zg;var b=Qe(a,Oe("span","x")),c=b.getBoundingClientRect(),d=Lg(b,0,1).getBoundingClientRect();return Zg=Math.abs(c.left-d.left)>1}function $e(a,b,c,d){if(!a)return d(b,c,"ltr");for(var e=!1,f=0;f<a.length;++f){var g=a[f];(g.from<c&&g.to>b||b==c&&g.to==b)&&(d(Math.max(g.from,b),Math.min(g.to,c),1==g.level?"rtl":"ltr"),e=!0)}e||d(b,c,"ltr")}function _e(a){return a.level%2?a.to:a.from}function af(a){return a.level%2?a.from:a.to}function bf(a){var b=ce(a);return b?_e(b[0]):0}function cf(a){var b=ce(a);return b?af(Ee(b)):a.text.length}function df(a,b){var c=Xd(a.doc,b),d=qd(c);d!=c&&(b=_d(d));var e=ce(d),f=e?e[0].level%2?cf(d):bf(d):0;return Hf(b,f)}function ef(a,b){for(var c,d=Xd(a.doc,b);c=od(d);)d=c.find(1,!0).line,b=null;var e=ce(d),f=e?e[0].level%2?bf(d):cf(d):d.text.length;return Hf(null==b?_d(d):b,f)}function ff(a,b){var c=df(a,b.line),d=Xd(a.doc,c.line),e=ce(d);if(!e||0==e[0].level){var f=Math.max(0,d.text.search(/\S/)),g=b.line==c.line&&b.ch<=f&&b.ch;return Hf(c.line,g?0:f)}return c}function gf(a,b,c){var d=a[0].level;return b==d?!0:c==d?!1:c>b}function hf(a,b){_g=null;for(var c,d=0;d<a.length;++d){var e=a[d];if(e.from<b&&e.to>b)return d;if(e.from==b||e.to==b){if(null!=c)return gf(a,e.level,a[c].level)?(e.from!=e.to&&(_g=c),d):(e.from!=e.to&&(_g=d),c);c=d}}return c}function jf(a,b,c,d){if(!d)return b+c;do b+=c;while(b>0&&Ne(a.text.charAt(b)));return b}function kf(a,b,c,d){var e=ce(a);if(!e)return lf(a,b,c,d);for(var f=hf(e,b),g=e[f],h=jf(a,b,g.level%2?-c:c,d);;){if(h>g.from&&h<g.to)return h;if(h==g.from||h==g.to)return hf(e,h)==f?h:(g=e[f+=c],c>0==g.level%2?g.to:g.from);if(g=e[f+=c],!g)return null;h=c>0==g.level%2?jf(a,g.to,-1,d):jf(a,g.from,1,d)}}function lf(a,b,c,d){var e=b+c;if(d)for(;e>0&&Ne(a.text.charAt(e));)e+=c;return 0>e||e>a.text.length?null:e}var mf=/gecko\/\d/i.test(navigator.userAgent),nf=/MSIE \d/.test(navigator.userAgent),of=/Trident\/(?:[7-9]|\d{2,})\..*rv:(\d+)/.exec(navigator.userAgent),pf=nf||of,qf=pf&&(nf?document.documentMode||6:of[1]),rf=/WebKit\//.test(navigator.userAgent),sf=rf&&/Qt\/\d+\.\d+/.test(navigator.userAgent),tf=/Chrome\//.test(navigator.userAgent),uf=/Opera\//.test(navigator.userAgent),vf=/Apple Computer/.test(navigator.vendor),wf=/Mac OS X 1\d\D([8-9]|\d\d)\D/.test(navigator.userAgent),xf=/PhantomJS/.test(navigator.userAgent),yf=/AppleWebKit/.test(navigator.userAgent)&&/Mobile\/\w+/.test(navigator.userAgent),zf=yf||/Android|webOS|BlackBerry|Opera Mini|Opera Mobi|IEMobile/i.test(navigator.userAgent),Af=yf||/Mac/.test(navigator.platform),Bf=/win/i.test(navigator.platform),Cf=uf&&navigator.userAgent.match(/Version\/(\d*\.\d*)/);Cf&&(Cf=Number(Cf[1])),Cf&&Cf>=15&&(uf=!1,rf=!0);var Df=Af&&(sf||uf&&(null==Cf||12.11>Cf)),Ef=mf||pf&&qf>=9,Ff=!1,Gf=!1;p.prototype=Je({update:function(a){var b=a.scrollWidth>a.clientWidth+1,c=a.scrollHeight>a.clientHeight+1,d=a.nativeBarWidth;if(c){this.vert.style.display="block",this.vert.style.bottom=b?d+"px":"0";var e=a.viewHeight-(b?d:0);this.vert.firstChild.style.height=Math.max(0,a.scrollHeight-a.clientHeight+e)+"px"}else this.vert.style.display="",this.vert.firstChild.style.height="0";if(b){this.horiz.style.display="block",this.horiz.style.right=c?d+"px":"0",this.horiz.style.left=a.barLeft+"px";var f=a.viewWidth-a.barLeft-(c?d:0);this.horiz.firstChild.style.width=a.scrollWidth-a.clientWidth+f+"px"}else this.horiz.style.display="",this.horiz.firstChild.style.width="0";return!this.checkedOverlay&&a.clientHeight>0&&(0==d&&this.overlayHack(),this.checkedOverlay=!0),{right:c?d:0,bottom:b?d:0}},setScrollLeft:function(a){this.horiz.scrollLeft!=a&&(this.horiz.scrollLeft=a)},setScrollTop:function(a){this.vert.scrollTop!=a&&(this.vert.scrollTop=a)},overlayHack:function(){var a=Af&&!wf?"12px":"18px";this.horiz.style.minHeight=this.vert.style.minWidth=a;var b=this,c=function(a){te(a)!=b.vert&&te(a)!=b.horiz&&Db(b.cm,Ub)(a)};zg(this.vert,"mousedown",c),zg(this.horiz,"mousedown",c)},clear:function(){var a=this.horiz.parentNode;a.removeChild(this.horiz),a.removeChild(this.vert)}},p.prototype),q.prototype=Je({update:function(){return{bottom:0,right:0}},setScrollLeft:function(){},setScrollTop:function(){},clear:function(){}},q.prototype),a.scrollbarModel={"native":p,"null":q},z.prototype.signal=function(a,b){ze(a,b)&&this.events.push(arguments)},z.prototype.finish=function(){for(var a=0;a<this.events.length;a++)Bg.apply(null,this.events[a])};var Hf=a.Pos=function(a,b){return this instanceof Hf?(this.line=a,void(this.ch=b)):new Hf(a,b)},If=a.cmpPos=function(a,b){return a.line-b.line||a.ch-b.ch},Jf=null;da.prototype=Je({init:function(a){function b(a){if(d.somethingSelected())Jf=d.getSelections(),c.inaccurateSelection&&(c.prevInput="",c.inaccurateSelection=!1,f.value=Jf.join("\n"),Kg(f));else{if(!d.options.lineWiseCopyCut)return;var b=ba(d);Jf=b.text,"cut"==a.type?d.setSelections(b.ranges,null,Fg):(c.prevInput="",f.value=b.text.join("\n"),Kg(f))}"cut"==a.type&&(d.state.cutIncoming=!0)}var c=this,d=this.cm,e=this.wrapper=ea(),f=this.textarea=e.firstChild;a.wrapper.insertBefore(e,a.wrapper.firstChild),yf&&(f.style.width="0px"),zg(f,"input",function(){pf&&qf>=9&&c.hasSelection&&(c.hasSelection=null),c.poll()}),zg(f,"paste",function(a){return _(a,d)?!0:(d.state.pasteIncoming=!0,void c.fastPoll())}),zg(f,"cut",b),zg(f,"copy",b),zg(a.scroller,"paste",function(b){
|
4 |
+
Sb(a,b)||(d.state.pasteIncoming=!0,c.focus())}),zg(a.lineSpace,"selectstart",function(b){Sb(a,b)||wg(b)}),zg(f,"compositionstart",function(){var a=d.getCursor("from");c.composing={start:a,range:d.markText(a,d.getCursor("to"),{className:"CodeMirror-composing"})}}),zg(f,"compositionend",function(){c.composing&&(c.poll(),c.composing.range.clear(),c.composing=null)})},prepareSelection:function(){var a=this.cm,b=a.display,c=a.doc,d=Ia(a);if(a.options.moveInputWithCursor){var e=mb(a,c.sel.primary().head,"div"),f=b.wrapper.getBoundingClientRect(),g=b.lineDiv.getBoundingClientRect();d.teTop=Math.max(0,Math.min(b.wrapper.clientHeight-10,e.top+g.top-f.top)),d.teLeft=Math.max(0,Math.min(b.wrapper.clientWidth-10,e.left+g.left-f.left))}return d},showSelection:function(a){var b=this.cm,c=b.display;Qe(c.cursorDiv,a.cursors),Qe(c.selectionDiv,a.selection),null!=a.teTop&&(this.wrapper.style.top=a.teTop+"px",this.wrapper.style.left=a.teLeft+"px")},reset:function(a){if(!this.contextMenuPending){var b,c,d=this.cm,e=d.doc;if(d.somethingSelected()){this.prevInput="";var f=e.sel.primary();b=Yg&&(f.to().line-f.from().line>100||(c=d.getSelection()).length>1e3);var g=b?"-":c||d.getSelection();this.textarea.value=g,d.state.focused&&Kg(this.textarea),pf&&qf>=9&&(this.hasSelection=g)}else a||(this.prevInput=this.textarea.value="",pf&&qf>=9&&(this.hasSelection=null));this.inaccurateSelection=b}},getField:function(){return this.textarea},supportsTouch:function(){return!1},focus:function(){if("nocursor"!=this.cm.options.readOnly&&(!zf||Re()!=this.textarea))try{this.textarea.focus()}catch(a){}},blur:function(){this.textarea.blur()},resetPosition:function(){this.wrapper.style.top=this.wrapper.style.left=0},receivedFocus:function(){this.slowPoll()},slowPoll:function(){var a=this;a.pollingFast||a.polling.set(this.cm.options.pollInterval,function(){a.poll(),a.cm.state.focused&&a.slowPoll()})},fastPoll:function(){function a(){var d=c.poll();d||b?(c.pollingFast=!1,c.slowPoll()):(b=!0,c.polling.set(60,a))}var b=!1,c=this;c.pollingFast=!0,c.polling.set(20,a)},poll:function(){var a=this.cm,b=this.textarea,c=this.prevInput;if(this.contextMenuPending||!a.state.focused||Xg(b)&&!c&&!this.composing||Z(a)||a.options.disableInput||a.state.keySeq)return!1;var d=b.value;if(d==c&&!a.somethingSelected())return!1;if(pf&&qf>=9&&this.hasSelection===d||Af&&/[\uf700-\uf7ff]/.test(d))return a.display.input.reset(),!1;if(a.doc.sel==a.display.selForContextMenu){var e=d.charCodeAt(0);if(8203!=e||c||(c=""),8666==e)return this.reset(),this.cm.execCommand("undo")}for(var f=0,g=Math.min(c.length,d.length);g>f&&c.charCodeAt(f)==d.charCodeAt(f);)++f;var h=this;return Cb(a,function(){$(a,d.slice(f),c.length-f,null,h.composing?"*compose":null),d.length>1e3||d.indexOf("\n")>-1?b.value=h.prevInput="":h.prevInput=d,h.composing&&(h.composing.range.clear(),h.composing.range=a.markText(h.composing.start,a.getCursor("to"),{className:"CodeMirror-composing"}))}),!0},ensurePolled:function(){this.pollingFast&&this.poll()&&(this.pollingFast=!1)},onKeyPress:function(){pf&&qf>=9&&(this.hasSelection=null),this.fastPoll()},onContextMenu:function(a){function b(){if(null!=g.selectionStart){var a=e.somethingSelected(),b=""+(a?g.value:"");g.value="⇚",g.value=b,d.prevInput=a?"":"",g.selectionStart=1,g.selectionEnd=b.length,f.selForContextMenu=e.doc.sel}}function c(){if(d.contextMenuPending=!1,d.wrapper.style.position="relative",g.style.cssText=k,pf&&9>qf&&f.scrollbars.setScrollTop(f.scroller.scrollTop=i),null!=g.selectionStart){(!pf||pf&&9>qf)&&b();var a=0,c=function(){f.selForContextMenu==e.doc.sel&&0==g.selectionStart&&g.selectionEnd>0&&""==d.prevInput?Db(e,fg.selectAll)(e):a++<10?f.detectingSelectAll=setTimeout(c,500):f.input.reset()};f.detectingSelectAll=setTimeout(c,200)}}var d=this,e=d.cm,f=e.display,g=d.textarea,h=Tb(e,a),i=f.scroller.scrollTop;if(h&&!uf){var j=e.options.resetSelectionOnContextMenu;j&&-1==e.doc.sel.contains(h)&&Db(e,Ba)(e.doc,oa(h),Fg);var k=g.style.cssText;if(d.wrapper.style.position="absolute",g.style.cssText="position: fixed; width: 30px; height: 30px; top: "+(a.clientY-5)+"px; left: "+(a.clientX-5)+"px; z-index: 1000; background: "+(pf?"rgba(255, 255, 255, .05)":"transparent")+"; outline: none; border-width: 0; outline: none; overflow: hidden; opacity: .05; filter: alpha(opacity=5);",rf)var l=window.scrollY;if(f.input.focus(),rf&&window.scrollTo(null,l),f.input.reset(),e.somethingSelected()||(g.value=d.prevInput=" "),d.contextMenuPending=!0,f.selForContextMenu=e.doc.sel,clearTimeout(f.detectingSelectAll),pf&&qf>=9&&b(),Ef){yg(a);var m=function(){Ag(window,"mouseup",m),setTimeout(c,20)};zg(window,"mouseup",m)}else setTimeout(c,50)}},setUneditable:He,needsContentAttribute:!1},da.prototype),fa.prototype=Je({init:function(a){function b(a){if(d.somethingSelected())Jf=d.getSelections(),"cut"==a.type&&d.replaceSelection("",null,"cut");else{if(!d.options.lineWiseCopyCut)return;var b=ba(d);Jf=b.text,"cut"==a.type&&d.operation(function(){d.setSelections(b.ranges,0,Fg),d.replaceSelection("",null,"cut")})}if(a.clipboardData&&!yf)a.preventDefault(),a.clipboardData.clearData(),a.clipboardData.setData("text/plain",Jf.join("\n"));else{var c=ea(),e=c.firstChild;d.display.lineSpace.insertBefore(c,d.display.lineSpace.firstChild),e.value=Jf.join("\n");var f=document.activeElement;Kg(e),setTimeout(function(){d.display.lineSpace.removeChild(c),f.focus()},50)}}var c=this,d=c.cm,e=c.div=a.lineDiv;e.contentEditable="true",ca(e),zg(e,"paste",function(a){_(a,d)}),zg(e,"compositionstart",function(a){var b=a.data;if(c.composing={sel:d.doc.sel,data:b,startData:b},b){var e=d.doc.sel.primary(),f=d.getLine(e.head.line),g=f.indexOf(b,Math.max(0,e.head.ch-b.length));g>-1&&g<=e.head.ch&&(c.composing.sel=oa(Hf(e.head.line,g),Hf(e.head.line,g+b.length)))}}),zg(e,"compositionupdate",function(a){c.composing.data=a.data}),zg(e,"compositionend",function(a){var b=c.composing;b&&(a.data==b.startData||/\u200b/.test(a.data)||(b.data=a.data),setTimeout(function(){b.handled||c.applyComposition(b),c.composing==b&&(c.composing=null)},50))}),zg(e,"touchstart",function(){c.forceCompositionEnd()}),zg(e,"input",function(){c.composing||c.pollContent()||Cb(c.cm,function(){Ib(d)})}),zg(e,"copy",b),zg(e,"cut",b)},prepareSelection:function(){var a=Ia(this.cm,!1);return a.focus=this.cm.state.focused,a},showSelection:function(a){a&&this.cm.display.view.length&&(a.focus&&this.showPrimarySelection(),this.showMultipleSelections(a))},showPrimarySelection:function(){var a=window.getSelection(),b=this.cm.doc.sel.primary(),c=ia(this.cm,a.anchorNode,a.anchorOffset),d=ia(this.cm,a.focusNode,a.focusOffset);if(!c||c.bad||!d||d.bad||0!=If(X(c,d),b.from())||0!=If(W(c,d),b.to())){var e=ga(this.cm,b.from()),f=ga(this.cm,b.to());if(e||f){var g=this.cm.display.view,h=a.rangeCount&&a.getRangeAt(0);if(e){if(!f){var i=g[g.length-1].measure,j=i.maps?i.maps[i.maps.length-1]:i.map;f={node:j[j.length-1],offset:j[j.length-2]-j[j.length-3]}}}else e={node:g[0].measure.map[2],offset:0};try{var k=Lg(e.node,e.offset,f.offset,f.node)}catch(l){}k&&(a.removeAllRanges(),a.addRange(k),h&&null==a.anchorNode?a.addRange(h):mf&&this.startGracePeriod()),this.rememberSelection()}}},startGracePeriod:function(){var a=this;clearTimeout(this.gracePeriod),this.gracePeriod=setTimeout(function(){a.gracePeriod=!1,a.selectionChanged()&&a.cm.operation(function(){a.cm.curOp.selectionChanged=!0})},20)},showMultipleSelections:function(a){Qe(this.cm.display.cursorDiv,a.cursors),Qe(this.cm.display.selectionDiv,a.selection)},rememberSelection:function(){var a=window.getSelection();this.lastAnchorNode=a.anchorNode,this.lastAnchorOffset=a.anchorOffset,this.lastFocusNode=a.focusNode,this.lastFocusOffset=a.focusOffset},selectionInEditor:function(){var a=window.getSelection();if(!a.rangeCount)return!1;var b=a.getRangeAt(0).commonAncestorContainer;return Pg(this.div,b)},focus:function(){"nocursor"!=this.cm.options.readOnly&&this.div.focus()},blur:function(){this.div.blur()},getField:function(){return this.div},supportsTouch:function(){return!0},receivedFocus:function(){function a(){b.cm.state.focused&&(b.pollSelection(),b.polling.set(b.cm.options.pollInterval,a))}var b=this;this.selectionInEditor()?this.pollSelection():Cb(this.cm,function(){b.cm.curOp.selectionChanged=!0}),this.polling.set(this.cm.options.pollInterval,a)},selectionChanged:function(){var a=window.getSelection();return a.anchorNode!=this.lastAnchorNode||a.anchorOffset!=this.lastAnchorOffset||a.focusNode!=this.lastFocusNode||a.focusOffset!=this.lastFocusOffset},pollSelection:function(){if(!this.composing&&!this.gracePeriod&&this.selectionChanged()){var a=window.getSelection(),b=this.cm;this.rememberSelection();var c=ia(b,a.anchorNode,a.anchorOffset),d=ia(b,a.focusNode,a.focusOffset);c&&d&&Cb(b,function(){Ba(b.doc,oa(c,d),Fg),(c.bad||d.bad)&&(b.curOp.selectionChanged=!0)})}},pollContent:function(){var a=this.cm,b=a.display,c=a.doc.sel.primary(),d=c.from(),e=c.to();if(d.line<b.viewFrom||e.line>b.viewTo-1)return!1;var f;if(d.line==b.viewFrom||0==(f=Lb(a,d.line)))var g=_d(b.view[0].line),h=b.view[0].node;else var g=_d(b.view[f].line),h=b.view[f-1].node.nextSibling;var i=Lb(a,e.line);if(i==b.view.length-1)var j=b.viewTo-1,k=b.lineDiv.lastChild;else var j=_d(b.view[i+1].line)-1,k=b.view[i+1].node.previousSibling;for(var l=a.doc.splitLines(ka(a,h,k,g,j)),m=Yd(a.doc,Hf(g,0),Hf(j,Xd(a.doc,j).text.length));l.length>1&&m.length>1;)if(Ee(l)==Ee(m))l.pop(),m.pop(),j--;else{if(l[0]!=m[0])break;l.shift(),m.shift(),g++}for(var n=0,o=0,p=l[0],q=m[0],r=Math.min(p.length,q.length);r>n&&p.charCodeAt(n)==q.charCodeAt(n);)++n;for(var s=Ee(l),t=Ee(m),u=Math.min(s.length-(1==l.length?n:0),t.length-(1==m.length?n:0));u>o&&s.charCodeAt(s.length-o-1)==t.charCodeAt(t.length-o-1);)++o;l[l.length-1]=s.slice(0,s.length-o),l[0]=l[0].slice(n);var v=Hf(g,n),w=Hf(j,m.length?Ee(m).length-o:0);return l.length>1||l[0]||If(v,w)?(Ec(a.doc,l,v,w,"+input"),!0):void 0},ensurePolled:function(){this.forceCompositionEnd()},reset:function(){this.forceCompositionEnd()},forceCompositionEnd:function(){this.composing&&!this.composing.handled&&(this.applyComposition(this.composing),this.composing.handled=!0,this.div.blur(),this.div.focus())},applyComposition:function(a){a.data&&a.data!=a.startData&&Db(this.cm,$)(this.cm,a.data,0,a.sel)},setUneditable:function(a){a.setAttribute("contenteditable","false")},onKeyPress:function(a){a.preventDefault(),Db(this.cm,$)(this.cm,String.fromCharCode(null==a.charCode?a.keyCode:a.charCode),0)},onContextMenu:He,resetPosition:He,needsContentAttribute:!0},fa.prototype),a.inputStyles={textarea:da,contenteditable:fa},la.prototype={primary:function(){return this.ranges[this.primIndex]},equals:function(a){if(a==this)return!0;if(a.primIndex!=this.primIndex||a.ranges.length!=this.ranges.length)return!1;for(var b=0;b<this.ranges.length;b++){var c=this.ranges[b],d=a.ranges[b];if(0!=If(c.anchor,d.anchor)||0!=If(c.head,d.head))return!1}return!0},deepCopy:function(){for(var a=[],b=0;b<this.ranges.length;b++)a[b]=new ma(V(this.ranges[b].anchor),V(this.ranges[b].head));return new la(a,this.primIndex)},somethingSelected:function(){for(var a=0;a<this.ranges.length;a++)if(!this.ranges[a].empty())return!0;return!1},contains:function(a,b){b||(b=a);for(var c=0;c<this.ranges.length;c++){var d=this.ranges[c];if(If(b,d.from())>=0&&If(a,d.to())<=0)return c}return-1}},ma.prototype={from:function(){return X(this.anchor,this.head)},to:function(){return W(this.anchor,this.head)},empty:function(){return this.head.line==this.anchor.line&&this.head.ch==this.anchor.ch}};var Kf,Lf,Mf,Nf={left:0,right:0,top:0,bottom:0},Of=null,Pf=0,Qf=0,Rf=0,Sf=null;pf?Sf=-.53:mf?Sf=15:tf?Sf=-.7:vf&&(Sf=-1/3);var Tf=function(a){var b=a.wheelDeltaX,c=a.wheelDeltaY;return null==b&&a.detail&&a.axis==a.HORIZONTAL_AXIS&&(b=a.detail),null==c&&a.detail&&a.axis==a.VERTICAL_AXIS?c=a.detail:null==c&&(c=a.wheelDelta),{x:b,y:c}};a.wheelEventPixels=function(a){var b=Tf(a);return b.x*=Sf,b.y*=Sf,b};var Uf=new Be,Vf=null,Wf=a.changeEnd=function(a){return a.text?Hf(a.from.line+a.text.length-1,Ee(a.text).length+(1==a.text.length?a.from.ch:0)):a.to};a.prototype={constructor:a,focus:function(){window.focus(),this.display.input.focus()},setOption:function(a,b){var c=this.options,d=c[a];(c[a]!=b||"mode"==a)&&(c[a]=b,Yf.hasOwnProperty(a)&&Db(this,Yf[a])(this,b,d))},getOption:function(a){return this.options[a]},getDoc:function(){return this.doc},addKeyMap:function(a,b){this.state.keyMaps[b?"push":"unshift"](Tc(a))},removeKeyMap:function(a){for(var b=this.state.keyMaps,c=0;c<b.length;++c)if(b[c]==a||b[c].name==a)return b.splice(c,1),!0},addOverlay:Eb(function(b,c){var d=b.token?b:a.getMode(this.options,b);if(d.startState)throw new Error("Overlays may not be stateful.");this.state.overlays.push({mode:d,modeSpec:b,opaque:c&&c.opaque}),this.state.modeGen++,Ib(this)}),removeOverlay:Eb(function(a){for(var b=this.state.overlays,c=0;c<b.length;++c){var d=b[c].modeSpec;if(d==a||"string"==typeof a&&d.name==a)return b.splice(c,1),this.state.modeGen++,void Ib(this)}}),indentLine:Eb(function(a,b,c){"string"!=typeof b&&"number"!=typeof b&&(b=null==b?this.options.smartIndent?"smart":"prev":b?"add":"subtract"),sa(this.doc,a)&&Mc(this,a,b,c)}),indentSelection:Eb(function(a){for(var b=this.doc.sel.ranges,c=-1,d=0;d<b.length;d++){var e=b[d];if(e.empty())e.head.line>c&&(Mc(this,e.head.line,a,!0),c=e.head.line,d==this.doc.sel.primIndex&&Kc(this));else{var f=e.from(),g=e.to(),h=Math.max(c,f.line);c=Math.min(this.lastLine(),g.line-(g.ch?0:1))+1;for(var i=h;c>i;++i)Mc(this,i,a);var j=this.doc.sel.ranges;0==f.ch&&b.length==j.length&&j[d].from().ch>0&&xa(this.doc,d,new ma(f,j[d].to()),Fg)}}}),getTokenAt:function(a,b){return Ed(this,a,b)},getLineTokens:function(a,b){return Ed(this,Hf(a),b,!0)},getTokenTypeAt:function(a){a=qa(this.doc,a);var b,c=Hd(this,Xd(this.doc,a.line)),d=0,e=(c.length-1)/2,f=a.ch;if(0==f)b=c[2];else for(;;){var g=d+e>>1;if((g?c[2*g-1]:0)>=f)e=g;else{if(!(c[2*g+1]<f)){b=c[2*g+2];break}d=g+1}}var h=b?b.indexOf("cm-overlay "):-1;return 0>h?b:0==h?null:b.slice(0,h-1)},getModeAt:function(b){var c=this.doc.mode;return c.innerMode?a.innerMode(c,this.getTokenAt(b).state).mode:c},getHelper:function(a,b){return this.getHelpers(a,b)[0]},getHelpers:function(a,b){var c=[];if(!cg.hasOwnProperty(b))return c;var d=cg[b],e=this.getModeAt(a);if("string"==typeof e[b])d[e[b]]&&c.push(d[e[b]]);else if(e[b])for(var f=0;f<e[b].length;f++){var g=d[e[b][f]];g&&c.push(g)}else e.helperType&&d[e.helperType]?c.push(d[e.helperType]):d[e.name]&&c.push(d[e.name]);for(var f=0;f<d._global.length;f++){var h=d._global[f];h.pred(e,this)&&-1==Fe(c,h.val)&&c.push(h.val)}return c},getStateAfter:function(a,b){var c=this.doc;return a=pa(c,null==a?c.first+c.size-1:a),Pa(this,a+1,b)},cursorCoords:function(a,b){var c,d=this.doc.sel.primary();return c=null==a?d.head:"object"==typeof a?qa(this.doc,a):a?d.from():d.to(),mb(this,c,b||"page")},charCoords:function(a,b){return lb(this,qa(this.doc,a),b||"page")},coordsChar:function(a,b){return a=kb(this,a,b||"page"),pb(this,a.left,a.top)},lineAtHeight:function(a,b){return a=kb(this,{top:a,left:0},b||"page").top,ae(this.doc,a+this.display.viewOffset)},heightAtLine:function(a,b){var c,d=!1;if("number"==typeof a){var e=this.doc.first+this.doc.size-1;a<this.doc.first?a=this.doc.first:a>e&&(a=e,d=!0),c=Xd(this.doc,a)}else c=a;return jb(this,c,{top:0,left:0},b||"page").top+(d?this.doc.height-be(c):0)},defaultTextHeight:function(){return rb(this.display)},defaultCharWidth:function(){return sb(this.display)},setGutterMarker:Eb(function(a,b,c){return Nc(this.doc,a,"gutter",function(a){var d=a.gutterMarkers||(a.gutterMarkers={});return d[b]=c,!c&&Me(d)&&(a.gutterMarkers=null),!0})}),clearGutter:Eb(function(a){var b=this,c=b.doc,d=c.first;c.iter(function(c){c.gutterMarkers&&c.gutterMarkers[a]&&(c.gutterMarkers[a]=null,Jb(b,d,"gutter"),Me(c.gutterMarkers)&&(c.gutterMarkers=null)),++d})}),lineInfo:function(a){if("number"==typeof a){if(!sa(this.doc,a))return null;var b=a;if(a=Xd(this.doc,a),!a)return null}else{var b=_d(a);if(null==b)return null}return{line:b,handle:a,text:a.text,gutterMarkers:a.gutterMarkers,textClass:a.textClass,bgClass:a.bgClass,wrapClass:a.wrapClass,widgets:a.widgets}},getViewport:function(){return{from:this.display.viewFrom,to:this.display.viewTo}},addWidget:function(a,b,c,d,e){var f=this.display;a=mb(this,qa(this.doc,a));var g=a.bottom,h=a.left;if(b.style.position="absolute",b.setAttribute("cm-ignore-events","true"),this.display.input.setUneditable(b),f.sizer.appendChild(b),"over"==d)g=a.top;else if("above"==d||"near"==d){var i=Math.max(f.wrapper.clientHeight,this.doc.height),j=Math.max(f.sizer.clientWidth,f.lineSpace.clientWidth);("above"==d||a.bottom+b.offsetHeight>i)&&a.top>b.offsetHeight?g=a.top-b.offsetHeight:a.bottom+b.offsetHeight<=i&&(g=a.bottom),h+b.offsetWidth>j&&(h=j-b.offsetWidth)}b.style.top=g+"px",b.style.left=b.style.right="","right"==e?(h=f.sizer.clientWidth-b.offsetWidth,b.style.right="0px"):("left"==e?h=0:"middle"==e&&(h=(f.sizer.clientWidth-b.offsetWidth)/2),b.style.left=h+"px"),c&&Hc(this,h,g,h+b.offsetWidth,g+b.offsetHeight)},triggerOnKeyDown:Eb(kc),triggerOnKeyPress:Eb(nc),triggerOnKeyUp:mc,execCommand:function(a){return fg.hasOwnProperty(a)?fg[a].call(null,this):void 0},triggerElectric:Eb(function(a){aa(this,a)}),findPosH:function(a,b,c,d){var e=1;0>b&&(e=-1,b=-b);for(var f=0,g=qa(this.doc,a);b>f&&(g=Pc(this.doc,g,e,c,d),!g.hitSide);++f);return g},moveH:Eb(function(a,b){var c=this;c.extendSelectionsBy(function(d){return c.display.shift||c.doc.extend||d.empty()?Pc(c.doc,d.head,a,b,c.options.rtlMoveVisually):0>a?d.from():d.to()},Hg)}),deleteH:Eb(function(a,b){var c=this.doc.sel,d=this.doc;c.somethingSelected()?d.replaceSelection("",null,"+delete"):Oc(this,function(c){var e=Pc(d,c.head,a,b,!1);return 0>a?{from:e,to:c.head}:{from:c.head,to:e}})}),findPosV:function(a,b,c,d){var e=1,f=d;0>b&&(e=-1,b=-b);for(var g=0,h=qa(this.doc,a);b>g;++g){var i=mb(this,h,"div");if(null==f?f=i.left:i.left=f,h=Qc(this,i,e,c),h.hitSide)break}return h},moveV:Eb(function(a,b){var c=this,d=this.doc,e=[],f=!c.display.shift&&!d.extend&&d.sel.somethingSelected();if(d.extendSelectionsBy(function(g){if(f)return 0>a?g.from():g.to();var h=mb(c,g.head,"div");null!=g.goalColumn&&(h.left=g.goalColumn),e.push(h.left);var i=Qc(c,h,a,b);return"page"==b&&g==d.sel.primary()&&Jc(c,null,lb(c,i,"div").top-h.top),i},Hg),e.length)for(var g=0;g<d.sel.ranges.length;g++)d.sel.ranges[g].goalColumn=e[g]}),findWordAt:function(a){var b=this.doc,c=Xd(b,a.line).text,d=a.ch,e=a.ch;if(c){var f=this.getHelper(a,"wordChars");(a.xRel<0||e==c.length)&&d?--d:++e;for(var g=c.charAt(d),h=Le(g,f)?function(a){return Le(a,f)}:/\s/.test(g)?function(a){return/\s/.test(a)}:function(a){return!/\s/.test(a)&&!Le(a)};d>0&&h(c.charAt(d-1));)--d;for(;e<c.length&&h(c.charAt(e));)++e}return new ma(Hf(a.line,d),Hf(a.line,e))},toggleOverwrite:function(a){(null==a||a!=this.state.overwrite)&&((this.state.overwrite=!this.state.overwrite)?Tg(this.display.cursorDiv,"CodeMirror-overwrite"):Sg(this.display.cursorDiv,"CodeMirror-overwrite"),Bg(this,"overwriteToggle",this,this.state.overwrite))},hasFocus:function(){return this.display.input.getField()==Re()},scrollTo:Eb(function(a,b){(null!=a||null!=b)&&Lc(this),null!=a&&(this.curOp.scrollLeft=a),null!=b&&(this.curOp.scrollTop=b)}),getScrollInfo:function(){var a=this.display.scroller;return{left:a.scrollLeft,top:a.scrollTop,height:a.scrollHeight-Ta(this)-this.display.barHeight,width:a.scrollWidth-Ta(this)-this.display.barWidth,clientHeight:Va(this),clientWidth:Ua(this)}},scrollIntoView:Eb(function(a,b){if(null==a?(a={from:this.doc.sel.primary().head,to:null},null==b&&(b=this.options.cursorScrollMargin)):"number"==typeof a?a={from:Hf(a,0),to:null}:null==a.from&&(a={from:a,to:null}),a.to||(a.to=a.from),a.margin=b||0,null!=a.from.line)Lc(this),this.curOp.scrollToPos=a;else{var c=Ic(this,Math.min(a.from.left,a.to.left),Math.min(a.from.top,a.to.top)-a.margin,Math.max(a.from.right,a.to.right),Math.max(a.from.bottom,a.to.bottom)+a.margin);this.scrollTo(c.scrollLeft,c.scrollTop)}}),setSize:Eb(function(a,b){function c(a){return"number"==typeof a||/^\d+$/.test(String(a))?a+"px":a}var d=this;null!=a&&(d.display.wrapper.style.width=c(a)),null!=b&&(d.display.wrapper.style.height=c(b)),d.options.lineWrapping&&fb(this);var e=d.display.viewFrom;d.doc.iter(e,d.display.viewTo,function(a){if(a.widgets)for(var b=0;b<a.widgets.length;b++)if(a.widgets[b].noHScroll){Jb(d,e,"widget");break}++e}),d.curOp.forceUpdate=!0,Bg(d,"refresh",this)}),operation:function(a){return Cb(this,a)},refresh:Eb(function(){var a=this.display.cachedTextHeight;Ib(this),this.curOp.forceUpdate=!0,gb(this),this.scrollTo(this.doc.scrollLeft,this.doc.scrollTop),k(this),(null==a||Math.abs(a-rb(this.display))>.5)&&g(this),Bg(this,"refresh",this)}),swapDoc:Eb(function(a){var b=this.doc;return b.cm=null,Wd(this,a),gb(this),this.display.input.reset(),this.scrollTo(a.scrollLeft,a.scrollTop),this.curOp.forceScroll=!0,ve(this,"swapDoc",this,b),b}),getInputField:function(){return this.display.input.getField()},getWrapperElement:function(){return this.display.wrapper},getScrollerElement:function(){return this.display.scroller},getGutterElement:function(){return this.display.gutters}},Ae(a);var Xf=a.defaults={},Yf=a.optionHandlers={},Zf=a.Init={toString:function(){return"CodeMirror.Init"}};Rc("value","",function(a,b){a.setValue(b)},!0),Rc("mode",null,function(a,b){a.doc.modeOption=b,c(a)},!0),Rc("indentUnit",2,c,!0),Rc("indentWithTabs",!1),Rc("smartIndent",!0),Rc("tabSize",4,function(a){d(a),gb(a),Ib(a)},!0),Rc("lineSeparator",null,function(a,b){if(a.doc.lineSep=b,b){var c=[],d=a.doc.first;a.doc.iter(function(a){for(var e=0;;){var f=a.text.indexOf(b,e);if(-1==f)break;e=f+b.length,c.push(Hf(d,f))}d++});for(var e=c.length-1;e>=0;e--)Ec(a.doc,b,c[e],Hf(c[e].line,c[e].ch+b.length))}}),Rc("specialChars",/[\t\u0000-\u0019\u00ad\u200b-\u200f\u2028\u2029\ufeff]/g,function(b,c,d){b.state.specialChars=new RegExp(c.source+(c.test(" ")?"":"| "),"g"),d!=a.Init&&b.refresh()}),Rc("specialCharPlaceholder",Ld,function(a){a.refresh()},!0),Rc("electricChars",!0),Rc("inputStyle",zf?"contenteditable":"textarea",function(){throw new Error("inputStyle can not (yet) be changed in a running editor")},!0),Rc("rtlMoveVisually",!Bf),Rc("wholeLineUpdateBefore",!0),Rc("theme","default",function(a){h(a),i(a)},!0),Rc("keyMap","default",function(b,c,d){var e=Tc(c),f=d!=a.Init&&Tc(d);f&&f.detach&&f.detach(b,e),e.attach&&e.attach(b,f||null)}),Rc("extraKeys",null),Rc("lineWrapping",!1,e,!0),Rc("gutters",[],function(a){n(a.options),i(a)},!0),Rc("fixedGutter",!0,function(a,b){a.display.gutters.style.left=b?y(a.display)+"px":"0",a.refresh()},!0),Rc("coverGutterNextToScrollbar",!1,function(a){s(a)},!0),Rc("scrollbarStyle","native",function(a){r(a),s(a),a.display.scrollbars.setScrollTop(a.doc.scrollTop),a.display.scrollbars.setScrollLeft(a.doc.scrollLeft)},!0),Rc("lineNumbers",!1,function(a){n(a.options),i(a)},!0),Rc("firstLineNumber",1,i,!0),Rc("lineNumberFormatter",function(a){return a},i,!0),Rc("showCursorWhenSelecting",!1,Ha,!0),Rc("resetSelectionOnContextMenu",!0),Rc("lineWiseCopyCut",!0),Rc("readOnly",!1,function(a,b){"nocursor"==b?(qc(a),a.display.input.blur(),a.display.disabled=!0):(a.display.disabled=!1,b||a.display.input.reset())}),Rc("disableInput",!1,function(a,b){b||a.display.input.reset()},!0),Rc("dragDrop",!0,Qb),Rc("cursorBlinkRate",530),Rc("cursorScrollMargin",0),Rc("cursorHeight",1,Ha,!0),Rc("singleCursorHeightPerLine",!0,Ha,!0),Rc("workTime",100),Rc("workDelay",100),Rc("flattenSpans",!0,d,!0),Rc("addModeClass",!1,d,!0),Rc("pollInterval",100),Rc("undoDepth",200,function(a,b){a.doc.history.undoDepth=b}),Rc("historyEventDelay",1250),Rc("viewportMargin",10,function(a){a.refresh()},!0),Rc("maxHighlightLength",1e4,d,!0),Rc("moveInputWithCursor",!0,function(a,b){b||a.display.input.resetPosition()}),Rc("tabindex",null,function(a,b){a.display.input.getField().tabIndex=b||""}),Rc("autofocus",null);var $f=a.modes={},_f=a.mimeModes={};a.defineMode=function(b,c){a.defaults.mode||"null"==b||(a.defaults.mode=b),arguments.length>2&&(c.dependencies=Array.prototype.slice.call(arguments,2)),$f[b]=c},a.defineMIME=function(a,b){_f[a]=b},a.resolveMode=function(b){if("string"==typeof b&&_f.hasOwnProperty(b))b=_f[b];else if(b&&"string"==typeof b.name&&_f.hasOwnProperty(b.name)){var c=_f[b.name];"string"==typeof c&&(c={name:c}),b=Ie(c,b),b.name=c.name}else if("string"==typeof b&&/^[\w\-]+\/[\w\-]+\+xml$/.test(b))return a.resolveMode("application/xml");return"string"==typeof b?{name:b}:b||{name:"null"}},a.getMode=function(b,c){var c=a.resolveMode(c),d=$f[c.name];if(!d)return a.getMode(b,"text/plain");var e=d(b,c);if(ag.hasOwnProperty(c.name)){var f=ag[c.name];for(var g in f)f.hasOwnProperty(g)&&(e.hasOwnProperty(g)&&(e["_"+g]=e[g]),e[g]=f[g])}if(e.name=c.name,c.helperType&&(e.helperType=c.helperType),c.modeProps)for(var g in c.modeProps)e[g]=c.modeProps[g];return e},a.defineMode("null",function(){return{token:function(a){a.skipToEnd()}}}),a.defineMIME("text/plain","null");var ag=a.modeExtensions={};a.extendMode=function(a,b){var c=ag.hasOwnProperty(a)?ag[a]:ag[a]={};Je(b,c)},a.defineExtension=function(b,c){a.prototype[b]=c},a.defineDocExtension=function(a,b){tg.prototype[a]=b},a.defineOption=Rc;var bg=[];a.defineInitHook=function(a){bg.push(a)};var cg=a.helpers={};a.registerHelper=function(b,c,d){cg.hasOwnProperty(b)||(cg[b]=a[b]={_global:[]}),cg[b][c]=d},a.registerGlobalHelper=function(b,c,d,e){a.registerHelper(b,c,e),cg[b]._global.push({pred:d,val:e})};var dg=a.copyState=function(a,b){if(b===!0)return b;if(a.copyState)return a.copyState(b);var c={};for(var d in b){var e=b[d];e instanceof Array&&(e=e.concat([])),c[d]=e}return c},eg=a.startState=function(a,b,c){return a.startState?a.startState(b,c):!0};a.innerMode=function(a,b){for(;a.innerMode;){var c=a.innerMode(b);if(!c||c.mode==a)break;b=c.state,a=c.mode}return c||{mode:a,state:b}};var fg=a.commands={selectAll:function(a){a.setSelection(Hf(a.firstLine(),0),Hf(a.lastLine()),Fg)},singleSelection:function(a){a.setSelection(a.getCursor("anchor"),a.getCursor("head"),Fg)},killLine:function(a){Oc(a,function(b){if(b.empty()){var c=Xd(a.doc,b.head.line).text.length;return b.head.ch==c&&b.head.line<a.lastLine()?{from:b.head,to:Hf(b.head.line+1,0)}:{from:b.head,to:Hf(b.head.line,c)}}return{from:b.from(),to:b.to()}})},deleteLine:function(a){Oc(a,function(b){return{from:Hf(b.from().line,0),to:qa(a.doc,Hf(b.to().line+1,0))}})},delLineLeft:function(a){Oc(a,function(a){return{from:Hf(a.from().line,0),to:a.from()}})},delWrappedLineLeft:function(a){Oc(a,function(b){var c=a.charCoords(b.head,"div").top+5,d=a.coordsChar({left:0,top:c},"div");return{from:d,to:b.from()}})},delWrappedLineRight:function(a){Oc(a,function(b){var c=a.charCoords(b.head,"div").top+5,d=a.coordsChar({left:a.display.lineDiv.offsetWidth+100,top:c},"div");return{from:b.from(),to:d}})},undo:function(a){a.undo()},redo:function(a){a.redo()},undoSelection:function(a){a.undoSelection()},redoSelection:function(a){a.redoSelection()},goDocStart:function(a){a.extendSelection(Hf(a.firstLine(),0))},goDocEnd:function(a){a.extendSelection(Hf(a.lastLine()))},goLineStart:function(a){a.extendSelectionsBy(function(b){return df(a,b.head.line)},{origin:"+move",bias:1})},goLineStartSmart:function(a){a.extendSelectionsBy(function(b){return ff(a,b.head)},{origin:"+move",bias:1})},goLineEnd:function(a){a.extendSelectionsBy(function(b){return ef(a,b.head.line)},{origin:"+move",bias:-1})},goLineRight:function(a){a.extendSelectionsBy(function(b){var c=a.charCoords(b.head,"div").top+5;return a.coordsChar({left:a.display.lineDiv.offsetWidth+100,top:c},"div")},Hg)},goLineLeft:function(a){a.extendSelectionsBy(function(b){var c=a.charCoords(b.head,"div").top+5;return a.coordsChar({left:0,top:c},"div")},Hg)},goLineLeftSmart:function(a){a.extendSelectionsBy(function(b){var c=a.charCoords(b.head,"div").top+5,d=a.coordsChar({left:0,top:c},"div");return d.ch<a.getLine(d.line).search(/\S/)?ff(a,b.head):d},Hg)},goLineUp:function(a){a.moveV(-1,"line")},goLineDown:function(a){a.moveV(1,"line")},goPageUp:function(a){a.moveV(-1,"page")},goPageDown:function(a){a.moveV(1,"page")},goCharLeft:function(a){a.moveH(-1,"char")},goCharRight:function(a){a.moveH(1,"char")},goColumnLeft:function(a){a.moveH(-1,"column")},goColumnRight:function(a){a.moveH(1,"column")},goWordLeft:function(a){a.moveH(-1,"word")},goGroupRight:function(a){a.moveH(1,"group")},goGroupLeft:function(a){a.moveH(-1,"group")},goWordRight:function(a){a.moveH(1,"word")},delCharBefore:function(a){a.deleteH(-1,"char")},delCharAfter:function(a){a.deleteH(1,"char")},delWordBefore:function(a){a.deleteH(-1,"word")},delWordAfter:function(a){a.deleteH(1,"word")},delGroupBefore:function(a){a.deleteH(-1,"group")},delGroupAfter:function(a){a.deleteH(1,"group")},indentAuto:function(a){a.indentSelection("smart")},indentMore:function(a){a.indentSelection("add")},indentLess:function(a){a.indentSelection("subtract")},insertTab:function(a){a.replaceSelection(" ")},insertSoftTab:function(a){for(var b=[],c=a.listSelections(),d=a.options.tabSize,e=0;e<c.length;e++){var f=c[e].from(),g=Ig(a.getLine(f.line),f.ch,d);b.push(new Array(d-g%d+1).join(" "))}a.replaceSelections(b)},defaultTab:function(a){a.somethingSelected()?a.indentSelection("add"):a.execCommand("insertTab")},transposeChars:function(a){Cb(a,function(){for(var b=a.listSelections(),c=[],d=0;d<b.length;d++){var e=b[d].head,f=Xd(a.doc,e.line).text;if(f)if(e.ch==f.length&&(e=new Hf(e.line,e.ch-1)),e.ch>0)e=new Hf(e.line,e.ch+1),a.replaceRange(f.charAt(e.ch-1)+f.charAt(e.ch-2),Hf(e.line,e.ch-2),e,"+transpose");else if(e.line>a.doc.first){var g=Xd(a.doc,e.line-1).text;g&&a.replaceRange(f.charAt(0)+a.doc.lineSeparator()+g.charAt(g.length-1),Hf(e.line-1,g.length-1),Hf(e.line,1),"+transpose")}c.push(new ma(e,e))}a.setSelections(c)})},newlineAndIndent:function(a){Cb(a,function(){for(var b=a.listSelections().length,c=0;b>c;c++){var d=a.listSelections()[c];a.replaceRange(a.doc.lineSeparator(),d.anchor,d.head,"+input"),a.indentLine(d.from().line+1,null,!0),Kc(a)}})},toggleOverwrite:function(a){a.toggleOverwrite()}},gg=a.keyMap={};gg.basic={Left:"goCharLeft",Right:"goCharRight",Up:"goLineUp",Down:"goLineDown",End:"goLineEnd",Home:"goLineStartSmart",PageUp:"goPageUp",PageDown:"goPageDown",Delete:"delCharAfter",Backspace:"delCharBefore","Shift-Backspace":"delCharBefore",Tab:"defaultTab","Shift-Tab":"indentAuto",Enter:"newlineAndIndent",Insert:"toggleOverwrite",Esc:"singleSelection"},gg.pcDefault={"Ctrl-A":"selectAll","Ctrl-D":"deleteLine","Ctrl-Z":"undo","Shift-Ctrl-Z":"redo","Ctrl-Y":"redo","Ctrl-Home":"goDocStart","Ctrl-End":"goDocEnd","Ctrl-Up":"goLineUp","Ctrl-Down":"goLineDown","Ctrl-Left":"goGroupLeft","Ctrl-Right":"goGroupRight","Alt-Left":"goLineStart","Alt-Right":"goLineEnd","Ctrl-Backspace":"delGroupBefore","Ctrl-Delete":"delGroupAfter","Ctrl-S":"save","Ctrl-F":"find","Ctrl-G":"findNext","Shift-Ctrl-G":"findPrev","Shift-Ctrl-F":"replace","Shift-Ctrl-R":"replaceAll","Ctrl-[":"indentLess","Ctrl-]":"indentMore","Ctrl-U":"undoSelection","Shift-Ctrl-U":"redoSelection","Alt-U":"redoSelection",fallthrough:"basic"},gg.emacsy={"Ctrl-F":"goCharRight","Ctrl-B":"goCharLeft","Ctrl-P":"goLineUp","Ctrl-N":"goLineDown","Alt-F":"goWordRight","Alt-B":"goWordLeft","Ctrl-A":"goLineStart","Ctrl-E":"goLineEnd","Ctrl-V":"goPageDown","Shift-Ctrl-V":"goPageUp","Ctrl-D":"delCharAfter","Ctrl-H":"delCharBefore","Alt-D":"delWordAfter","Alt-Backspace":"delWordBefore","Ctrl-K":"killLine","Ctrl-T":"transposeChars"},gg.macDefault={"Cmd-A":"selectAll","Cmd-D":"deleteLine","Cmd-Z":"undo","Shift-Cmd-Z":"redo","Cmd-Y":"redo","Cmd-Home":"goDocStart","Cmd-Up":"goDocStart","Cmd-End":"goDocEnd","Cmd-Down":"goDocEnd","Alt-Left":"goGroupLeft","Alt-Right":"goGroupRight","Cmd-Left":"goLineLeft","Cmd-Right":"goLineRight","Alt-Backspace":"delGroupBefore","Ctrl-Alt-Backspace":"delGroupAfter","Alt-Delete":"delGroupAfter","Cmd-S":"save","Cmd-F":"find","Cmd-G":"findNext","Shift-Cmd-G":"findPrev","Cmd-Alt-F":"replace",
|
5 |
+
"Shift-Cmd-Alt-F":"replaceAll","Cmd-[":"indentLess","Cmd-]":"indentMore","Cmd-Backspace":"delWrappedLineLeft","Cmd-Delete":"delWrappedLineRight","Cmd-U":"undoSelection","Shift-Cmd-U":"redoSelection","Ctrl-Up":"goDocStart","Ctrl-Down":"goDocEnd",fallthrough:["basic","emacsy"]},gg["default"]=Af?gg.macDefault:gg.pcDefault,a.normalizeKeyMap=function(a){var b={};for(var c in a)if(a.hasOwnProperty(c)){var d=a[c];if(/^(name|fallthrough|(de|at)tach)$/.test(c))continue;if("..."==d){delete a[c];continue}for(var e=Ge(c.split(" "),Sc),f=0;f<e.length;f++){var g,h;f==e.length-1?(h=e.join(" "),g=d):(h=e.slice(0,f+1).join(" "),g="...");var i=b[h];if(i){if(i!=g)throw new Error("Inconsistent bindings for "+h)}else b[h]=g}delete a[c]}for(var j in b)a[j]=b[j];return a};var hg=a.lookupKey=function(a,b,c,d){b=Tc(b);var e=b.call?b.call(a,d):b[a];if(e===!1)return"nothing";if("..."===e)return"multi";if(null!=e&&c(e))return"handled";if(b.fallthrough){if("[object Array]"!=Object.prototype.toString.call(b.fallthrough))return hg(a,b.fallthrough,c,d);for(var f=0;f<b.fallthrough.length;f++){var g=hg(a,b.fallthrough[f],c,d);if(g)return g}}},ig=a.isModifierKey=function(a){var b="string"==typeof a?a:$g[a.keyCode];return"Ctrl"==b||"Alt"==b||"Shift"==b||"Mod"==b},jg=a.keyName=function(a,b){if(uf&&34==a.keyCode&&a["char"])return!1;var c=$g[a.keyCode],d=c;return null==d||a.altGraphKey?!1:(a.altKey&&"Alt"!=c&&(d="Alt-"+d),(Df?a.metaKey:a.ctrlKey)&&"Ctrl"!=c&&(d="Ctrl-"+d),(Df?a.ctrlKey:a.metaKey)&&"Cmd"!=c&&(d="Cmd-"+d),!b&&a.shiftKey&&"Shift"!=c&&(d="Shift-"+d),d)};a.fromTextArea=function(b,c){function d(){b.value=j.getValue()}if(c=c?Je(c):{},c.value=b.value,!c.tabindex&&b.tabIndex&&(c.tabindex=b.tabIndex),!c.placeholder&&b.placeholder&&(c.placeholder=b.placeholder),null==c.autofocus){var e=Re();c.autofocus=e==b||null!=b.getAttribute("autofocus")&&e==document.body}if(b.form&&(zg(b.form,"submit",d),!c.leaveSubmitMethodAlone)){var f=b.form,g=f.submit;try{var h=f.submit=function(){d(),f.submit=g,f.submit(),f.submit=h}}catch(i){}}c.finishInit=function(a){a.save=d,a.getTextArea=function(){return b},a.toTextArea=function(){a.toTextArea=isNaN,d(),b.parentNode.removeChild(a.getWrapperElement()),b.style.display="",b.form&&(Ag(b.form,"submit",d),"function"==typeof b.form.submit&&(b.form.submit=g))}},b.style.display="none";var j=a(function(a){b.parentNode.insertBefore(a,b.nextSibling)},c);return j};var kg=a.StringStream=function(a,b){this.pos=this.start=0,this.string=a,this.tabSize=b||8,this.lastColumnPos=this.lastColumnValue=0,this.lineStart=0};kg.prototype={eol:function(){return this.pos>=this.string.length},sol:function(){return this.pos==this.lineStart},peek:function(){return this.string.charAt(this.pos)||void 0},next:function(){return this.pos<this.string.length?this.string.charAt(this.pos++):void 0},eat:function(a){var b=this.string.charAt(this.pos);if("string"==typeof a)var c=b==a;else var c=b&&(a.test?a.test(b):a(b));return c?(++this.pos,b):void 0},eatWhile:function(a){for(var b=this.pos;this.eat(a););return this.pos>b},eatSpace:function(){for(var a=this.pos;/[\s\u00a0]/.test(this.string.charAt(this.pos));)++this.pos;return this.pos>a},skipToEnd:function(){this.pos=this.string.length},skipTo:function(a){var b=this.string.indexOf(a,this.pos);return b>-1?(this.pos=b,!0):void 0},backUp:function(a){this.pos-=a},column:function(){return this.lastColumnPos<this.start&&(this.lastColumnValue=Ig(this.string,this.start,this.tabSize,this.lastColumnPos,this.lastColumnValue),this.lastColumnPos=this.start),this.lastColumnValue-(this.lineStart?Ig(this.string,this.lineStart,this.tabSize):0)},indentation:function(){return Ig(this.string,null,this.tabSize)-(this.lineStart?Ig(this.string,this.lineStart,this.tabSize):0)},match:function(a,b,c){if("string"!=typeof a){var d=this.string.slice(this.pos).match(a);return d&&d.index>0?null:(d&&b!==!1&&(this.pos+=d[0].length),d)}var e=function(a){return c?a.toLowerCase():a},f=this.string.substr(this.pos,a.length);return e(f)==e(a)?(b!==!1&&(this.pos+=a.length),!0):void 0},current:function(){return this.string.slice(this.start,this.pos)},hideFirstChars:function(a,b){this.lineStart+=a;try{return b()}finally{this.lineStart-=a}}};var lg=0,mg=a.TextMarker=function(a,b){this.lines=[],this.type=b,this.doc=a,this.id=++lg};Ae(mg),mg.prototype.clear=function(){if(!this.explicitlyCleared){var a=this.doc.cm,b=a&&!a.curOp;if(b&&tb(a),ze(this,"clear")){var c=this.find();c&&ve(this,"clear",c.from,c.to)}for(var d=null,e=null,f=0;f<this.lines.length;++f){var g=this.lines[f],h=$c(g.markedSpans,this);a&&!this.collapsed?Jb(a,_d(g),"text"):a&&(null!=h.to&&(e=_d(g)),null!=h.from&&(d=_d(g))),g.markedSpans=_c(g.markedSpans,h),null==h.from&&this.collapsed&&!ud(this.doc,g)&&a&&$d(g,rb(a.display))}if(a&&this.collapsed&&!a.options.lineWrapping)for(var f=0;f<this.lines.length;++f){var i=qd(this.lines[f]),j=l(i);j>a.display.maxLineLength&&(a.display.maxLine=i,a.display.maxLineLength=j,a.display.maxLineChanged=!0)}null!=d&&a&&this.collapsed&&Ib(a,d,e+1),this.lines.length=0,this.explicitlyCleared=!0,this.atomic&&this.doc.cantEdit&&(this.doc.cantEdit=!1,a&&Ea(a.doc)),a&&ve(a,"markerCleared",a,this),b&&vb(a),this.parent&&this.parent.clear()}},mg.prototype.find=function(a,b){null==a&&"bookmark"==this.type&&(a=1);for(var c,d,e=0;e<this.lines.length;++e){var f=this.lines[e],g=$c(f.markedSpans,this);if(null!=g.from&&(c=Hf(b?f:_d(f),g.from),-1==a))return c;if(null!=g.to&&(d=Hf(b?f:_d(f),g.to),1==a))return d}return c&&{from:c,to:d}},mg.prototype.changed=function(){var a=this.find(-1,!0),b=this,c=this.doc.cm;a&&c&&Cb(c,function(){var d=a.line,e=_d(a.line),f=$a(c,e);if(f&&(eb(f),c.curOp.selectionChanged=c.curOp.forceUpdate=!0),c.curOp.updateMaxLine=!0,!ud(b.doc,d)&&null!=b.height){var g=b.height;b.height=null;var h=xd(b)-g;h&&$d(d,d.height+h)}})},mg.prototype.attachLine=function(a){if(!this.lines.length&&this.doc.cm){var b=this.doc.cm.curOp;b.maybeHiddenMarkers&&-1!=Fe(b.maybeHiddenMarkers,this)||(b.maybeUnhiddenMarkers||(b.maybeUnhiddenMarkers=[])).push(this)}this.lines.push(a)},mg.prototype.detachLine=function(a){if(this.lines.splice(Fe(this.lines,a),1),!this.lines.length&&this.doc.cm){var b=this.doc.cm.curOp;(b.maybeHiddenMarkers||(b.maybeHiddenMarkers=[])).push(this)}};var lg=0,ng=a.SharedTextMarker=function(a,b){this.markers=a,this.primary=b;for(var c=0;c<a.length;++c)a[c].parent=this};Ae(ng),ng.prototype.clear=function(){if(!this.explicitlyCleared){this.explicitlyCleared=!0;for(var a=0;a<this.markers.length;++a)this.markers[a].clear();ve(this,"clear")}},ng.prototype.find=function(a,b){return this.primary.find(a,b)};var og=a.LineWidget=function(a,b,c){if(c)for(var d in c)c.hasOwnProperty(d)&&(this[d]=c[d]);this.doc=a,this.node=b};Ae(og),og.prototype.clear=function(){var a=this.doc.cm,b=this.line.widgets,c=this.line,d=_d(c);if(null!=d&&b){for(var e=0;e<b.length;++e)b[e]==this&&b.splice(e--,1);b.length||(c.widgets=null);var f=xd(this);$d(c,Math.max(0,c.height-f)),a&&Cb(a,function(){wd(a,c,-f),Jb(a,d,"widget")})}},og.prototype.changed=function(){var a=this.height,b=this.doc.cm,c=this.line;this.height=null;var d=xd(this)-a;d&&($d(c,c.height+d),b&&Cb(b,function(){b.curOp.forceUpdate=!0,wd(b,c,d)}))};var pg=a.Line=function(a,b,c){this.text=a,id(this,b),this.height=c?c(this):1};Ae(pg),pg.prototype.lineNo=function(){return _d(this)};var qg={},rg={};Td.prototype={chunkSize:function(){return this.lines.length},removeInner:function(a,b){for(var c=a,d=a+b;d>c;++c){var e=this.lines[c];this.height-=e.height,Ad(e),ve(e,"delete")}this.lines.splice(a,b)},collapse:function(a){a.push.apply(a,this.lines)},insertInner:function(a,b,c){this.height+=c,this.lines=this.lines.slice(0,a).concat(b).concat(this.lines.slice(a));for(var d=0;d<b.length;++d)b[d].parent=this},iterN:function(a,b,c){for(var d=a+b;d>a;++a)if(c(this.lines[a]))return!0}},Ud.prototype={chunkSize:function(){return this.size},removeInner:function(a,b){this.size-=b;for(var c=0;c<this.children.length;++c){var d=this.children[c],e=d.chunkSize();if(e>a){var f=Math.min(b,e-a),g=d.height;if(d.removeInner(a,f),this.height-=g-d.height,e==f&&(this.children.splice(c--,1),d.parent=null),0==(b-=f))break;a=0}else a-=e}if(this.size-b<25&&(this.children.length>1||!(this.children[0]instanceof Td))){var h=[];this.collapse(h),this.children=[new Td(h)],this.children[0].parent=this}},collapse:function(a){for(var b=0;b<this.children.length;++b)this.children[b].collapse(a)},insertInner:function(a,b,c){this.size+=b.length,this.height+=c;for(var d=0;d<this.children.length;++d){var e=this.children[d],f=e.chunkSize();if(f>=a){if(e.insertInner(a,b,c),e.lines&&e.lines.length>50){for(;e.lines.length>50;){var g=e.lines.splice(e.lines.length-25,25),h=new Td(g);e.height-=h.height,this.children.splice(d+1,0,h),h.parent=this}this.maybeSpill()}break}a-=f}},maybeSpill:function(){if(!(this.children.length<=10)){var a=this;do{var b=a.children.splice(a.children.length-5,5),c=new Ud(b);if(a.parent){a.size-=c.size,a.height-=c.height;var d=Fe(a.parent.children,a);a.parent.children.splice(d+1,0,c)}else{var e=new Ud(a.children);e.parent=a,a.children=[e,c],a=e}c.parent=a.parent}while(a.children.length>10);a.parent.maybeSpill()}},iterN:function(a,b,c){for(var d=0;d<this.children.length;++d){var e=this.children[d],f=e.chunkSize();if(f>a){var g=Math.min(b,f-a);if(e.iterN(a,g,c))return!0;if(0==(b-=g))break;a=0}else a-=f}}};var sg=0,tg=a.Doc=function(a,b,c,d){if(!(this instanceof tg))return new tg(a,b,c,d);null==c&&(c=0),Ud.call(this,[new Td([new pg("",null)])]),this.first=c,this.scrollTop=this.scrollLeft=0,this.cantEdit=!1,this.cleanGeneration=1,this.frontier=c;var e=Hf(c,0);this.sel=oa(e),this.history=new de(null),this.id=++sg,this.modeOption=b,this.lineSep=d,"string"==typeof a&&(a=this.splitLines(a)),Sd(this,{from:e,to:e,text:a}),Ba(this,oa(e),Fg)};tg.prototype=Ie(Ud.prototype,{constructor:tg,iter:function(a,b,c){c?this.iterN(a-this.first,b-a,c):this.iterN(this.first,this.first+this.size,a)},insert:function(a,b){for(var c=0,d=0;d<b.length;++d)c+=b[d].height;this.insertInner(a-this.first,b,c)},remove:function(a,b){this.removeInner(a-this.first,b)},getValue:function(a){var b=Zd(this,this.first,this.first+this.size);return a===!1?b:b.join(a||this.lineSeparator())},setValue:Fb(function(a){var b=Hf(this.first,0),c=this.first+this.size-1;yc(this,{from:b,to:Hf(c,Xd(this,c).text.length),text:this.splitLines(a),origin:"setValue",full:!0},!0),Ba(this,oa(b))}),replaceRange:function(a,b,c,d){b=qa(this,b),c=c?qa(this,c):b,Ec(this,a,b,c,d)},getRange:function(a,b,c){var d=Yd(this,qa(this,a),qa(this,b));return c===!1?d:d.join(c||this.lineSeparator())},getLine:function(a){var b=this.getLineHandle(a);return b&&b.text},getLineHandle:function(a){return sa(this,a)?Xd(this,a):void 0},getLineNumber:function(a){return _d(a)},getLineHandleVisualStart:function(a){return"number"==typeof a&&(a=Xd(this,a)),qd(a)},lineCount:function(){return this.size},firstLine:function(){return this.first},lastLine:function(){return this.first+this.size-1},clipPos:function(a){return qa(this,a)},getCursor:function(a){var b,c=this.sel.primary();return b=null==a||"head"==a?c.head:"anchor"==a?c.anchor:"end"==a||"to"==a||a===!1?c.to():c.from()},listSelections:function(){return this.sel.ranges},somethingSelected:function(){return this.sel.somethingSelected()},setCursor:Fb(function(a,b,c){ya(this,qa(this,"number"==typeof a?Hf(a,b||0):a),null,c)}),setSelection:Fb(function(a,b,c){ya(this,qa(this,a),qa(this,b||a),c)}),extendSelection:Fb(function(a,b,c){va(this,qa(this,a),b&&qa(this,b),c)}),extendSelections:Fb(function(a,b){wa(this,ta(this,a,b))}),extendSelectionsBy:Fb(function(a,b){wa(this,Ge(this.sel.ranges,a),b)}),setSelections:Fb(function(a,b,c){if(a.length){for(var d=0,e=[];d<a.length;d++)e[d]=new ma(qa(this,a[d].anchor),qa(this,a[d].head));null==b&&(b=Math.min(a.length-1,this.sel.primIndex)),Ba(this,na(e,b),c)}}),addSelection:Fb(function(a,b,c){var d=this.sel.ranges.slice(0);d.push(new ma(qa(this,a),qa(this,b||a))),Ba(this,na(d,d.length-1),c)}),getSelection:function(a){for(var b,c=this.sel.ranges,d=0;d<c.length;d++){var e=Yd(this,c[d].from(),c[d].to());b=b?b.concat(e):e}return a===!1?b:b.join(a||this.lineSeparator())},getSelections:function(a){for(var b=[],c=this.sel.ranges,d=0;d<c.length;d++){var e=Yd(this,c[d].from(),c[d].to());a!==!1&&(e=e.join(a||this.lineSeparator())),b[d]=e}return b},replaceSelection:function(a,b,c){for(var d=[],e=0;e<this.sel.ranges.length;e++)d[e]=a;this.replaceSelections(d,b,c||"+input")},replaceSelections:Fb(function(a,b,c){for(var d=[],e=this.sel,f=0;f<e.ranges.length;f++){var g=e.ranges[f];d[f]={from:g.from(),to:g.to(),text:this.splitLines(a[f]),origin:c}}for(var h=b&&"end"!=b&&wc(this,d,b),f=d.length-1;f>=0;f--)yc(this,d[f]);h?Aa(this,h):this.cm&&Kc(this.cm)}),undo:Fb(function(){Ac(this,"undo")}),redo:Fb(function(){Ac(this,"redo")}),undoSelection:Fb(function(){Ac(this,"undo",!0)}),redoSelection:Fb(function(){Ac(this,"redo",!0)}),setExtending:function(a){this.extend=a},getExtending:function(){return this.extend},historySize:function(){for(var a=this.history,b=0,c=0,d=0;d<a.done.length;d++)a.done[d].ranges||++b;for(var d=0;d<a.undone.length;d++)a.undone[d].ranges||++c;return{undo:b,redo:c}},clearHistory:function(){this.history=new de(this.history.maxGeneration)},markClean:function(){this.cleanGeneration=this.changeGeneration(!0)},changeGeneration:function(a){return a&&(this.history.lastOp=this.history.lastSelOp=this.history.lastOrigin=null),this.history.generation},isClean:function(a){return this.history.generation==(a||this.cleanGeneration)},getHistory:function(){return{done:oe(this.history.done),undone:oe(this.history.undone)}},setHistory:function(a){var b=this.history=new de(this.history.maxGeneration);b.done=oe(a.done.slice(0),null,!0),b.undone=oe(a.undone.slice(0),null,!0)},addLineClass:Fb(function(a,b,c){return Nc(this,a,"gutter"==b?"gutter":"class",function(a){var d="text"==b?"textClass":"background"==b?"bgClass":"gutter"==b?"gutterClass":"wrapClass";if(a[d]){if(Se(c).test(a[d]))return!1;a[d]+=" "+c}else a[d]=c;return!0})}),removeLineClass:Fb(function(a,b,c){return Nc(this,a,"gutter"==b?"gutter":"class",function(a){var d="text"==b?"textClass":"background"==b?"bgClass":"gutter"==b?"gutterClass":"wrapClass",e=a[d];if(!e)return!1;if(null==c)a[d]=null;else{var f=e.match(Se(c));if(!f)return!1;var g=f.index+f[0].length;a[d]=e.slice(0,f.index)+(f.index&&g!=e.length?" ":"")+e.slice(g)||null}return!0})}),addLineWidget:Fb(function(a,b,c){return yd(this,a,b,c)}),removeLineWidget:function(a){a.clear()},markText:function(a,b,c){return Uc(this,qa(this,a),qa(this,b),c,"range")},setBookmark:function(a,b){var c={replacedWith:b&&(null==b.nodeType?b.widget:b),insertLeft:b&&b.insertLeft,clearWhenEmpty:!1,shared:b&&b.shared,handleMouseEvents:b&&b.handleMouseEvents};return a=qa(this,a),Uc(this,a,a,c,"bookmark")},findMarksAt:function(a){a=qa(this,a);var b=[],c=Xd(this,a.line).markedSpans;if(c)for(var d=0;d<c.length;++d){var e=c[d];(null==e.from||e.from<=a.ch)&&(null==e.to||e.to>=a.ch)&&b.push(e.marker.parent||e.marker)}return b},findMarks:function(a,b,c){a=qa(this,a),b=qa(this,b);var d=[],e=a.line;return this.iter(a.line,b.line+1,function(f){var g=f.markedSpans;if(g)for(var h=0;h<g.length;h++){var i=g[h];e==a.line&&a.ch>i.to||null==i.from&&e!=a.line||e==b.line&&i.from>b.ch||c&&!c(i.marker)||d.push(i.marker.parent||i.marker)}++e}),d},getAllMarks:function(){var a=[];return this.iter(function(b){var c=b.markedSpans;if(c)for(var d=0;d<c.length;++d)null!=c[d].from&&a.push(c[d].marker)}),a},posFromIndex:function(a){var b,c=this.first;return this.iter(function(d){var e=d.text.length+1;return e>a?(b=a,!0):(a-=e,void++c)}),qa(this,Hf(c,b))},indexFromPos:function(a){a=qa(this,a);var b=a.ch;return a.line<this.first||a.ch<0?0:(this.iter(this.first,a.line,function(a){b+=a.text.length+1}),b)},copy:function(a){var b=new tg(Zd(this,this.first,this.first+this.size),this.modeOption,this.first,this.lineSep);return b.scrollTop=this.scrollTop,b.scrollLeft=this.scrollLeft,b.sel=this.sel,b.extend=!1,a&&(b.history.undoDepth=this.history.undoDepth,b.setHistory(this.getHistory())),b},linkedDoc:function(a){a||(a={});var b=this.first,c=this.first+this.size;null!=a.from&&a.from>b&&(b=a.from),null!=a.to&&a.to<c&&(c=a.to);var d=new tg(Zd(this,b,c),a.mode||this.modeOption,b,this.lineSep);return a.sharedHist&&(d.history=this.history),(this.linked||(this.linked=[])).push({doc:d,sharedHist:a.sharedHist}),d.linked=[{doc:this,isParent:!0,sharedHist:a.sharedHist}],Xc(d,Wc(this)),d},unlinkDoc:function(b){if(b instanceof a&&(b=b.doc),this.linked)for(var c=0;c<this.linked.length;++c){var d=this.linked[c];if(d.doc==b){this.linked.splice(c,1),b.unlinkDoc(this),Yc(Wc(this));break}}if(b.history==this.history){var e=[b.id];Vd(b,function(a){e.push(a.id)},!0),b.history=new de(null),b.history.done=oe(this.history.done,e),b.history.undone=oe(this.history.undone,e)}},iterLinkedDocs:function(a){Vd(this,a)},getMode:function(){return this.mode},getEditor:function(){return this.cm},splitLines:function(a){return this.lineSep?a.split(this.lineSep):Wg(a)},lineSeparator:function(){return this.lineSep||"\n"}}),tg.prototype.eachLine=tg.prototype.iter;var ug="iter insert remove copy getEditor constructor".split(" ");for(var vg in tg.prototype)tg.prototype.hasOwnProperty(vg)&&Fe(ug,vg)<0&&(a.prototype[vg]=function(a){return function(){return a.apply(this.doc,arguments)}}(tg.prototype[vg]));Ae(tg);var wg=a.e_preventDefault=function(a){a.preventDefault?a.preventDefault():a.returnValue=!1},xg=a.e_stopPropagation=function(a){a.stopPropagation?a.stopPropagation():a.cancelBubble=!0},yg=a.e_stop=function(a){wg(a),xg(a)},zg=a.on=function(a,b,c){if(a.addEventListener)a.addEventListener(b,c,!1);else if(a.attachEvent)a.attachEvent("on"+b,c);else{var d=a._handlers||(a._handlers={}),e=d[b]||(d[b]=[]);e.push(c)}},Ag=a.off=function(a,b,c){if(a.removeEventListener)a.removeEventListener(b,c,!1);else if(a.detachEvent)a.detachEvent("on"+b,c);else{var d=a._handlers&&a._handlers[b];if(!d)return;for(var e=0;e<d.length;++e)if(d[e]==c){d.splice(e,1);break}}},Bg=a.signal=function(a,b){var c=a._handlers&&a._handlers[b];if(c)for(var d=Array.prototype.slice.call(arguments,2),e=0;e<c.length;++e)c[e].apply(null,d)},Cg=null,Dg=30,Eg=a.Pass={toString:function(){return"CodeMirror.Pass"}},Fg={scroll:!1},Gg={origin:"*mouse"},Hg={origin:"+move"};Be.prototype.set=function(a,b){clearTimeout(this.id),this.id=setTimeout(b,a)};var Ig=a.countColumn=function(a,b,c,d,e){null==b&&(b=a.search(/[^\s\u00a0]/),-1==b&&(b=a.length));for(var f=d||0,g=e||0;;){var h=a.indexOf(" ",f);if(0>h||h>=b)return g+(b-f);g+=h-f,g+=c-g%c,f=h+1}},Jg=[""],Kg=function(a){a.select()};yf?Kg=function(a){a.selectionStart=0,a.selectionEnd=a.value.length}:pf&&(Kg=function(a){try{a.select()}catch(b){}});var Lg,Mg=/[\u00df\u0587\u0590-\u05f4\u0600-\u06ff\u3040-\u309f\u30a0-\u30ff\u3400-\u4db5\u4e00-\u9fcc\uac00-\ud7af]/,Ng=a.isWordChar=function(a){return/\w/.test(a)||a>""&&(a.toUpperCase()!=a.toLowerCase()||Mg.test(a))},Og=/[\u0300-\u036f\u0483-\u0489\u0591-\u05bd\u05bf\u05c1\u05c2\u05c4\u05c5\u05c7\u0610-\u061a\u064b-\u065e\u0670\u06d6-\u06dc\u06de-\u06e4\u06e7\u06e8\u06ea-\u06ed\u0711\u0730-\u074a\u07a6-\u07b0\u07eb-\u07f3\u0816-\u0819\u081b-\u0823\u0825-\u0827\u0829-\u082d\u0900-\u0902\u093c\u0941-\u0948\u094d\u0951-\u0955\u0962\u0963\u0981\u09bc\u09be\u09c1-\u09c4\u09cd\u09d7\u09e2\u09e3\u0a01\u0a02\u0a3c\u0a41\u0a42\u0a47\u0a48\u0a4b-\u0a4d\u0a51\u0a70\u0a71\u0a75\u0a81\u0a82\u0abc\u0ac1-\u0ac5\u0ac7\u0ac8\u0acd\u0ae2\u0ae3\u0b01\u0b3c\u0b3e\u0b3f\u0b41-\u0b44\u0b4d\u0b56\u0b57\u0b62\u0b63\u0b82\u0bbe\u0bc0\u0bcd\u0bd7\u0c3e-\u0c40\u0c46-\u0c48\u0c4a-\u0c4d\u0c55\u0c56\u0c62\u0c63\u0cbc\u0cbf\u0cc2\u0cc6\u0ccc\u0ccd\u0cd5\u0cd6\u0ce2\u0ce3\u0d3e\u0d41-\u0d44\u0d4d\u0d57\u0d62\u0d63\u0dca\u0dcf\u0dd2-\u0dd4\u0dd6\u0ddf\u0e31\u0e34-\u0e3a\u0e47-\u0e4e\u0eb1\u0eb4-\u0eb9\u0ebb\u0ebc\u0ec8-\u0ecd\u0f18\u0f19\u0f35\u0f37\u0f39\u0f71-\u0f7e\u0f80-\u0f84\u0f86\u0f87\u0f90-\u0f97\u0f99-\u0fbc\u0fc6\u102d-\u1030\u1032-\u1037\u1039\u103a\u103d\u103e\u1058\u1059\u105e-\u1060\u1071-\u1074\u1082\u1085\u1086\u108d\u109d\u135f\u1712-\u1714\u1732-\u1734\u1752\u1753\u1772\u1773\u17b7-\u17bd\u17c6\u17c9-\u17d3\u17dd\u180b-\u180d\u18a9\u1920-\u1922\u1927\u1928\u1932\u1939-\u193b\u1a17\u1a18\u1a56\u1a58-\u1a5e\u1a60\u1a62\u1a65-\u1a6c\u1a73-\u1a7c\u1a7f\u1b00-\u1b03\u1b34\u1b36-\u1b3a\u1b3c\u1b42\u1b6b-\u1b73\u1b80\u1b81\u1ba2-\u1ba5\u1ba8\u1ba9\u1c2c-\u1c33\u1c36\u1c37\u1cd0-\u1cd2\u1cd4-\u1ce0\u1ce2-\u1ce8\u1ced\u1dc0-\u1de6\u1dfd-\u1dff\u200c\u200d\u20d0-\u20f0\u2cef-\u2cf1\u2de0-\u2dff\u302a-\u302f\u3099\u309a\ua66f-\ua672\ua67c\ua67d\ua6f0\ua6f1\ua802\ua806\ua80b\ua825\ua826\ua8c4\ua8e0-\ua8f1\ua926-\ua92d\ua947-\ua951\ua980-\ua982\ua9b3\ua9b6-\ua9b9\ua9bc\uaa29-\uaa2e\uaa31\uaa32\uaa35\uaa36\uaa43\uaa4c\uaab0\uaab2-\uaab4\uaab7\uaab8\uaabe\uaabf\uaac1\uabe5\uabe8\uabed\udc00-\udfff\ufb1e\ufe00-\ufe0f\ufe20-\ufe26\uff9e\uff9f]/;Lg=document.createRange?function(a,b,c,d){var e=document.createRange();return e.setEnd(d||a,c),e.setStart(a,b),e}:function(a,b,c){var d=document.body.createTextRange();try{d.moveToElementText(a.parentNode)}catch(e){return d}return d.collapse(!0),d.moveEnd("character",c),d.moveStart("character",b),d};var Pg=a.contains=function(a,b){if(3==b.nodeType&&(b=b.parentNode),a.contains)return a.contains(b);do if(11==b.nodeType&&(b=b.host),b==a)return!0;while(b=b.parentNode)};pf&&11>qf&&(Re=function(){try{return document.activeElement}catch(a){return document.body}});var Qg,Rg,Sg=a.rmClass=function(a,b){var c=a.className,d=Se(b).exec(c);if(d){var e=c.slice(d.index+d[0].length);a.className=c.slice(0,d.index)+(e?d[1]+e:"")}},Tg=a.addClass=function(a,b){var c=a.className;Se(b).test(c)||(a.className+=(c?" ":"")+b)},Ug=!1,Vg=function(){if(pf&&9>qf)return!1;var a=Oe("div");return"draggable"in a||"dragDrop"in a}(),Wg=a.splitLines=3!="\n\nb".split(/\n/).length?function(a){for(var b=0,c=[],d=a.length;d>=b;){var e=a.indexOf("\n",b);-1==e&&(e=a.length);var f=a.slice(b,"\r"==a.charAt(e-1)?e-1:e),g=f.indexOf("\r");-1!=g?(c.push(f.slice(0,g)),b+=g+1):(c.push(f),b=e+1)}return c}:function(a){return a.split(/\r\n?|\n/)},Xg=window.getSelection?function(a){try{return a.selectionStart!=a.selectionEnd}catch(b){return!1}}:function(a){try{var b=a.ownerDocument.selection.createRange()}catch(c){}return b&&b.parentElement()==a?0!=b.compareEndPoints("StartToEnd",b):!1},Yg=function(){var a=Oe("div");return"oncopy"in a?!0:(a.setAttribute("oncopy","return;"),"function"==typeof a.oncopy)}(),Zg=null,$g={3:"Enter",8:"Backspace",9:"Tab",13:"Enter",16:"Shift",17:"Ctrl",18:"Alt",19:"Pause",20:"CapsLock",27:"Esc",32:"Space",33:"PageUp",34:"PageDown",35:"End",36:"Home",37:"Left",38:"Up",39:"Right",40:"Down",44:"PrintScrn",45:"Insert",46:"Delete",59:";",61:"=",91:"Mod",92:"Mod",93:"Mod",107:"=",109:"-",127:"Delete",173:"-",186:";",187:"=",188:",",189:"-",190:".",191:"/",192:"`",219:"[",220:"\\",221:"]",222:"'",63232:"Up",63233:"Down",63234:"Left",63235:"Right",63272:"Delete",63273:"Home",63275:"End",63276:"PageUp",63277:"PageDown",63302:"Insert"};a.keyNames=$g,function(){for(var a=0;10>a;a++)$g[a+48]=$g[a+96]=String(a);for(var a=65;90>=a;a++)$g[a]=String.fromCharCode(a);for(var a=1;12>=a;a++)$g[a+111]=$g[a+63235]="F"+a}();var _g,ah=function(){function a(a){return 247>=a?c.charAt(a):a>=1424&&1524>=a?"R":a>=1536&&1773>=a?d.charAt(a-1536):a>=1774&&2220>=a?"r":a>=8192&&8203>=a?"w":8204==a?"b":"L"}function b(a,b,c){this.level=a,this.from=b,this.to=c}var c="bbbbbbbbbtstwsbbbbbbbbbbbbbbssstwNN%%%NNNNNN,N,N1111111111NNNNNNNLLLLLLLLLLLLLLLLLLLLLLLLLLNNNNNNLLLLLLLLLLLLLLLLLLLLLLLLLLNNNNbbbbbbsbbbbbbbbbbbbbbbbbbbbbbbbbb,N%%%%NNNNLNNNNN%%11NLNNN1LNNNNNLLLLLLLLLLLLLLLLLLLLLLLNLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLN",d="rrrrrrrrrrrr,rNNmmmmmmrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrmmmmmmmmmmmmmmrrrrrrrnnnnnnnnnn%nnrrrmrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrmmmmmmmmmmmmmmmmmmmNmmmm",e=/[\u0590-\u05f4\u0600-\u06ff\u0700-\u08ac]/,f=/[stwN]/,g=/[LRr]/,h=/[Lb1n]/,i=/[1n]/,j="L";return function(c){if(!e.test(c))return!1;for(var d,k=c.length,l=[],m=0;k>m;++m)l.push(d=a(c.charCodeAt(m)));for(var m=0,n=j;k>m;++m){var d=l[m];"m"==d?l[m]=n:n=d}for(var m=0,o=j;k>m;++m){var d=l[m];"1"==d&&"r"==o?l[m]="n":g.test(d)&&(o=d,"r"==d&&(l[m]="R"))}for(var m=1,n=l[0];k-1>m;++m){var d=l[m];"+"==d&&"1"==n&&"1"==l[m+1]?l[m]="1":","!=d||n!=l[m+1]||"1"!=n&&"n"!=n||(l[m]=n),n=d}for(var m=0;k>m;++m){var d=l[m];if(","==d)l[m]="N";else if("%"==d){for(var p=m+1;k>p&&"%"==l[p];++p);for(var q=m&&"!"==l[m-1]||k>p&&"1"==l[p]?"1":"N",r=m;p>r;++r)l[r]=q;m=p-1}}for(var m=0,o=j;k>m;++m){var d=l[m];"L"==o&&"1"==d?l[m]="L":g.test(d)&&(o=d)}for(var m=0;k>m;++m)if(f.test(l[m])){for(var p=m+1;k>p&&f.test(l[p]);++p);for(var s="L"==(m?l[m-1]:j),t="L"==(k>p?l[p]:j),q=s||t?"L":"R",r=m;p>r;++r)l[r]=q;m=p-1}for(var u,v=[],m=0;k>m;)if(h.test(l[m])){var w=m;for(++m;k>m&&h.test(l[m]);++m);v.push(new b(0,w,m))}else{var x=m,y=v.length;for(++m;k>m&&"L"!=l[m];++m);for(var r=x;m>r;)if(i.test(l[r])){r>x&&v.splice(y,0,new b(1,x,r));var z=r;for(++r;m>r&&i.test(l[r]);++r);v.splice(y,0,new b(2,z,r)),x=r}else++r;m>x&&v.splice(y,0,new b(1,x,m))}return 1==v[0].level&&(u=c.match(/^\s+/))&&(v[0].from=u[0].length,v.unshift(new b(0,0,u[0].length))),1==Ee(v).level&&(u=c.match(/\s+$/))&&(Ee(v).to-=u[0].length,v.push(new b(0,k-u[0].length,k))),2==v[0].level&&v.unshift(new b(1,v[0].to,v[0].to)),v[0].level!=Ee(v).level&&v.push(new b(v[0].level,k,k)),v}}();return a.version="5.6.0",a}),function(a){"object"==typeof exports&&"object"==typeof module?a(require("../../lib/codemirror")):"function"==typeof define&&define.amd?define(["../../lib/codemirror"],a):a(CodeMirror)}(function(a){"use strict";function b(a){for(var b={},c=a.split(" "),d=0;d<c.length;++d)b[c[d]]=!0;return b}function c(a,b){if(!b.startOfLine)return!1;for(;;){if(!a.skipTo("\\")){a.skipToEnd(),b.tokenize=null;break}if(a.next(),a.eol()){b.tokenize=c;break}}return"meta"}function d(a,b){return"variable-3"==b.prevToken?"variable-3":!1}function e(a,b){if(a.backUp(1),a.match(/(R|u8R|uR|UR|LR)/)){var c=a.match(/"([^\s\\()]{0,16})\(/);return c?(b.cpp11RawStringDelim=c[1],b.tokenize=h,h(a,b)):!1}return a.match(/(u8|u|U|L)/)?a.match(/["']/,!1)?"string":!1:(a.next(),!1)}function f(a){var b=/(\w+)::(\w+)$/.exec(a);return b&&b[1]==b[2]}function g(a,b){for(var c;null!=(c=a.next());)if('"'==c&&!a.eat('"')){b.tokenize=null;break}return"string"}function h(a,b){var c=b.cpp11RawStringDelim.replace(/[^\w\s]/g,"\\$&"),d=a.match(new RegExp(".*?\\)"+c+'"'));return d?b.tokenize=null:a.skipToEnd(),"string"}function i(b,c){function d(a){if(a)for(var b in a)a.hasOwnProperty(b)&&e.push(b)}"string"==typeof b&&(b=[b]);var e=[];d(c.keywords),d(c.types),d(c.builtin),d(c.atoms),e.length&&(c.helperType=b[0],a.registerHelper("hintWords",b[0],e));for(var f=0;f<b.length;++f)a.defineMIME(b[f],c)}function j(a,b){for(var c=!1;!a.eol();){if(!c&&a.match('"""')){b.tokenize=null;break}c="\\"==a.next()&&!c}return"string"}a.defineMode("clike",function(b,c){function d(a,b){var c=a.next();if(x[c]){var d=x[c](a,b);if(d!==!1)return d}if('"'==c||"'"==c)return b.tokenize=e(c),b.tokenize(a,b);if(/[\[\]{}\(\),;\:\.]/.test(c))return m=c,null;if(/\d/.test(c))return a.eatWhile(/[\w\.]/),"number";if("/"==c){if(a.eat("*"))return b.tokenize=f,f(a,b);if(a.eat("/"))return a.skipToEnd(),"comment"}if(C.test(c))return a.eatWhile(C),"operator";if(a.eatWhile(/[\w\$_\xa1-\uffff]/),B)for(;a.match(B);)a.eatWhile(/[\w\$_\xa1-\uffff]/);var g=a.current();return r.propertyIsEnumerable(g)?(u.propertyIsEnumerable(g)&&(m="newstatement"),v.propertyIsEnumerable(g)&&(n=!0),"keyword"):s.propertyIsEnumerable(g)?"variable-3":t.propertyIsEnumerable(g)?(u.propertyIsEnumerable(g)&&(m="newstatement"),"builtin"):w.propertyIsEnumerable(g)?"atom":"variable"}function e(a){return function(b,c){for(var d,e=!1,f=!1;null!=(d=b.next());){if(d==a&&!e){f=!0;break}e=!e&&"\\"==d}return(f||!e&&!y)&&(c.tokenize=null),"string"}}function f(a,b){for(var c,d=!1;c=a.next();){if("/"==c&&d){b.tokenize=null;break}d="*"==c}return"comment"}function g(a,b,c,d,e){this.indented=a,this.column=b,this.type=c,this.align=d,this.prev=e}function h(a){return"statement"==a||"switchstatement"==a||"namespace"==a}function i(a,b,c){var d=a.indented;return a.context&&h(a.context.type)&&!h(c)&&(d=a.context.indented),a.context=new g(d,b,c,null,a.context)}function j(a){var b=a.context.type;return(")"==b||"]"==b||"}"==b)&&(a.indented=a.context.indented),a.context=a.context.prev}function k(a,b){return"variable"==b.prevToken||"variable-3"==b.prevToken?!0:/\S(?:[^- ]>|[*\]])\s*$|\*$/.test(a.string.slice(0,a.start))?!0:void 0}function l(a){for(;;){if(!a||"top"==a.type)return!0;if("}"==a.type&&"namespace"!=a.prev.type)return!1;a=a.prev}}var m,n,o=b.indentUnit,p=c.statementIndentUnit||o,q=c.dontAlignCalls,r=c.keywords||{},s=c.types||{},t=c.builtin||{},u=c.blockKeywords||{},v=c.defKeywords||{},w=c.atoms||{},x=c.hooks||{},y=c.multiLineStrings,z=c.indentStatements!==!1,A=c.indentSwitch!==!1,B=c.namespaceSeparator,C=/[+\-*&%=<>!?|\/]/;return{startState:function(a){return{tokenize:null,context:new g((a||0)-o,0,"top",!1),indented:0,startOfLine:!0,prevToken:null}},token:function(a,b){var e=b.context;if(a.sol()&&(null==e.align&&(e.align=!1),b.indented=a.indentation(),b.startOfLine=!0),a.eatSpace())return null;m=n=null;var f=(b.tokenize||d)(a,b);if("comment"==f||"meta"==f)return f;if(null==e.align&&(e.align=!0),";"==m||":"==m||","==m)for(;h(b.context.type);)j(b);else if("{"==m)i(b,a.column(),"}");else if("["==m)i(b,a.column(),"]");else if("("==m)i(b,a.column(),")");else if("}"==m){for(;h(e.type);)e=j(b);for("}"==e.type&&(e=j(b));h(e.type);)e=j(b)}else if(m==e.type)j(b);else if(z&&(("}"==e.type||"top"==e.type)&&";"!=m||h(e.type)&&"newstatement"==m)){var g="statement";"newstatement"==m&&A&&"switch"==a.current()?g="switchstatement":"keyword"==f&&"namespace"==a.current()&&(g="namespace"),i(b,a.column(),g)}if("variable"==f&&("def"==b.prevToken||c.typeFirstDefinitions&&k(a,b)&&l(b.context)&&a.match(/^\s*\(/,!1))&&(f="def"),x.token){var o=x.token(a,b,f);void 0!==o&&(f=o)}return"def"==f&&c.styleDefs===!1&&(f="variable"),b.startOfLine=!1,b.prevToken=n?"def":f||m,f},indent:function(b,c){if(b.tokenize!=d&&null!=b.tokenize)return a.Pass;var e=b.context,f=c&&c.charAt(0);h(e.type)&&"}"==f&&(e=e.prev);var g=f==e.type,i=e.prev&&"switchstatement"==e.prev.type;return h(e.type)?e.indented+("{"==f?0:p):!e.align||q&&")"==e.type?")"!=e.type||g?e.indented+(g?0:o)+(g||!i||/^(?:case|default)\b/.test(c)?0:o):e.indented+p:e.column+(g?0:1)},electricInput:A?/^\s*(?:case .*?:|default:|\{\}?|\})$/:/^\s*[{}]$/,blockCommentStart:"/*",blockCommentEnd:"*/",lineComment:"//",fold:"brace"}});var k="auto if break case register continue return default do sizeof static else struct switch extern typedef float union for goto while enum const volatile",l="int long char short double float unsigned signed void size_t ptrdiff_t";i(["text/x-csrc","text/x-c","text/x-chdr"],{name:"clike",keywords:b(k),types:b(l+" bool _Complex _Bool float_t double_t intptr_t intmax_t int8_t int16_t int32_t int64_t uintptr_t uintmax_t uint8_t uint16_t uint32_t uint64_t"),blockKeywords:b("case do else for if switch while struct"),defKeywords:b("struct"),typeFirstDefinitions:!0,atoms:b("null true false"),hooks:{"#":c,"*":d},modeProps:{fold:["brace","include"]}}),i(["text/x-c++src","text/x-c++hdr"],{name:"clike",keywords:b(k+" asm dynamic_cast namespace reinterpret_cast try explicit new static_cast typeid catch operator template typename class friend private this using const_cast inline public throw virtual delete mutable protected alignas alignof constexpr decltype nullptr noexcept thread_local final static_assert override"),types:b(l+" bool wchar_t"),blockKeywords:b("catch class do else finally for if struct switch try while"),defKeywords:b("class namespace struct enum union"),typeFirstDefinitions:!0,atoms:b("true false null"),hooks:{"#":c,"*":d,u:e,U:e,L:e,R:e,token:function(a,b,c){return"variable"!=c||"("!=a.peek()||";"!=b.prevToken&&null!=b.prevToken&&"}"!=b.prevToken||!f(a.current())?void 0:"def";
|
6 |
+
}},namespaceSeparator:"::",modeProps:{fold:["brace","include"]}}),i("text/x-java",{name:"clike",keywords:b("abstract assert break case catch class const continue default do else enum extends final finally float for goto if implements import instanceof interface native new package private protected public return static strictfp super switch synchronized this throw throws transient try volatile while"),types:b("byte short int long float double boolean char void Boolean Byte Character Double Float Integer Long Number Object Short String StringBuffer StringBuilder Void"),blockKeywords:b("catch class do else finally for if switch try while"),defKeywords:b("class interface package enum"),typeFirstDefinitions:!0,atoms:b("true false null"),hooks:{"@":function(a){return a.eatWhile(/[\w\$_]/),"meta"}},modeProps:{fold:["brace","import"]}}),i("text/x-csharp",{name:"clike",keywords:b("abstract as async await base break case catch checked class const continue default delegate do else enum event explicit extern finally fixed for foreach goto if implicit in interface internal is lock namespace new operator out override params private protected public readonly ref return sealed sizeof stackalloc static struct switch this throw try typeof unchecked unsafe using virtual void volatile while add alias ascending descending dynamic from get global group into join let orderby partial remove select set value var yield"),types:b("Action Boolean Byte Char DateTime DateTimeOffset Decimal Double Func Guid Int16 Int32 Int64 Object SByte Single String Task TimeSpan UInt16 UInt32 UInt64 bool byte char decimal double short int long object sbyte float string ushort uint ulong"),blockKeywords:b("catch class do else finally for foreach if struct switch try while"),defKeywords:b("class interface namespace struct var"),typeFirstDefinitions:!0,atoms:b("true false null"),hooks:{"@":function(a,b){return a.eat('"')?(b.tokenize=g,g(a,b)):(a.eatWhile(/[\w\$_]/),"meta")}}}),i("text/x-scala",{name:"clike",keywords:b("abstract case catch class def do else extends false final finally for forSome if implicit import lazy match new null object override package private protected return sealed super this throw trait try type val var while with yield _ : = => <- <: <% >: # @ assert assume require print println printf readLine readBoolean readByte readShort readChar readInt readLong readFloat readDouble :: #:: "),types:b("AnyVal App Application Array BufferedIterator BigDecimal BigInt Char Console Either Enumeration Equiv Error Exception Fractional Function IndexedSeq Integral Iterable Iterator List Map Numeric Nil NotNull Option Ordered Ordering PartialFunction PartialOrdering Product Proxy Range Responder Seq Serializable Set Specializable Stream StringBuilder StringContext Symbol Throwable Traversable TraversableOnce Tuple Unit Vector Boolean Byte Character CharSequence Class ClassLoader Cloneable Comparable Compiler Double Exception Float Integer Long Math Number Object Package Pair Process Runtime Runnable SecurityManager Short StackTraceElement StrictMath String StringBuffer System Thread ThreadGroup ThreadLocal Throwable Triple Void"),multiLineStrings:!0,blockKeywords:b("catch class do else finally for forSome if match switch try while"),defKeywords:b("class def object package trait type val var"),atoms:b("true false null"),indentStatements:!1,indentSwitch:!1,hooks:{"@":function(a){return a.eatWhile(/[\w\$_]/),"meta"},'"':function(a,b){return a.match('""')?(b.tokenize=j,b.tokenize(a,b)):!1},"'":function(a){return a.eatWhile(/[\w\$_\xa1-\uffff]/),"atom"}},modeProps:{closeBrackets:{triples:'"'}}}),i(["x-shader/x-vertex","x-shader/x-fragment"],{name:"clike",keywords:b("sampler1D sampler2D sampler3D samplerCube sampler1DShadow sampler2DShadow const attribute uniform varying break continue discard return for while do if else struct in out inout"),types:b("float int bool void vec2 vec3 vec4 ivec2 ivec3 ivec4 bvec2 bvec3 bvec4 mat2 mat3 mat4"),blockKeywords:b("for while do if else struct"),builtin:b("radians degrees sin cos tan asin acos atan pow exp log exp2 sqrt inversesqrt abs sign floor ceil fract mod min max clamp mix step smoothstep length distance dot cross normalize ftransform faceforward reflect refract matrixCompMult lessThan lessThanEqual greaterThan greaterThanEqual equal notEqual any all not texture1D texture1DProj texture1DLod texture1DProjLod texture2D texture2DProj texture2DLod texture2DProjLod texture3D texture3DProj texture3DLod texture3DProjLod textureCube textureCubeLod shadow1D shadow2D shadow1DProj shadow2DProj shadow1DLod shadow2DLod shadow1DProjLod shadow2DProjLod dFdx dFdy fwidth noise1 noise2 noise3 noise4"),atoms:b("true false gl_FragColor gl_SecondaryColor gl_Normal gl_Vertex gl_MultiTexCoord0 gl_MultiTexCoord1 gl_MultiTexCoord2 gl_MultiTexCoord3 gl_MultiTexCoord4 gl_MultiTexCoord5 gl_MultiTexCoord6 gl_MultiTexCoord7 gl_FogCoord gl_PointCoord gl_Position gl_PointSize gl_ClipVertex gl_FrontColor gl_BackColor gl_FrontSecondaryColor gl_BackSecondaryColor gl_TexCoord gl_FogFragCoord gl_FragCoord gl_FrontFacing gl_FragData gl_FragDepth gl_ModelViewMatrix gl_ProjectionMatrix gl_ModelViewProjectionMatrix gl_TextureMatrix gl_NormalMatrix gl_ModelViewMatrixInverse gl_ProjectionMatrixInverse gl_ModelViewProjectionMatrixInverse gl_TexureMatrixTranspose gl_ModelViewMatrixInverseTranspose gl_ProjectionMatrixInverseTranspose gl_ModelViewProjectionMatrixInverseTranspose gl_TextureMatrixInverseTranspose gl_NormalScale gl_DepthRange gl_ClipPlane gl_Point gl_FrontMaterial gl_BackMaterial gl_LightSource gl_LightModel gl_FrontLightModelProduct gl_BackLightModelProduct gl_TextureColor gl_EyePlaneS gl_EyePlaneT gl_EyePlaneR gl_EyePlaneQ gl_FogParameters gl_MaxLights gl_MaxClipPlanes gl_MaxTextureUnits gl_MaxTextureCoords gl_MaxVertexAttribs gl_MaxVertexUniformComponents gl_MaxVaryingFloats gl_MaxVertexTextureImageUnits gl_MaxTextureImageUnits gl_MaxFragmentUniformComponents gl_MaxCombineTextureImageUnits gl_MaxDrawBuffers"),indentSwitch:!1,hooks:{"#":c},modeProps:{fold:["brace","include"]}}),i("text/x-nesc",{name:"clike",keywords:b(k+"as atomic async call command component components configuration event generic implementation includes interface module new norace nx_struct nx_union post provides signal task uses abstract extends"),types:b(l),blockKeywords:b("case do else for if switch while struct"),atoms:b("null true false"),hooks:{"#":c},modeProps:{fold:["brace","include"]}}),i("text/x-objectivec",{name:"clike",keywords:b(k+"inline restrict _Bool _Complex _Imaginery BOOL Class bycopy byref id IMP in inout nil oneway out Protocol SEL self super atomic nonatomic retain copy readwrite readonly"),types:b(l),atoms:b("YES NO NULL NILL ON OFF true false"),hooks:{"@":function(a){return a.eatWhile(/[\w\$]/),"keyword"},"#":c},modeProps:{fold:"brace"}}),i("text/x-squirrel",{name:"clike",keywords:b("base break clone continue const default delete enum extends function in class foreach local resume return this throw typeof yield constructor instanceof static"),types:b(l),blockKeywords:b("case catch class else for foreach if switch try while"),defKeywords:b("function local class"),typeFirstDefinitions:!0,atoms:b("true false null"),hooks:{"#":c},modeProps:{fold:["brace","include"]}})}),function(a){"object"==typeof exports&&"object"==typeof module?a(require("../../lib/codemirror"),require("../htmlmixed/htmlmixed"),require("../clike/clike")):"function"==typeof define&&define.amd?define(["../../lib/codemirror","../htmlmixed/htmlmixed","../clike/clike"],a):a(CodeMirror)}(function(a){"use strict";function b(a){for(var b={},c=a.split(" "),d=0;d<c.length;++d)b[c[d]]=!0;return b}function c(a,b,e){return 0==a.length?d(b):function(f,g){for(var h=a[0],i=0;i<h.length;i++)if(f.match(h[i][0]))return g.tokenize=c(a.slice(1),b),h[i][1];return g.tokenize=d(b,e),"string"}}function d(a,b){return function(c,d){return e(c,d,a,b)}}function e(a,b,d,e){if(e!==!1&&a.match("${",!1)||a.match("{$",!1))return b.tokenize=null,"string";if(e!==!1&&a.match(/^\$[a-zA-Z_][a-zA-Z0-9_]*/))return a.match("[",!1)&&(b.tokenize=c([[["[",null]],[[/\d[\w\.]*/,"number"],[/\$[a-zA-Z_][a-zA-Z0-9_]*/,"variable-2"],[/[\w\$]+/,"variable"]],[["]",null]]],d,e)),a.match(/\-\>\w/,!1)&&(b.tokenize=c([[["->",null]],[[/[\w]+/,"variable"]]],d,e)),"variable-2";for(var f=!1;!a.eol()&&(f||e===!1||!a.match("{$",!1)&&!a.match(/^(\$[a-zA-Z_][a-zA-Z0-9_]*|\$\{)/,!1));){if(!f&&a.match(d)){b.tokenize=null,b.tokStack.pop(),b.tokStack.pop();break}f="\\"==a.next()&&!f}return"string"}var f="abstract and array as break case catch class clone const continue declare default do else elseif enddeclare endfor endforeach endif endswitch endwhile extends final for foreach function global goto if implements interface instanceof namespace new or private protected public static switch throw trait try use var while xor die echo empty exit eval include include_once isset list require require_once return print unset __halt_compiler self static parent yield insteadof finally",g="true false null TRUE FALSE NULL __CLASS__ __DIR__ __FILE__ __LINE__ __METHOD__ __FUNCTION__ __NAMESPACE__ __TRAIT__",h="func_num_args func_get_arg func_get_args strlen strcmp strncmp strcasecmp strncasecmp each error_reporting define defined trigger_error user_error set_error_handler restore_error_handler get_declared_classes get_loaded_extensions extension_loaded get_extension_funcs debug_backtrace constant bin2hex hex2bin sleep usleep time mktime gmmktime strftime gmstrftime strtotime date gmdate getdate localtime checkdate flush wordwrap htmlspecialchars htmlentities html_entity_decode md5 md5_file crc32 getimagesize image_type_to_mime_type phpinfo phpversion phpcredits strnatcmp strnatcasecmp substr_count strspn strcspn strtok strtoupper strtolower strpos strrpos strrev hebrev hebrevc nl2br basename dirname pathinfo stripslashes stripcslashes strstr stristr strrchr str_shuffle str_word_count strcoll substr substr_replace quotemeta ucfirst ucwords strtr addslashes addcslashes rtrim str_replace str_repeat count_chars chunk_split trim ltrim strip_tags similar_text explode implode setlocale localeconv parse_str str_pad chop strchr sprintf printf vprintf vsprintf sscanf fscanf parse_url urlencode urldecode rawurlencode rawurldecode readlink linkinfo link unlink exec system escapeshellcmd escapeshellarg passthru shell_exec proc_open proc_close rand srand getrandmax mt_rand mt_srand mt_getrandmax base64_decode base64_encode abs ceil floor round is_finite is_nan is_infinite bindec hexdec octdec decbin decoct dechex base_convert number_format fmod ip2long long2ip getenv putenv getopt microtime gettimeofday getrusage uniqid quoted_printable_decode set_time_limit get_cfg_var magic_quotes_runtime set_magic_quotes_runtime get_magic_quotes_gpc get_magic_quotes_runtime import_request_variables error_log serialize unserialize memory_get_usage var_dump var_export debug_zval_dump print_r highlight_file show_source highlight_string ini_get ini_get_all ini_set ini_alter ini_restore get_include_path set_include_path restore_include_path setcookie header headers_sent connection_aborted connection_status ignore_user_abort parse_ini_file is_uploaded_file move_uploaded_file intval floatval doubleval strval gettype settype is_null is_resource is_bool is_long is_float is_int is_integer is_double is_real is_numeric is_string is_array is_object is_scalar ereg ereg_replace eregi eregi_replace split spliti join sql_regcase dl pclose popen readfile rewind rmdir umask fclose feof fgetc fgets fgetss fread fopen fpassthru ftruncate fstat fseek ftell fflush fwrite fputs mkdir rename copy tempnam tmpfile file file_get_contents stream_select stream_context_create stream_context_set_params stream_context_set_option stream_context_get_options stream_filter_prepend stream_filter_append fgetcsv flock get_meta_tags stream_set_write_buffer set_file_buffer set_socket_blocking stream_set_blocking socket_set_blocking stream_get_meta_data stream_register_wrapper stream_wrapper_register stream_set_timeout socket_set_timeout socket_get_status realpath fnmatch fsockopen pfsockopen pack unpack get_browser crypt opendir closedir chdir getcwd rewinddir readdir dir glob fileatime filectime filegroup fileinode filemtime fileowner fileperms filesize filetype file_exists is_writable is_writeable is_readable is_executable is_file is_dir is_link stat lstat chown touch clearstatcache mail ob_start ob_flush ob_clean ob_end_flush ob_end_clean ob_get_flush ob_get_clean ob_get_length ob_get_level ob_get_status ob_get_contents ob_implicit_flush ob_list_handlers ksort krsort natsort natcasesort asort arsort sort rsort usort uasort uksort shuffle array_walk count end prev next reset current key min max in_array array_search extract compact array_fill range array_multisort array_push array_pop array_shift array_unshift array_splice array_slice array_merge array_merge_recursive array_keys array_values array_count_values array_reverse array_reduce array_pad array_flip array_change_key_case array_rand array_unique array_intersect array_intersect_assoc array_diff array_diff_assoc array_sum array_filter array_map array_chunk array_key_exists pos sizeof key_exists assert assert_options version_compare ftok str_rot13 aggregate session_name session_module_name session_save_path session_id session_regenerate_id session_decode session_register session_unregister session_is_registered session_encode session_start session_destroy session_unset session_set_save_handler session_cache_limiter session_cache_expire session_set_cookie_params session_get_cookie_params session_write_close preg_match preg_match_all preg_replace preg_replace_callback preg_split preg_quote preg_grep overload ctype_alnum ctype_alpha ctype_cntrl ctype_digit ctype_lower ctype_graph ctype_print ctype_punct ctype_space ctype_upper ctype_xdigit virtual apache_request_headers apache_note apache_lookup_uri apache_child_terminate apache_setenv apache_response_headers apache_get_version getallheaders mysql_connect mysql_pconnect mysql_close mysql_select_db mysql_create_db mysql_drop_db mysql_query mysql_unbuffered_query mysql_db_query mysql_list_dbs mysql_list_tables mysql_list_fields mysql_list_processes mysql_error mysql_errno mysql_affected_rows mysql_insert_id mysql_result mysql_num_rows mysql_num_fields mysql_fetch_row mysql_fetch_array mysql_fetch_assoc mysql_fetch_object mysql_data_seek mysql_fetch_lengths mysql_fetch_field mysql_field_seek mysql_free_result mysql_field_name mysql_field_table mysql_field_len mysql_field_type mysql_field_flags mysql_escape_string mysql_real_escape_string mysql_stat mysql_thread_id mysql_client_encoding mysql_get_client_info mysql_get_host_info mysql_get_proto_info mysql_get_server_info mysql_info mysql mysql_fieldname mysql_fieldtable mysql_fieldlen mysql_fieldtype mysql_fieldflags mysql_selectdb mysql_createdb mysql_dropdb mysql_freeresult mysql_numfields mysql_numrows mysql_listdbs mysql_listtables mysql_listfields mysql_db_name mysql_dbname mysql_tablename mysql_table_name pg_connect pg_pconnect pg_close pg_connection_status pg_connection_busy pg_connection_reset pg_host pg_dbname pg_port pg_tty pg_options pg_ping pg_query pg_send_query pg_cancel_query pg_fetch_result pg_fetch_row pg_fetch_assoc pg_fetch_array pg_fetch_object pg_fetch_all pg_affected_rows pg_get_result pg_result_seek pg_result_status pg_free_result pg_last_oid pg_num_rows pg_num_fields pg_field_name pg_field_num pg_field_size pg_field_type pg_field_prtlen pg_field_is_null pg_get_notify pg_get_pid pg_result_error pg_last_error pg_last_notice pg_put_line pg_end_copy pg_copy_to pg_copy_from pg_trace pg_untrace pg_lo_create pg_lo_unlink pg_lo_open pg_lo_close pg_lo_read pg_lo_write pg_lo_read_all pg_lo_import pg_lo_export pg_lo_seek pg_lo_tell pg_escape_string pg_escape_bytea pg_unescape_bytea pg_client_encoding pg_set_client_encoding pg_meta_data pg_convert pg_insert pg_update pg_delete pg_select pg_exec pg_getlastoid pg_cmdtuples pg_errormessage pg_numrows pg_numfields pg_fieldname pg_fieldsize pg_fieldtype pg_fieldnum pg_fieldprtlen pg_fieldisnull pg_freeresult pg_result pg_loreadall pg_locreate pg_lounlink pg_loopen pg_loclose pg_loread pg_lowrite pg_loimport pg_loexport http_response_code get_declared_traits getimagesizefromstring socket_import_stream stream_set_chunk_size trait_exists header_register_callback class_uses session_status session_register_shutdown echo print global static exit array empty eval isset unset die include require include_once require_once json_decode json_encode json_last_error json_last_error_msg curl_close curl_copy_handle curl_errno curl_error curl_escape curl_exec curl_file_create curl_getinfo curl_init curl_multi_add_handle curl_multi_close curl_multi_exec curl_multi_getcontent curl_multi_info_read curl_multi_init curl_multi_remove_handle curl_multi_select curl_multi_setopt curl_multi_strerror curl_pause curl_reset curl_setopt_array curl_setopt curl_share_close curl_share_init curl_share_setopt curl_strerror curl_unescape curl_version mysqli_affected_rows mysqli_autocommit mysqli_change_user mysqli_character_set_name mysqli_close mysqli_commit mysqli_connect_errno mysqli_connect_error mysqli_connect mysqli_data_seek mysqli_debug mysqli_dump_debug_info mysqli_errno mysqli_error_list mysqli_error mysqli_fetch_all mysqli_fetch_array mysqli_fetch_assoc mysqli_fetch_field_direct mysqli_fetch_field mysqli_fetch_fields mysqli_fetch_lengths mysqli_fetch_object mysqli_fetch_row mysqli_field_count mysqli_field_seek mysqli_field_tell mysqli_free_result mysqli_get_charset mysqli_get_client_info mysqli_get_client_stats mysqli_get_client_version mysqli_get_connection_stats mysqli_get_host_info mysqli_get_proto_info mysqli_get_server_info mysqli_get_server_version mysqli_info mysqli_init mysqli_insert_id mysqli_kill mysqli_more_results mysqli_multi_query mysqli_next_result mysqli_num_fields mysqli_num_rows mysqli_options mysqli_ping mysqli_prepare mysqli_query mysqli_real_connect mysqli_real_escape_string mysqli_real_query mysqli_reap_async_query mysqli_refresh mysqli_rollback mysqli_select_db mysqli_set_charset mysqli_set_local_infile_default mysqli_set_local_infile_handler mysqli_sqlstate mysqli_ssl_set mysqli_stat mysqli_stmt_init mysqli_store_result mysqli_thread_id mysqli_thread_safe mysqli_use_result mysqli_warning_count";a.registerHelper("hintWords","php",[f,g,h].join(" ").split(" ")),a.registerHelper("wordChars","php",/[\w$]/);var i={name:"clike",helperType:"php",keywords:b(f),blockKeywords:b("catch do else elseif for foreach if switch try while finally"),defKeywords:b("class function interface namespace trait"),atoms:b(g),builtin:b(h),multiLineStrings:!0,hooks:{$:function(a){return a.eatWhile(/[\w\$_]/),"variable-2"},"<":function(a,b){var c;if(c=a.match(/<<\s*/)){var e=a.eat(/['"]/);a.eatWhile(/[\w\.]/);var f=a.current().slice(c[0].length+(e?2:1));if(e&&a.eat(e),f)return(b.tokStack||(b.tokStack=[])).push(f,0),b.tokenize=d(f,"'"!=e),"string"}return!1},"#":function(a){for(;!a.eol()&&!a.match("?>",!1);)a.next();return"comment"},"/":function(a){if(a.eat("/")){for(;!a.eol()&&!a.match("?>",!1);)a.next();return"comment"}return!1},'"':function(a,b){return(b.tokStack||(b.tokStack=[])).push('"',0),b.tokenize=d('"'),"string"},"{":function(a,b){return b.tokStack&&b.tokStack.length&&b.tokStack[b.tokStack.length-1]++,!1},"}":function(a,b){return b.tokStack&&b.tokStack.length>0&&!--b.tokStack[b.tokStack.length-1]&&(b.tokenize=d(b.tokStack[b.tokStack.length-2])),!1}}};a.defineMode("php",function(b,c){function d(a,b){var c=b.curMode==f;if(a.sol()&&b.pending&&'"'!=b.pending&&"'"!=b.pending&&(b.pending=null),c)return c&&null==b.php.tokenize&&a.match("?>")?(b.curMode=e,b.curState=b.html,"meta"):f.token(a,b.curState);if(a.match(/^<\?\w*/))return b.curMode=f,b.curState=b.php,"meta";if('"'==b.pending||"'"==b.pending){for(;!a.eol()&&a.next()!=b.pending;);var d="string"}else if(b.pending&&a.pos<b.pending.end){a.pos=b.pending.end;var d=b.pending.style}else var d=e.token(a,b.curState);b.pending&&(b.pending=null);var g,h=a.current(),i=h.search(/<\?/);return-1!=i&&("string"==d&&(g=h.match(/[\'\"]$/))&&!/\?>/.test(h)?b.pending=g[0]:b.pending={end:a.pos,style:d},a.backUp(h.length-i)),d}var e=a.getMode(b,"text/html"),f=a.getMode(b,i);return{startState:function(){var b=a.startState(e),d=a.startState(f);return{html:b,php:d,curMode:c.startOpen?f:e,curState:c.startOpen?d:b,pending:null}},copyState:function(b){var c,d=b.html,g=a.copyState(e,d),h=b.php,i=a.copyState(f,h);return c=b.curMode==e?g:i,{html:g,php:i,curMode:b.curMode,curState:c,pending:b.pending}},token:d,indent:function(a,b){return a.curMode!=f&&/^\s*<\//.test(b)||a.curMode==f&&/^\?>/.test(b)?e.indent(a.html,b):a.curMode.indent(a.curState,b)},blockCommentStart:"/*",blockCommentEnd:"*/",lineComment:"//",innerMode:function(a){return{state:a.curState,mode:a.curMode}}}},"htmlmixed","clike"),a.defineMIME("application/x-httpd-php","php"),a.defineMIME("application/x-httpd-php-open",{name:"php",startOpen:!0}),a.defineMIME("text/x-php",i)}),function(a){"object"==typeof exports&&"object"==typeof module?a(require("../../lib/codemirror")):"function"==typeof define&&define.amd?define(["../../lib/codemirror"],a):a(CodeMirror)}(function(a){"use strict";function b(a,b,e,f){if(this.atOccurrence=!1,this.doc=a,null==f&&"string"==typeof b&&(f=!1),e=e?a.clipPos(e):d(0,0),this.pos={from:e,to:e},"string"!=typeof b)b.global||(b=new RegExp(b.source,b.ignoreCase?"ig":"g")),this.matches=function(c,e){if(c){b.lastIndex=0;for(var f,g,h=a.getLine(e.line).slice(0,e.ch),i=0;;){b.lastIndex=i;var j=b.exec(h);if(!j)break;if(f=j,g=f.index,i=f.index+(f[0].length||1),i==h.length)break}var k=f&&f[0].length||0;k||(0==g&&0==h.length?f=void 0:g!=a.getLine(e.line).length&&k++)}else{b.lastIndex=e.ch;var h=a.getLine(e.line),f=b.exec(h),k=f&&f[0].length||0,g=f&&f.index;g+k==h.length||k||(k=1)}return f&&k?{from:d(e.line,g),to:d(e.line,g+k),match:f}:void 0};else{var g=b;f&&(b=b.toLowerCase());var h=f?function(a){return a.toLowerCase()}:function(a){return a},i=b.split("\n");if(1==i.length)b.length?this.matches=function(e,f){if(e){var i=a.getLine(f.line).slice(0,f.ch),j=h(i),k=j.lastIndexOf(b);if(k>-1)return k=c(i,j,k),{from:d(f.line,k),to:d(f.line,k+g.length)}}else{var i=a.getLine(f.line).slice(f.ch),j=h(i),k=j.indexOf(b);if(k>-1)return k=c(i,j,k)+f.ch,{from:d(f.line,k),to:d(f.line,k+g.length)}}}:this.matches=function(){};else{var j=g.split("\n");this.matches=function(b,c){var e=i.length-1;if(b){if(c.line-(i.length-1)<a.firstLine())return;if(h(a.getLine(c.line).slice(0,j[e].length))!=i[i.length-1])return;for(var f=d(c.line,j[e].length),g=c.line-1,k=e-1;k>=1;--k,--g)if(i[k]!=h(a.getLine(g)))return;var l=a.getLine(g),m=l.length-j[0].length;if(h(l.slice(m))!=i[0])return;return{from:d(g,m),to:f}}if(!(c.line+(i.length-1)>a.lastLine())){var l=a.getLine(c.line),m=l.length-j[0].length;if(h(l.slice(m))==i[0]){for(var n=d(c.line,m),g=c.line+1,k=1;e>k;++k,++g)if(i[k]!=h(a.getLine(g)))return;if(h(a.getLine(g).slice(0,j[e].length))==i[e])return{from:n,to:d(g,j[e].length)}}}}}}}function c(a,b,c){if(a.length==b.length)return c;for(var d=Math.min(c,a.length);;){var e=a.slice(0,d).toLowerCase().length;if(c>e)++d;else{if(!(e>c))return d;--d}}}var d=a.Pos;b.prototype={findNext:function(){return this.find(!1)},findPrevious:function(){return this.find(!0)},find:function(a){function b(a){var b=d(a,0);return c.pos={from:b,to:b},c.atOccurrence=!1,!1}for(var c=this,e=this.doc.clipPos(a?this.pos.from:this.pos.to);;){if(this.pos=this.matches(a,e))return this.atOccurrence=!0,this.pos.match||!0;if(a){if(!e.line)return b(0);e=d(e.line-1,this.doc.getLine(e.line-1).length)}else{var f=this.doc.lineCount();if(e.line==f-1)return b(f);e=d(e.line+1,0)}}},from:function(){return this.atOccurrence?this.pos.from:void 0},to:function(){return this.atOccurrence?this.pos.to:void 0},replace:function(b,c){if(this.atOccurrence){var e=a.splitLines(b);this.doc.replaceRange(e,this.pos.from,this.pos.to,c),this.pos.to=d(this.pos.from.line+e.length-1,e[e.length-1].length+(1==e.length?this.pos.from.ch:0))}}},a.defineExtension("getSearchCursor",function(a,c,d){return new b(this.doc,a,c,d)}),a.defineDocExtension("getSearchCursor",function(a,c,d){return new b(this,a,c,d)}),a.defineExtension("selectMatches",function(b,c){for(var d=[],e=this.getSearchCursor(b,this.getCursor("from"),c);e.findNext()&&!(a.cmpPos(e.to(),this.getCursor("to"))>0);)d.push({anchor:e.from(),head:e.to()});d.length&&this.setSelections(d,0)})}),function(a){"object"==typeof exports&&"object"==typeof module?a(require("../../lib/codemirror"),require("./searchcursor"),require("../dialog/dialog")):"function"==typeof define&&define.amd?define(["../../lib/codemirror","./searchcursor","../dialog/dialog"],a):a(CodeMirror)}(function(a){"use strict";function b(a,b){return"string"==typeof a?a=new RegExp(a.replace(/[\-\[\]\/\{\}\(\)\*\+\?\.\\\^\$\|]/g,"\\$&"),b?"gi":"g"):a.global||(a=new RegExp(a.source,a.ignoreCase?"gi":"g")),{token:function(b){a.lastIndex=b.pos;var c=a.exec(b.string);return c&&c.index==b.pos?(b.pos+=c[0].length,"searching"):void(c?b.pos=c.index:b.skipToEnd())}}}function c(){this.posFrom=this.posTo=this.lastQuery=this.query=null,this.overlay=null}function d(a){return a.state.search||(a.state.search=new c)}function e(a){return"string"==typeof a&&a==a.toLowerCase()}function f(a,b,c){return a.getSearchCursor(b,c,e(b))}function g(a,b,c,d){a.openDialog(b,d,{value:c,selectValueOnOpen:!0,closeOnEnter:!1,onClose:function(){o(a)}})}function h(a,b,c,d,e){a.openDialog?a.openDialog(b,e,{value:d,selectValueOnOpen:!0}):e(prompt(c,d))}function i(a,b,c,d){a.openConfirm?a.openConfirm(b,d):confirm(c)&&d[0]()}function j(a){return a.replace(/\\(.)/g,function(a,b){return"n"==b?"\n":"r"==b?"\r":b})}function k(a){var b=a.match(/^\/(.*)\/([a-z]*)$/);if(b)try{a=new RegExp(b[1],-1==b[2].indexOf("i")?"":"i")}catch(c){}else a=j(a);return("string"==typeof a?""==a:a.test(""))&&(a=/x^/),a}function l(a,c,d){c.queryText=d,c.query=k(d),a.removeOverlay(c.overlay,e(c.query)),c.overlay=b(c.query,e(c.query)),a.addOverlay(c.overlay),a.showMatchesOnScrollbar&&(c.annotate&&(c.annotate.clear(),c.annotate=null),c.annotate=a.showMatchesOnScrollbar(c.query,e(c.query)))}function m(b,c,e){var f=d(b);if(f.query)return n(b,c);var i=b.getSelection()||f.lastQuery;e&&b.openDialog?g(b,q,i,function(c,d){a.e_stop(d),c&&(c!=f.queryText&&l(b,f,c),n(b,d.shiftKey))}):h(b,q,"Search for:",i,function(a){a&&!f.query&&b.operation(function(){l(b,f,a),f.posFrom=f.posTo=b.getCursor(),n(b,c)})})}function n(b,c){b.operation(function(){var e=d(b),g=f(b,e.query,c?e.posFrom:e.posTo);(g.find(c)||(g=f(b,e.query,c?a.Pos(b.lastLine()):a.Pos(b.firstLine(),0)),g.find(c)))&&(b.setSelection(g.from(),g.to()),b.scrollIntoView({from:g.from(),to:g.to()},20),e.posFrom=g.from(),e.posTo=g.to())})}function o(a){a.operation(function(){var b=d(a);b.lastQuery=b.query,b.query&&(b.query=b.queryText=null,a.removeOverlay(b.overlay),b.annotate&&(b.annotate.clear(),b.annotate=null))})}function p(a,b){if(!a.getOption("readOnly")){var c=a.getSelection()||d(a).lastQuery;h(a,r,"Replace:",c,function(c){c&&(c=k(c),h(a,s,"Replace with:","",function(d){if(d=j(d),b)a.operation(function(){for(var b=f(a,c);b.findNext();)if("string"!=typeof c){var e=a.getRange(b.from(),b.to()).match(c);b.replace(d.replace(/\$(\d)/g,function(a,b){return e[b]}))}else b.replace(d)});else{o(a);var e=f(a,c,a.getCursor()),g=function(){var b,d=e.from();!(b=e.findNext())&&(e=f(a,c),!(b=e.findNext())||d&&e.from().line==d.line&&e.from().ch==d.ch)||(a.setSelection(e.from(),e.to()),a.scrollIntoView({from:e.from(),to:e.to()}),i(a,t,"Replace?",[function(){h(b)},g]))},h=function(a){e.replace("string"==typeof c?d:d.replace(/\$(\d)/g,function(b,c){return a[c]})),g()};g()}}))})}}var q='Search: <input type="text" style="width: 10em" class="CodeMirror-search-field"/> <span style="color: #888" class="CodeMirror-search-hint">(Use /re/ syntax for regexp search)</span>',r='Replace: <input type="text" style="width: 10em" class="CodeMirror-search-field"/> <span style="color: #888" class="CodeMirror-search-hint">(Use /re/ syntax for regexp search)</span>',s='With: <input type="text" style="width: 10em" class="CodeMirror-search-field"/>',t="Replace? <button>Yes</button> <button>No</button> <button>Stop</button>";a.commands.find=function(a){o(a),m(a)},a.commands.findPersistent=function(a){o(a),m(a,!1,!0)},a.commands.findNext=m,a.commands.findPrev=function(a){m(a,!0)},a.commands.clearSearch=o,a.commands.replace=p,a.commands.replaceAll=function(a){p(a,!0)}}),function(a){"object"==typeof exports&&"object"==typeof module?a(require("../../lib/codemirror")):"function"==typeof define&&define.amd?define(["../../lib/codemirror"],a):a(CodeMirror)}(function(a){function b(a,b,d,e){var f=a.getLineHandle(b.line),i=b.ch-1,j=i>=0&&h[f.text.charAt(i)]||h[f.text.charAt(++i)];if(!j)return null;var k=">"==j.charAt(1)?1:-1;if(d&&k>0!=(i==b.ch))return null;var l=a.getTokenTypeAt(g(b.line,i+1)),m=c(a,g(b.line,i+(k>0?1:0)),k,l||null,e);return null==m?null:{from:g(b.line,i),to:m&&m.pos,match:m&&m.ch==j.charAt(0),forward:k>0}}function c(a,b,c,d,e){for(var f=e&&e.maxScanLineLength||1e4,i=e&&e.maxScanLines||1e3,j=[],k=e&&e.bracketRegex?e.bracketRegex:/[(){}[\]]/,l=c>0?Math.min(b.line+i,a.lastLine()+1):Math.max(a.firstLine()-1,b.line-i),m=b.line;m!=l;m+=c){var n=a.getLine(m);if(n){var o=c>0?0:n.length-1,p=c>0?n.length:-1;if(!(n.length>f))for(m==b.line&&(o=b.ch-(0>c?1:0));o!=p;o+=c){var q=n.charAt(o);if(k.test(q)&&(void 0===d||a.getTokenTypeAt(g(m,o+1))==d)){var r=h[q];if(">"==r.charAt(1)==c>0)j.push(q);else{if(!j.length)return{pos:g(m,o),ch:q};j.pop()}}}}}return m-c==(c>0?a.lastLine():a.firstLine())?!1:null}function d(a,c,d){for(var e=a.state.matchBrackets.maxHighlightLineLength||1e3,h=[],i=a.listSelections(),j=0;j<i.length;j++){var k=i[j].empty()&&b(a,i[j].head,!1,d);if(k&&a.getLine(k.from.line).length<=e){var l=k.match?"CodeMirror-matchingbracket":"CodeMirror-nonmatchingbracket";h.push(a.markText(k.from,g(k.from.line,k.from.ch+1),{className:l})),k.to&&a.getLine(k.to.line).length<=e&&h.push(a.markText(k.to,g(k.to.line,k.to.ch+1),{className:l}))}}if(h.length){f&&a.state.focused&&a.focus();var m=function(){a.operation(function(){for(var a=0;a<h.length;a++)h[a].clear()})};if(!c)return m;setTimeout(m,800)}}function e(a){a.operation(function(){i&&(i(),i=null),i=d(a,!1,a.state.matchBrackets)})}var f=/MSIE \d/.test(navigator.userAgent)&&(null==document.documentMode||document.documentMode<8),g=a.Pos,h={"(":")>",")":"(<","[":"]>","]":"[<","{":"}>","}":"{<"},i=null;a.defineOption("matchBrackets",!1,function(b,c,d){d&&d!=a.Init&&b.off("cursorActivity",e),c&&(b.state.matchBrackets="object"==typeof c?c:{},b.on("cursorActivity",e))}),a.defineExtension("matchBrackets",function(){d(this,!0)}),a.defineExtension("findMatchingBracket",function(a,c,d){return b(this,a,c,d)}),a.defineExtension("scanForBracket",function(a,b,d,e){return c(this,a,b,d,e)})});
|
js/vendor/jquery.tagit.css
DELETED
@@ -1,67 +0,0 @@
|
|
1 |
-
ul.tagit {
|
2 |
-
padding: 1px 5px;
|
3 |
-
overflow: auto;
|
4 |
-
margin-left: inherit; /* usually we don't want the regular ul margins. */
|
5 |
-
margin-right: inherit;
|
6 |
-
}
|
7 |
-
ul.tagit li {
|
8 |
-
display: block;
|
9 |
-
float: left;
|
10 |
-
margin: 2px 5px 2px 0;
|
11 |
-
}
|
12 |
-
ul.tagit li.tagit-choice {
|
13 |
-
position: relative;
|
14 |
-
line-height: inherit;
|
15 |
-
}
|
16 |
-
|
17 |
-
ul.tagit li.tagit-choice-read-only {
|
18 |
-
padding: .2em .5em .2em .5em;
|
19 |
-
}
|
20 |
-
|
21 |
-
ul.tagit li.tagit-choice-editable {
|
22 |
-
padding: .2em 18px .2em .5em;
|
23 |
-
}
|
24 |
-
|
25 |
-
ul.tagit li.tagit-new {
|
26 |
-
padding: .25em 4px .25em 0;
|
27 |
-
}
|
28 |
-
|
29 |
-
ul.tagit li.tagit-choice a.tagit-label {
|
30 |
-
cursor: pointer;
|
31 |
-
text-decoration: none;
|
32 |
-
}
|
33 |
-
ul.tagit li.tagit-choice .tagit-close {
|
34 |
-
cursor: pointer;
|
35 |
-
position: absolute;
|
36 |
-
right: .1em;
|
37 |
-
top: 50%;
|
38 |
-
margin-top: -8px;
|
39 |
-
line-height: 17px;
|
40 |
-
}
|
41 |
-
|
42 |
-
/* used for some custom themes that don't need image icons */
|
43 |
-
ul.tagit li.tagit-choice .tagit-close .text-icon {
|
44 |
-
display: none;
|
45 |
-
}
|
46 |
-
|
47 |
-
ul.tagit li.tagit-choice input {
|
48 |
-
display: block;
|
49 |
-
float: left;
|
50 |
-
margin: 2px 5px 2px 0;
|
51 |
-
}
|
52 |
-
ul.tagit input[type="text"] {
|
53 |
-
-moz-box-sizing: border-box;
|
54 |
-
-webkit-box-sizing: border-box;
|
55 |
-
box-sizing: border-box;
|
56 |
-
|
57 |
-
-moz-box-shadow: none;
|
58 |
-
-webkit-box-shadow: none;
|
59 |
-
box-shadow: none;
|
60 |
-
|
61 |
-
border: none;
|
62 |
-
margin: 0;
|
63 |
-
padding: 0;
|
64 |
-
width: inherit;
|
65 |
-
background-color: inherit;
|
66 |
-
outline: none;
|
67 |
-
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
js/vendor/tag-it.min.js
DELETED
@@ -1,16 +0,0 @@
|
|
1 |
-
(function(b){b.widget("ui.tagit",{options:{allowDuplicates:!1,caseSensitive:!0,fieldName:"tags",placeholderText:null,readOnly:!1,removeConfirmation:!1,tagLimit:null,availableTags:[],autocomplete:{},showAutocompleteOnFocus:!1,allowSpaces:!1,singleField:!1,singleFieldDelimiter:",",singleFieldNode:null,animate:!0,tabIndex:null,beforeTagAdded:null,afterTagAdded:null,beforeTagRemoved:null,afterTagRemoved:null,onTagClicked:null,onTagLimitExceeded:null,onTagAdded:null,onTagRemoved:null,tagSource:null},_create:function(){var a=
|
2 |
-
this;this.element.is("input")?(this.tagList=b("<ul></ul>").insertAfter(this.element),this.options.singleField=!0,this.options.singleFieldNode=this.element,this.element.css("display","none")):this.tagList=this.element.find("ul, ol").andSelf().last();this.tagInput=b('<input type="text" />').addClass("ui-widget-content");this.options.readOnly&&this.tagInput.attr("disabled","disabled");this.options.tabIndex&&this.tagInput.attr("tabindex",this.options.tabIndex);this.options.placeholderText&&this.tagInput.attr("placeholder",
|
3 |
-
this.options.placeholderText);this.options.autocomplete.source||(this.options.autocomplete.source=function(a,c){var d=a.term.toLowerCase(),e=b.grep(this.options.availableTags,function(a){return 0===a.toLowerCase().indexOf(d)});c(this._subtractArray(e,this.assignedTags()))});this.options.showAutocompleteOnFocus&&(this.tagInput.focus(function(){a._showAutocomplete()}),"undefined"===typeof this.options.autocomplete.minLength&&(this.options.autocomplete.minLength=0));b.isFunction(this.options.autocomplete.source)&&
|
4 |
-
(this.options.autocomplete.source=b.proxy(this.options.autocomplete.source,this));b.isFunction(this.options.tagSource)&&(this.options.tagSource=b.proxy(this.options.tagSource,this));this.tagList.addClass("tagit").addClass("ui-widget ui-widget-content ui-corner-all").append(b('<li class="tagit-new"></li>').append(this.tagInput)).click(function(c){var d=b(c.target);d.hasClass("tagit-label")?(d=d.closest(".tagit-choice"),d.hasClass("removed")||a._trigger("onTagClicked",c,{tag:d,tagLabel:a.tagLabel(d)})):
|
5 |
-
a.tagInput.focus()});var d=!1;if(this.options.singleField)if(this.options.singleFieldNode){var c=b(this.options.singleFieldNode),e=c.val().split(this.options.singleFieldDelimiter);c.val("");b.each(e,function(b,c){a.createTag(c,null,!0);d=!0})}else this.options.singleFieldNode=b('<input type="hidden" style="display:none;" value="" name="'+this.options.fieldName+'" />'),this.tagList.after(this.options.singleFieldNode);d||this.tagList.children("li").each(function(){b(this).hasClass("tagit-new")||(a.createTag(b(this).text(),
|
6 |
-
b(this).attr("class"),!0),b(this).remove())});this.tagInput.keydown(function(c){if(c.which==b.ui.keyCode.BACKSPACE&&""===a.tagInput.val()){var d=a._lastTag();!a.options.removeConfirmation||d.hasClass("remove")?a.removeTag(d):a.options.removeConfirmation&&d.addClass("remove ui-state-highlight")}else a.options.removeConfirmation&&a._lastTag().removeClass("remove ui-state-highlight");if(c.which===b.ui.keyCode.COMMA||c.which===b.ui.keyCode.ENTER||c.which==b.ui.keyCode.TAB&&""!==a.tagInput.val()||c.which==
|
7 |
-
b.ui.keyCode.SPACE&&!0!==a.options.allowSpaces&&('"'!=b.trim(a.tagInput.val()).replace(/^s*/,"").charAt(0)||'"'==b.trim(a.tagInput.val()).charAt(0)&&'"'==b.trim(a.tagInput.val()).charAt(b.trim(a.tagInput.val()).length-1)&&0!==b.trim(a.tagInput.val()).length-1))c.which===b.ui.keyCode.ENTER&&""===a.tagInput.val()||c.preventDefault(),a.createTag(a._cleanedInput()),a.tagInput.autocomplete("close")}).blur(function(){a.tagInput.data("autocomplete-open")||a.createTag(a._cleanedInput())});if(this.options.availableTags||
|
8 |
-
this.options.tagSource||this.options.autocomplete.source)c={select:function(b,c){a.createTag(c.item.value);return!1}},b.extend(c,this.options.autocomplete),c.source=this.options.tagSource||c.source,this.tagInput.autocomplete(c).bind("autocompleteopen",function(){a.tagInput.data("autocomplete-open",!0)}).bind("autocompleteclose",function(){a.tagInput.data("autocomplete-open",!1)})},_cleanedInput:function(){return b.trim(this.tagInput.val().replace(/^"(.*)"$/,"$1"))},_lastTag:function(){return this.tagList.find(".tagit-choice:last:not(.removed)")},
|
9 |
-
_tags:function(){return this.tagList.find(".tagit-choice:not(.removed)")},assignedTags:function(){var a=this,d=[];this.options.singleField?(d=b(this.options.singleFieldNode).val().split(this.options.singleFieldDelimiter),""===d[0]&&(d=[])):this._tags().each(function(){d.push(a.tagLabel(this))});return d},_updateSingleTagsField:function(a){b(this.options.singleFieldNode).val(a.join(this.options.singleFieldDelimiter)).trigger("change")},_subtractArray:function(a,d){for(var c=[],e=0;e<a.length;e++)-1==
|
10 |
-
b.inArray(a[e],d)&&c.push(a[e]);return c},tagLabel:function(a){return this.options.singleField?b(a).find(".tagit-label:first").text():b(a).find("input:first").val()},_showAutocomplete:function(){this.tagInput.autocomplete("search","")},_findTagByLabel:function(a){var d=this,c=null;this._tags().each(function(){if(d._formatStr(a)==d._formatStr(d.tagLabel(this)))return c=b(this),!1});return c},_isNew:function(a){return!this._findTagByLabel(a)},_formatStr:function(a){return this.options.caseSensitive?
|
11 |
-
a:b.trim(a.toLowerCase())},_effectExists:function(a){return Boolean(b.effects&&(b.effects[a]||b.effects.effect&&b.effects.effect[a]))},createTag:function(a,d,c){var e=this;a=b.trim(a);this.options.preprocessTag&&(a=this.options.preprocessTag(a));if(""===a)return!1;if(!this.options.allowDuplicates&&!this._isNew(a))return a=this._findTagByLabel(a),!1!==this._trigger("onTagExists",null,{existingTag:a,duringInitialization:c})&&this._effectExists("highlight")&&a.effect("highlight"),!1;if(this.options.tagLimit&&
|
12 |
-
this._tags().length>=this.options.tagLimit)return this._trigger("onTagLimitExceeded",null,{duringInitialization:c}),!1;var g=b(this.options.onTagClicked?'<a class="tagit-label"></a>':'<span class="tagit-label"></span>').text(a),f=b("<li></li>").addClass("tagit-choice ui-widget-content ui-state-default ui-corner-all").addClass(d).append(g);this.options.readOnly?f.addClass("tagit-choice-read-only"):(f.addClass("tagit-choice-editable"),d=b("<span></span>").addClass("ui-icon ui-icon-close"),d=b('<a><span class="text-icon">\u00d7</span></a>').addClass("tagit-close").append(d).click(function(){e.removeTag(f)}),
|
13 |
-
f.append(d));this.options.singleField||(g=g.html(),f.append('<input type="hidden" style="display:none;" value="'+g+'" name="'+this.options.fieldName+'" />'));!1!==this._trigger("beforeTagAdded",null,{tag:f,tagLabel:this.tagLabel(f),duringInitialization:c})&&(this.options.singleField&&(g=this.assignedTags(),g.push(a),this._updateSingleTagsField(g)),this._trigger("onTagAdded",null,f),this.tagInput.val(""),this.tagInput.parent().before(f),this._trigger("afterTagAdded",null,{tag:f,tagLabel:this.tagLabel(f),
|
14 |
-
duringInitialization:c}),this.options.showAutocompleteOnFocus&&!c&&setTimeout(function(){e._showAutocomplete()},0))},removeTag:function(a,d){d="undefined"===typeof d?this.options.animate:d;a=b(a);this._trigger("onTagRemoved",null,a);if(!1!==this._trigger("beforeTagRemoved",null,{tag:a,tagLabel:this.tagLabel(a)})){if(this.options.singleField){var c=this.assignedTags(),e=this.tagLabel(a),c=b.grep(c,function(a){return a!=e});this._updateSingleTagsField(c)}if(d){a.addClass("removed");var c=this._effectExists("blind")?
|
15 |
-
["blind",{direction:"horizontal"},"fast"]:["fast"],g=this;c.push(function(){a.remove();g._trigger("afterTagRemoved",null,{tag:a,tagLabel:g.tagLabel(a)})});a.fadeOut("fast").hide.apply(a,c).dequeue()}else a.remove(),this._trigger("afterTagRemoved",null,{tag:a,tagLabel:this.tagLabel(a)})}},removeTagByLabel:function(a,b){var c=this._findTagByLabel(a);if(!c)throw"No such tag exists with the name '"+a+"'";this.removeTag(c,b)},removeAll:function(){var a=this;this._tags().each(function(b,c){a.removeTag(c,
|
16 |
-
!1)})}})})(jQuery);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
js/vendor/tagit.ui-zendesk.css
DELETED
@@ -1,56 +0,0 @@
|
|
1 |
-
|
2 |
-
/* Optional scoped theme for tag-it which mimics the zendesk widget. */
|
3 |
-
|
4 |
-
|
5 |
-
ul.tagit {
|
6 |
-
border-style: solid;
|
7 |
-
border-width: 1px;
|
8 |
-
border-color: #C6C6C6;
|
9 |
-
background: #fff;
|
10 |
-
}
|
11 |
-
ul.tagit li.tagit-choice {
|
12 |
-
-moz-border-radius: 6px;
|
13 |
-
border-radius: 6px;
|
14 |
-
-webkit-border-radius: 6px;
|
15 |
-
border: 1px solid #CAD8F3;
|
16 |
-
|
17 |
-
background: none;
|
18 |
-
background-color: #DEE7F8;
|
19 |
-
|
20 |
-
font-weight: normal;
|
21 |
-
}
|
22 |
-
ul.tagit li.tagit-choice .tagit-label:not(a) {
|
23 |
-
color: #555;
|
24 |
-
}
|
25 |
-
ul.tagit li.tagit-choice a.tagit-close {
|
26 |
-
text-decoration: none;
|
27 |
-
}
|
28 |
-
ul.tagit li.tagit-choice .tagit-close {
|
29 |
-
right: .4em;
|
30 |
-
}
|
31 |
-
ul.tagit li.tagit-choice .ui-icon {
|
32 |
-
display: none;
|
33 |
-
}
|
34 |
-
ul.tagit li.tagit-choice .tagit-close .text-icon {
|
35 |
-
display: inline;
|
36 |
-
font-family: arial, sans-serif;
|
37 |
-
font-size: 16px;
|
38 |
-
line-height: 16px;
|
39 |
-
color: #777;
|
40 |
-
}
|
41 |
-
ul.tagit li.tagit-choice:hover, ul.tagit li.tagit-choice.remove {
|
42 |
-
background-color: #bbcef1;
|
43 |
-
border-color: #6d95e0;
|
44 |
-
}
|
45 |
-
ul.tagit li.tagit-choice a.tagLabel:hover,
|
46 |
-
ul.tagit li.tagit-choice a.tagit-close .text-icon:hover {
|
47 |
-
color: #222;
|
48 |
-
}
|
49 |
-
ul.tagit input[type="text"] {
|
50 |
-
color: #333333;
|
51 |
-
background: none;
|
52 |
-
}
|
53 |
-
.ui-widget {
|
54 |
-
font-size: 1.1em;
|
55 |
-
}
|
56 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
languages/code-snippets-de_DE.mo
CHANGED
Binary file
|
languages/code-snippets-de_DE.po
CHANGED
@@ -8,8 +8,8 @@ msgid ""
|
|
8 |
msgstr ""
|
9 |
"Project-Id-Version: Code Snippets v1.7\n"
|
10 |
"Report-Msgid-Bugs-To: \n"
|
11 |
-
"POT-Creation-Date: 2015-
|
12 |
-
"PO-Revision-Date: 2015-
|
13 |
"Last-Translator: Joerg Knoerchen <webmaster@sensorgrafie.de>\n"
|
14 |
"Language-Team: David Decker -- http://deckerweb.de/kontakt/\n"
|
15 |
"Language: de_DE\n"
|
@@ -17,7 +17,7 @@ msgstr ""
|
|
17 |
"Content-Type: text/plain; charset=UTF-8\n"
|
18 |
"Content-Transfer-Encoding: 8bit\n"
|
19 |
"Plural-Forms: nplurals=2; plural=n != 1;\n"
|
20 |
-
"X-Generator: Poedit 1.7.
|
21 |
"X-Poedit-SourceCharset: utf-8\n"
|
22 |
"X-Poedit-KeywordsList: __;_e;__ngettext:1,2;_n:1,2;__ngettext_noop:1,2;_n_noop:1,2;"
|
23 |
"_c,_nc:4c,1,2;_x:1,2c;_ex:1,2c;_nx:4c,1,2;_nx_noop:4c,1,2\n"
|
@@ -32,46 +32,46 @@ msgid "Snippets"
|
|
32 |
msgstr "Codeschnipsel"
|
33 |
|
34 |
# @ code-snippets
|
35 |
-
#: includes/admin.php:
|
36 |
msgid "Manage your existing snippets"
|
37 |
msgstr "Bestehende Codeschnipsel verwalten"
|
38 |
|
39 |
# @ code-snippets
|
40 |
-
#: includes/admin.php:
|
41 |
msgid "Manage"
|
42 |
msgstr "Verwalten"
|
43 |
|
44 |
# @ code-snippets
|
45 |
-
#: includes/admin.php:
|
46 |
msgid "Visit the WordPress.org plugin page"
|
47 |
msgstr "Die Plugin-Seite bei WordPress.org aufrufen"
|
48 |
|
49 |
# @ code-snippets
|
50 |
-
#: includes/admin.php:
|
51 |
msgid "About"
|
52 |
msgstr "Über"
|
53 |
|
54 |
# @ code-snippets
|
55 |
-
#: includes/admin.php:
|
56 |
msgid "Visit the support forums"
|
57 |
msgstr "Die Support-Foren aufrufen"
|
58 |
|
59 |
# @ code-snippets
|
60 |
-
#: includes/admin.php:
|
61 |
msgid "Support"
|
62 |
msgstr "Support"
|
63 |
|
64 |
# @ code-snippets
|
65 |
-
#: includes/admin.php:
|
66 |
msgid "Support this plugin's development"
|
67 |
msgstr "Die Entwicklung dieses Plugins unterstützen"
|
68 |
|
69 |
# @ code-snippets
|
70 |
-
#: includes/admin.php:
|
71 |
msgid "Donate"
|
72 |
msgstr "Spenden"
|
73 |
|
74 |
-
#: includes/admin.php:
|
75 |
msgid ""
|
76 |
"<strong>Have feedback on Code Snippets?</strong> Please take the time to answer a "
|
77 |
"short survey on how you use this plugin and what you'd like to see changed or added "
|
@@ -81,51 +81,51 @@ msgstr ""
|
|
81 |
"beantworten sie bitte eine kurze Umfrage zum Plugin, wie sie es nutzen und welche "
|
82 |
"Funktionen sie in Zukunft gerne verändert oder hinzugefügt haben möchten."
|
83 |
|
84 |
-
#: includes/admin.php:
|
85 |
msgid "Take the survey now"
|
86 |
msgstr "An der Umfrage teilnehmen"
|
87 |
|
88 |
-
#: includes/class-export.php:
|
89 |
msgid ""
|
90 |
"This is a code snippets export file generated by the Code Snippets WordPress plugin."
|
91 |
msgstr ""
|
92 |
"Dies ist eine Codeschnipsel-Export-Datei die durch das Code Snippets WordPress "
|
93 |
"Plugin erstellt wurde."
|
94 |
|
95 |
-
#: includes/class-export.php:
|
96 |
msgid "http://wordpress.org/plugins/code-snippets"
|
97 |
msgstr "http://wordpress.org/plugins/code-snippets"
|
98 |
|
99 |
-
#: includes/class-export.php:
|
100 |
msgid "To import these snippets a WordPress site follow these steps:"
|
101 |
msgstr ""
|
102 |
"Um Codeschnipsel in eine WordPress Seite zu importieren folge diesen Schritten:"
|
103 |
|
104 |
-
#: includes/class-export.php:
|
105 |
msgid "1. Log in to that site as an administrator."
|
106 |
msgstr "1. Melde dich als Administrator an."
|
107 |
|
108 |
-
#: includes/class-export.php:
|
109 |
msgid ""
|
110 |
"2. Install the Code Snippets plugin using the directions provided at the above link."
|
111 |
msgstr ""
|
112 |
"2. Installiere das Code Snippets Plugin nutze hierzu den Link und die Informationen "
|
113 |
"von oben."
|
114 |
|
115 |
-
#: includes/class-export.php:
|
116 |
msgid "3. Go to 'Tools: Import' in the WordPress admin panel."
|
117 |
msgstr ""
|
118 |
"3. Navigiere zu 'Werkzeuge: Daten importieren' in der WordPress Administration."
|
119 |
|
120 |
-
#: includes/class-export.php:
|
121 |
msgid "4. Click on the \"Code Snippets\" importer in the list"
|
122 |
msgstr "4. Klicke in der Liste der Importmodule auf \"Code Snippets\" "
|
123 |
|
124 |
-
#: includes/class-export.php:
|
125 |
msgid "5. Upload this file using the form provided on that page."
|
126 |
msgstr "5. Lade diese Datei über den angebotenen Dialog der Importseite hoch."
|
127 |
|
128 |
-
#: includes/class-export.php:
|
129 |
msgid ""
|
130 |
"6. Code Snippets will then import all of the snippets and associated information "
|
131 |
"contained in this file into your site."
|
@@ -133,7 +133,7 @@ msgstr ""
|
|
133 |
"6. Die Codeschnipsel werden neben allen anderen Informationen aus dieser Datei in "
|
134 |
"deine Seite importiert."
|
135 |
|
136 |
-
#: includes/class-export.php:
|
137 |
msgid ""
|
138 |
"7. You will then have to visit the 'Snippets: Manage' admin menu and activate "
|
139 |
"desired snippets."
|
@@ -198,12 +198,12 @@ msgstr ""
|
|
198 |
#: includes/edit/admin-help.php:31
|
199 |
msgid ""
|
200 |
"More places to find snippets, as well as a selection of example snippets, can be "
|
201 |
-
"found in the <a href=\"https://github.com/sheabunge/code-snippets/wiki/Finding-
|
202 |
-
"\">plugin documentation</a>"
|
203 |
msgstr ""
|
204 |
"Weitere Orte, um Codeschnipsel zu finden und ebenso eine Sammlung von Beispiel-"
|
205 |
-
"Schnipseln finden Sie in der <a href=\"https://github.com/sheabunge/code-snippets/
|
206 |
-
"Finding-snippets\">Dokumentation des Plugins</a>."
|
207 |
|
208 |
# @ code-snippets
|
209 |
#: includes/edit/admin-help.php:36
|
@@ -264,11 +264,11 @@ msgstr ""
|
|
264 |
#: includes/edit/admin-help.php:46 includes/import/admin-help.php:40
|
265 |
#: includes/manage/admin-help.php:40
|
266 |
msgid ""
|
267 |
-
"<a href=\"http://bungeshea.com/plugins/code-snippets/\" target=\"_blank\">Project
|
268 |
-
"a>"
|
269 |
msgstr ""
|
270 |
-
"<a href=\"http://bungeshea.com/plugins/code-snippets/\" target=\"_blank
|
271 |
-
"a>"
|
272 |
|
273 |
#: includes/edit/admin-messages.php:14
|
274 |
msgid "An error occurred when saving the snippet."
|
@@ -299,45 +299,46 @@ msgid "Snippet <strong>added</strong>."
|
|
299 |
msgstr "Codeschnipsel <strong>hinzugefügt</strong>."
|
300 |
|
301 |
# @ code-snippets
|
302 |
-
#: includes/edit/admin.php:26 includes/edit/edit.php:
|
303 |
msgid "Edit Snippet"
|
304 |
msgstr "Codeschnipsel bearbeiten"
|
305 |
|
306 |
# @ code-snippets
|
307 |
-
#: includes/edit/admin.php:
|
|
|
308 |
msgid "Add New"
|
309 |
msgstr "Hinzufügen"
|
310 |
|
311 |
# @ code-snippets
|
312 |
-
#: includes/edit/admin.php:
|
313 |
msgid "Add New Snippet"
|
314 |
msgstr "Neuen Codeschnipsel hinzufügen"
|
315 |
|
316 |
# @ code-snippets
|
317 |
-
#: includes/edit/admin.php:
|
318 |
msgid "Name (short title)"
|
319 |
msgstr "Name (Kurztitel)"
|
320 |
|
321 |
# @ code-snippets
|
322 |
-
#: includes/edit/admin.php:
|
323 |
msgid "Code"
|
324 |
msgstr "Code"
|
325 |
|
326 |
-
#: includes/edit/admin.php:
|
327 |
msgid "Save Changes and Activate"
|
328 |
msgstr "Speichere Änderungen und Aktiviere"
|
329 |
|
330 |
-
#: includes/edit/admin.php:
|
331 |
msgid "Save Changes and Deactivate"
|
332 |
msgstr "Speichere Änderungen und Deaktiviere"
|
333 |
|
334 |
# @ code-snippets
|
335 |
-
#: includes/edit/admin.php:
|
336 |
-
#: includes/manage/class-list-table.php:
|
337 |
msgid "Export"
|
338 |
msgstr "Exportieren"
|
339 |
|
340 |
-
#: includes/edit/admin.php:
|
341 |
msgid ""
|
342 |
"You are about to permanently delete this snippet.\n"
|
343 |
"'Cancel' to stop, 'OK' to delete."
|
@@ -346,24 +347,49 @@ msgstr ""
|
|
346 |
"'Abbrechen' um zu stoppen, 'OK' um zu löschen."
|
347 |
|
348 |
# @ code-snippets
|
349 |
-
#: includes/edit/admin.php:
|
350 |
-
#: includes/manage/class-list-table.php:
|
351 |
msgid "Delete"
|
352 |
msgstr "Löschen"
|
353 |
|
|
|
|
|
|
|
|
|
|
|
354 |
#: includes/edit/edit.php:83 includes/manage/manage.php:67
|
355 |
msgid "You are not authorized to access this page."
|
356 |
msgstr "Du hast keine Berechtigung diese Seite zu betreten."
|
357 |
|
358 |
# @ code-snippets
|
359 |
-
#: includes/edit/edit.php:
|
360 |
msgid "Description"
|
361 |
msgstr "Beschreibung"
|
362 |
|
363 |
-
#: includes/edit/edit.php:
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
364 |
msgid "Tags"
|
365 |
msgstr "Stichworte"
|
366 |
|
|
|
|
|
|
|
|
|
367 |
# @ code-snippets
|
368 |
#: includes/import/admin-help.php:18
|
369 |
msgid ""
|
@@ -424,9 +450,14 @@ msgstr ""
|
|
424 |
#, php-format
|
425 |
msgid ""
|
426 |
"Successfully imported <strong>%d</strong> snippet. <a href=\"%s\">Have fun!</a>"
|
427 |
-
|
|
|
|
|
428 |
"Erfolgreicher Import des <strong>%d</strong> Codeschnipsel. <a href=\"%s\">Viel "
|
429 |
"Spass!</a>"
|
|
|
|
|
|
|
430 |
|
431 |
#: includes/import/admin-messages.php:30
|
432 |
msgid "An error occurred when processing the import file."
|
@@ -591,8 +622,8 @@ msgstr ""
|
|
591 |
msgid ""
|
592 |
"<strong>Warning:</strong> Safe mode is active and snippets will not execute! Remove "
|
593 |
"the <code>CODE_SNIPPETS_SAFE_MODE</code> constant from <code>wp-config.php</code> "
|
594 |
-
"to turn off safe mode. <a href=\"https://github.com/sheabunge/code-snippets/wiki/
|
595 |
-
"\" target=\"_blank\">Help</a>"
|
596 |
msgstr ""
|
597 |
"<strong>Warnung:</strong> Sicherheitsmodus aktiv! Codeschnipsel werden nicht "
|
598 |
"ausgeführt. Entferne den Parameter <code>CODE_SNIPPETS_SAFE_MODE</code> aus deiner "
|
@@ -631,42 +662,42 @@ msgid "Selected snippets <strong>deleted</strong>."
|
|
631 |
msgstr "Ausgewählte Codeschnipsel wurden <strong>gelöscht</strong>."
|
632 |
|
633 |
# @ code-snippets
|
634 |
-
#: includes/manage/admin.php:
|
635 |
msgid "Search Installed Snippets"
|
636 |
msgstr "Installierte Codeschnipsel suchen"
|
637 |
|
638 |
# @ code-snippets
|
639 |
-
#: includes/manage/class-list-table.php:
|
640 |
msgid "Snippets per page"
|
641 |
msgstr "Codeschnipsel pro Seite"
|
642 |
|
643 |
# @ code-snippets
|
644 |
-
#: includes/manage/class-list-table.php:
|
645 |
msgid "Network Deactivate"
|
646 |
msgstr "Netzwerkweit deaktivieren"
|
647 |
|
648 |
# @ code-snippets
|
649 |
-
#: includes/manage/class-list-table.php:
|
650 |
msgid "Deactivate"
|
651 |
msgstr "Deaktivieren"
|
652 |
|
653 |
# @ code-snippets
|
654 |
-
#: includes/manage/class-list-table.php:
|
655 |
msgid "Network Activate"
|
656 |
msgstr "Netzwerkweit aktivieren"
|
657 |
|
658 |
# @ code-snippets
|
659 |
-
#: includes/manage/class-list-table.php:
|
660 |
msgid "Activate"
|
661 |
msgstr "Aktivieren"
|
662 |
|
663 |
# @ code-snippets
|
664 |
-
#: includes/manage/class-list-table.php:
|
665 |
msgid "Edit"
|
666 |
msgstr "Bearbeiten"
|
667 |
|
668 |
# @ code-snippets
|
669 |
-
#: includes/manage/class-list-table.php:
|
670 |
msgid ""
|
671 |
"You are about to permanently delete the selected item.\n"
|
672 |
"\t\t\t\t'Cancel' to stop, 'OK' to delete."
|
@@ -674,66 +705,88 @@ msgstr ""
|
|
674 |
"Sie sind dabei das ausgewählte Element dauerhaft zu löschen.\n"
|
675 |
"\t\t\t\t'Abbrechen', um das zu stoppen, 'OK', um wirklich zu löschen."
|
676 |
|
677 |
-
#: includes/manage/class-list-table.php:
|
678 |
#, php-format
|
679 |
msgid "Untitled #%d"
|
680 |
msgstr "Unbenannt #%d"
|
681 |
|
682 |
# @ code-snippets
|
683 |
-
#: includes/manage/class-list-table.php:
|
684 |
msgid "Name"
|
685 |
msgstr "Name"
|
686 |
|
687 |
# @ code-snippets
|
688 |
-
#: includes/manage/class-list-table.php:
|
689 |
msgid "ID"
|
690 |
msgstr "ID"
|
691 |
|
692 |
# @ code-snippets
|
693 |
-
#: includes/manage/class-list-table.php:
|
694 |
msgid "Export to PHP"
|
695 |
msgstr "Als PHP exportieren"
|
696 |
|
697 |
# @ code-snippets
|
698 |
-
#: includes/manage/class-list-table.php:
|
699 |
#, php-format
|
700 |
msgid "All <span class=\"count\">(%s)</span>"
|
701 |
-
|
|
|
|
|
702 |
|
703 |
# @ code-snippets
|
704 |
-
#: includes/manage/class-list-table.php:
|
705 |
#, php-format
|
706 |
msgid "Active <span class=\"count\">(%s)</span>"
|
707 |
-
|
|
|
|
|
708 |
|
709 |
# @ code-snippets
|
710 |
-
#: includes/manage/class-list-table.php:
|
711 |
#, php-format
|
712 |
msgid "Recently Active <span class=\"count\">(%s)</span>"
|
713 |
-
|
|
|
|
|
714 |
|
715 |
# @ code-snippets
|
716 |
-
#: includes/manage/class-list-table.php:
|
717 |
#, php-format
|
718 |
msgid "Inactive <span class=\"count\">(%s)</span>"
|
719 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
720 |
|
721 |
-
#: includes/manage/class-list-table.php:
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
722 |
msgid "Show all tags"
|
723 |
msgstr "Zeige alle Stichworte"
|
724 |
|
725 |
# @ code-snippets
|
726 |
-
#: includes/manage/class-list-table.php:
|
727 |
msgid "Filter"
|
728 |
msgstr "Filter"
|
729 |
|
730 |
# @ code-snippets
|
731 |
-
#: includes/manage/class-list-table.php:
|
732 |
msgid "Clear List"
|
733 |
msgstr "Liste bereinigen"
|
734 |
|
735 |
# @ code-snippets
|
736 |
-
#: includes/manage/class-list-table.php:
|
737 |
#, php-format
|
738 |
msgid ""
|
739 |
"You do not appear to have any snippets available at this time. <a href=\"%s\">Add "
|
@@ -743,23 +796,23 @@ msgstr ""
|
|
743 |
"href=\"%s\">hinzufügen →</a>"
|
744 |
|
745 |
# @ code-snippets
|
746 |
-
#: includes/manage/class-list-table.php:
|
747 |
msgid "Search results"
|
748 |
msgstr "Suchergebnisse"
|
749 |
|
750 |
# @ code-snippets
|
751 |
-
#: includes/manage/class-list-table.php:
|
752 |
#, php-format
|
753 |
msgid " for “%s”"
|
754 |
msgstr " für “%s”"
|
755 |
|
756 |
-
#: includes/manage/class-list-table.php:
|
757 |
#, php-format
|
758 |
msgid " in tag “%s”"
|
759 |
msgstr " in Stichwort “%s”"
|
760 |
|
761 |
# @ code-snippets
|
762 |
-
#: includes/manage/class-list-table.php:
|
763 |
msgid "Clear Filters"
|
764 |
msgstr "Filter zurücksetzen"
|
765 |
|
@@ -767,98 +820,137 @@ msgstr "Filter zurücksetzen"
|
|
767 |
msgid "Snippets Settings"
|
768 |
msgstr "Codeschnipsel Einstellungen"
|
769 |
|
770 |
-
#: includes/settings/admin.php:21 includes/settings/admin.php:
|
771 |
msgid "Settings"
|
772 |
msgstr "Einstellungen"
|
773 |
|
774 |
-
#: includes/settings/settings.php:51
|
775 |
-
msgid "General"
|
776 |
-
msgstr "Allgemein"
|
777 |
-
|
778 |
-
#: includes/settings/settings.php:52
|
779 |
-
msgid "Editor"
|
780 |
-
msgstr "Editor"
|
781 |
-
|
782 |
-
#: includes/settings/settings.php:68
|
783 |
msgid "Activate by Default"
|
784 |
msgstr "Standardmäßig aktivieren"
|
785 |
|
786 |
-
#: includes/settings/settings.php:
|
787 |
msgid "Make the 'Save and Activate' button the default action when saving a snippet."
|
788 |
msgstr ""
|
789 |
"Legt die 'Speichern und Aktivieren' Schaltfläche als Standard Aktion fest beim "
|
790 |
"Speichern eines Codeschnipsel."
|
791 |
|
792 |
-
#: includes/settings/settings.php:
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
793 |
msgid "Theme"
|
794 |
msgstr "Theme"
|
795 |
|
796 |
-
#: includes/settings/settings.php:
|
797 |
msgid "Indent With Tabs"
|
798 |
msgstr "Tabulatorbreite"
|
799 |
|
800 |
-
#: includes/settings/settings.php:
|
801 |
msgid "Use hard tabs (not spaces) for indentation."
|
802 |
msgstr "Benutze Tabulator anstelle von Leerzeichen."
|
803 |
|
804 |
-
#: includes/settings/settings.php:
|
805 |
msgid "Tab Size"
|
806 |
msgstr "Tabulatorweite"
|
807 |
|
808 |
-
#: includes/settings/settings.php:
|
809 |
msgid "The width of a tab character."
|
810 |
msgstr "Die Länge eines Tabulatorzeichens."
|
811 |
|
812 |
-
#: includes/settings/settings.php:
|
813 |
msgid "Indent Unit"
|
814 |
msgstr "Einheit des Einzugs"
|
815 |
|
816 |
-
#: includes/settings/settings.php:
|
817 |
msgid "How many spaces a block should be indented."
|
818 |
msgstr "Anzahl der Leerzeichen die einem Einzug entsprechen sollen."
|
819 |
|
820 |
-
#: includes/settings/settings.php:
|
821 |
msgid "Wrap Lines"
|
822 |
msgstr "Zeilen umbrechen"
|
823 |
|
824 |
-
#: includes/settings/settings.php:
|
825 |
msgid "Whether the editor should scroll or wrap for long lines."
|
826 |
msgstr "Legt fest ob der Editor Zeilen umbricht oder bei langen Zeilen scrollen soll."
|
827 |
|
828 |
-
#: includes/settings/settings.php:
|
829 |
msgid "Line Numbers"
|
830 |
msgstr "Zeilennummer"
|
831 |
|
832 |
-
#: includes/settings/settings.php:
|
833 |
msgid "Show line numbers to the left of the editor."
|
834 |
msgstr "Zeigt Zeilennummern auf der linken Seite des Editors."
|
835 |
|
836 |
-
#: includes/settings/settings.php:
|
837 |
msgid "Auto Close Brackets"
|
838 |
msgstr "Klammern automatisch schliessen."
|
839 |
|
840 |
-
#: includes/settings/settings.php:
|
841 |
msgid "Auto-close brackets and quotes when typed."
|
842 |
msgstr ""
|
843 |
"Vervollständigt und schliesst Klammern und Anführungszeichen während der Eingabe."
|
844 |
|
845 |
-
#: includes/settings/settings.php:
|
846 |
msgid "Highlight Selection Matches"
|
847 |
msgstr "Auswahlhervorhebung"
|
848 |
|
849 |
-
#: includes/settings/settings.php:
|
850 |
msgid "Highlight all instances of a currently selected word."
|
851 |
msgstr ""
|
852 |
"Eine Auswahl an anderen Stellen hervorheben an denen die Auswahl ebenfalls vorkommt."
|
853 |
|
854 |
-
#: includes/settings/settings.php:
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
855 |
msgid "Editor Preview"
|
856 |
msgstr "Editor Vorschau"
|
857 |
|
858 |
-
#: includes/settings/settings.php:
|
859 |
msgid "Settings saved."
|
860 |
msgstr "Einstellungen gespeichert."
|
861 |
|
|
|
|
|
|
|
862 |
# @ code-snippets
|
863 |
#~ msgid ""
|
864 |
#~ "An easy, clean and simple way to add code snippets to your site. No need to edit "
|
@@ -876,11 +968,6 @@ msgstr "Einstellungen gespeichert."
|
|
876 |
#~ msgid "http://bungeshea.com"
|
877 |
#~ msgstr "http://bungeshea.com/"
|
878 |
|
879 |
-
# @ code-snippets
|
880 |
-
#~ msgctxt "snippet"
|
881 |
-
#~ msgid "Add New"
|
882 |
-
#~ msgstr "Hinzufügen"
|
883 |
-
|
884 |
# @ code-snippets
|
885 |
#~ msgid "Please provide a name for the snippet and its code."
|
886 |
#~ msgstr "Bitte geben Sie einen Namen für den Codeschnipsel und dessen Code an."
|
8 |
msgstr ""
|
9 |
"Project-Id-Version: Code Snippets v1.7\n"
|
10 |
"Report-Msgid-Bugs-To: \n"
|
11 |
+
"POT-Creation-Date: 2015-05-20 15:56+1000\n"
|
12 |
+
"PO-Revision-Date: 2015-05-22 08:57+0100\n"
|
13 |
"Last-Translator: Joerg Knoerchen <webmaster@sensorgrafie.de>\n"
|
14 |
"Language-Team: David Decker -- http://deckerweb.de/kontakt/\n"
|
15 |
"Language: de_DE\n"
|
17 |
"Content-Type: text/plain; charset=UTF-8\n"
|
18 |
"Content-Transfer-Encoding: 8bit\n"
|
19 |
"Plural-Forms: nplurals=2; plural=n != 1;\n"
|
20 |
+
"X-Generator: Poedit 1.7.6\n"
|
21 |
"X-Poedit-SourceCharset: utf-8\n"
|
22 |
"X-Poedit-KeywordsList: __;_e;__ngettext:1,2;_n:1,2;__ngettext_noop:1,2;_n_noop:1,2;"
|
23 |
"_c,_nc:4c,1,2;_x:1,2c;_ex:1,2c;_nx:4c,1,2;_nx_noop:4c,1,2\n"
|
32 |
msgstr "Codeschnipsel"
|
33 |
|
34 |
# @ code-snippets
|
35 |
+
#: includes/admin.php:152
|
36 |
msgid "Manage your existing snippets"
|
37 |
msgstr "Bestehende Codeschnipsel verwalten"
|
38 |
|
39 |
# @ code-snippets
|
40 |
+
#: includes/admin.php:153 includes/manage/manage.php:34
|
41 |
msgid "Manage"
|
42 |
msgstr "Verwalten"
|
43 |
|
44 |
# @ code-snippets
|
45 |
+
#: includes/admin.php:182
|
46 |
msgid "Visit the WordPress.org plugin page"
|
47 |
msgstr "Die Plugin-Seite bei WordPress.org aufrufen"
|
48 |
|
49 |
# @ code-snippets
|
50 |
+
#: includes/admin.php:183
|
51 |
msgid "About"
|
52 |
msgstr "Über"
|
53 |
|
54 |
# @ code-snippets
|
55 |
+
#: includes/admin.php:187
|
56 |
msgid "Visit the support forums"
|
57 |
msgstr "Die Support-Foren aufrufen"
|
58 |
|
59 |
# @ code-snippets
|
60 |
+
#: includes/admin.php:188
|
61 |
msgid "Support"
|
62 |
msgstr "Support"
|
63 |
|
64 |
# @ code-snippets
|
65 |
+
#: includes/admin.php:192
|
66 |
msgid "Support this plugin's development"
|
67 |
msgstr "Die Entwicklung dieses Plugins unterstützen"
|
68 |
|
69 |
# @ code-snippets
|
70 |
+
#: includes/admin.php:193
|
71 |
msgid "Donate"
|
72 |
msgstr "Spenden"
|
73 |
|
74 |
+
#: includes/admin.php:226
|
75 |
msgid ""
|
76 |
"<strong>Have feedback on Code Snippets?</strong> Please take the time to answer a "
|
77 |
"short survey on how you use this plugin and what you'd like to see changed or added "
|
81 |
"beantworten sie bitte eine kurze Umfrage zum Plugin, wie sie es nutzen und welche "
|
82 |
"Funktionen sie in Zukunft gerne verändert oder hinzugefügt haben möchten."
|
83 |
|
84 |
+
#: includes/admin.php:229
|
85 |
msgid "Take the survey now"
|
86 |
msgstr "An der Umfrage teilnehmen"
|
87 |
|
88 |
+
#: includes/class-export.php:102
|
89 |
msgid ""
|
90 |
"This is a code snippets export file generated by the Code Snippets WordPress plugin."
|
91 |
msgstr ""
|
92 |
"Dies ist eine Codeschnipsel-Export-Datei die durch das Code Snippets WordPress "
|
93 |
"Plugin erstellt wurde."
|
94 |
|
95 |
+
#: includes/class-export.php:103
|
96 |
msgid "http://wordpress.org/plugins/code-snippets"
|
97 |
msgstr "http://wordpress.org/plugins/code-snippets"
|
98 |
|
99 |
+
#: includes/class-export.php:104
|
100 |
msgid "To import these snippets a WordPress site follow these steps:"
|
101 |
msgstr ""
|
102 |
"Um Codeschnipsel in eine WordPress Seite zu importieren folge diesen Schritten:"
|
103 |
|
104 |
+
#: includes/class-export.php:105
|
105 |
msgid "1. Log in to that site as an administrator."
|
106 |
msgstr "1. Melde dich als Administrator an."
|
107 |
|
108 |
+
#: includes/class-export.php:106
|
109 |
msgid ""
|
110 |
"2. Install the Code Snippets plugin using the directions provided at the above link."
|
111 |
msgstr ""
|
112 |
"2. Installiere das Code Snippets Plugin nutze hierzu den Link und die Informationen "
|
113 |
"von oben."
|
114 |
|
115 |
+
#: includes/class-export.php:107
|
116 |
msgid "3. Go to 'Tools: Import' in the WordPress admin panel."
|
117 |
msgstr ""
|
118 |
"3. Navigiere zu 'Werkzeuge: Daten importieren' in der WordPress Administration."
|
119 |
|
120 |
+
#: includes/class-export.php:108
|
121 |
msgid "4. Click on the \"Code Snippets\" importer in the list"
|
122 |
msgstr "4. Klicke in der Liste der Importmodule auf \"Code Snippets\" "
|
123 |
|
124 |
+
#: includes/class-export.php:109
|
125 |
msgid "5. Upload this file using the form provided on that page."
|
126 |
msgstr "5. Lade diese Datei über den angebotenen Dialog der Importseite hoch."
|
127 |
|
128 |
+
#: includes/class-export.php:110
|
129 |
msgid ""
|
130 |
"6. Code Snippets will then import all of the snippets and associated information "
|
131 |
"contained in this file into your site."
|
133 |
"6. Die Codeschnipsel werden neben allen anderen Informationen aus dieser Datei in "
|
134 |
"deine Seite importiert."
|
135 |
|
136 |
+
#: includes/class-export.php:111
|
137 |
msgid ""
|
138 |
"7. You will then have to visit the 'Snippets: Manage' admin menu and activate "
|
139 |
"desired snippets."
|
198 |
#: includes/edit/admin-help.php:31
|
199 |
msgid ""
|
200 |
"More places to find snippets, as well as a selection of example snippets, can be "
|
201 |
+
"found in the <a href=\"https://github.com/sheabunge/code-snippets/wiki/Finding-"
|
202 |
+
"snippets\">plugin documentation</a>"
|
203 |
msgstr ""
|
204 |
"Weitere Orte, um Codeschnipsel zu finden und ebenso eine Sammlung von Beispiel-"
|
205 |
+
"Schnipseln finden Sie in der <a href=\"https://github.com/sheabunge/code-snippets/"
|
206 |
+
"wiki/Finding-snippets\">Dokumentation des Plugins</a>."
|
207 |
|
208 |
# @ code-snippets
|
209 |
#: includes/edit/admin-help.php:36
|
264 |
#: includes/edit/admin-help.php:46 includes/import/admin-help.php:40
|
265 |
#: includes/manage/admin-help.php:40
|
266 |
msgid ""
|
267 |
+
"<a href=\"http://bungeshea.com/plugins/code-snippets/\" target=\"_blank\">Project "
|
268 |
+
"Website</a>"
|
269 |
msgstr ""
|
270 |
+
"<a href=\"http://bungeshea.com/plugins/code-snippets/\" target=\"_blank"
|
271 |
+
"\">Projektwebseite</a>"
|
272 |
|
273 |
#: includes/edit/admin-messages.php:14
|
274 |
msgid "An error occurred when saving the snippet."
|
299 |
msgstr "Codeschnipsel <strong>hinzugefügt</strong>."
|
300 |
|
301 |
# @ code-snippets
|
302 |
+
#: includes/edit/admin.php:26 includes/edit/edit.php:48 includes/edit/edit.php:49
|
303 |
msgid "Edit Snippet"
|
304 |
msgstr "Codeschnipsel bearbeiten"
|
305 |
|
306 |
# @ code-snippets
|
307 |
+
#: includes/edit/admin.php:29 includes/manage/admin.php:24
|
308 |
+
msgctxt "snippet"
|
309 |
msgid "Add New"
|
310 |
msgstr "Hinzufügen"
|
311 |
|
312 |
# @ code-snippets
|
313 |
+
#: includes/edit/admin.php:32 includes/edit/edit.php:34
|
314 |
msgid "Add New Snippet"
|
315 |
msgstr "Neuen Codeschnipsel hinzufügen"
|
316 |
|
317 |
# @ code-snippets
|
318 |
+
#: includes/edit/admin.php:49 includes/edit/admin.php:50
|
319 |
msgid "Name (short title)"
|
320 |
msgstr "Name (Kurztitel)"
|
321 |
|
322 |
# @ code-snippets
|
323 |
+
#: includes/edit/admin.php:55
|
324 |
msgid "Code"
|
325 |
msgstr "Code"
|
326 |
|
327 |
+
#: includes/edit/admin.php:75 includes/edit/admin.php:89
|
328 |
msgid "Save Changes and Activate"
|
329 |
msgstr "Speichere Änderungen und Aktiviere"
|
330 |
|
331 |
+
#: includes/edit/admin.php:95
|
332 |
msgid "Save Changes and Deactivate"
|
333 |
msgstr "Speichere Änderungen und Deaktiviere"
|
334 |
|
335 |
# @ code-snippets
|
336 |
+
#: includes/edit/admin.php:105 includes/manage/class-list-table.php:141
|
337 |
+
#: includes/manage/class-list-table.php:266
|
338 |
msgid "Export"
|
339 |
msgstr "Exportieren"
|
340 |
|
341 |
+
#: includes/edit/admin.php:112
|
342 |
msgid ""
|
343 |
"You are about to permanently delete this snippet.\n"
|
344 |
"'Cancel' to stop, 'OK' to delete."
|
347 |
"'Abbrechen' um zu stoppen, 'OK' um zu löschen."
|
348 |
|
349 |
# @ code-snippets
|
350 |
+
#: includes/edit/admin.php:117 includes/manage/class-list-table.php:150
|
351 |
+
#: includes/manage/class-list-table.php:267
|
352 |
msgid "Delete"
|
353 |
msgstr "Löschen"
|
354 |
|
355 |
+
# @ code-snippets
|
356 |
+
#: includes/edit/edit.php:35
|
357 |
+
msgid "Add New"
|
358 |
+
msgstr "Hinzufügen"
|
359 |
+
|
360 |
#: includes/edit/edit.php:83 includes/manage/manage.php:67
|
361 |
msgid "You are not authorized to access this page."
|
362 |
msgstr "Du hast keine Berechtigung diese Seite zu betreten."
|
363 |
|
364 |
# @ code-snippets
|
365 |
+
#: includes/edit/edit.php:177 includes/manage/class-list-table.php:226
|
366 |
msgid "Description"
|
367 |
msgstr "Beschreibung"
|
368 |
|
369 |
+
#: includes/edit/edit.php:204
|
370 |
+
msgid "Run snippet everywhere"
|
371 |
+
msgstr "Codeschnipsel überall ausführen"
|
372 |
+
|
373 |
+
#: includes/edit/edit.php:205
|
374 |
+
msgid "Only run in adminstration area"
|
375 |
+
msgstr "Nur im Admin-Bereich ausführen"
|
376 |
+
|
377 |
+
#: includes/edit/edit.php:206
|
378 |
+
msgid "Only run on site front-end"
|
379 |
+
msgstr "Nur auf öffentlicher Seite ausführen"
|
380 |
+
|
381 |
+
#: includes/edit/edit.php:210
|
382 |
+
msgid "Scope"
|
383 |
+
msgstr "Bereich"
|
384 |
+
|
385 |
+
#: includes/edit/edit.php:231 includes/manage/class-list-table.php:227
|
386 |
msgid "Tags"
|
387 |
msgstr "Stichworte"
|
388 |
|
389 |
+
#: includes/edit/edit.php:235
|
390 |
+
msgid "Enter a list of tags; separated by commas"
|
391 |
+
msgstr "Schlagwortliste, Komma getrennt"
|
392 |
+
|
393 |
# @ code-snippets
|
394 |
#: includes/import/admin-help.php:18
|
395 |
msgid ""
|
450 |
#, php-format
|
451 |
msgid ""
|
452 |
"Successfully imported <strong>%d</strong> snippet. <a href=\"%s\">Have fun!</a>"
|
453 |
+
msgid_plural ""
|
454 |
+
"Successfully imported <strong>%d</strong> snippets. <a href=\"%s\">Have fun!</a>"
|
455 |
+
msgstr[0] ""
|
456 |
"Erfolgreicher Import des <strong>%d</strong> Codeschnipsel. <a href=\"%s\">Viel "
|
457 |
"Spass!</a>"
|
458 |
+
msgstr[1] ""
|
459 |
+
"Erfolgreicher Import der <strong>%d</strong> Codeschnipsel. <a href=\"%s\">Viel "
|
460 |
+
"Spass!</a>"
|
461 |
|
462 |
#: includes/import/admin-messages.php:30
|
463 |
msgid "An error occurred when processing the import file."
|
622 |
msgid ""
|
623 |
"<strong>Warning:</strong> Safe mode is active and snippets will not execute! Remove "
|
624 |
"the <code>CODE_SNIPPETS_SAFE_MODE</code> constant from <code>wp-config.php</code> "
|
625 |
+
"to turn off safe mode. <a href=\"https://github.com/sheabunge/code-snippets/wiki/"
|
626 |
+
"Safe-Mode\" target=\"_blank\">Help</a>"
|
627 |
msgstr ""
|
628 |
"<strong>Warnung:</strong> Sicherheitsmodus aktiv! Codeschnipsel werden nicht "
|
629 |
"ausgeführt. Entferne den Parameter <code>CODE_SNIPPETS_SAFE_MODE</code> aus deiner "
|
662 |
msgstr "Ausgewählte Codeschnipsel wurden <strong>gelöscht</strong>."
|
663 |
|
664 |
# @ code-snippets
|
665 |
+
#: includes/manage/admin.php:36
|
666 |
msgid "Search Installed Snippets"
|
667 |
msgstr "Installierte Codeschnipsel suchen"
|
668 |
|
669 |
# @ code-snippets
|
670 |
+
#: includes/manage/class-list-table.php:53
|
671 |
msgid "Snippets per page"
|
672 |
msgstr "Codeschnipsel pro Seite"
|
673 |
|
674 |
# @ code-snippets
|
675 |
+
#: includes/manage/class-list-table.php:116 includes/manage/class-list-table.php:265
|
676 |
msgid "Network Deactivate"
|
677 |
msgstr "Netzwerkweit deaktivieren"
|
678 |
|
679 |
# @ code-snippets
|
680 |
+
#: includes/manage/class-list-table.php:116 includes/manage/class-list-table.php:265
|
681 |
msgid "Deactivate"
|
682 |
msgstr "Deaktivieren"
|
683 |
|
684 |
# @ code-snippets
|
685 |
+
#: includes/manage/class-list-table.php:125 includes/manage/class-list-table.php:264
|
686 |
msgid "Network Activate"
|
687 |
msgstr "Netzwerkweit aktivieren"
|
688 |
|
689 |
# @ code-snippets
|
690 |
+
#: includes/manage/class-list-table.php:125 includes/manage/class-list-table.php:264
|
691 |
msgid "Activate"
|
692 |
msgstr "Aktivieren"
|
693 |
|
694 |
# @ code-snippets
|
695 |
+
#: includes/manage/class-list-table.php:135
|
696 |
msgid "Edit"
|
697 |
msgstr "Bearbeiten"
|
698 |
|
699 |
# @ code-snippets
|
700 |
+
#: includes/manage/class-list-table.php:157
|
701 |
msgid ""
|
702 |
"You are about to permanently delete the selected item.\n"
|
703 |
"\t\t\t\t'Cancel' to stop, 'OK' to delete."
|
705 |
"Sie sind dabei das ausgewählte Element dauerhaft zu löschen.\n"
|
706 |
"\t\t\t\t'Abbrechen', um das zu stoppen, 'OK', um wirklich zu löschen."
|
707 |
|
708 |
+
#: includes/manage/class-list-table.php:165
|
709 |
#, php-format
|
710 |
msgid "Untitled #%d"
|
711 |
msgstr "Unbenannt #%d"
|
712 |
|
713 |
# @ code-snippets
|
714 |
+
#: includes/manage/class-list-table.php:224
|
715 |
msgid "Name"
|
716 |
msgstr "Name"
|
717 |
|
718 |
# @ code-snippets
|
719 |
+
#: includes/manage/class-list-table.php:225
|
720 |
msgid "ID"
|
721 |
msgstr "ID"
|
722 |
|
723 |
# @ code-snippets
|
724 |
+
#: includes/manage/class-list-table.php:268
|
725 |
msgid "Export to PHP"
|
726 |
msgstr "Als PHP exportieren"
|
727 |
|
728 |
# @ code-snippets
|
729 |
+
#: includes/manage/class-list-table.php:305
|
730 |
#, php-format
|
731 |
msgid "All <span class=\"count\">(%s)</span>"
|
732 |
+
msgid_plural "All <span class=\"count\">(%s)</span>"
|
733 |
+
msgstr[0] "Alle <span class=\"count\">(%s)</span>"
|
734 |
+
msgstr[1] "Alle <span class=\"count\">(%s)</span>"
|
735 |
|
736 |
# @ code-snippets
|
737 |
+
#: includes/manage/class-list-table.php:308
|
738 |
#, php-format
|
739 |
msgid "Active <span class=\"count\">(%s)</span>"
|
740 |
+
msgid_plural "Active <span class=\"count\">(%s)</span>"
|
741 |
+
msgstr[0] "Aktiv <span class=\"count\">(%s)</span>"
|
742 |
+
msgstr[1] "Aktive <span class=\"count\">(%s)</span>"
|
743 |
|
744 |
# @ code-snippets
|
745 |
+
#: includes/manage/class-list-table.php:311
|
746 |
#, php-format
|
747 |
msgid "Recently Active <span class=\"count\">(%s)</span>"
|
748 |
+
msgid_plural "Recently Active <span class=\"count\">(%s)</span>"
|
749 |
+
msgstr[0] "Kürzlich aktiv <span class=\"count\">(%s)</span>"
|
750 |
+
msgstr[1] "Kürzlich aktive <span class=\"count\">(%s)</span>"
|
751 |
|
752 |
# @ code-snippets
|
753 |
+
#: includes/manage/class-list-table.php:314
|
754 |
#, php-format
|
755 |
msgid "Inactive <span class=\"count\">(%s)</span>"
|
756 |
+
msgid_plural "Inactive <span class=\"count\">(%s)</span>"
|
757 |
+
msgstr[0] "Inaktiv <span class=\"count\">(%s)</span>"
|
758 |
+
msgstr[1] "Inaktive <span class=\"count\">(%s)</span>"
|
759 |
+
|
760 |
+
#: includes/manage/class-list-table.php:317
|
761 |
+
#, php-format
|
762 |
+
msgid "Admin <span class=\"count\">(%s)</span>"
|
763 |
+
msgid_plural "Admin <span class=\"count\">(%s)</span>"
|
764 |
+
msgstr[0] "Admin <span class=\"count\">(%s)</span>"
|
765 |
+
msgstr[1] "Admin <span class=\"count\">(%s)</span>"
|
766 |
|
767 |
+
#: includes/manage/class-list-table.php:320
|
768 |
+
#, php-format
|
769 |
+
msgid "Front End <span class=\"count\">(%s)</span>"
|
770 |
+
msgid_plural "Front End <span class=\"count\">(%s)</span>"
|
771 |
+
msgstr[0] "Öffentliche Seite <span class=\"count\">(%s)</span>"
|
772 |
+
msgstr[1] "Öffentliche Seiten <span class=\"count\">(%s)</span>"
|
773 |
+
|
774 |
+
#: includes/manage/class-list-table.php:380
|
775 |
msgid "Show all tags"
|
776 |
msgstr "Zeige alle Stichworte"
|
777 |
|
778 |
# @ code-snippets
|
779 |
+
#: includes/manage/class-list-table.php:394
|
780 |
msgid "Filter"
|
781 |
msgstr "Filter"
|
782 |
|
783 |
# @ code-snippets
|
784 |
+
#: includes/manage/class-list-table.php:402
|
785 |
msgid "Clear List"
|
786 |
msgstr "Liste bereinigen"
|
787 |
|
788 |
# @ code-snippets
|
789 |
+
#: includes/manage/class-list-table.php:551
|
790 |
#, php-format
|
791 |
msgid ""
|
792 |
"You do not appear to have any snippets available at this time. <a href=\"%s\">Add "
|
796 |
"href=\"%s\">hinzufügen →</a>"
|
797 |
|
798 |
# @ code-snippets
|
799 |
+
#: includes/manage/class-list-table.php:783
|
800 |
msgid "Search results"
|
801 |
msgstr "Suchergebnisse"
|
802 |
|
803 |
# @ code-snippets
|
804 |
+
#: includes/manage/class-list-table.php:786
|
805 |
#, php-format
|
806 |
msgid " for “%s”"
|
807 |
msgstr " für “%s”"
|
808 |
|
809 |
+
#: includes/manage/class-list-table.php:790
|
810 |
#, php-format
|
811 |
msgid " in tag “%s”"
|
812 |
msgstr " in Stichwort “%s”"
|
813 |
|
814 |
# @ code-snippets
|
815 |
+
#: includes/manage/class-list-table.php:796
|
816 |
msgid "Clear Filters"
|
817 |
msgstr "Filter zurücksetzen"
|
818 |
|
820 |
msgid "Snippets Settings"
|
821 |
msgstr "Codeschnipsel Einstellungen"
|
822 |
|
823 |
+
#: includes/settings/admin.php:21 includes/settings/admin.php:39
|
824 |
msgid "Settings"
|
825 |
msgstr "Einstellungen"
|
826 |
|
827 |
+
#: includes/settings/class-settings.php:51
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
828 |
msgid "Activate by Default"
|
829 |
msgstr "Standardmäßig aktivieren"
|
830 |
|
831 |
+
#: includes/settings/class-settings.php:53
|
832 |
msgid "Make the 'Save and Activate' button the default action when saving a snippet."
|
833 |
msgstr ""
|
834 |
"Legt die 'Speichern und Aktivieren' Schaltfläche als Standard Aktion fest beim "
|
835 |
"Speichern eines Codeschnipsel."
|
836 |
|
837 |
+
#: includes/settings/class-settings.php:59
|
838 |
+
msgid "Enable Scope Selector"
|
839 |
+
msgstr "Aktiviere Bereichswahl"
|
840 |
+
|
841 |
+
#: includes/settings/class-settings.php:61
|
842 |
+
msgid "Enable the scope selector when editing a snippet"
|
843 |
+
msgstr "Aktiviere die Bereichswahl bei der Bearbeitung eines Codeschnipsels"
|
844 |
+
|
845 |
+
#: includes/settings/class-settings.php:71
|
846 |
+
msgid "Row Height"
|
847 |
+
msgstr "Zeilenhöhe"
|
848 |
+
|
849 |
+
#: includes/settings/class-settings.php:73
|
850 |
+
msgid "rows"
|
851 |
+
msgstr "Zeilen"
|
852 |
+
|
853 |
+
#: includes/settings/class-settings.php:80
|
854 |
+
msgid "Use Full Editor"
|
855 |
+
msgstr "Benutze den erweiterten Editor"
|
856 |
+
|
857 |
+
#: includes/settings/class-settings.php:82
|
858 |
+
msgid "Enable all features of the visual editor"
|
859 |
+
msgstr "Aktiviere alle Funktionen des visuellen Editors"
|
860 |
+
|
861 |
+
#: includes/settings/class-settings.php:88
|
862 |
+
msgid "Media Buttons"
|
863 |
+
msgstr "Medien Schaltflächen"
|
864 |
+
|
865 |
+
#: includes/settings/class-settings.php:90
|
866 |
+
msgid "Enable the add media buttons"
|
867 |
+
msgstr "Aktiviere die Schaltfläche Medien hinzufügen."
|
868 |
+
|
869 |
+
#: includes/settings/class-settings.php:100
|
870 |
msgid "Theme"
|
871 |
msgstr "Theme"
|
872 |
|
873 |
+
#: includes/settings/class-settings.php:108
|
874 |
msgid "Indent With Tabs"
|
875 |
msgstr "Tabulatorbreite"
|
876 |
|
877 |
+
#: includes/settings/class-settings.php:110
|
878 |
msgid "Use hard tabs (not spaces) for indentation."
|
879 |
msgstr "Benutze Tabulator anstelle von Leerzeichen."
|
880 |
|
881 |
+
#: includes/settings/class-settings.php:117
|
882 |
msgid "Tab Size"
|
883 |
msgstr "Tabulatorweite"
|
884 |
|
885 |
+
#: includes/settings/class-settings.php:119
|
886 |
msgid "The width of a tab character."
|
887 |
msgstr "Die Länge eines Tabulatorzeichens."
|
888 |
|
889 |
+
#: includes/settings/class-settings.php:127
|
890 |
msgid "Indent Unit"
|
891 |
msgstr "Einheit des Einzugs"
|
892 |
|
893 |
+
#: includes/settings/class-settings.php:129
|
894 |
msgid "How many spaces a block should be indented."
|
895 |
msgstr "Anzahl der Leerzeichen die einem Einzug entsprechen sollen."
|
896 |
|
897 |
+
#: includes/settings/class-settings.php:137
|
898 |
msgid "Wrap Lines"
|
899 |
msgstr "Zeilen umbrechen"
|
900 |
|
901 |
+
#: includes/settings/class-settings.php:139
|
902 |
msgid "Whether the editor should scroll or wrap for long lines."
|
903 |
msgstr "Legt fest ob der Editor Zeilen umbricht oder bei langen Zeilen scrollen soll."
|
904 |
|
905 |
+
#: includes/settings/class-settings.php:146
|
906 |
msgid "Line Numbers"
|
907 |
msgstr "Zeilennummer"
|
908 |
|
909 |
+
#: includes/settings/class-settings.php:148
|
910 |
msgid "Show line numbers to the left of the editor."
|
911 |
msgstr "Zeigt Zeilennummern auf der linken Seite des Editors."
|
912 |
|
913 |
+
#: includes/settings/class-settings.php:155
|
914 |
msgid "Auto Close Brackets"
|
915 |
msgstr "Klammern automatisch schliessen."
|
916 |
|
917 |
+
#: includes/settings/class-settings.php:157
|
918 |
msgid "Auto-close brackets and quotes when typed."
|
919 |
msgstr ""
|
920 |
"Vervollständigt und schliesst Klammern und Anführungszeichen während der Eingabe."
|
921 |
|
922 |
+
#: includes/settings/class-settings.php:164
|
923 |
msgid "Highlight Selection Matches"
|
924 |
msgstr "Auswahlhervorhebung"
|
925 |
|
926 |
+
#: includes/settings/class-settings.php:165
|
927 |
msgid "Highlight all instances of a currently selected word."
|
928 |
msgstr ""
|
929 |
"Eine Auswahl an anderen Stellen hervorheben an denen die Auswahl ebenfalls vorkommt."
|
930 |
|
931 |
+
#: includes/settings/settings.php:84
|
932 |
+
msgid "General"
|
933 |
+
msgstr "Allgemein"
|
934 |
+
|
935 |
+
#: includes/settings/settings.php:85
|
936 |
+
msgid "Description Editor"
|
937 |
+
msgstr "Beschreibungs-Editor"
|
938 |
+
|
939 |
+
#: includes/settings/settings.php:86
|
940 |
+
msgid "Code Editor"
|
941 |
+
msgstr "Quellcode-Editor"
|
942 |
+
|
943 |
+
#: includes/settings/settings.php:134
|
944 |
msgid "Editor Preview"
|
945 |
msgstr "Editor Vorschau"
|
946 |
|
947 |
+
#: includes/settings/settings.php:180
|
948 |
msgid "Settings saved."
|
949 |
msgstr "Einstellungen gespeichert."
|
950 |
|
951 |
+
#~ msgid "Editor"
|
952 |
+
#~ msgstr "Editor"
|
953 |
+
|
954 |
# @ code-snippets
|
955 |
#~ msgid ""
|
956 |
#~ "An easy, clean and simple way to add code snippets to your site. No need to edit "
|
968 |
#~ msgid "http://bungeshea.com"
|
969 |
#~ msgstr "http://bungeshea.com/"
|
970 |
|
|
|
|
|
|
|
|
|
|
|
971 |
# @ code-snippets
|
972 |
#~ msgid "Please provide a name for the snippet and its code."
|
973 |
#~ msgstr "Bitte geben Sie einen Namen für den Codeschnipsel und dessen Code an."
|
languages/code-snippets-fr_FR.mo
CHANGED
Binary file
|
languages/code-snippets-fr_FR.po
CHANGED
@@ -5,7 +5,7 @@ msgstr ""
|
|
5 |
"Report-Msgid-Bugs-To: \n"
|
6 |
"POT-Creation-Date: 2015-05-11 08:58+1000\n"
|
7 |
"PO-Revision-Date: 2015-05-11 10:08+1000\n"
|
8 |
-
"Last-Translator:
|
9 |
"Language-Team: oWEB <oweb@office-web.net>\n"
|
10 |
"Language: fr\n"
|
11 |
"MIME-Version: 1.0\n"
|
5 |
"Report-Msgid-Bugs-To: \n"
|
6 |
"POT-Creation-Date: 2015-05-11 08:58+1000\n"
|
7 |
"PO-Revision-Date: 2015-05-11 10:08+1000\n"
|
8 |
+
"Last-Translator: Shea Bunge <info@bungeshea.com>"
|
9 |
"Language-Team: oWEB <oweb@office-web.net>\n"
|
10 |
"Language: fr\n"
|
11 |
"MIME-Version: 1.0\n"
|
languages/code-snippets-ja.mo
DELETED
Binary file
|
languages/code-snippets-ja.po
DELETED
@@ -1,569 +0,0 @@
|
|
1 |
-
# This file is distributed under the same license as the Code Snippets package.
|
2 |
-
msgid ""
|
3 |
-
msgstr ""
|
4 |
-
"PO-Revision-Date: 2013-11-30 10:44+0900\n"
|
5 |
-
"MIME-Version: 1.0\n"
|
6 |
-
"Content-Type: text/plain; charset=UTF-8\n"
|
7 |
-
"Content-Transfer-Encoding: 8bit\n"
|
8 |
-
"Plural-Forms: nplurals=2; plural=n != 1;\n"
|
9 |
-
"X-Generator: Poedit 1.5.7\n"
|
10 |
-
"Project-Id-Version: Code Snippets\n"
|
11 |
-
"POT-Creation-Date: \n"
|
12 |
-
"Last-Translator: \n"
|
13 |
-
"Language-Team: \n"
|
14 |
-
|
15 |
-
#: code-snippets.php:0 code-snippets.php:262
|
16 |
-
msgid "Code Snippets"
|
17 |
-
msgstr "Code Snippets"
|
18 |
-
|
19 |
-
#: code-snippets.php:0
|
20 |
-
msgid ""
|
21 |
-
"An easy, clean and simple way to add code snippets to your site. No need to "
|
22 |
-
"edit to your theme's functions.php file again!"
|
23 |
-
msgstr ""
|
24 |
-
"簡単に、あなたのサイトにコードスニペットを追加する方法です。もうテーマの"
|
25 |
-
"functions.phpを編集する必要はありません!"
|
26 |
-
|
27 |
-
#: code-snippets.php:0
|
28 |
-
msgid "Shea Bunge"
|
29 |
-
msgstr "Shea Bunge"
|
30 |
-
|
31 |
-
#: code-snippets.php:0
|
32 |
-
msgid "http://bungeshea.com"
|
33 |
-
msgstr "http://bungeshea.com"
|
34 |
-
|
35 |
-
#: code-snippets.php:577 code-snippets.php:578 code-snippets.php:588
|
36 |
-
#: includes/admin/manage.php:36
|
37 |
-
msgid "Snippets"
|
38 |
-
msgstr "スニペット"
|
39 |
-
|
40 |
-
#: code-snippets.php:612 code-snippets.php:1145 includes/admin/single.php:45
|
41 |
-
msgid "Add New Snippet"
|
42 |
-
msgstr "スニペット新規追加"
|
43 |
-
|
44 |
-
#: code-snippets.php:613
|
45 |
-
msgid "Add New"
|
46 |
-
msgstr "新規追加"
|
47 |
-
|
48 |
-
#: code-snippets.php:641 includes/admin/import.php:34
|
49 |
-
msgid "Import Snippets"
|
50 |
-
msgstr "スニペットインポート"
|
51 |
-
|
52 |
-
#: code-snippets.php:642
|
53 |
-
msgid "Import"
|
54 |
-
msgstr "インポート"
|
55 |
-
|
56 |
-
#: code-snippets.php:601 code-snippets.php:1146 includes/admin/single.php:37
|
57 |
-
msgid "Edit Snippet"
|
58 |
-
msgstr "スニペット編集"
|
59 |
-
|
60 |
-
#: code-snippets.php:1465
|
61 |
-
msgid "Manage your existing snippets"
|
62 |
-
msgstr "登録されているスニペットを管理"
|
63 |
-
|
64 |
-
#: code-snippets.php:589 code-snippets.php:1466
|
65 |
-
msgid "Manage"
|
66 |
-
msgstr "管理"
|
67 |
-
|
68 |
-
#: code-snippets.php:1486
|
69 |
-
msgid "Visit the WordPress.org plugin page"
|
70 |
-
msgstr "WordPress.orgプラグインページへ"
|
71 |
-
|
72 |
-
#: code-snippets.php:1487
|
73 |
-
msgid "About"
|
74 |
-
msgstr "このプラグインについて"
|
75 |
-
|
76 |
-
#: code-snippets.php:1491
|
77 |
-
msgid "Visit the support forums"
|
78 |
-
msgstr "サポートフォーラムへ"
|
79 |
-
|
80 |
-
#: code-snippets.php:1492
|
81 |
-
msgid "Support"
|
82 |
-
msgstr "サポート"
|
83 |
-
|
84 |
-
#: code-snippets.php:1496
|
85 |
-
msgid "Support this plugin's development"
|
86 |
-
msgstr "このプラグインの開発をサポート"
|
87 |
-
|
88 |
-
#: code-snippets.php:1497
|
89 |
-
msgid "Donate"
|
90 |
-
msgstr "寄付"
|
91 |
-
|
92 |
-
#: includes/admin/import.php:38
|
93 |
-
msgid ""
|
94 |
-
"Howdy! Upload your Code Snippets export file and we’ll import the "
|
95 |
-
"snippets to this site."
|
96 |
-
msgstr ""
|
97 |
-
"こんにちは!あなたのコードスニペットエクスポートファイルをアップロードして、"
|
98 |
-
"このサイトにスニペットをインポートします。"
|
99 |
-
|
100 |
-
#: includes/admin/import.php:40
|
101 |
-
msgid ""
|
102 |
-
"You will need to go to the <a href=\"%s\">Manage Snippets</a> page to "
|
103 |
-
"activate the imported snippets."
|
104 |
-
msgstr ""
|
105 |
-
"<a href=\"%s\">スニペットの管理</a> ページでインポートしたスニペットを有効に"
|
106 |
-
"する必要があります。"
|
107 |
-
|
108 |
-
#: includes/admin/import.php:42
|
109 |
-
msgid ""
|
110 |
-
"Choose a Code Snippets (.xml) file to upload, then click Upload file and "
|
111 |
-
"import."
|
112 |
-
msgstr ""
|
113 |
-
"アップロードするスニペットファイル(.xml)を選択し、クリックしてファイルをアッ"
|
114 |
-
"プロードし、インポートして下さい。"
|
115 |
-
|
116 |
-
#: includes/admin/import.php:46
|
117 |
-
msgid "Choose a file from your computer:"
|
118 |
-
msgstr "ファイルをコンピュータから選択:"
|
119 |
-
|
120 |
-
#: includes/admin/import.php:46
|
121 |
-
msgid "(Maximum size: 8MB)"
|
122 |
-
msgstr "(最大ファイルサイズ: 8MB)"
|
123 |
-
|
124 |
-
#: includes/admin/import.php:55
|
125 |
-
msgid "Upload file and import"
|
126 |
-
msgstr "ファイルをアップロードし、インポート"
|
127 |
-
|
128 |
-
#: includes/admin/manage.php:21
|
129 |
-
msgid "Snippet <strong>activated</strong>."
|
130 |
-
msgstr "スニペットを <strong>有効化</strong>。"
|
131 |
-
|
132 |
-
#: includes/admin/manage.php:23
|
133 |
-
msgid "Selected snippets <strong>activated</strong>."
|
134 |
-
msgstr "選択されたスニペットを <strong>有効化</strong>。"
|
135 |
-
|
136 |
-
#: includes/admin/manage.php:25
|
137 |
-
msgid "Snippet <strong>deactivated</strong>."
|
138 |
-
msgstr "スニペットを <strong>停止</strong>。"
|
139 |
-
|
140 |
-
#: includes/admin/manage.php:27
|
141 |
-
msgid "Selected snippets <strong>deactivated</strong>."
|
142 |
-
msgstr "選択したスニペットを <strong>停止</strong>。"
|
143 |
-
|
144 |
-
#: includes/admin/manage.php:29
|
145 |
-
msgid "Snippet <strong>deleted</strong>."
|
146 |
-
msgstr "スニペットを <strong>削除</strong>。"
|
147 |
-
|
148 |
-
#: includes/admin/manage.php:31
|
149 |
-
msgid "Selected snippets <strong>deleted</strong>."
|
150 |
-
msgstr "選択されたスニペットを <strong>削除</strong>。"
|
151 |
-
|
152 |
-
#: includes/admin/manage.php:38 includes/admin/single.php:42
|
153 |
-
msgctxt "snippet"
|
154 |
-
msgid "Add New"
|
155 |
-
msgstr "新規追加"
|
156 |
-
|
157 |
-
#: includes/admin/manage.php:47
|
158 |
-
msgid "Search Installed Snippets"
|
159 |
-
msgstr "インストールされているスニペットを検索"
|
160 |
-
|
161 |
-
#: includes/admin/single.php:22
|
162 |
-
msgid "Please provide a name for the snippet and its code."
|
163 |
-
msgstr "スニペットもしくはコードに名前をつけて下さい。"
|
164 |
-
|
165 |
-
#: includes/admin/single.php:28
|
166 |
-
msgid "Snippet <strong>updated</strong>."
|
167 |
-
msgstr "スニペットを <strong>更新</strong>。"
|
168 |
-
|
169 |
-
#: includes/admin/single.php:30
|
170 |
-
msgid "Snippet <strong>added</strong>."
|
171 |
-
msgstr "スニペットを <strong>追加</strong>。"
|
172 |
-
|
173 |
-
#: includes/admin/single.php:55 includes/admin/single.php:56
|
174 |
-
msgid "Name (short title)"
|
175 |
-
msgstr "名前 (短いタイトル)"
|
176 |
-
|
177 |
-
#: includes/admin/single.php:61
|
178 |
-
msgid "Code"
|
179 |
-
msgstr "コード"
|
180 |
-
|
181 |
-
#: code-snippets.php:1433 includes/class-list-table.php:189
|
182 |
-
msgid "Description"
|
183 |
-
msgstr "説明"
|
184 |
-
|
185 |
-
#: code-snippets.php:1434
|
186 |
-
msgid "(Optional)"
|
187 |
-
msgstr "(オプション)"
|
188 |
-
|
189 |
-
#: includes/class-list-table.php:36
|
190 |
-
msgid "Snippets per page"
|
191 |
-
msgstr "1ページあたりのスニペット表示件数"
|
192 |
-
|
193 |
-
#: code-snippets.php:1118 includes/class-list-table.php:127
|
194 |
-
#: includes/class-list-table.php:213
|
195 |
-
msgid "Network Deactivate"
|
196 |
-
msgstr "ネットワーク 無効"
|
197 |
-
|
198 |
-
#: code-snippets.php:1118 includes/class-list-table.php:127
|
199 |
-
#: includes/class-list-table.php:213
|
200 |
-
msgid "Deactivate"
|
201 |
-
msgstr "無効"
|
202 |
-
|
203 |
-
#: code-snippets.php:1127 includes/class-list-table.php:137
|
204 |
-
#: includes/class-list-table.php:212
|
205 |
-
msgid "Network Activate"
|
206 |
-
msgstr "ネットワーク 有効"
|
207 |
-
|
208 |
-
#: code-snippets.php:1127 includes/class-list-table.php:137
|
209 |
-
#: includes/class-list-table.php:212
|
210 |
-
msgid "Activate"
|
211 |
-
msgstr "有効"
|
212 |
-
|
213 |
-
#: includes/class-list-table.php:187
|
214 |
-
msgid "Name"
|
215 |
-
msgstr "名前"
|
216 |
-
|
217 |
-
#: includes/class-list-table.php:188
|
218 |
-
msgid "ID"
|
219 |
-
msgstr "ID"
|
220 |
-
|
221 |
-
#: includes/class-list-table.php:147 includes/class-list-table.php:214
|
222 |
-
msgid "Export"
|
223 |
-
msgstr "エクスポート"
|
224 |
-
|
225 |
-
#: includes/class-list-table.php:155 includes/class-list-table.php:215
|
226 |
-
msgid "Delete"
|
227 |
-
msgstr "削除"
|
228 |
-
|
229 |
-
#: includes/class-list-table.php:216
|
230 |
-
msgid "Export to PHP"
|
231 |
-
msgstr "PHPにエクスポート"
|
232 |
-
|
233 |
-
#: includes/class-list-table.php:236
|
234 |
-
msgid "All <span class=\"count\">(%s)</span>"
|
235 |
-
msgid_plural "All <span class=\"count\">(%s)</span>"
|
236 |
-
msgstr[0] "全て <span class=\"count\">(%s)</span>"
|
237 |
-
msgstr[1] "全て <span class=\"count\">(%s)</span>"
|
238 |
-
|
239 |
-
#: includes/class-list-table.php:239
|
240 |
-
msgid "Active <span class=\"count\">(%s)</span>"
|
241 |
-
msgid_plural "Active <span class=\"count\">(%s)</span>"
|
242 |
-
msgstr[0] "有効 <span class=\"count\">(%s)</span>"
|
243 |
-
msgstr[1] "有効 <span class=\"count\">(%s)</span>"
|
244 |
-
|
245 |
-
#: includes/class-list-table.php:242
|
246 |
-
msgid "Recently Active <span class=\"count\">(%s)</span>"
|
247 |
-
msgid_plural "Recently Active <span class=\"count\">(%s)</span>"
|
248 |
-
msgstr[0] "最近まで使用 <span class=\"count\">(%s)</span>"
|
249 |
-
msgstr[1] "最近の有効 <span class=\"count\">(%s)</span>"
|
250 |
-
|
251 |
-
#: includes/class-list-table.php:245
|
252 |
-
msgid "Inactive <span class=\"count\">(%s)</span>"
|
253 |
-
msgid_plural "Inactive <span class=\"count\">(%s)</span>"
|
254 |
-
msgstr[0] "停止 <span class=\"count\">(%s)</span>"
|
255 |
-
msgstr[1] "停止 <span class=\"count\">(%s)</span>"
|
256 |
-
|
257 |
-
#: includes/class-list-table.php:279
|
258 |
-
msgid "Clear List"
|
259 |
-
msgstr "一覧をクリア"
|
260 |
-
|
261 |
-
#: includes/class-list-table.php:374
|
262 |
-
msgid ""
|
263 |
-
"You do not appear to have any snippets available at this time. <a href=\"%s"
|
264 |
-
"\">Add New→</a>"
|
265 |
-
msgstr "表示するスニペットがまだありません。<a href=\"%s\">新規追加→</a>"
|
266 |
-
|
267 |
-
#: includes/help/import.php:5 includes/help/manage.php:5
|
268 |
-
#: includes/help/single.php:5
|
269 |
-
msgid "Overview"
|
270 |
-
msgstr "概要"
|
271 |
-
|
272 |
-
#: includes/help/import.php:7
|
273 |
-
msgid ""
|
274 |
-
"Snippets are similar to plugins - they both extend and expand the "
|
275 |
-
"functionality of WordPress. Snippets are more light-weight, just a few lines "
|
276 |
-
"of code, and do not put as much load on your server. Here you can load "
|
277 |
-
"snippets from a Code Snippets (.xml) import file into the database with your "
|
278 |
-
"existing snippets."
|
279 |
-
msgstr ""
|
280 |
-
"スニペットはプラグインに似ています。両方ともWordPressの機能を拡張します。スニ"
|
281 |
-
"ペットは、より軽量、わずか数行のコードであり、サーバに負荷をかけません。ここ"
|
282 |
-
"であなたが持つスニペットを Code Snippets のインポートファイル(.xml) からデー"
|
283 |
-
"タベースに登録できます。"
|
284 |
-
|
285 |
-
#: includes/help/import.php:12
|
286 |
-
msgid "Importing"
|
287 |
-
msgstr "インポート中"
|
288 |
-
|
289 |
-
#: includes/help/import.php:15
|
290 |
-
msgid ""
|
291 |
-
"Snippets will be added to the database along with your existing snippets. "
|
292 |
-
"Regardless of whether the snippets were active on the previous site, "
|
293 |
-
"imported snippets are always inactive until activated using the <a href=\"%s"
|
294 |
-
"\">Manage Snippets</a> page.</p>"
|
295 |
-
msgstr ""
|
296 |
-
"スニペットは、既存のスニペットと一緒にデータベースに追加されます。<a href="
|
297 |
-
"\"%s\">スニペット管理</a> ページを使用して有効化されるまで、スニペットは、以"
|
298 |
-
"前のサイト上でアクティブになっていたかどうかにかかわらず、インポートされたス"
|
299 |
-
"ニペットは常に停止状態となります。</p>"
|
300 |
-
|
301 |
-
#: includes/help/import.php:20
|
302 |
-
msgid "Exporting"
|
303 |
-
msgstr "エクスポート中"
|
304 |
-
|
305 |
-
#: includes/help/import.php:22
|
306 |
-
msgid ""
|
307 |
-
"You can save your snippets to a Code Snippets (.xml) export file using the "
|
308 |
-
"<a href=\"%s\">Manage Snippets</a> page."
|
309 |
-
msgstr ""
|
310 |
-
"<a href=\"%s\">スニペット管理</a> ページでスニペットをCode Snippetsエクスポー"
|
311 |
-
"トファイル(.xml)に保存することができます。"
|
312 |
-
|
313 |
-
#: includes/help/import.php:26 includes/help/manage.php:27
|
314 |
-
#: includes/help/single.php:31
|
315 |
-
msgid "For more information:"
|
316 |
-
msgstr "より多くの情報:"
|
317 |
-
|
318 |
-
#: includes/help/import.php:27 includes/help/single.php:32
|
319 |
-
msgid ""
|
320 |
-
"<a href=\"http://wordpress.org/plugins/code-snippets\" target=\"_blank"
|
321 |
-
"\">WordPress Extend</a>"
|
322 |
-
msgstr ""
|
323 |
-
"<a href=\"http://wordpress.org/plugins/code-snippets\" target=\"_blank"
|
324 |
-
"\">WordPress Extend</a>"
|
325 |
-
|
326 |
-
#: includes/help/import.php:28 includes/help/manage.php:29
|
327 |
-
#: includes/help/single.php:33
|
328 |
-
msgid ""
|
329 |
-
"<a href=\"http://wordpress.org/support/plugin/code-snippets\" target=\"_blank"
|
330 |
-
"\">Support Forums</a>"
|
331 |
-
msgstr ""
|
332 |
-
"<a href=\"http://wordpress.org/support/plugin/code-snippets\" target=\"_blank"
|
333 |
-
"\">サポートフォラム</a>"
|
334 |
-
|
335 |
-
#: includes/help/manage.php:7
|
336 |
-
msgid ""
|
337 |
-
"Snippets are similar to plugins - they both extend and expand the "
|
338 |
-
"functionality of WordPress. Snippets are more light-weight, just a few lines "
|
339 |
-
"of code, and do not put as much load on your server. Here you can manage "
|
340 |
-
"your existing snippets and preform tasks on them such as activating, "
|
341 |
-
"deactivating, deleting and exporting."
|
342 |
-
msgstr ""
|
343 |
-
"スニペットはプラグインに似ています。両方ともWordPressの機能を拡張します。スニ"
|
344 |
-
"ペットは、より軽量、わずか数行のコードであり、サーバに負荷をかけません。ここ"
|
345 |
-
"では、既存のスニペットなどの有効化、停止、削除、エクスポートなど、それらのタ"
|
346 |
-
"スクを管理することができます。"
|
347 |
-
|
348 |
-
#: includes/help/manage.php:12
|
349 |
-
msgid "Safe Mode"
|
350 |
-
msgstr "セーフモード"
|
351 |
-
|
352 |
-
#: includes/help/manage.php:14
|
353 |
-
msgid ""
|
354 |
-
"Be sure to check your snippets for errors before you activate them, as a "
|
355 |
-
"faulty snippet could bring your whole blog down. If your site starts doing "
|
356 |
-
"strange things, deactivate all your snippets and activate them one at a time."
|
357 |
-
msgstr ""
|
358 |
-
"サイト全体が障害のあるスニペットで停止しないように、それらを有効化する前にス"
|
359 |
-
"ニペットを確認して下さい。サイトが奇妙な動作をした場合は、すべてのスニペット"
|
360 |
-
"を無効化し、それらを一度に1をアクティブにします。"
|
361 |
-
|
362 |
-
#: includes/help/manage.php:20
|
363 |
-
msgid "Uninstall"
|
364 |
-
msgstr "アンインストール"
|
365 |
-
|
366 |
-
#: includes/help/manage.php:22
|
367 |
-
msgid ""
|
368 |
-
"When you delete Code Snippets through the Plugins menu in WordPress it will "
|
369 |
-
"clear up the <code>%1$s</code> table and a few other bits of data stored in "
|
370 |
-
"the database. If you want to keep this data (ie: you are only temporally "
|
371 |
-
"uninstalling Code Snippets) then remove the <code>%2$s</code> folder using "
|
372 |
-
"FTP."
|
373 |
-
msgstr ""
|
374 |
-
"あなたがワードプレスでのプラグインメニューからコードスニペットを削除すると"
|
375 |
-
"き、<code>%1$s</code>テーブルと、データベースに格納されたデータのいくつかをク"
|
376 |
-
"リアします。(例:あなただけの一時的コードスニペットをアンインストールする)"
|
377 |
-
"このデータを保持する場合は、FTPを使用して <code>%2$s</code> フォルダを削除し"
|
378 |
-
"ます。"
|
379 |
-
|
380 |
-
#: includes/help/manage.php:23
|
381 |
-
msgid ""
|
382 |
-
"Even if you're sure that you don't want to use Code Snippets ever again on "
|
383 |
-
"this WordPress installation, you may want to use the export feature to back "
|
384 |
-
"up your snippets."
|
385 |
-
msgstr ""
|
386 |
-
"インストールされたスニペットコードをこのWordPressで使用しないとしても、スニ"
|
387 |
-
"ペットをエクスポート機能でバックアップして使用することができます。"
|
388 |
-
|
389 |
-
#: includes/help/manage.php:28
|
390 |
-
msgid ""
|
391 |
-
"<a href=\"http://wordpress.org/plugins/code-snippets\" target=\"_blank"
|
392 |
-
"\">WordPress Extend</a></p>"
|
393 |
-
msgstr ""
|
394 |
-
"<a href=\"http://wordpress.org/plugins/code-snippets\" target=\"_blank"
|
395 |
-
"\">WordPress Extend</a></p>"
|
396 |
-
|
397 |
-
#: includes/help/single.php:7
|
398 |
-
msgid ""
|
399 |
-
"Snippets are similar to plugins - they both extend and expand the "
|
400 |
-
"functionality of WordPress. Snippets are more light-weight, just a few lines "
|
401 |
-
"of code, and do not put as much load on your server. Here you can add a new "
|
402 |
-
"snippet, or edit an existing one."
|
403 |
-
msgstr ""
|
404 |
-
"スニペットはプラグインに似ています。両方ともWordPressの機能を拡張します。スニ"
|
405 |
-
"ペットは、より軽量、わずか数行のコードであり、サーバに負荷をかけません。ここ"
|
406 |
-
"では、新しいスニペットを追加するか、既存のものを編集することができます。"
|
407 |
-
|
408 |
-
#: includes/help/single.php:11
|
409 |
-
msgid "Finding Snippets"
|
410 |
-
msgstr "スニペットを探す"
|
411 |
-
|
412 |
-
#: includes/help/single.php:13
|
413 |
-
msgid ""
|
414 |
-
"Here are some links to websites which host a large number of snippets that "
|
415 |
-
"you can add to your site.\n"
|
416 |
-
"\t\t<ul>\n"
|
417 |
-
"\t\t\t<li><a href=\"http://wp-snippets.com\" title=\"WordPress Snippets\">WP-"
|
418 |
-
"Snippets</a></li>\n"
|
419 |
-
"\t\t\t<li><a href=\"http://wpsnipp.com\" title=\"WP Snipp\">WP Snipp</a></"
|
420 |
-
"li>\n"
|
421 |
-
"\t\t\t<li><a href=\"http://www.catswhocode.com/blog/snippets\" title=\"Cats "
|
422 |
-
"Who Code Snippet Library\">Cats Who Code</a></li>\n"
|
423 |
-
"\t\t\t<li><a href=\"http://www.wpfunction.me\">WP Function Me</a></li>\n"
|
424 |
-
"\t\t</ul>"
|
425 |
-
msgstr ""
|
426 |
-
"ここにあなたのサイトに追加できるスニペットをホストしているWebサイトを挙げま"
|
427 |
-
"す。\n"
|
428 |
-
"\t\t<ul>\n"
|
429 |
-
"\t\t\t<li><a href=\"http://wp-snippets.com\" title=\"WordPress Snippets\">WP-"
|
430 |
-
"Snippets</a></li>\n"
|
431 |
-
"\t\t\t<li><a href=\"http://wpsnipp.com\" title=\"WP Snipp\">WP Snipp</a></"
|
432 |
-
"li>\n"
|
433 |
-
"\t\t\t<li><a href=\"http://www.catswhocode.com/blog/snippets\" title=\"Cats "
|
434 |
-
"Who Code Snippet Library\">Cats Who Code</a></li>\n"
|
435 |
-
"\t\t\t<li><a href=\"http://www.wpfunction.me\">WP Function Me</a></li>\n"
|
436 |
-
"\t\t</ul>"
|
437 |
-
|
438 |
-
#: includes/help/single.php:24
|
439 |
-
msgid "Adding Snippets"
|
440 |
-
msgstr "スニペットを追加"
|
441 |
-
|
442 |
-
#: includes/help/single.php:26
|
443 |
-
msgid ""
|
444 |
-
"You need to fill out the name and code fields for your snippet to be added. "
|
445 |
-
"While the description field will add more information about how your snippet "
|
446 |
-
"works, what is does and where you found it, it is completely optional."
|
447 |
-
msgstr ""
|
448 |
-
"あなたは、追加するスニペットの名前とコードのフィールドに必要事項を記入する必"
|
449 |
-
"要があります。説明フィールドには、あなたのスニペットがどのように機能するかに"
|
450 |
-
"ついての詳細情報を記入しますが、これは任意です。"
|
451 |
-
|
452 |
-
#: includes/help/single.php:27
|
453 |
-
msgid ""
|
454 |
-
"Please be sure to check that your snippet is valid PHP code and will not "
|
455 |
-
"produce errors before adding it through this page. While doing so will not "
|
456 |
-
"become active straight away, it will help to minimise the chance of a faulty "
|
457 |
-
"snippet becoming active on your site."
|
458 |
-
msgstr ""
|
459 |
-
"このページで追加するスニペットのPHPコードがエラーを起こさないことを確認して下"
|
460 |
-
"さい。そうすることですぐに有効になりませんが、障害のあるスニペットは、サイト"
|
461 |
-
"上で有効になる可能性を最小限に抑えるのに役立ちます。"
|
462 |
-
|
463 |
-
#: code-snippets.php:0
|
464 |
-
msgid "http://code-snippets.bungeshea.com"
|
465 |
-
msgstr "http://code-snippets.bungeshea.com"
|
466 |
-
|
467 |
-
#: code-snippets.php:263
|
468 |
-
msgid "Import snippets from a <strong>Code Snippets</strong> export file"
|
469 |
-
msgstr ""
|
470 |
-
"スニペットを<strong>Code Snippets</strong>のエクスポートファイルからインポー"
|
471 |
-
"ト"
|
472 |
-
|
473 |
-
#: includes/admin/import.php:20
|
474 |
-
msgid "Imported <strong>%d</strong> snippet."
|
475 |
-
msgid_plural "Imported <strong>%d</strong> snippets."
|
476 |
-
msgstr[0] "スニペットを <strong>%d</strong> 件インポートしました。"
|
477 |
-
msgstr[1] "スニペットを <strong>%d</strong> 件インポートしました。"
|
478 |
-
|
479 |
-
#: includes/help/import.php:29 includes/help/manage.php:30
|
480 |
-
#: includes/help/single.php:34
|
481 |
-
msgid ""
|
482 |
-
"<a href=\"http://code-snippets.bungeshea.com/\" target=\"_blank\">Project "
|
483 |
-
"Website</a>"
|
484 |
-
msgstr ""
|
485 |
-
"<a href=\"http://code-snippets.bungeshea.com/\" target=\"_blank\">プロジェク"
|
486 |
-
"トサイト</a>"
|
487 |
-
|
488 |
-
#: includes/help/manage.php:15
|
489 |
-
msgid ""
|
490 |
-
"If something goes wrong with a snippet and you can't use WordPress, you can "
|
491 |
-
"cause all snippets to stop executing by adding <code>define"
|
492 |
-
"('CODE_SNIPPETS_SAFE_MODE', true);</code> to your <code>wp-config.php</code> "
|
493 |
-
"file. After you have deactivated the offending snippet, you can turn off "
|
494 |
-
"safe mode by removing this line or replacing <strong>true</strong> with "
|
495 |
-
"<strong>false</strong>."
|
496 |
-
msgstr ""
|
497 |
-
"もしもスニペットに何か問題があってWordPressが使えなくなったら、<code>wp-"
|
498 |
-
"config.php</code>ファイルに <code>define('CODE_SNIPPETS_SAFE_MODE', true);</"
|
499 |
-
"code> と記述することでスニペットの実行を停止します。あなたが問題のスニペット"
|
500 |
-
"を無効にした後は、この行を削除するか、<strong>true</strong> を "
|
501 |
-
"<strong>false</strong> に置き換えることでセーフモードをオフにすることができま"
|
502 |
-
"す。"
|
503 |
-
|
504 |
-
#: includes/help/single.php:20
|
505 |
-
msgid ""
|
506 |
-
"More places to find snippets, as well as a selection of example snippets, "
|
507 |
-
"can be found in the <a href=\"http://code-snippets.bungeshea.com/docs/"
|
508 |
-
"finding-snippets/\">plugin documentation</a>"
|
509 |
-
msgstr ""
|
510 |
-
"スニペットの例は、<a href=\"http://code-snippets.bungeshea.com/docs/finding-"
|
511 |
-
"snippets/\">プラグインドキュメント</a> に記載されています。"
|
512 |
-
|
513 |
-
#: code-snippets.php:0
|
514 |
-
msgid "1.7"
|
515 |
-
msgstr "1.7"
|
516 |
-
|
517 |
-
#: code-snippets.php:602 includes/class-list-table.php:142
|
518 |
-
msgid "Edit"
|
519 |
-
msgstr "編集"
|
520 |
-
|
521 |
-
#: code-snippets.php:1227
|
522 |
-
msgid "Sorry, you're not allowed to edit snippets"
|
523 |
-
msgstr "申し訳ありません、スニペット編集の許可がないようです"
|
524 |
-
|
525 |
-
#: includes/admin/single.php:24
|
526 |
-
msgid "Snippet <strong>updated</strong> and <strong>activated</strong>."
|
527 |
-
msgstr ""
|
528 |
-
"スニペットを <strong>更新</strong> し、 <strong>有効化</strong>しました。"
|
529 |
-
|
530 |
-
#: includes/admin/single.php:26
|
531 |
-
msgid "Snippet <strong>added</strong> and <strong>activated</strong>."
|
532 |
-
msgstr ""
|
533 |
-
"スニペットを <strong>追加</strong> し、 <strong>有効化</strong>しました。"
|
534 |
-
|
535 |
-
#: includes/class-list-table.php:163
|
536 |
-
msgid ""
|
537 |
-
"You are about to permanently delete the selected item.\n"
|
538 |
-
"\t\t\t\t'Cancel' to stop, 'OK' to delete."
|
539 |
-
msgstr ""
|
540 |
-
"あなたは永久に選択した項目を削除しようとしています。\n"
|
541 |
-
"\t\t\t\t 削除するには、'OK'を、中止するには 'Cancel'をクリックして下さい。"
|
542 |
-
|
543 |
-
#: includes/class-list-table.php:270
|
544 |
-
msgid "Filter"
|
545 |
-
msgstr "検索条件"
|
546 |
-
|
547 |
-
#: includes/class-list-table.php:541
|
548 |
-
msgid "Search results"
|
549 |
-
msgstr "検索結果"
|
550 |
-
|
551 |
-
#: includes/class-list-table.php:544
|
552 |
-
msgid " for “%s”"
|
553 |
-
msgstr " for “%s”"
|
554 |
-
|
555 |
-
#: includes/class-list-table.php:550
|
556 |
-
msgid "Clear Filters"
|
557 |
-
msgstr "検索条件を解除"
|
558 |
-
|
559 |
-
#: includes/help/import.php:14
|
560 |
-
msgid ""
|
561 |
-
"You can load your snippets from a code snippets (.xml) export file using "
|
562 |
-
"this page."
|
563 |
-
msgstr ""
|
564 |
-
"このページでスニペットコードをエクスポートファイル(.xml)から読み込むことがで"
|
565 |
-
"きます。"
|
566 |
-
|
567 |
-
#: includes/admin/single.php:74
|
568 |
-
msgid "Save Changes & Activate"
|
569 |
-
msgstr "変更を保存 & 有効化"
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
languages/code-snippets-ru_RU.mo
CHANGED
Binary file
|
languages/code-snippets-ru_RU.po
CHANGED
@@ -2,9 +2,10 @@
|
|
2 |
msgid ""
|
3 |
msgstr ""
|
4 |
"Project-Id-Version: Code Snippets\n"
|
5 |
-
"
|
6 |
-
"
|
7 |
-
"
|
|
|
8 |
"Language-Team: Flector <rlector@gmail.com>\n"
|
9 |
"Language: ru\n"
|
10 |
"MIME-Version: 1.0\n"
|
@@ -12,7 +13,7 @@ msgstr ""
|
|
12 |
"Content-Transfer-Encoding: 8bit\n"
|
13 |
"Plural-Forms: nplurals=3; plural=(n%10==1 && n%100!=11 ? 0 : n%10>=2 && n"
|
14 |
"%10<=4 && (n%100<10 || n%100>=20) ? 1 : 2);\n"
|
15 |
-
"X-Generator: Poedit 1.6
|
16 |
"X-Poedit-SourceCharset: UTF-8\n"
|
17 |
"X-Poedit-Basepath: ../\n"
|
18 |
"X-Poedit-KeywordsList: __;_e;__ngettext:1,2;_n:1,2;_x:1,2c;_n;_nx:4c,1,2;"
|
@@ -20,180 +21,133 @@ msgstr ""
|
|
20 |
"esc_html_e\n"
|
21 |
"X-Poedit-SearchPath-0: .\n"
|
22 |
|
23 |
-
#: admin
|
24 |
-
|
25 |
-
|
|
|
|
|
26 |
|
27 |
-
#: admin
|
28 |
-
msgid ""
|
29 |
-
"
|
30 |
-
"functionality of WordPress. Snippets are more light-weight, just a few lines "
|
31 |
-
"of code, and do not put as much load on your server. Here you can load "
|
32 |
-
"snippets from a Code Snippets (.xml) import file into the database with your "
|
33 |
-
"existing snippets."
|
34 |
-
msgstr ""
|
35 |
-
"Сниппеты похожи на плагины - и те и другие расширяют функциональность движка "
|
36 |
-
"WordPress. Сниппеты зачастую маленькие, состоят лишь из нескольких строк "
|
37 |
-
"кода и не вызывают нагрузки на ваш сервер. Здесь вы можете загрузить ваши "
|
38 |
-
"сниппеты из файла экспорта плагина (.xml), чтобы добавить их на ваш сайт."
|
39 |
|
40 |
-
#: admin/
|
41 |
-
msgid "
|
42 |
-
msgstr "
|
43 |
|
44 |
-
#: admin
|
45 |
-
msgid ""
|
46 |
-
"
|
47 |
-
"this page."
|
48 |
-
msgstr "Вы можете загрузить ваши сниппеты из файла экспорта (.xml)."
|
49 |
|
50 |
-
#: admin
|
51 |
-
|
52 |
-
|
53 |
-
"Snippets will be added to the database along with your existing snippets. "
|
54 |
-
"Regardless of whether the snippets were active on the previous site, "
|
55 |
-
"imported snippets are always inactive until activated using the <a href=\"%s"
|
56 |
-
"\">Manage Snippets</a> page.</p>"
|
57 |
-
msgstr ""
|
58 |
-
"Сниппеты будут добавлены в вашу базу (они не будут работать до тех пор, пока "
|
59 |
-
"вы их не активируете на странице <a href=\"%s\">Управление сниппетами</a>)</"
|
60 |
-
"p>"
|
61 |
|
62 |
-
#: admin
|
63 |
-
msgid "
|
64 |
-
msgstr "
|
65 |
|
66 |
-
#: admin
|
67 |
-
|
68 |
-
|
69 |
-
"You can save your snippets to a Code Snippets (.xml) export file using the "
|
70 |
-
"<a href=\"%s\">Manage Snippets</a> page."
|
71 |
-
msgstr ""
|
72 |
-
"Вы можете сохранить ваши сниппеты в файл экспорта (.xml) на странице <a href="
|
73 |
-
"\"%s\">Управление сниппетами</a>."
|
74 |
|
75 |
-
#:
|
76 |
-
msgid "
|
77 |
-
msgstr "
|
78 |
|
79 |
-
#:
|
80 |
-
msgid ""
|
81 |
-
|
82 |
-
"\">WordPress Extend</a>"
|
83 |
-
msgstr ""
|
84 |
-
"<a href=\"http://wordpress.org/plugins/code-snippets\" target=\"_blank"
|
85 |
-
"\">Страница плагина</a>"
|
86 |
|
87 |
-
#:
|
88 |
msgid ""
|
89 |
-
"<
|
90 |
-
"
|
|
|
91 |
msgstr ""
|
92 |
-
"<
|
93 |
-
"
|
94 |
|
95 |
-
#:
|
96 |
-
msgid ""
|
97 |
-
|
98 |
-
"Website</a>"
|
99 |
-
msgstr ""
|
100 |
-
"<a href=\"http://bungeshea.com/plugins/code-snippets/\" target=\"_blank\">Сайт "
|
101 |
-
"плагина</a>"
|
102 |
|
103 |
-
#:
|
104 |
msgid ""
|
105 |
-
"
|
106 |
-
"
|
107 |
-
"of code, and do not put as much load on your server. Here you can manage "
|
108 |
-
"your existing snippets and preform tasks on them such as activating, "
|
109 |
-
"deactivating, deleting and exporting."
|
110 |
msgstr ""
|
111 |
-
"
|
112 |
-
"WordPress.
|
113 |
-
"кода и не вызывают нагрузки на ваш сервер. Здесь вы можете управлять вашими "
|
114 |
-
"сниппетами (добавлять, редактировать, активировать и деактивировать)."
|
115 |
|
116 |
-
#:
|
117 |
-
msgid "
|
118 |
-
msgstr "
|
119 |
|
120 |
-
#:
|
121 |
-
msgid ""
|
122 |
-
"
|
123 |
-
|
124 |
-
|
125 |
-
|
126 |
-
"
|
127 |
-
"Некорректные сниппеты могут испортить вам сайт!"
|
128 |
|
129 |
-
#:
|
130 |
msgid ""
|
131 |
-
"
|
132 |
-
"
|
133 |
-
"
|
134 |
-
"config.php</code> file. After you have deactivated the offending snippet, "
|
135 |
-
"you can turn off safe mode by removing this line or replacing <strong>true</"
|
136 |
-
"strong> with <strong>false</strong>."
|
137 |
-
msgstr ""
|
138 |
-
"В случае любых проблем со сниппетами плагина вы можете их все "
|
139 |
-
"деактивировать, добавив строчку <code>define('CODE_SNIPPETS_SAFE_MODE', "
|
140 |
-
"true);</code> в ваш файл конфигурации <code>wp-config.php</code> . После "
|
141 |
-
"этого вы сможете деактивировать глючный сниппет, а потом снова включить "
|
142 |
-
"плагин, удалив указанную строчку."
|
143 |
|
144 |
-
#:
|
145 |
-
msgid "
|
146 |
-
msgstr "
|
147 |
|
148 |
-
#:
|
149 |
-
|
150 |
-
|
151 |
-
|
152 |
-
|
153 |
-
"
|
154 |
-
"
|
155 |
-
"FTP."
|
156 |
-
msgstr ""
|
157 |
-
"При удалении плагина через меню \"Плагины\" в админке блога таблица <code>"
|
158 |
-
"%1$s</code> в базе данных будет удалена. Если вы хотите сохранить настройки "
|
159 |
-
"(сниппеты) плагина, то удаляйте плагин (<code>%2$s</code>) через FTP, а не "
|
160 |
-
"через админку. Только в этом случае ваши сниппеты не будут потеряны (но вы, "
|
161 |
-
"конечно, можете сделать экспорт сниппетов во внешний .xml файл)."
|
162 |
|
163 |
-
#:
|
164 |
msgid ""
|
165 |
-
"
|
166 |
-
"
|
167 |
-
"up your snippets."
|
168 |
msgstr ""
|
169 |
-
"
|
170 |
-
"
|
171 |
|
172 |
-
#:
|
173 |
msgid ""
|
174 |
-
"
|
175 |
-
"
|
176 |
msgstr ""
|
177 |
-
"<a href=\"
|
178 |
-
"
|
|
|
|
|
|
|
|
|
|
|
179 |
|
180 |
-
#: admin
|
181 |
msgid ""
|
182 |
"Snippets are similar to plugins - they both extend and expand the "
|
183 |
"functionality of WordPress. Snippets are more light-weight, just a few lines "
|
184 |
"of code, and do not put as much load on your server. Here you can add a new "
|
185 |
"snippet, or edit an existing one."
|
186 |
msgstr ""
|
187 |
-
"Сниппеты похожи на плагины
|
188 |
-
"WordPress. Сниппеты
|
189 |
-
"
|
190 |
-
"
|
191 |
|
192 |
-
#: admin
|
193 |
msgid "Finding Snippets"
|
194 |
msgstr "Поиск сниппетов"
|
195 |
|
196 |
-
#: admin
|
197 |
msgid ""
|
198 |
"Here are some links to websites which host a large number of snippets that "
|
199 |
"you can add to your site.\n"
|
@@ -207,7 +161,7 @@ msgid ""
|
|
207 |
"\t\t\t<li><a href=\"http://www.wpfunction.me\">WP Function Me</a></li>\n"
|
208 |
"\t\t</ul>"
|
209 |
msgstr ""
|
210 |
-
"Здесь
|
211 |
"\t\t<ul>\n"
|
212 |
"\t\t\t<li><a href=\"http://www.wphook.ru\" title=\"WPHook.ru\">WPHook.ru</"
|
213 |
"a></li>\n"
|
@@ -220,317 +174,480 @@ msgstr ""
|
|
220 |
"\t\t\t<li><a href=\"http://www.wpfunction.me\">WP Function Me</a></li>\n"
|
221 |
"\t\t</ul>"
|
222 |
|
223 |
-
#: admin
|
224 |
msgid ""
|
225 |
"More places to find snippets, as well as a selection of example snippets, "
|
226 |
-
"can be found in the <a href=\"https://github.com/sheabunge/code-snippets/
|
227 |
-
"Finding-snippets\">plugin documentation</a>"
|
228 |
msgstr ""
|
229 |
-
"
|
230 |
-
"Finding-snippets
|
|
|
231 |
|
232 |
-
#: admin
|
233 |
msgid "Adding Snippets"
|
234 |
msgstr "Добавление сниппетов"
|
235 |
|
236 |
-
#: admin
|
237 |
msgid ""
|
238 |
"You need to fill out the name and code fields for your snippet to be added. "
|
239 |
"While the description field will add more information about how your snippet "
|
240 |
"works, what is does and where you found it, it is completely optional."
|
241 |
-
msgstr "
|
|
|
|
|
|
|
242 |
|
243 |
-
#: admin
|
244 |
msgid ""
|
245 |
"Please be sure to check that your snippet is valid PHP code and will not "
|
246 |
"produce errors before adding it through this page. While doing so will not "
|
247 |
"become active straight away, it will help to minimise the chance of a faulty "
|
248 |
"snippet becoming active on your site."
|
249 |
msgstr ""
|
250 |
-
"Пожалуйста, убедитесь в том, что
|
251 |
-
"корректным PHP кодом,
|
252 |
-
"
|
|
|
253 |
|
254 |
-
#: admin/
|
255 |
-
|
256 |
-
msgid ""
|
257 |
-
|
258 |
-
"a>"
|
259 |
-
msgid_plural ""
|
260 |
-
"Successfully imported <strong>%d</strong> snippets. <a href=\"%s\">Have fun!"
|
261 |
-
"</a>"
|
262 |
-
msgstr[0] ""
|
263 |
-
"Удачно импортирован <strong>%d</strong> сниппет. <a href=\"%s\">Удачи!</a>"
|
264 |
-
msgstr[1] ""
|
265 |
-
"Удачно импортировано <strong>%d</strong> сниппета. <a href=\"%s\">Удачи!</a>"
|
266 |
-
msgstr[2] ""
|
267 |
-
"Удачно импортировано <strong>%d</strong> сниппетов. <a href=\"%s\">Удачи!</a>"
|
268 |
-
|
269 |
-
#: admin/messages/import.php:32
|
270 |
-
msgid "An error occurred when processing the import file."
|
271 |
-
msgstr "Произошла ошибка при импортировании сниппета."
|
272 |
|
273 |
-
#: admin/
|
274 |
msgid ""
|
275 |
-
"<
|
276 |
-
"
|
277 |
-
"config.php</code> to turn off safe mode. <a href=\"http://code-snippets."
|
278 |
-
"bungeshea.com/docs/safe-mode/\" target=\"_blank\">Help</a>"
|
279 |
msgstr ""
|
280 |
-
"<
|
281 |
-
"
|
282 |
-
"файла <code>wp-config.php</code>, чтобы выключить режим Safe mode. <a href="
|
283 |
-
"\"https://github.com/sheabunge/code-snippets/wiki/Safe-Mode\" target=\"_blank"
|
284 |
-
"\">Помощь</a>"
|
285 |
-
|
286 |
-
#: admin/messages/manage.php:20
|
287 |
-
msgid "Snippet <strong>activated</strong>."
|
288 |
-
msgstr "Сниппет <strong>активирован</strong>."
|
289 |
-
|
290 |
-
#: admin/messages/manage.php:24
|
291 |
-
msgid "Selected snippets <strong>activated</strong>."
|
292 |
-
msgstr "Выбранные сниппеты <strong>активированы</strong>."
|
293 |
-
|
294 |
-
#: admin/messages/manage.php:28
|
295 |
-
msgid "Snippet <strong>deactivated</strong>."
|
296 |
-
msgstr "Сниппет <strong>деактивирован</strong>."
|
297 |
-
|
298 |
-
#: admin/messages/manage.php:32
|
299 |
-
msgid "Selected snippets <strong>deactivated</strong>."
|
300 |
-
msgstr "Выбранные сниппеты <strong>деактивированы</strong>."
|
301 |
|
302 |
-
#: admin/
|
303 |
-
|
304 |
-
|
|
|
|
|
|
|
|
|
|
|
305 |
|
306 |
-
#: admin/
|
307 |
-
|
308 |
-
|
|
|
|
|
|
|
|
|
|
|
309 |
|
310 |
-
#: admin
|
311 |
msgid "An error occurred when saving the snippet."
|
312 |
msgstr "Произошла ошибка при сохранении сниппета."
|
313 |
|
314 |
-
#: admin
|
315 |
msgid "Snippet <strong>updated</strong> and <strong>activated</strong>."
|
316 |
msgstr "Сниппет <strong>обновлен</strong> и <strong>активирован</strong>."
|
317 |
|
318 |
-
#: admin
|
319 |
msgid "Snippet <strong>added</strong> and <strong>activated</strong>."
|
320 |
msgstr "Сниппет <strong>добавлен</strong> и <strong>активирован</strong>."
|
321 |
|
322 |
-
#: admin
|
323 |
msgid "Snippet <strong>updated</strong> and <strong>deactivated</strong>."
|
324 |
msgstr "Сниппет <strong>обновлен</strong> и <strong>деактивирован</strong>."
|
325 |
|
326 |
-
#: admin
|
327 |
msgid "Snippet <strong>updated</strong>."
|
328 |
msgstr "Сниппет <strong>обновлен</strong>."
|
329 |
|
330 |
-
#: admin
|
331 |
msgid "Snippet <strong>added</strong>."
|
332 |
msgstr "Сниппет <strong>добавлен</strong>."
|
333 |
|
334 |
-
#:
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
335 |
msgid "Import Snippets"
|
336 |
msgstr "Импортирование сниппетов"
|
337 |
|
338 |
-
#:
|
339 |
msgid ""
|
340 |
"Howdy! Upload your Code Snippets export file and we’ll import the "
|
341 |
"snippets to this site."
|
342 |
msgstr ""
|
343 |
"Привет! Загрузите файл экспорта, чтобы импортировать сниппеты на этот сайт."
|
344 |
|
345 |
-
#:
|
346 |
#, php-format
|
347 |
msgid ""
|
348 |
"You will need to go to the <a href=\"%s\">Manage Snippets</a> page to "
|
349 |
"activate the imported snippets."
|
350 |
msgstr ""
|
351 |
-
"
|
352 |
-
"
|
353 |
|
354 |
-
#:
|
355 |
msgid ""
|
356 |
"Choose a Code Snippets (.xml) file to upload, then click Upload file and "
|
357 |
"import."
|
358 |
msgstr ""
|
359 |
-
"Выберите файл экспорта (.xml), а затем
|
360 |
"импортировать\"."
|
361 |
|
362 |
-
#:
|
363 |
msgid "Choose a file from your computer:"
|
364 |
msgstr "Выберите файл на вашем компьютере:"
|
365 |
|
366 |
-
#:
|
367 |
msgid "(Maximum size: 8MB)"
|
368 |
-
msgstr "(Максимальный размер:
|
369 |
|
370 |
-
#:
|
371 |
msgid "Upload file and import"
|
372 |
msgstr "Загрузить файл и импортировать"
|
373 |
|
374 |
-
#:
|
375 |
-
#: includes/class-admin.php:276 includes/class-admin.php:277
|
376 |
-
#: includes/class-admin.php:287
|
377 |
-
msgid "Snippets"
|
378 |
-
msgstr "Сниппеты"
|
379 |
-
|
380 |
-
#: admin/views/manage.php:26 admin/views/single.php:34
|
381 |
-
#: includes/class-admin.php:300
|
382 |
-
msgid "Add New"
|
383 |
-
msgstr "Добавить новый"
|
384 |
-
|
385 |
-
#: admin/views/manage.php:39
|
386 |
-
msgid "Search Installed Snippets"
|
387 |
-
msgstr "Искать установленные сниппеты"
|
388 |
-
|
389 |
-
#: admin/views/single.php:29 includes/class-admin.php:299
|
390 |
-
msgid "Edit Snippet"
|
391 |
-
msgstr "Редактирование сниппета"
|
392 |
-
|
393 |
-
#: admin/views/single.php:37 includes/class-admin.php:299
|
394 |
-
msgid "Add New Snippet"
|
395 |
-
msgstr "Добавление нового сниппета"
|
396 |
-
|
397 |
-
#: admin/views/single.php:53 admin/views/single.php:54
|
398 |
-
msgid "Name (short title)"
|
399 |
-
msgstr "Имя (короткое название на английском)"
|
400 |
-
|
401 |
-
#: admin/views/single.php:59
|
402 |
-
msgid "Code"
|
403 |
-
msgstr "Код"
|
404 |
-
|
405 |
-
#: admin/views/single.php:85
|
406 |
-
msgid "Save Changes & Activate"
|
407 |
-
msgstr "Сохранить изменения & Активировать"
|
408 |
-
|
409 |
-
#: admin/views/single.php:91
|
410 |
-
msgid "Save Changes & Deactivate"
|
411 |
-
msgstr "Сохранить изменения & Деактивировать"
|
412 |
-
|
413 |
-
#: admin/views/single.php:100 includes/class-list-table.php:166
|
414 |
-
#: includes/class-list-table.php:265
|
415 |
-
msgid "Export"
|
416 |
-
msgstr "Экспорт"
|
417 |
-
|
418 |
-
#: admin/views/single.php:107 includes/class-list-table.php:182
|
419 |
-
msgid "Вы действительно хотите удалить выбранный сниппет?"
|
420 |
-
msgstr "Вы действительно хотите удалить выбранный сниппет?"
|
421 |
-
|
422 |
-
#: admin/views/single.php:112 includes/class-list-table.php:175
|
423 |
-
#: includes/class-list-table.php:266
|
424 |
-
msgid "Delete"
|
425 |
-
msgstr "Удалить"
|
426 |
-
|
427 |
-
#: includes/class-admin.php:185
|
428 |
msgid "Code Snippets"
|
429 |
msgstr "Code Snippets"
|
430 |
|
431 |
-
#: includes/
|
432 |
-
msgid "Import snippets from a
|
433 |
msgstr "Импортировать сниппеты из файла экспорта плагина \"Code Snippets\"."
|
434 |
|
435 |
-
#: includes/
|
436 |
-
msgid "You are not authorized to access this page."
|
437 |
-
msgstr "У вас нет доступа к этой странице."
|
438 |
-
|
439 |
-
#: includes/class-admin.php:288 includes/class-admin.php:695
|
440 |
-
msgid "Manage"
|
441 |
-
msgstr "Управление сниппетами"
|
442 |
-
|
443 |
-
#: includes/class-admin.php:300 includes/class-list-table.php:160
|
444 |
-
msgid "Edit"
|
445 |
-
msgstr "Редактировать"
|
446 |
-
|
447 |
-
#: includes/class-admin.php:328
|
448 |
msgid "Import"
|
449 |
msgstr "Импорт"
|
450 |
|
451 |
-
#: includes/
|
452 |
-
msgid "
|
453 |
-
msgstr "
|
454 |
|
455 |
-
#: includes/
|
456 |
-
msgid "
|
457 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
458 |
|
459 |
-
#: includes/
|
460 |
-
msgid "
|
461 |
-
msgstr "
|
462 |
|
463 |
-
#: includes/
|
464 |
-
msgid "
|
465 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
466 |
|
467 |
-
#: includes/
|
468 |
-
msgid "
|
469 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
470 |
|
471 |
-
#: includes/
|
472 |
-
|
473 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
474 |
|
475 |
-
#: includes/
|
476 |
-
msgid "
|
477 |
-
|
|
|
|
|
|
|
|
|
|
|
478 |
|
479 |
-
#: includes/
|
480 |
-
msgid "
|
481 |
-
|
|
|
|
|
|
|
|
|
482 |
|
483 |
-
#: includes/
|
484 |
msgid ""
|
485 |
-
"<strong>
|
486 |
-
"
|
487 |
-
"
|
|
|
488 |
msgstr ""
|
489 |
-
"<strong
|
490 |
-
"
|
|
|
|
|
|
|
491 |
|
492 |
-
#: includes/
|
493 |
-
msgid "
|
494 |
-
msgstr "
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
495 |
|
496 |
-
#: includes/
|
|
|
|
|
|
|
|
|
497 |
msgid "Snippets per page"
|
498 |
-
msgstr "Сниппетов на
|
499 |
|
500 |
-
#: includes/
|
|
|
501 |
msgid "Network Deactivate"
|
502 |
msgstr "Деактивировать в сети"
|
503 |
|
504 |
-
#: includes/
|
|
|
505 |
msgid "Deactivate"
|
506 |
msgstr "Деактивировать"
|
507 |
|
508 |
-
#: includes/
|
|
|
509 |
msgid "Network Activate"
|
510 |
msgstr "Активировать в сети"
|
511 |
|
512 |
-
#: includes/
|
|
|
513 |
msgid "Activate"
|
514 |
msgstr "Активировать"
|
515 |
|
516 |
-
#: includes/class-list-table.php:
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
517 |
#, php-format
|
518 |
msgid "Untitled #%d"
|
519 |
-
msgstr "
|
520 |
|
521 |
-
#: includes/class-list-table.php:
|
522 |
msgid "Name"
|
523 |
-
msgstr "
|
524 |
|
525 |
-
#: includes/class-list-table.php:
|
526 |
msgid "ID"
|
527 |
msgstr "ID"
|
528 |
|
529 |
-
#: includes/class-list-table.php:
|
530 |
msgid "Export to PHP"
|
531 |
msgstr "Экспорт в PHP"
|
532 |
|
533 |
-
#: includes/class-list-table.php:
|
534 |
#, php-format
|
535 |
msgid "All <span class=\"count\">(%s)</span>"
|
536 |
msgid_plural "All <span class=\"count\">(%s)</span>"
|
@@ -538,69 +655,216 @@ msgstr[0] "Все <span class=\"count\">(%s)</span>"
|
|
538 |
msgstr[1] "Все <span class=\"count\">(%s)</span>"
|
539 |
msgstr[2] "Все <span class=\"count\">(%s)</span>"
|
540 |
|
541 |
-
#: includes/class-list-table.php:
|
542 |
#, php-format
|
543 |
msgid "Active <span class=\"count\">(%s)</span>"
|
544 |
msgid_plural "Active <span class=\"count\">(%s)</span>"
|
545 |
-
msgstr[0] "
|
546 |
msgstr[1] "Активные <span class=\"count\">(%s)</span>"
|
547 |
msgstr[2] "Активные <span class=\"count\">(%s)</span>"
|
548 |
|
549 |
-
#: includes/class-list-table.php:
|
550 |
#, php-format
|
551 |
msgid "Recently Active <span class=\"count\">(%s)</span>"
|
552 |
msgid_plural "Recently Active <span class=\"count\">(%s)</span>"
|
553 |
-
msgstr[0] "Недавно
|
554 |
msgstr[1] "Недавно активные <span class=\"count\">(%s)</span>"
|
555 |
msgstr[2] "Недавно активные <span class=\"count\">(%s)</span>"
|
556 |
|
557 |
-
#: includes/class-list-table.php:
|
558 |
#, php-format
|
559 |
msgid "Inactive <span class=\"count\">(%s)</span>"
|
560 |
msgid_plural "Inactive <span class=\"count\">(%s)</span>"
|
561 |
-
msgstr[0] "
|
562 |
msgstr[1] "Неактивные <span class=\"count\">(%s)</span>"
|
563 |
msgstr[2] "Неактивные <span class=\"count\">(%s)</span>"
|
564 |
|
565 |
-
#: includes/class-list-table.php:
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
566 |
msgid "Filter"
|
567 |
msgstr "Фильтр"
|
568 |
|
569 |
-
#: includes/class-list-table.php:
|
570 |
msgid "Clear List"
|
571 |
-
msgstr "Очистить
|
572 |
|
573 |
-
#: includes/class-list-table.php:
|
574 |
#, php-format
|
575 |
msgid ""
|
576 |
"You do not appear to have any snippets available at this time. <a href=\"%s"
|
577 |
"\">Add New→</a>"
|
578 |
msgstr "Нет доступных сниппетов. <a href=\"%s\">Добавить новый→</a>"
|
579 |
|
580 |
-
#: includes/class-list-table.php:
|
581 |
msgid "Search results"
|
582 |
msgstr "Результаты поиска"
|
583 |
|
584 |
-
#: includes/class-list-table.php:
|
585 |
#, php-format
|
586 |
msgid " for “%s”"
|
587 |
msgstr " по запросу “%s”"
|
588 |
|
589 |
-
#: includes/class-list-table.php:
|
|
|
|
|
|
|
|
|
|
|
590 |
msgid "Clear Filters"
|
591 |
msgstr "Очистить фильтры"
|
592 |
|
593 |
-
|
594 |
-
|
595 |
-
|
596 |
-
|
597 |
-
|
598 |
-
|
599 |
-
|
600 |
-
|
601 |
-
|
602 |
-
|
603 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
604 |
|
605 |
#, fuzzy
|
606 |
#~ msgid "Все <span class=\"count\">(%s)</span>"
|
2 |
msgid ""
|
3 |
msgstr ""
|
4 |
"Project-Id-Version: Code Snippets\n"
|
5 |
+
"Report-Msgid-Bugs-To: \n"
|
6 |
+
"POT-Creation-Date: 2015-05-20 15:56+1000\n"
|
7 |
+
"PO-Revision-Date: 2015-05-20 12:15+0300\n"
|
8 |
+
"Last-Translator: Alexey Chumakov <alex@chumakov.ru>\n"
|
9 |
"Language-Team: Flector <rlector@gmail.com>\n"
|
10 |
"Language: ru\n"
|
11 |
"MIME-Version: 1.0\n"
|
13 |
"Content-Transfer-Encoding: 8bit\n"
|
14 |
"Plural-Forms: nplurals=3; plural=(n%10==1 && n%100!=11 ? 0 : n%10>=2 && n"
|
15 |
"%10<=4 && (n%100<10 || n%100>=20) ? 1 : 2);\n"
|
16 |
+
"X-Generator: Poedit 1.7.6\n"
|
17 |
"X-Poedit-SourceCharset: UTF-8\n"
|
18 |
"X-Poedit-Basepath: ../\n"
|
19 |
"X-Poedit-KeywordsList: __;_e;__ngettext:1,2;_n:1,2;_x:1,2c;_n;_nx:4c,1,2;"
|
21 |
"esc_html_e\n"
|
22 |
"X-Poedit-SearchPath-0: .\n"
|
23 |
|
24 |
+
#: includes/admin.php:81 includes/manage/admin.php:21
|
25 |
+
#: includes/manage/manage.php:22 includes/manage/manage.php:23
|
26 |
+
#: includes/manage/manage.php:33
|
27 |
+
msgid "Snippets"
|
28 |
+
msgstr "Сниппеты"
|
29 |
|
30 |
+
#: includes/admin.php:152
|
31 |
+
msgid "Manage your existing snippets"
|
32 |
+
msgstr "Управление имеющимися сниппетами"
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
33 |
|
34 |
+
#: includes/admin.php:153 includes/manage/manage.php:34
|
35 |
+
msgid "Manage"
|
36 |
+
msgstr "Управление"
|
37 |
|
38 |
+
#: includes/admin.php:182
|
39 |
+
msgid "Visit the WordPress.org plugin page"
|
40 |
+
msgstr "Посетить страницу плагина на WordPress.org"
|
|
|
|
|
41 |
|
42 |
+
#: includes/admin.php:183
|
43 |
+
msgid "About"
|
44 |
+
msgstr "О плагине"
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
45 |
|
46 |
+
#: includes/admin.php:187
|
47 |
+
msgid "Visit the support forums"
|
48 |
+
msgstr "Посетить форумы поддержки"
|
49 |
|
50 |
+
#: includes/admin.php:188
|
51 |
+
msgid "Support"
|
52 |
+
msgstr "Поддержка"
|
|
|
|
|
|
|
|
|
|
|
53 |
|
54 |
+
#: includes/admin.php:192
|
55 |
+
msgid "Support this plugin's development"
|
56 |
+
msgstr "Поддержите развитие плагина"
|
57 |
|
58 |
+
#: includes/admin.php:193
|
59 |
+
msgid "Donate"
|
60 |
+
msgstr "Пожертвования"
|
|
|
|
|
|
|
|
|
61 |
|
62 |
+
#: includes/admin.php:226
|
63 |
msgid ""
|
64 |
+
"<strong>Have feedback on Code Snippets?</strong> Please take the time to "
|
65 |
+
"answer a short survey on how you use this plugin and what you'd like to see "
|
66 |
+
"changed or added in the future."
|
67 |
msgstr ""
|
68 |
+
"<strong>У вас есть замечания по работе Code Snippets?</strong> Тогда "
|
69 |
+
"пожалуйста заполните анкету на сайте плагина."
|
70 |
|
71 |
+
#: includes/admin.php:229
|
72 |
+
msgid "Take the survey now"
|
73 |
+
msgstr "Оставить отзыв"
|
|
|
|
|
|
|
|
|
74 |
|
75 |
+
#: includes/class-export.php:102
|
76 |
msgid ""
|
77 |
+
"This is a code snippets export file generated by the Code Snippets WordPress "
|
78 |
+
"plugin."
|
|
|
|
|
|
|
79 |
msgstr ""
|
80 |
+
"Это файл экспорта сниппетов кода, созданный плагином Code Snippets для "
|
81 |
+
"WordPress."
|
|
|
|
|
82 |
|
83 |
+
#: includes/class-export.php:103
|
84 |
+
msgid "http://wordpress.org/plugins/code-snippets"
|
85 |
+
msgstr "http://wordpress.org/plugins/code-snippets"
|
86 |
|
87 |
+
#: includes/class-export.php:104
|
88 |
+
msgid "To import these snippets a WordPress site follow these steps:"
|
89 |
+
msgstr "Для импорта сниппетов на сайт WordPress выполните эти действия:"
|
90 |
+
|
91 |
+
#: includes/class-export.php:105
|
92 |
+
msgid "1. Log in to that site as an administrator."
|
93 |
+
msgstr "1. Войдите на сайт как администратор."
|
|
|
94 |
|
95 |
+
#: includes/class-export.php:106
|
96 |
msgid ""
|
97 |
+
"2. Install the Code Snippets plugin using the directions provided at the "
|
98 |
+
"above link."
|
99 |
+
msgstr "2. Установите плагин Code Snippets, следуя указаниям по ссылке выше."
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
100 |
|
101 |
+
#: includes/class-export.php:107
|
102 |
+
msgid "3. Go to 'Tools: Import' in the WordPress admin panel."
|
103 |
+
msgstr "3. Перейдите в 'Инструменты: Импорт' в консоли WordPress."
|
104 |
|
105 |
+
#: includes/class-export.php:108
|
106 |
+
msgid "4. Click on the \"Code Snippets\" importer in the list"
|
107 |
+
msgstr "4. Нажмите на импорт \"Code Snippets\" в списке"
|
108 |
+
|
109 |
+
#: includes/class-export.php:109
|
110 |
+
msgid "5. Upload this file using the form provided on that page."
|
111 |
+
msgstr "5. Загрузите этот файл через форму на той странице."
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
112 |
|
113 |
+
#: includes/class-export.php:110
|
114 |
msgid ""
|
115 |
+
"6. Code Snippets will then import all of the snippets and associated "
|
116 |
+
"information contained in this file into your site."
|
|
|
117 |
msgstr ""
|
118 |
+
"6. Code Snippets импортирует из этого файла на сайт все сниппеты и "
|
119 |
+
"сопутствующую информацию."
|
120 |
|
121 |
+
#: includes/class-export.php:111
|
122 |
msgid ""
|
123 |
+
"7. You will then have to visit the 'Snippets: Manage' admin menu and "
|
124 |
+
"activate desired snippets."
|
125 |
msgstr ""
|
126 |
+
"7. Потребуется зайти в <a href=\"%s\">Сниппеты: управление</a>, и "
|
127 |
+
"активировать нужные сниппеты."
|
128 |
+
|
129 |
+
#: includes/edit/admin-help.php:15 includes/import/admin-help.php:16
|
130 |
+
#: includes/manage/admin-help.php:15
|
131 |
+
msgid "Overview"
|
132 |
+
msgstr "Обзор"
|
133 |
|
134 |
+
#: includes/edit/admin-help.php:17
|
135 |
msgid ""
|
136 |
"Snippets are similar to plugins - they both extend and expand the "
|
137 |
"functionality of WordPress. Snippets are more light-weight, just a few lines "
|
138 |
"of code, and do not put as much load on your server. Here you can add a new "
|
139 |
"snippet, or edit an existing one."
|
140 |
msgstr ""
|
141 |
+
"Сниппеты похожи на плагины — и те и другие расширяют функциональность "
|
142 |
+
"WordPress. Сниппеты меньше, они состоят лишь из нескольких строк кода и не "
|
143 |
+
"сильно нагружают ваш сервер. Здесь можно добавить или отредактировать "
|
144 |
+
"сниппет."
|
145 |
|
146 |
+
#: includes/edit/admin-help.php:22
|
147 |
msgid "Finding Snippets"
|
148 |
msgstr "Поиск сниппетов"
|
149 |
|
150 |
+
#: includes/edit/admin-help.php:24
|
151 |
msgid ""
|
152 |
"Here are some links to websites which host a large number of snippets that "
|
153 |
"you can add to your site.\n"
|
161 |
"\t\t\t<li><a href=\"http://www.wpfunction.me\">WP Function Me</a></li>\n"
|
162 |
"\t\t</ul>"
|
163 |
msgstr ""
|
164 |
+
"Здесь приведены ссылки на некоторые сайты со множеством сниппетов:\n"
|
165 |
"\t\t<ul>\n"
|
166 |
"\t\t\t<li><a href=\"http://www.wphook.ru\" title=\"WPHook.ru\">WPHook.ru</"
|
167 |
"a></li>\n"
|
174 |
"\t\t\t<li><a href=\"http://www.wpfunction.me\">WP Function Me</a></li>\n"
|
175 |
"\t\t</ul>"
|
176 |
|
177 |
+
#: includes/edit/admin-help.php:31
|
178 |
msgid ""
|
179 |
"More places to find snippets, as well as a selection of example snippets, "
|
180 |
+
"can be found in the <a href=\"https://github.com/sheabunge/code-snippets/"
|
181 |
+
"wiki/Finding-snippets\">plugin documentation</a>"
|
182 |
msgstr ""
|
183 |
+
"Места, где можно найти сниппеты, а также избранные примеры, находятся на <a "
|
184 |
+
"href=\"https://github.com/sheabunge/code-snippets/wiki/Finding-snippets"
|
185 |
+
"\">странице плагина</a>"
|
186 |
|
187 |
+
#: includes/edit/admin-help.php:36
|
188 |
msgid "Adding Snippets"
|
189 |
msgstr "Добавление сниппетов"
|
190 |
|
191 |
+
#: includes/edit/admin-help.php:38
|
192 |
msgid ""
|
193 |
"You need to fill out the name and code fields for your snippet to be added. "
|
194 |
"While the description field will add more information about how your snippet "
|
195 |
"works, what is does and where you found it, it is completely optional."
|
196 |
+
msgstr ""
|
197 |
+
"Для добавление сниппета нужно заполнить поля названия и кода. В поле "
|
198 |
+
"описания можно добавить дополнительные сведения о том, как работает сниппет, "
|
199 |
+
"но это совершенно необязательно."
|
200 |
|
201 |
+
#: includes/edit/admin-help.php:39
|
202 |
msgid ""
|
203 |
"Please be sure to check that your snippet is valid PHP code and will not "
|
204 |
"produce errors before adding it through this page. While doing so will not "
|
205 |
"become active straight away, it will help to minimise the chance of a faulty "
|
206 |
"snippet becoming active on your site."
|
207 |
msgstr ""
|
208 |
+
"Пожалуйста, перед добавление сниппета убедитесь в том, что он является "
|
209 |
+
"корректным PHP кодом, и не приведет к сбоям. Хотя добавляемый сниппет сразу "
|
210 |
+
"не активизируется, это поможет сократить вероятность включения неисправного "
|
211 |
+
"сниппета в будущем."
|
212 |
|
213 |
+
#: includes/edit/admin-help.php:43 includes/import/admin-help.php:37
|
214 |
+
#: includes/manage/admin-help.php:37
|
215 |
+
msgid "For more information:"
|
216 |
+
msgstr "Дополнительная информация:"
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
217 |
|
218 |
+
#: includes/edit/admin-help.php:44 includes/import/admin-help.php:38
|
219 |
msgid ""
|
220 |
+
"<a href=\"http://wordpress.org/plugins/code-snippets\" target=\"_blank"
|
221 |
+
"\">WordPress Extend</a>"
|
|
|
|
|
222 |
msgstr ""
|
223 |
+
"<a href=\"http://wordpress.org/plugins/code-snippets\" target=\"_blank"
|
224 |
+
"\">Страница плагина</a>"
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
225 |
|
226 |
+
#: includes/edit/admin-help.php:45 includes/import/admin-help.php:39
|
227 |
+
#: includes/manage/admin-help.php:39
|
228 |
+
msgid ""
|
229 |
+
"<a href=\"http://wordpress.org/support/plugin/code-snippets\" target=\"_blank"
|
230 |
+
"\">Support Forums</a>"
|
231 |
+
msgstr ""
|
232 |
+
"<a href=\"http://wordpress.org/support/plugin/code-snippets\" target=\"_blank"
|
233 |
+
"\">Форумы поддержки</a>"
|
234 |
|
235 |
+
#: includes/edit/admin-help.php:46 includes/import/admin-help.php:40
|
236 |
+
#: includes/manage/admin-help.php:40
|
237 |
+
msgid ""
|
238 |
+
"<a href=\"http://bungeshea.com/plugins/code-snippets/\" target=\"_blank"
|
239 |
+
"\">Project Website</a>"
|
240 |
+
msgstr ""
|
241 |
+
"<a href=\"http://bungeshea.com/plugins/code-snippets/\" target=\"_blank"
|
242 |
+
"\">Сайт плагина</a>"
|
243 |
|
244 |
+
#: includes/edit/admin-messages.php:14
|
245 |
msgid "An error occurred when saving the snippet."
|
246 |
msgstr "Произошла ошибка при сохранении сниппета."
|
247 |
|
248 |
+
#: includes/edit/admin-messages.php:18
|
249 |
msgid "Snippet <strong>updated</strong> and <strong>activated</strong>."
|
250 |
msgstr "Сниппет <strong>обновлен</strong> и <strong>активирован</strong>."
|
251 |
|
252 |
+
#: includes/edit/admin-messages.php:22
|
253 |
msgid "Snippet <strong>added</strong> and <strong>activated</strong>."
|
254 |
msgstr "Сниппет <strong>добавлен</strong> и <strong>активирован</strong>."
|
255 |
|
256 |
+
#: includes/edit/admin-messages.php:26
|
257 |
msgid "Snippet <strong>updated</strong> and <strong>deactivated</strong>."
|
258 |
msgstr "Сниппет <strong>обновлен</strong> и <strong>деактивирован</strong>."
|
259 |
|
260 |
+
#: includes/edit/admin-messages.php:30
|
261 |
msgid "Snippet <strong>updated</strong>."
|
262 |
msgstr "Сниппет <strong>обновлен</strong>."
|
263 |
|
264 |
+
#: includes/edit/admin-messages.php:34
|
265 |
msgid "Snippet <strong>added</strong>."
|
266 |
msgstr "Сниппет <strong>добавлен</strong>."
|
267 |
|
268 |
+
#: includes/edit/admin.php:26 includes/edit/edit.php:48
|
269 |
+
#: includes/edit/edit.php:49
|
270 |
+
msgid "Edit Snippet"
|
271 |
+
msgstr "Редактирование сниппета"
|
272 |
+
|
273 |
+
#: includes/edit/admin.php:29 includes/manage/admin.php:24
|
274 |
+
msgctxt "snippet"
|
275 |
+
msgid "Add New"
|
276 |
+
msgstr "Добавить новый"
|
277 |
+
|
278 |
+
#: includes/edit/admin.php:32 includes/edit/edit.php:34
|
279 |
+
msgid "Add New Snippet"
|
280 |
+
msgstr "Добавление нового сниппета"
|
281 |
+
|
282 |
+
#: includes/edit/admin.php:49 includes/edit/admin.php:50
|
283 |
+
msgid "Name (short title)"
|
284 |
+
msgstr "Название (короткий заголовок на английском)"
|
285 |
+
|
286 |
+
#: includes/edit/admin.php:55
|
287 |
+
msgid "Code"
|
288 |
+
msgstr "Код"
|
289 |
+
|
290 |
+
#: includes/edit/admin.php:75 includes/edit/admin.php:89
|
291 |
+
msgid "Save Changes and Activate"
|
292 |
+
msgstr "Сохранить изменения и активировать"
|
293 |
+
|
294 |
+
#: includes/edit/admin.php:95
|
295 |
+
msgid "Save Changes and Deactivate"
|
296 |
+
msgstr "Сохранить изменения и деактивировать"
|
297 |
+
|
298 |
+
#: includes/edit/admin.php:105 includes/manage/class-list-table.php:141
|
299 |
+
#: includes/manage/class-list-table.php:266
|
300 |
+
msgid "Export"
|
301 |
+
msgstr "Экспорт"
|
302 |
+
|
303 |
+
#: includes/edit/admin.php:112
|
304 |
+
msgid ""
|
305 |
+
"You are about to permanently delete this snippet.\n"
|
306 |
+
"'Cancel' to stop, 'OK' to delete."
|
307 |
+
msgstr ""
|
308 |
+
"Вы собираетесь удалить этот сниппет.\n"
|
309 |
+
"'Отмена' — прекратить, 'OK' — удалить."
|
310 |
+
|
311 |
+
#: includes/edit/admin.php:117 includes/manage/class-list-table.php:150
|
312 |
+
#: includes/manage/class-list-table.php:267
|
313 |
+
msgid "Delete"
|
314 |
+
msgstr "Удалить"
|
315 |
+
|
316 |
+
#: includes/edit/edit.php:35
|
317 |
+
msgid "Add New"
|
318 |
+
msgstr "Добавить новый"
|
319 |
+
|
320 |
+
#: includes/edit/edit.php:83 includes/manage/manage.php:67
|
321 |
+
msgid "You are not authorized to access this page."
|
322 |
+
msgstr "У вас нет доступа к этой странице."
|
323 |
+
|
324 |
+
#: includes/edit/edit.php:177 includes/manage/class-list-table.php:226
|
325 |
+
msgid "Description"
|
326 |
+
msgstr "Описание"
|
327 |
+
|
328 |
+
#: includes/edit/edit.php:204
|
329 |
+
msgid "Run snippet everywhere"
|
330 |
+
msgstr "Запускать сниппет везде"
|
331 |
+
|
332 |
+
#: includes/edit/edit.php:205
|
333 |
+
msgid "Only run in adminstration area"
|
334 |
+
msgstr "Запускать только в консоли администратора"
|
335 |
+
|
336 |
+
#: includes/edit/edit.php:206
|
337 |
+
msgid "Only run on site front-end"
|
338 |
+
msgstr "Запускать только на фронт-энде сайта"
|
339 |
+
|
340 |
+
#: includes/edit/edit.php:210
|
341 |
+
msgid "Scope"
|
342 |
+
msgstr "Область"
|
343 |
+
|
344 |
+
#: includes/edit/edit.php:231 includes/manage/class-list-table.php:227
|
345 |
+
msgid "Tags"
|
346 |
+
msgstr "Метки"
|
347 |
+
|
348 |
+
#: includes/edit/edit.php:235
|
349 |
+
msgid "Enter a list of tags; separated by commas"
|
350 |
+
msgstr "Введите метки через запятую"
|
351 |
+
|
352 |
+
#: includes/import/admin-help.php:18
|
353 |
+
msgid ""
|
354 |
+
"Snippets are similar to plugins - they both extend and expand the "
|
355 |
+
"functionality of WordPress. Snippets are more light-weight, just a few lines "
|
356 |
+
"of code, and do not put as much load on your server. Here you can load "
|
357 |
+
"snippets from a Code Snippets (.xml) import file into the database with your "
|
358 |
+
"existing snippets."
|
359 |
+
msgstr ""
|
360 |
+
"Сниппеты похожи на плагины — и те и другие расширяют функциональность "
|
361 |
+
"WordPress. Сниппеты меньше, они состоят лишь из нескольких строк кода и не "
|
362 |
+
"сильно нагружают ваш сервер. Здесь вы можете загрузить ваши сниппеты из "
|
363 |
+
"файла экспорта плагина (.xml), чтобы добавить их на ваш сайт."
|
364 |
+
|
365 |
+
#: includes/import/admin-help.php:23
|
366 |
+
msgid "Importing"
|
367 |
+
msgstr "Импорт"
|
368 |
+
|
369 |
+
#: includes/import/admin-help.php:25
|
370 |
+
msgid ""
|
371 |
+
"You can load your snippets from a code snippets (.xml) export file using "
|
372 |
+
"this page."
|
373 |
+
msgstr ""
|
374 |
+
"На этой странице вы можете загрузить свои сниппеты из файла экспорта (.xml)."
|
375 |
+
|
376 |
+
#: includes/import/admin-help.php:26
|
377 |
+
#, php-format
|
378 |
+
msgid ""
|
379 |
+
"Snippets will be added to the database along with your existing snippets. "
|
380 |
+
"Regardless of whether the snippets were active on the previous site, "
|
381 |
+
"imported snippets are always inactive until activated using the <a href=\"%s"
|
382 |
+
"\">Manage Snippets</a> page.</p>"
|
383 |
+
msgstr ""
|
384 |
+
"Сниппеты будут добавлены в вашу базу к уже имеющимся. Независимо от того, "
|
385 |
+
"были ли они активны на предыдущем сайте, импортированные сниппеты всегда "
|
386 |
+
"неактивны, пока их не активировать на странице <a href=\"%s\">Управление "
|
387 |
+
"сниппетами</a>).</p>"
|
388 |
+
|
389 |
+
#: includes/import/admin-help.php:31
|
390 |
+
msgid "Exporting"
|
391 |
+
msgstr "Экспорт"
|
392 |
+
|
393 |
+
#: includes/import/admin-help.php:33
|
394 |
+
#, php-format
|
395 |
+
msgid ""
|
396 |
+
"You can save your snippets to a Code Snippets (.xml) export file using the "
|
397 |
+
"<a href=\"%s\">Manage Snippets</a> page."
|
398 |
+
msgstr ""
|
399 |
+
"Вы можете сохранить свои сниппеты в файл экспорта (.xml) на странице <a href="
|
400 |
+
"\"%s\">Управление сниппетами</a>."
|
401 |
+
|
402 |
+
#: includes/import/admin-messages.php:16
|
403 |
+
#, php-format
|
404 |
+
msgid ""
|
405 |
+
"Successfully imported <strong>%d</strong> snippet. <a href=\"%s\">Have fun!</"
|
406 |
+
"a>"
|
407 |
+
msgid_plural ""
|
408 |
+
"Successfully imported <strong>%d</strong> snippets. <a href=\"%s\">Have fun!"
|
409 |
+
"</a>"
|
410 |
+
msgstr[0] ""
|
411 |
+
"Успешно импортирован <strong>%d</strong> сниппет. <a href=\"%s\">Удачи!</a>"
|
412 |
+
msgstr[1] ""
|
413 |
+
"Успешно импортировано <strong>%d</strong> сниппета. <a href=\"%s\">Удачи!</a>"
|
414 |
+
msgstr[2] ""
|
415 |
+
"Усеешно импортировано <strong>%d</strong> сниппетов. <a href=\"%s\">Удачи!</"
|
416 |
+
"a>"
|
417 |
+
|
418 |
+
#: includes/import/admin-messages.php:30
|
419 |
+
msgid "An error occurred when processing the import file."
|
420 |
+
msgstr "Произошла ошибка при импортировании сниппета."
|
421 |
+
|
422 |
+
#: includes/import/admin.php:18 includes/import/import.php:55
|
423 |
msgid "Import Snippets"
|
424 |
msgstr "Импортирование сниппетов"
|
425 |
|
426 |
+
#: includes/import/admin.php:22
|
427 |
msgid ""
|
428 |
"Howdy! Upload your Code Snippets export file and we’ll import the "
|
429 |
"snippets to this site."
|
430 |
msgstr ""
|
431 |
"Привет! Загрузите файл экспорта, чтобы импортировать сниппеты на этот сайт."
|
432 |
|
433 |
+
#: includes/import/admin.php:24
|
434 |
#, php-format
|
435 |
msgid ""
|
436 |
"You will need to go to the <a href=\"%s\">Manage Snippets</a> page to "
|
437 |
"activate the imported snippets."
|
438 |
msgstr ""
|
439 |
+
"Чтобы активировать импортированные сниппеты, потребуется зайти в <a href=\"%s"
|
440 |
+
"\">Управление сниппетами</a>, "
|
441 |
|
442 |
+
#: includes/import/admin.php:26
|
443 |
msgid ""
|
444 |
"Choose a Code Snippets (.xml) file to upload, then click Upload file and "
|
445 |
"import."
|
446 |
msgstr ""
|
447 |
+
"Выберите файл экспорта (.xml), а затем нажмите \"Загрузить файл и "
|
448 |
"импортировать\"."
|
449 |
|
450 |
+
#: includes/import/admin.php:33
|
451 |
msgid "Choose a file from your computer:"
|
452 |
msgstr "Выберите файл на вашем компьютере:"
|
453 |
|
454 |
+
#: includes/import/admin.php:34
|
455 |
msgid "(Maximum size: 8MB)"
|
456 |
+
msgstr "(Максимальный размер: 8МБ)"
|
457 |
|
458 |
+
#: includes/import/admin.php:40
|
459 |
msgid "Upload file and import"
|
460 |
msgstr "Загрузить файл и импортировать"
|
461 |
|
462 |
+
#: includes/import/import.php:34
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
463 |
msgid "Code Snippets"
|
464 |
msgstr "Code Snippets"
|
465 |
|
466 |
+
#: includes/import/import.php:35
|
467 |
+
msgid "Import snippets from a code snippets export file"
|
468 |
msgstr "Импортировать сниппеты из файла экспорта плагина \"Code Snippets\"."
|
469 |
|
470 |
+
#: includes/import/import.php:56
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
471 |
msgid "Import"
|
472 |
msgstr "Импорт"
|
473 |
|
474 |
+
#: includes/import/import.php:92
|
475 |
+
msgid "You are not access this page."
|
476 |
+
msgstr "У вас нет доступа к этой странице."
|
477 |
|
478 |
+
#: includes/manage/admin-help.php:17
|
479 |
+
msgid ""
|
480 |
+
"Snippets are similar to plugins - they both extend and expand the "
|
481 |
+
"functionality of WordPress. Snippets are more light-weight, just a few lines "
|
482 |
+
"of code, and do not put as much load on your server. Here you can manage "
|
483 |
+
"your existing snippets and preform tasks on them such as activating, "
|
484 |
+
"deactivating, deleting and exporting."
|
485 |
+
msgstr ""
|
486 |
+
"Сниппеты похожи на плагины — и те и другие расширяют функциональность "
|
487 |
+
"WordPress. Сниппеты меньше, они состоят лишь из нескольких строк кода и не "
|
488 |
+
"сильно нагружают ваш сервер. Отсюда вы можете управлять вашими сниппетами "
|
489 |
+
"(добавлять, редактировать, активировать и деактивировать)."
|
490 |
|
491 |
+
#: includes/manage/admin-help.php:22
|
492 |
+
msgid "Safe Mode"
|
493 |
+
msgstr "Безопасный режим"
|
494 |
|
495 |
+
#: includes/manage/admin-help.php:24
|
496 |
+
msgid ""
|
497 |
+
"Be sure to check your snippets for errors before you activate them, as a "
|
498 |
+
"faulty snippet could bring your whole blog down. If your site starts doing "
|
499 |
+
"strange things, deactivate all your snippets and activate them one at a time."
|
500 |
+
msgstr ""
|
501 |
+
"Прежде чем активировать сниппеты, убедитесь, что они не содержат ошибок. "
|
502 |
+
"Некорректные сниппеты могут положить вам сайт! Если ваш сайт начинает вести "
|
503 |
+
"себя странно, отключите все сниппеты и включайте их по одному."
|
504 |
|
505 |
+
#: includes/manage/admin-help.php:25
|
506 |
+
msgid ""
|
507 |
+
"If something goes wrong with a snippet and you can't use WordPress, you can "
|
508 |
+
"cause all snippets to stop executing by adding "
|
509 |
+
"<code>define('CODE_SNIPPETS_SAFE_MODE', true);</code> to your <code>wp-"
|
510 |
+
"config.php</code> file. After you have deactivated the offending snippet, "
|
511 |
+
"you can turn off safe mode by removing this line or replacing <strong>true</"
|
512 |
+
"strong> with <strong>false</strong>."
|
513 |
+
msgstr ""
|
514 |
+
"На случай любых проблем со сниппетом, приводящим к сбою WordPress, можно "
|
515 |
+
"отключить все сниппеты, добавив строчку "
|
516 |
+
"<code>define('CODE_SNIPPETS_SAFE_MODE', true);</code> в ваш файл "
|
517 |
+
"конфигурации <code>wp-config.php</code> . Отключив виновный сниппет, можно "
|
518 |
+
"отключить безопасный режим, удалив указанную строчку или "
|
519 |
+
"поменяв<strong>true</strong> на <strong>false</strong>."
|
520 |
+
|
521 |
+
#: includes/manage/admin-help.php:30
|
522 |
+
msgid "Uninstall"
|
523 |
+
msgstr "Удаление"
|
524 |
|
525 |
+
#: includes/manage/admin-help.php:32
|
526 |
+
#, php-format
|
527 |
+
msgid ""
|
528 |
+
"When you delete Code Snippets through the Plugins menu in WordPress it will "
|
529 |
+
"clear up the <code>%1$s</code> table and a few other bits of data stored in "
|
530 |
+
"the database. If you want to keep this data (ie: you are only temporally "
|
531 |
+
"uninstalling Code Snippets) then remove the <code>%2$s</code> folder using "
|
532 |
+
"FTP."
|
533 |
+
msgstr ""
|
534 |
+
"При удалении плагина через меню \"Плагины\" консоли таблица <code>%1$s</"
|
535 |
+
"code> в базе данных и кое-какие еще следы в базе данных будут удалены. Если "
|
536 |
+
"вы хотите сохранить настройки (сниппеты) плагина, то удаляйте плагин (<code>"
|
537 |
+
"%2$s</code>) через FTP, а не через консоль."
|
538 |
|
539 |
+
#: includes/manage/admin-help.php:33
|
540 |
+
msgid ""
|
541 |
+
"Even if you're sure that you don't want to use Code Snippets ever again on "
|
542 |
+
"this WordPress installation, you may want to use the export feature to back "
|
543 |
+
"up your snippets."
|
544 |
+
msgstr ""
|
545 |
+
"Даже если вы уверены, что никогда больше не будете использовать данный "
|
546 |
+
"плагин на этом сайте, на всякий случай сделайте экспорт всех сниппетов."
|
547 |
|
548 |
+
#: includes/manage/admin-help.php:38
|
549 |
+
msgid ""
|
550 |
+
"<a href=\"http://wordpress.org/plugins/code-snippets\" target=\"_blank"
|
551 |
+
"\">WordPress Extend</a></p>"
|
552 |
+
msgstr ""
|
553 |
+
"<a href=\"http://wordpress.org/plugins/code-snippets\" target=\"_blank"
|
554 |
+
"\">Страница плагина</a></p>"
|
555 |
|
556 |
+
#: includes/manage/admin-messages.php:14
|
557 |
msgid ""
|
558 |
+
"<strong>Warning:</strong> Safe mode is active and snippets will not execute! "
|
559 |
+
"Remove the <code>CODE_SNIPPETS_SAFE_MODE</code> constant from <code>wp-"
|
560 |
+
"config.php</code> to turn off safe mode. <a href=\"https://github.com/"
|
561 |
+
"sheabunge/code-snippets/wiki/Safe-Mode\" target=\"_blank\">Help</a>"
|
562 |
msgstr ""
|
563 |
+
"<strong>Внимание:</strong> включен безопасный режим, и сниппеты не будут "
|
564 |
+
"выполняются! Удалите константу <code>CODE_SNIPPETS_SAFE_MODE</code> из файла "
|
565 |
+
"<code>wp-config.php</code>, чтобы выключить безопасный режим. <a href="
|
566 |
+
"\"https://github.com/sheabunge/code-snippets/wiki/Safe-Mode\" target=\"_blank"
|
567 |
+
"\">Помощь</a>"
|
568 |
|
569 |
+
#: includes/manage/admin-messages.php:20
|
570 |
+
msgid "Snippet <strong>activated</strong>."
|
571 |
+
msgstr "Сниппет <strong>активирован</strong>."
|
572 |
+
|
573 |
+
#: includes/manage/admin-messages.php:24
|
574 |
+
msgid "Selected snippets <strong>activated</strong>."
|
575 |
+
msgstr "Выбранные сниппеты <strong>активированы</strong>."
|
576 |
+
|
577 |
+
#: includes/manage/admin-messages.php:28
|
578 |
+
msgid "Snippet <strong>deactivated</strong>."
|
579 |
+
msgstr "Сниппет <strong>деактивирован</strong>."
|
580 |
+
|
581 |
+
#: includes/manage/admin-messages.php:32
|
582 |
+
msgid "Selected snippets <strong>deactivated</strong>."
|
583 |
+
msgstr "Выбранные сниппеты <strong>деактивированы</strong>."
|
584 |
+
|
585 |
+
#: includes/manage/admin-messages.php:36
|
586 |
+
msgid "Snippet <strong>deleted</strong>."
|
587 |
+
msgstr "Сниппет <strong>удален</strong>."
|
588 |
+
|
589 |
+
#: includes/manage/admin-messages.php:40
|
590 |
+
msgid "Selected snippets <strong>deleted</strong>."
|
591 |
+
msgstr "Выбранные сниппеты <strong>удалены</strong>."
|
592 |
|
593 |
+
#: includes/manage/admin.php:36
|
594 |
+
msgid "Search Installed Snippets"
|
595 |
+
msgstr "Искать установленные сниппеты"
|
596 |
+
|
597 |
+
#: includes/manage/class-list-table.php:53
|
598 |
msgid "Snippets per page"
|
599 |
+
msgstr "Сниппетов на странице"
|
600 |
|
601 |
+
#: includes/manage/class-list-table.php:116
|
602 |
+
#: includes/manage/class-list-table.php:265
|
603 |
msgid "Network Deactivate"
|
604 |
msgstr "Деактивировать в сети"
|
605 |
|
606 |
+
#: includes/manage/class-list-table.php:116
|
607 |
+
#: includes/manage/class-list-table.php:265
|
608 |
msgid "Deactivate"
|
609 |
msgstr "Деактивировать"
|
610 |
|
611 |
+
#: includes/manage/class-list-table.php:125
|
612 |
+
#: includes/manage/class-list-table.php:264
|
613 |
msgid "Network Activate"
|
614 |
msgstr "Активировать в сети"
|
615 |
|
616 |
+
#: includes/manage/class-list-table.php:125
|
617 |
+
#: includes/manage/class-list-table.php:264
|
618 |
msgid "Activate"
|
619 |
msgstr "Активировать"
|
620 |
|
621 |
+
#: includes/manage/class-list-table.php:135
|
622 |
+
msgid "Edit"
|
623 |
+
msgstr "Изменить"
|
624 |
+
|
625 |
+
#: includes/manage/class-list-table.php:157
|
626 |
+
msgid ""
|
627 |
+
"You are about to permanently delete the selected item.\n"
|
628 |
+
"\t\t\t\t'Cancel' to stop, 'OK' to delete."
|
629 |
+
msgstr ""
|
630 |
+
"Вы действительно хотите удалить выбранный сниппет?\n"
|
631 |
+
"\t\t\t\t'Отмена' — прекратить, 'OK' — удалить."
|
632 |
+
|
633 |
+
#: includes/manage/class-list-table.php:165
|
634 |
#, php-format
|
635 |
msgid "Untitled #%d"
|
636 |
+
msgstr "Без названия #%d"
|
637 |
|
638 |
+
#: includes/manage/class-list-table.php:224
|
639 |
msgid "Name"
|
640 |
+
msgstr "Название"
|
641 |
|
642 |
+
#: includes/manage/class-list-table.php:225
|
643 |
msgid "ID"
|
644 |
msgstr "ID"
|
645 |
|
646 |
+
#: includes/manage/class-list-table.php:268
|
647 |
msgid "Export to PHP"
|
648 |
msgstr "Экспорт в PHP"
|
649 |
|
650 |
+
#: includes/manage/class-list-table.php:305
|
651 |
#, php-format
|
652 |
msgid "All <span class=\"count\">(%s)</span>"
|
653 |
msgid_plural "All <span class=\"count\">(%s)</span>"
|
655 |
msgstr[1] "Все <span class=\"count\">(%s)</span>"
|
656 |
msgstr[2] "Все <span class=\"count\">(%s)</span>"
|
657 |
|
658 |
+
#: includes/manage/class-list-table.php:308
|
659 |
#, php-format
|
660 |
msgid "Active <span class=\"count\">(%s)</span>"
|
661 |
msgid_plural "Active <span class=\"count\">(%s)</span>"
|
662 |
+
msgstr[0] "Активный <span class=\"count\">(%s)</span>"
|
663 |
msgstr[1] "Активные <span class=\"count\">(%s)</span>"
|
664 |
msgstr[2] "Активные <span class=\"count\">(%s)</span>"
|
665 |
|
666 |
+
#: includes/manage/class-list-table.php:311
|
667 |
#, php-format
|
668 |
msgid "Recently Active <span class=\"count\">(%s)</span>"
|
669 |
msgid_plural "Recently Active <span class=\"count\">(%s)</span>"
|
670 |
+
msgstr[0] "Недавно активный <span class=\"count\">(%s)</span>"
|
671 |
msgstr[1] "Недавно активные <span class=\"count\">(%s)</span>"
|
672 |
msgstr[2] "Недавно активные <span class=\"count\">(%s)</span>"
|
673 |
|
674 |
+
#: includes/manage/class-list-table.php:314
|
675 |
#, php-format
|
676 |
msgid "Inactive <span class=\"count\">(%s)</span>"
|
677 |
msgid_plural "Inactive <span class=\"count\">(%s)</span>"
|
678 |
+
msgstr[0] "Неактивный <span class=\"count\">(%s)</span>"
|
679 |
msgstr[1] "Неактивные <span class=\"count\">(%s)</span>"
|
680 |
msgstr[2] "Неактивные <span class=\"count\">(%s)</span>"
|
681 |
|
682 |
+
#: includes/manage/class-list-table.php:317
|
683 |
+
#, php-format
|
684 |
+
msgid "Admin <span class=\"count\">(%s)</span>"
|
685 |
+
msgid_plural "Admin <span class=\"count\">(%s)</span>"
|
686 |
+
msgstr[0] "В консоли <span class=\"count\">(%s)</span>"
|
687 |
+
msgstr[1] "В консоли <span class=\"count\">(%s)</span>"
|
688 |
+
msgstr[2] "В консоли <span class=\"count\">(%s)</span>"
|
689 |
+
|
690 |
+
#: includes/manage/class-list-table.php:320
|
691 |
+
#, php-format
|
692 |
+
msgid "Front End <span class=\"count\">(%s)</span>"
|
693 |
+
msgid_plural "Front End <span class=\"count\">(%s)</span>"
|
694 |
+
msgstr[0] "На сайте <span class=\"count\">(%s)</span>"
|
695 |
+
msgstr[1] "На сайте <span class=\"count\">(%s)</span>"
|
696 |
+
msgstr[2] "На сайте <span class=\"count\">(%s)</span>"
|
697 |
+
|
698 |
+
#: includes/manage/class-list-table.php:380
|
699 |
+
msgid "Show all tags"
|
700 |
+
msgstr "Показать все метки"
|
701 |
+
|
702 |
+
#: includes/manage/class-list-table.php:394
|
703 |
msgid "Filter"
|
704 |
msgstr "Фильтр"
|
705 |
|
706 |
+
#: includes/manage/class-list-table.php:402
|
707 |
msgid "Clear List"
|
708 |
+
msgstr "Очистить список"
|
709 |
|
710 |
+
#: includes/manage/class-list-table.php:551
|
711 |
#, php-format
|
712 |
msgid ""
|
713 |
"You do not appear to have any snippets available at this time. <a href=\"%s"
|
714 |
"\">Add New→</a>"
|
715 |
msgstr "Нет доступных сниппетов. <a href=\"%s\">Добавить новый→</a>"
|
716 |
|
717 |
+
#: includes/manage/class-list-table.php:783
|
718 |
msgid "Search results"
|
719 |
msgstr "Результаты поиска"
|
720 |
|
721 |
+
#: includes/manage/class-list-table.php:786
|
722 |
#, php-format
|
723 |
msgid " for “%s”"
|
724 |
msgstr " по запросу “%s”"
|
725 |
|
726 |
+
#: includes/manage/class-list-table.php:790
|
727 |
+
#, php-format
|
728 |
+
msgid " in tag “%s”"
|
729 |
+
msgstr " в метке “%s”"
|
730 |
+
|
731 |
+
#: includes/manage/class-list-table.php:796
|
732 |
msgid "Clear Filters"
|
733 |
msgstr "Очистить фильтры"
|
734 |
|
735 |
+
#: includes/settings/admin.php:20
|
736 |
+
msgid "Snippets Settings"
|
737 |
+
msgstr "Настройки сниппетов"
|
738 |
+
|
739 |
+
#: includes/settings/admin.php:21 includes/settings/admin.php:39
|
740 |
+
msgid "Settings"
|
741 |
+
msgstr "Настройки"
|
742 |
+
|
743 |
+
#: includes/settings/class-settings.php:51
|
744 |
+
msgid "Activate by Default"
|
745 |
+
msgstr "Включать по умолчанию"
|
746 |
+
|
747 |
+
#: includes/settings/class-settings.php:53
|
748 |
+
msgid ""
|
749 |
+
"Make the 'Save and Activate' button the default action when saving a snippet."
|
750 |
+
msgstr ""
|
751 |
+
"Сделать кнопку 'Сохранить и активировать' действием по умолчанию при "
|
752 |
+
"сохранении сниппета"
|
753 |
+
|
754 |
+
#: includes/settings/class-settings.php:59
|
755 |
+
msgid "Enable Scope Selector"
|
756 |
+
msgstr "Включить селектор области"
|
757 |
+
|
758 |
+
#: includes/settings/class-settings.php:61
|
759 |
+
msgid "Enable the scope selector when editing a snippet"
|
760 |
+
msgstr "Включить селектор области применения при редактировании сниппета"
|
761 |
+
|
762 |
+
#: includes/settings/class-settings.php:71
|
763 |
+
msgid "Row Height"
|
764 |
+
msgstr "Высота в строках"
|
765 |
+
|
766 |
+
#: includes/settings/class-settings.php:73
|
767 |
+
msgid "rows"
|
768 |
+
msgstr "строк"
|
769 |
+
|
770 |
+
#: includes/settings/class-settings.php:80
|
771 |
+
msgid "Use Full Editor"
|
772 |
+
msgstr "Использовать расширенный редактор"
|
773 |
+
|
774 |
+
#: includes/settings/class-settings.php:82
|
775 |
+
msgid "Enable all features of the visual editor"
|
776 |
+
msgstr "Включить все функции визуального редактора"
|
777 |
+
|
778 |
+
#: includes/settings/class-settings.php:88
|
779 |
+
msgid "Media Buttons"
|
780 |
+
msgstr "Кнопки медиа"
|
781 |
+
|
782 |
+
#: includes/settings/class-settings.php:90
|
783 |
+
msgid "Enable the add media buttons"
|
784 |
+
msgstr "Включить кнопки добавления медиафайла"
|
785 |
+
|
786 |
+
#: includes/settings/class-settings.php:100
|
787 |
+
msgid "Theme"
|
788 |
+
msgstr "Тема"
|
789 |
+
|
790 |
+
#: includes/settings/class-settings.php:108
|
791 |
+
msgid "Indent With Tabs"
|
792 |
+
msgstr "Сдвигать табуляторами"
|
793 |
+
|
794 |
+
#: includes/settings/class-settings.php:110
|
795 |
+
msgid "Use hard tabs (not spaces) for indentation."
|
796 |
+
msgstr "Использовать жесткие табуляторы (не пробелы) для сдвига"
|
797 |
+
|
798 |
+
#: includes/settings/class-settings.php:117
|
799 |
+
msgid "Tab Size"
|
800 |
+
msgstr "Размер табулятора"
|
801 |
+
|
802 |
+
#: includes/settings/class-settings.php:119
|
803 |
+
msgid "The width of a tab character."
|
804 |
+
msgstr "Ширина символа табуляции"
|
805 |
+
|
806 |
+
#: includes/settings/class-settings.php:127
|
807 |
+
msgid "Indent Unit"
|
808 |
+
msgstr "Шаг сдвига"
|
809 |
+
|
810 |
+
#: includes/settings/class-settings.php:129
|
811 |
+
msgid "How many spaces a block should be indented."
|
812 |
+
msgstr "На сколько пробелов сдвигать блок"
|
813 |
+
|
814 |
+
#: includes/settings/class-settings.php:137
|
815 |
+
msgid "Wrap Lines"
|
816 |
+
msgstr "Переносить строки"
|
817 |
+
|
818 |
+
#: includes/settings/class-settings.php:139
|
819 |
+
msgid "Whether the editor should scroll or wrap for long lines."
|
820 |
+
msgstr "Прокручивать или переносить длинные строки в редакторе"
|
821 |
+
|
822 |
+
#: includes/settings/class-settings.php:146
|
823 |
+
msgid "Line Numbers"
|
824 |
+
msgstr "Номера строк"
|
825 |
+
|
826 |
+
#: includes/settings/class-settings.php:148
|
827 |
+
msgid "Show line numbers to the left of the editor."
|
828 |
+
msgstr "Показывать номера строк в редакторе слева"
|
829 |
+
|
830 |
+
#: includes/settings/class-settings.php:155
|
831 |
+
msgid "Auto Close Brackets"
|
832 |
+
msgstr "Автоматически закрывать скобки"
|
833 |
+
|
834 |
+
#: includes/settings/class-settings.php:157
|
835 |
+
msgid "Auto-close brackets and quotes when typed."
|
836 |
+
msgstr "Автоматически закрывать скобки и кавычки при наборе"
|
837 |
+
|
838 |
+
#: includes/settings/class-settings.php:164
|
839 |
+
msgid "Highlight Selection Matches"
|
840 |
+
msgstr "Выделять совпадения"
|
841 |
+
|
842 |
+
#: includes/settings/class-settings.php:165
|
843 |
+
msgid "Highlight all instances of a currently selected word."
|
844 |
+
msgstr "Выделять все вхождения выбранного слова"
|
845 |
+
|
846 |
+
#: includes/settings/settings.php:84
|
847 |
+
msgid "General"
|
848 |
+
msgstr "Основные"
|
849 |
+
|
850 |
+
#: includes/settings/settings.php:85
|
851 |
+
msgid "Description Editor"
|
852 |
+
msgstr "Редактор описания"
|
853 |
+
|
854 |
+
#: includes/settings/settings.php:86
|
855 |
+
msgid "Code Editor"
|
856 |
+
msgstr "Редактор кода"
|
857 |
+
|
858 |
+
#: includes/settings/settings.php:134
|
859 |
+
msgid "Editor Preview"
|
860 |
+
msgstr "Предварительный просмотр в редакторе"
|
861 |
+
|
862 |
+
#: includes/settings/settings.php:180
|
863 |
+
msgid "Settings saved."
|
864 |
+
msgstr "Настройки сохранены."
|
865 |
+
|
866 |
+
#~ msgid "Вы действительно хотите удалить выбранный сниппет?"
|
867 |
+
#~ msgstr "Вы действительно хотите удалить выбранный сниппет?"
|
868 |
|
869 |
#, fuzzy
|
870 |
#~ msgid "Все <span class=\"count\">(%s)</span>"
|
languages/code-snippets.pot
CHANGED
@@ -6,9 +6,9 @@
|
|
6 |
#, fuzzy
|
7 |
msgid ""
|
8 |
msgstr ""
|
9 |
-
"Project-Id-Version: code-snippets 2.
|
10 |
"Report-Msgid-Bugs-To: \n"
|
11 |
-
"POT-Creation-Date: 2015-
|
12 |
"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
|
13 |
"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
|
14 |
"Language-Team: LANGUAGE <LL@li.org>\n"
|
@@ -16,387 +16,407 @@ msgstr ""
|
|
16 |
"MIME-Version: 1.0\n"
|
17 |
"Content-Type: text/plain; charset=CHARSET\n"
|
18 |
"Content-Transfer-Encoding: 8bit\n"
|
|
|
19 |
|
20 |
-
#: includes/admin
|
21 |
-
|
22 |
-
#: includes/manage/manage.php:33
|
23 |
-
msgid "Snippets"
|
24 |
msgstr ""
|
25 |
|
26 |
-
#: includes/admin.php:
|
27 |
-
|
|
|
28 |
msgstr ""
|
29 |
|
30 |
-
#: includes/admin
|
31 |
-
msgid "
|
32 |
msgstr ""
|
33 |
|
34 |
-
#: includes/admin.php:
|
35 |
-
msgid "
|
36 |
msgstr ""
|
37 |
|
38 |
-
#: includes/admin.php:
|
39 |
-
|
|
|
40 |
msgstr ""
|
41 |
|
42 |
-
#: includes/admin.php:
|
43 |
-
|
|
|
44 |
msgstr ""
|
45 |
|
46 |
-
#: includes/admin.php:
|
47 |
-
msgid "
|
48 |
msgstr ""
|
49 |
|
50 |
-
#: includes/admin.php:
|
51 |
-
msgid "
|
52 |
msgstr ""
|
53 |
|
54 |
-
#: includes/admin.php:
|
55 |
-
msgid "
|
56 |
msgstr ""
|
57 |
|
58 |
-
#: includes/admin.php:
|
59 |
-
msgid ""
|
60 |
-
"<strong>Have feedback on Code Snippets?</strong> Please take the time to "
|
61 |
-
"answer a short survey on how you use this plugin and what you'd like to see "
|
62 |
-
"changed or added in the future."
|
63 |
msgstr ""
|
64 |
|
65 |
-
#: includes/admin.php:
|
66 |
-
msgid "
|
67 |
msgstr ""
|
68 |
|
69 |
-
#: includes/class-
|
70 |
-
msgid ""
|
71 |
-
"This is a code snippets export file generated by the Code Snippets WordPress "
|
72 |
-
"plugin."
|
73 |
msgstr ""
|
74 |
|
75 |
-
#: includes/class-
|
76 |
-
msgid "
|
77 |
msgstr ""
|
78 |
|
79 |
-
#: includes/class-
|
80 |
-
msgid "
|
81 |
msgstr ""
|
82 |
|
83 |
-
#: includes/class-
|
84 |
-
msgid "
|
85 |
msgstr ""
|
86 |
|
87 |
-
#: includes/class-
|
88 |
-
msgid ""
|
89 |
-
"2. Install the Code Snippets plugin using the directions provided at the "
|
90 |
-
"above link."
|
91 |
msgstr ""
|
92 |
|
93 |
-
#: includes/class-
|
94 |
-
msgid "
|
95 |
msgstr ""
|
96 |
|
97 |
-
#: includes/class-
|
98 |
-
msgid "
|
99 |
msgstr ""
|
100 |
|
101 |
-
#: includes/class-
|
102 |
-
msgid "
|
103 |
msgstr ""
|
104 |
|
105 |
-
#: includes/class-
|
106 |
-
msgid ""
|
107 |
-
"6. Code Snippets will then import all of the snippets and associated "
|
108 |
-
"information contained in this file into your site."
|
109 |
msgstr ""
|
110 |
|
111 |
-
#: includes/class-
|
112 |
-
msgid ""
|
113 |
-
"7. You will then have to visit the 'Snippets: Manage' admin menu and "
|
114 |
-
"activate desired snippets."
|
115 |
msgstr ""
|
116 |
|
117 |
-
#: includes/
|
118 |
-
|
119 |
-
msgid "Overview"
|
120 |
msgstr ""
|
121 |
|
122 |
-
#: includes/
|
|
|
|
|
|
|
|
|
|
|
123 |
msgid ""
|
124 |
-
"
|
125 |
-
"
|
126 |
-
|
127 |
-
"
|
|
|
|
|
|
|
|
|
|
|
|
|
128 |
msgstr ""
|
129 |
|
130 |
-
#: includes/
|
131 |
-
msgid "
|
132 |
msgstr ""
|
133 |
|
134 |
-
#: includes/
|
135 |
-
|
136 |
-
|
137 |
-
|
138 |
-
"
|
139 |
-
"\t\t\t<li><a href=\"http://wp-snippets.com\" title=\"WordPress Snippets\">WP-"
|
140 |
-
"Snippets</a></li>\n"
|
141 |
-
"\t\t\t<li><a href=\"http://wpsnipp.com\" title=\"WP Snipp\">WP Snipp</a></"
|
142 |
-
"li>\n"
|
143 |
-
"\t\t\t<li><a href=\"http://www.catswhocode.com/blog/snippets\" title=\"Cats "
|
144 |
-
"Who Code Snippet Library\">Cats Who Code</a></li>\n"
|
145 |
-
"\t\t\t<li><a href=\"http://www.wpfunction.me\">WP Function Me</a></li>\n"
|
146 |
-
"\t\t</ul>"
|
147 |
msgstr ""
|
148 |
|
149 |
-
#: includes/
|
150 |
msgid ""
|
151 |
-
"
|
152 |
-
"
|
153 |
-
"
|
|
|
154 |
msgstr ""
|
155 |
|
156 |
-
#: includes/
|
157 |
-
msgid "
|
158 |
msgstr ""
|
159 |
|
160 |
-
#: includes/
|
161 |
-
msgid ""
|
162 |
-
"You need to fill out the name and code fields for your snippet to be added. "
|
163 |
-
"While the description field will add more information about how your snippet "
|
164 |
-
"works, what is does and where you found it, it is completely optional."
|
165 |
msgstr ""
|
166 |
|
167 |
-
#: includes/
|
168 |
-
msgid ""
|
169 |
-
"Please be sure to check that your snippet is valid PHP code and will not "
|
170 |
-
"produce errors before adding it through this page. While doing so will not "
|
171 |
-
"become active straight away, it will help to minimise the chance of a faulty "
|
172 |
-
"snippet becoming active on your site."
|
173 |
msgstr ""
|
174 |
|
175 |
-
#: includes/
|
176 |
-
|
177 |
-
msgid "For more information:"
|
178 |
msgstr ""
|
179 |
|
180 |
-
#: includes/
|
181 |
-
msgid ""
|
182 |
-
"<a href=\"http://wordpress.org/plugins/code-snippets\" target=\"_blank"
|
183 |
-
"\">WordPress Extend</a>"
|
184 |
msgstr ""
|
185 |
|
186 |
-
#: includes/
|
187 |
-
|
188 |
-
msgid ""
|
189 |
-
"<a href=\"http://wordpress.org/support/plugin/code-snippets\" target=\"_blank"
|
190 |
-
"\">Support Forums</a>"
|
191 |
msgstr ""
|
192 |
|
193 |
-
#: includes/
|
194 |
-
#: includes/
|
195 |
-
msgid ""
|
196 |
-
"<a href=\"http://bungeshea.com/plugins/code-snippets/\" target=\"_blank"
|
197 |
-
"\">Project Website</a>"
|
198 |
msgstr ""
|
199 |
|
200 |
-
#: includes/
|
201 |
-
msgid "
|
202 |
msgstr ""
|
203 |
|
204 |
-
#: includes/
|
205 |
-
msgid "
|
206 |
msgstr ""
|
207 |
|
208 |
-
#: includes/
|
209 |
-
msgid "
|
210 |
msgstr ""
|
211 |
|
212 |
-
#: includes/
|
213 |
-
msgid "
|
214 |
msgstr ""
|
215 |
|
216 |
-
#: includes/
|
217 |
-
msgid "
|
218 |
msgstr ""
|
219 |
|
220 |
-
#: includes/
|
221 |
-
msgid "
|
222 |
msgstr ""
|
223 |
|
224 |
-
#: includes/
|
225 |
-
|
226 |
-
msgid "Edit Snippet"
|
227 |
msgstr ""
|
228 |
|
229 |
-
#: includes/
|
230 |
-
|
231 |
-
msgid "Add New"
|
232 |
msgstr ""
|
233 |
|
234 |
-
#: includes/
|
235 |
-
msgid "
|
|
|
|
|
|
|
236 |
msgstr ""
|
237 |
|
238 |
-
#: includes/
|
239 |
-
msgid "
|
240 |
msgstr ""
|
241 |
|
242 |
-
#: includes/
|
243 |
-
msgid "
|
|
|
|
|
244 |
msgstr ""
|
245 |
|
246 |
-
#: includes/
|
247 |
-
msgid "
|
248 |
msgstr ""
|
249 |
|
250 |
-
#: includes/
|
251 |
-
msgid "
|
252 |
msgstr ""
|
253 |
|
254 |
-
#: includes/
|
255 |
-
|
256 |
-
|
|
|
257 |
msgstr ""
|
258 |
|
259 |
-
#: includes/
|
260 |
-
msgid ""
|
261 |
-
"You are about to permanently delete this snippet.\n"
|
262 |
-
"'Cancel' to stop, 'OK' to delete."
|
263 |
msgstr ""
|
264 |
|
265 |
-
#: includes/
|
266 |
-
|
267 |
-
msgid "Delete"
|
268 |
msgstr ""
|
269 |
|
270 |
-
#: includes/
|
271 |
-
msgid "
|
272 |
msgstr ""
|
273 |
|
274 |
-
#: includes/
|
275 |
-
msgid "
|
|
|
|
|
276 |
msgstr ""
|
277 |
|
278 |
-
#: includes/
|
279 |
-
msgid "
|
|
|
|
|
280 |
msgstr ""
|
281 |
|
282 |
-
#: includes/
|
283 |
-
msgid "
|
284 |
msgstr ""
|
285 |
|
286 |
-
#: includes/
|
287 |
-
msgid "
|
288 |
msgstr ""
|
289 |
|
290 |
-
#: includes/
|
291 |
-
|
|
|
292 |
msgstr ""
|
293 |
|
294 |
-
#: includes/
|
295 |
-
msgid "
|
296 |
msgstr ""
|
297 |
|
298 |
-
#: includes/
|
299 |
-
|
300 |
-
|
301 |
-
"functionality of WordPress. Snippets are more light-weight, just a few lines "
|
302 |
-
"of code, and do not put as much load on your server. Here you can load "
|
303 |
-
"snippets from a Code Snippets (.xml) import file into the database with your "
|
304 |
-
"existing snippets."
|
305 |
msgstr ""
|
306 |
|
307 |
-
#: includes/
|
308 |
-
msgid "
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
309 |
msgstr ""
|
310 |
|
311 |
-
#: includes/
|
312 |
msgid ""
|
313 |
-
"You
|
314 |
-
"
|
315 |
msgstr ""
|
316 |
|
317 |
-
#: includes/
|
318 |
#, php-format
|
319 |
-
msgid ""
|
320 |
-
"Snippets will be added to the database along with your existing snippets. "
|
321 |
-
"Regardless of whether the snippets were active on the previous site, "
|
322 |
-
"imported snippets are always inactive until activated using the <a href=\"%s"
|
323 |
-
"\">Manage Snippets</a> page.</p>"
|
324 |
msgstr ""
|
325 |
|
326 |
-
#: includes/
|
327 |
-
msgid "
|
328 |
msgstr ""
|
329 |
|
330 |
-
#: includes/
|
331 |
-
|
332 |
-
msgid ""
|
333 |
-
"You can save your snippets to a Code Snippets (.xml) export file using the "
|
334 |
-
"<a href=\"%s\">Manage Snippets</a> page."
|
335 |
msgstr ""
|
336 |
|
337 |
-
#: includes/
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
338 |
#, php-format
|
339 |
-
msgid ""
|
340 |
-
"
|
341 |
-
"
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
342 |
msgstr ""
|
343 |
|
344 |
-
#: includes/
|
345 |
-
msgid "
|
346 |
msgstr ""
|
347 |
|
348 |
-
#: includes/
|
349 |
-
msgid "
|
350 |
msgstr ""
|
351 |
|
352 |
-
#: includes/
|
|
|
353 |
msgid ""
|
354 |
-
"
|
355 |
-
"
|
356 |
msgstr ""
|
357 |
|
358 |
-
#: includes/
|
|
|
|
|
|
|
|
|
359 |
#, php-format
|
360 |
-
msgid ""
|
361 |
-
"You will need to go to the <a href=\"%s\">Manage Snippets</a> page to "
|
362 |
-
"activate the imported snippets."
|
363 |
msgstr ""
|
364 |
|
365 |
-
#: includes/
|
366 |
-
|
367 |
-
"
|
368 |
-
"import."
|
369 |
msgstr ""
|
370 |
|
371 |
-
#: includes/
|
372 |
-
msgid "
|
373 |
msgstr ""
|
374 |
|
375 |
-
#: includes/
|
376 |
-
msgid "
|
377 |
msgstr ""
|
378 |
|
379 |
-
#: includes/
|
380 |
-
msgid "
|
381 |
msgstr ""
|
382 |
|
383 |
-
#: includes/
|
384 |
-
msgid "
|
385 |
msgstr ""
|
386 |
|
387 |
-
#: includes/
|
388 |
-
msgid "
|
389 |
msgstr ""
|
390 |
|
391 |
-
#: includes/
|
392 |
-
msgid "
|
393 |
msgstr ""
|
394 |
|
395 |
-
#: includes/
|
396 |
-
|
|
|
397 |
msgstr ""
|
398 |
|
399 |
-
#: includes/
|
400 |
msgid ""
|
401 |
"Snippets are similar to plugins - they both extend and expand the "
|
402 |
"functionality of WordPress. Snippets are more light-weight, just a few lines "
|
@@ -405,18 +425,18 @@ msgid ""
|
|
405 |
"deactivating, deleting and exporting."
|
406 |
msgstr ""
|
407 |
|
408 |
-
#: includes/
|
409 |
msgid "Safe Mode"
|
410 |
msgstr ""
|
411 |
|
412 |
-
#: includes/
|
413 |
msgid ""
|
414 |
"Be sure to check your snippets for errors before you activate them, as a "
|
415 |
"faulty snippet could bring your whole blog down. If your site starts doing "
|
416 |
"strange things, deactivate all your snippets and activate them one at a time."
|
417 |
msgstr ""
|
418 |
|
419 |
-
#: includes/
|
420 |
msgid ""
|
421 |
"If something goes wrong with a snippet and you can't use WordPress, you can "
|
422 |
"cause all snippets to stop executing by adding "
|
@@ -426,11 +446,11 @@ msgid ""
|
|
426 |
"strong> with <strong>false</strong>."
|
427 |
msgstr ""
|
428 |
|
429 |
-
#: includes/
|
430 |
msgid "Uninstall"
|
431 |
msgstr ""
|
432 |
|
433 |
-
#: includes/
|
434 |
#, php-format
|
435 |
msgid ""
|
436 |
"When you delete Code Snippets through the Plugins menu in WordPress it will "
|
@@ -440,274 +460,284 @@ msgid ""
|
|
440 |
"FTP."
|
441 |
msgstr ""
|
442 |
|
443 |
-
#: includes/
|
444 |
msgid ""
|
445 |
"Even if you're sure that you don't want to use Code Snippets ever again on "
|
446 |
"this WordPress installation, you may want to use the export feature to back "
|
447 |
"up your snippets."
|
448 |
msgstr ""
|
449 |
|
450 |
-
#: includes/
|
451 |
-
msgid ""
|
452 |
-
"<a href=\"http://wordpress.org/plugins/code-snippets\" target=\"_blank"
|
453 |
-
"\">WordPress Extend</a></p>"
|
454 |
-
msgstr ""
|
455 |
-
|
456 |
-
#: includes/manage/admin-messages.php:14
|
457 |
msgid ""
|
458 |
-
"
|
459 |
-
"
|
460 |
-
"
|
461 |
-
"
|
462 |
-
msgstr ""
|
463 |
-
|
464 |
-
#: includes/manage/admin-messages.php:20
|
465 |
-
msgid "Snippet <strong>activated</strong>."
|
466 |
-
msgstr ""
|
467 |
-
|
468 |
-
#: includes/manage/admin-messages.php:24
|
469 |
-
msgid "Selected snippets <strong>activated</strong>."
|
470 |
-
msgstr ""
|
471 |
-
|
472 |
-
#: includes/manage/admin-messages.php:28
|
473 |
-
msgid "Snippet <strong>deactivated</strong>."
|
474 |
msgstr ""
|
475 |
|
476 |
-
#: includes/
|
477 |
-
msgid "
|
478 |
msgstr ""
|
479 |
|
480 |
-
#: includes/
|
481 |
-
msgid "
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
482 |
msgstr ""
|
483 |
|
484 |
-
#: includes/
|
485 |
-
msgid "
|
|
|
|
|
|
|
486 |
msgstr ""
|
487 |
|
488 |
-
#: includes/
|
489 |
-
msgid "
|
490 |
msgstr ""
|
491 |
|
492 |
-
#: includes/
|
493 |
-
msgid "
|
|
|
|
|
|
|
494 |
msgstr ""
|
495 |
|
496 |
-
#: includes/
|
497 |
-
|
498 |
-
|
|
|
|
|
|
|
499 |
msgstr ""
|
500 |
|
501 |
-
#: includes/
|
502 |
-
|
503 |
-
|
|
|
|
|
|
|
|
|
504 |
msgstr ""
|
505 |
|
506 |
-
#: includes/
|
507 |
-
|
508 |
-
msgid "Network Activate"
|
509 |
msgstr ""
|
510 |
|
511 |
-
#: includes/
|
512 |
-
|
513 |
-
|
|
|
514 |
msgstr ""
|
515 |
|
516 |
-
#: includes/
|
517 |
-
|
|
|
|
|
|
|
|
|
|
|
518 |
msgstr ""
|
519 |
|
520 |
-
#: includes/
|
521 |
-
msgid ""
|
522 |
-
"You are about to permanently delete the selected item.\n"
|
523 |
-
"\t\t\t\t'Cancel' to stop, 'OK' to delete."
|
524 |
msgstr ""
|
525 |
|
526 |
-
#: includes/
|
527 |
#, php-format
|
528 |
-
msgid "
|
|
|
|
|
529 |
msgstr ""
|
530 |
|
531 |
-
#: includes/
|
532 |
-
msgid "
|
533 |
msgstr ""
|
534 |
|
535 |
-
#: includes/
|
536 |
-
msgid "
|
|
|
537 |
msgstr ""
|
538 |
|
539 |
-
#: includes/
|
540 |
-
msgid "
|
541 |
msgstr ""
|
542 |
|
543 |
-
#: includes/
|
544 |
-
|
545 |
-
msgid "All <span class=\"count\">(%s)</span>"
|
546 |
msgstr ""
|
547 |
|
548 |
-
#: includes/
|
549 |
-
|
550 |
-
msgid "Active <span class=\"count\">(%s)</span>"
|
551 |
msgstr ""
|
552 |
|
553 |
-
#: includes/
|
554 |
-
|
555 |
-
msgid "Recently Active <span class=\"count\">(%s)</span>"
|
556 |
msgstr ""
|
557 |
|
558 |
-
#: includes/
|
559 |
-
|
560 |
-
msgid "Inactive <span class=\"count\">(%s)</span>"
|
561 |
msgstr ""
|
562 |
|
563 |
-
#: includes/
|
564 |
-
|
565 |
-
msgid "Admin <span class=\"count\">(%s)</span>"
|
566 |
msgstr ""
|
567 |
|
568 |
-
#: includes/
|
569 |
-
|
570 |
-
msgid "Front End <span class=\"count\">(%s)</span>"
|
571 |
msgstr ""
|
572 |
|
573 |
-
#: includes/
|
574 |
-
msgid "
|
575 |
msgstr ""
|
576 |
|
577 |
-
#: includes/
|
578 |
-
msgid "
|
579 |
msgstr ""
|
580 |
|
581 |
-
#: includes/
|
582 |
-
msgid "
|
583 |
msgstr ""
|
584 |
|
585 |
-
#: includes/
|
586 |
-
|
587 |
-
msgid ""
|
588 |
-
"You do not appear to have any snippets available at this time. <a href=\"%s"
|
589 |
-
"\">Add New→</a>"
|
590 |
msgstr ""
|
591 |
|
592 |
-
#: includes/
|
593 |
-
msgid "
|
594 |
msgstr ""
|
595 |
|
596 |
-
#: includes/
|
597 |
-
|
598 |
-
msgid " for “%s”"
|
599 |
msgstr ""
|
600 |
|
601 |
-
#: includes/
|
602 |
-
|
603 |
-
msgid " in tag “%s”"
|
604 |
msgstr ""
|
605 |
|
606 |
-
#: includes/
|
607 |
-
msgid "
|
608 |
msgstr ""
|
609 |
|
610 |
-
#: includes/settings/
|
611 |
-
msgid "
|
612 |
msgstr ""
|
613 |
|
614 |
-
#: includes/settings/
|
615 |
-
msgid "
|
616 |
msgstr ""
|
617 |
|
618 |
-
#: includes/settings/class-settings.php:
|
619 |
-
msgid "
|
620 |
msgstr ""
|
621 |
|
622 |
-
#: includes/settings/class-settings.php:
|
623 |
-
msgid ""
|
624 |
-
"Make the 'Save and Activate' button the default action when saving a snippet."
|
625 |
msgstr ""
|
626 |
|
627 |
-
#: includes/settings/class-settings.php:
|
628 |
-
msgid "
|
629 |
msgstr ""
|
630 |
|
631 |
-
#: includes/settings/class-settings.php:
|
632 |
-
msgid "
|
633 |
msgstr ""
|
634 |
|
635 |
-
#: includes/settings/class-settings.php:
|
636 |
-
msgid "
|
637 |
msgstr ""
|
638 |
|
639 |
-
#: includes/settings/class-settings.php:
|
640 |
-
msgid "
|
641 |
msgstr ""
|
642 |
|
643 |
-
#: includes/settings/
|
644 |
-
msgid "
|
645 |
msgstr ""
|
646 |
|
647 |
-
#: includes/settings/
|
648 |
-
msgid "
|
649 |
msgstr ""
|
650 |
|
651 |
-
#: includes/settings/
|
652 |
-
msgid "
|
653 |
msgstr ""
|
654 |
|
655 |
-
#: includes/settings/
|
656 |
-
msgid "
|
657 |
msgstr ""
|
658 |
|
659 |
-
#: includes/settings/
|
660 |
-
msgid "
|
661 |
msgstr ""
|
662 |
|
663 |
-
#: includes/
|
664 |
-
|
|
|
665 |
msgstr ""
|
666 |
|
667 |
-
#: includes/
|
668 |
-
msgid "
|
669 |
msgstr ""
|
670 |
|
671 |
-
#: includes/
|
672 |
-
msgid "
|
673 |
msgstr ""
|
674 |
|
675 |
-
#: includes/
|
676 |
-
msgid "
|
677 |
msgstr ""
|
678 |
|
679 |
-
#: includes/
|
680 |
-
msgid "
|
681 |
msgstr ""
|
682 |
|
683 |
-
#: includes/
|
684 |
-
msgid "
|
|
|
|
|
685 |
msgstr ""
|
686 |
|
687 |
-
#: includes/
|
688 |
-
msgid "
|
|
|
|
|
689 |
msgstr ""
|
690 |
|
691 |
-
#: includes/
|
692 |
-
|
|
|
|
|
|
|
693 |
msgstr ""
|
694 |
|
695 |
-
#: includes/
|
696 |
-
msgid "
|
|
|
|
|
697 |
msgstr ""
|
698 |
|
699 |
-
#: includes/
|
700 |
-
msgid "
|
701 |
msgstr ""
|
702 |
|
703 |
-
#: includes/
|
704 |
-
msgid "
|
705 |
msgstr ""
|
706 |
|
707 |
-
#: includes/
|
708 |
-
msgid "
|
709 |
msgstr ""
|
710 |
|
711 |
-
#: includes/
|
712 |
-
msgid "
|
713 |
msgstr ""
|
6 |
#, fuzzy
|
7 |
msgid ""
|
8 |
msgstr ""
|
9 |
+
"Project-Id-Version: code-snippets 2.4.0\n"
|
10 |
"Report-Msgid-Bugs-To: \n"
|
11 |
+
"POT-Creation-Date: 2015-09-17 15:32+1000\n"
|
12 |
"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
|
13 |
"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
|
14 |
"Language-Team: LANGUAGE <LL@li.org>\n"
|
16 |
"MIME-Version: 1.0\n"
|
17 |
"Content-Type: text/plain; charset=CHARSET\n"
|
18 |
"Content-Transfer-Encoding: 8bit\n"
|
19 |
+
"Plural-Forms: nplurals=INTEGER; plural=EXPRESSION;\n"
|
20 |
|
21 |
+
#: includes/admin-menus/class-admin-menu.php:90
|
22 |
+
msgid "You are not authorized to access this page."
|
|
|
|
|
23 |
msgstr ""
|
24 |
|
25 |
+
#: includes/admin-menus/class-edit-menu.php:13
|
26 |
+
#: includes/admin-menus/class-edit-menu.php:14 includes/views/edit.php:25
|
27 |
+
msgid "Edit Snippet"
|
28 |
msgstr ""
|
29 |
|
30 |
+
#: includes/admin-menus/class-edit-menu.php:28
|
31 |
+
msgid "Add New"
|
32 |
msgstr ""
|
33 |
|
34 |
+
#: includes/admin-menus/class-edit-menu.php:29 includes/views/edit.php:31
|
35 |
+
msgid "Add New Snippet"
|
36 |
msgstr ""
|
37 |
|
38 |
+
#: includes/admin-menus/class-edit-menu.php:180
|
39 |
+
#: includes/class-list-table.php:324
|
40 |
+
msgid "Description"
|
41 |
msgstr ""
|
42 |
|
43 |
+
#: includes/admin-menus/class-edit-menu.php:205
|
44 |
+
#: includes/class-list-table.php:325
|
45 |
+
msgid "Tags"
|
46 |
msgstr ""
|
47 |
|
48 |
+
#: includes/admin-menus/class-edit-menu.php:209
|
49 |
+
msgid "Enter a list of tags; separated by commas"
|
50 |
msgstr ""
|
51 |
|
52 |
+
#: includes/admin-menus/class-edit-menu.php:228
|
53 |
+
msgid "Run snippet everywhere"
|
54 |
msgstr ""
|
55 |
|
56 |
+
#: includes/admin-menus/class-edit-menu.php:229
|
57 |
+
msgid "Only run in adminstration area"
|
58 |
msgstr ""
|
59 |
|
60 |
+
#: includes/admin-menus/class-edit-menu.php:230
|
61 |
+
msgid "Only run on site front-end"
|
|
|
|
|
|
|
62 |
msgstr ""
|
63 |
|
64 |
+
#: includes/admin-menus/class-edit-menu.php:234
|
65 |
+
msgid "Scope"
|
66 |
msgstr ""
|
67 |
|
68 |
+
#: includes/admin-menus/class-edit-menu.php:254
|
69 |
+
msgid "Sharing"
|
|
|
|
|
70 |
msgstr ""
|
71 |
|
72 |
+
#: includes/admin-menus/class-edit-menu.php:258
|
73 |
+
msgid "Allow this snippet to be activated on individual sites on the network"
|
74 |
msgstr ""
|
75 |
|
76 |
+
#: includes/admin-menus/class-edit-menu.php:272
|
77 |
+
msgid "An error occurred when saving the snippet."
|
78 |
msgstr ""
|
79 |
|
80 |
+
#: includes/admin-menus/class-edit-menu.php:282
|
81 |
+
msgid "Snippet <strong>added</strong>."
|
82 |
msgstr ""
|
83 |
|
84 |
+
#: includes/admin-menus/class-edit-menu.php:283
|
85 |
+
msgid "Snippet <strong>updated</strong>."
|
|
|
|
|
86 |
msgstr ""
|
87 |
|
88 |
+
#: includes/admin-menus/class-edit-menu.php:284
|
89 |
+
msgid "Snippet <strong>added</strong> and <strong>activated</strong>."
|
90 |
msgstr ""
|
91 |
|
92 |
+
#: includes/admin-menus/class-edit-menu.php:285
|
93 |
+
msgid "Snippet <strong>updated</strong> and <strong>activated</strong>."
|
94 |
msgstr ""
|
95 |
|
96 |
+
#: includes/admin-menus/class-edit-menu.php:286
|
97 |
+
msgid "Snippet <strong>updated</strong> and <strong>deactivated</strong>."
|
98 |
msgstr ""
|
99 |
|
100 |
+
#: includes/admin-menus/class-import-menu.php:15
|
101 |
+
msgid "Import"
|
|
|
|
|
102 |
msgstr ""
|
103 |
|
104 |
+
#: includes/admin-menus/class-import-menu.php:16 includes/views/import.php:17
|
105 |
+
msgid "Import Snippets"
|
|
|
|
|
106 |
msgstr ""
|
107 |
|
108 |
+
#: includes/admin-menus/class-import-menu.php:73
|
109 |
+
msgid "Code Snippets"
|
|
|
110 |
msgstr ""
|
111 |
|
112 |
+
#: includes/admin-menus/class-import-menu.php:74
|
113 |
+
msgid "Import snippets from a code snippets export file"
|
114 |
+
msgstr ""
|
115 |
+
|
116 |
+
#: includes/admin-menus/class-import-menu.php:88
|
117 |
+
#, php-format
|
118 |
msgid ""
|
119 |
+
"Successfully imported <strong>%d</strong> snippet. <a href=\"%s\">Have fun!</"
|
120 |
+
"a>"
|
121 |
+
msgid_plural ""
|
122 |
+
"Successfully imported <strong>%d</strong> snippets. <a href=\"%s\">Have fun!"
|
123 |
+
"</a>"
|
124 |
+
msgstr[0] ""
|
125 |
+
msgstr[1] ""
|
126 |
+
|
127 |
+
#: includes/admin-menus/class-import-menu.php:101
|
128 |
+
msgid "An error occurred when processing the import file."
|
129 |
msgstr ""
|
130 |
|
131 |
+
#: includes/admin-menus/class-manage-menu.php:22 includes/admin.php:117
|
132 |
+
msgid "Manage"
|
133 |
msgstr ""
|
134 |
|
135 |
+
#: includes/admin-menus/class-manage-menu.php:23
|
136 |
+
#: includes/admin-menus/class-manage-menu.php:39
|
137 |
+
#: includes/admin-menus/class-manage-menu.php:40 includes/admin.php:56
|
138 |
+
#: includes/views/manage.php:19
|
139 |
+
msgid "Snippets"
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
140 |
msgstr ""
|
141 |
|
142 |
+
#: includes/admin-menus/class-manage-menu.php:75
|
143 |
msgid ""
|
144 |
+
"<strong>Warning:</strong> Safe mode is active and snippets will not execute! "
|
145 |
+
"Remove the <code>CODE_SNIPPETS_SAFE_MODE</code> constant from <code>wp-"
|
146 |
+
"config.php</code> to turn off safe mode. <a href=\"https://github.com/"
|
147 |
+
"sheabunge/code-snippets/wiki/Safe-Mode\" target=\"_blank\">Help</a>"
|
148 |
msgstr ""
|
149 |
|
150 |
+
#: includes/admin-menus/class-manage-menu.php:81
|
151 |
+
msgid "Snippet <strong>activated</strong>."
|
152 |
msgstr ""
|
153 |
|
154 |
+
#: includes/admin-menus/class-manage-menu.php:82
|
155 |
+
msgid "Selected snippets <strong>activated</strong>."
|
|
|
|
|
|
|
156 |
msgstr ""
|
157 |
|
158 |
+
#: includes/admin-menus/class-manage-menu.php:83
|
159 |
+
msgid "Snippet <strong>deactivated</strong>."
|
|
|
|
|
|
|
|
|
160 |
msgstr ""
|
161 |
|
162 |
+
#: includes/admin-menus/class-manage-menu.php:84
|
163 |
+
msgid "Selected snippets <strong>deactivated</strong>."
|
|
|
164 |
msgstr ""
|
165 |
|
166 |
+
#: includes/admin-menus/class-manage-menu.php:85
|
167 |
+
msgid "Snippet <strong>deleted</strong>."
|
|
|
|
|
168 |
msgstr ""
|
169 |
|
170 |
+
#: includes/admin-menus/class-manage-menu.php:86
|
171 |
+
msgid "Selected snippets <strong>deleted</strong>."
|
|
|
|
|
|
|
172 |
msgstr ""
|
173 |
|
174 |
+
#: includes/admin-menus/class-settings-menu.php:16
|
175 |
+
#: includes/admin-menus/class-settings-menu.php:36 includes/views/edit.php:132
|
176 |
+
msgid "Settings"
|
|
|
|
|
177 |
msgstr ""
|
178 |
|
179 |
+
#: includes/admin-menus/class-settings-menu.php:17
|
180 |
+
msgid "Snippets Settings"
|
181 |
msgstr ""
|
182 |
|
183 |
+
#: includes/admin.php:116
|
184 |
+
msgid "Manage your existing snippets"
|
185 |
msgstr ""
|
186 |
|
187 |
+
#: includes/admin.php:146
|
188 |
+
msgid "Visit the WordPress.org plugin page"
|
189 |
msgstr ""
|
190 |
|
191 |
+
#: includes/admin.php:147
|
192 |
+
msgid "About"
|
193 |
msgstr ""
|
194 |
|
195 |
+
#: includes/admin.php:151
|
196 |
+
msgid "Visit the support forums"
|
197 |
msgstr ""
|
198 |
|
199 |
+
#: includes/admin.php:152
|
200 |
+
msgid "Support"
|
201 |
msgstr ""
|
202 |
|
203 |
+
#: includes/admin.php:156
|
204 |
+
msgid "Support this plugin's development"
|
|
|
205 |
msgstr ""
|
206 |
|
207 |
+
#: includes/admin.php:157
|
208 |
+
msgid "Donate"
|
|
|
209 |
msgstr ""
|
210 |
|
211 |
+
#: includes/admin.php:190
|
212 |
+
msgid ""
|
213 |
+
"<strong>Have feedback on Code Snippets?</strong> Please take the time to "
|
214 |
+
"answer a short survey on how you use this plugin and what you'd like to see "
|
215 |
+
"changed or added in the future."
|
216 |
msgstr ""
|
217 |
|
218 |
+
#: includes/admin.php:193
|
219 |
+
msgid "Take the survey now"
|
220 |
msgstr ""
|
221 |
|
222 |
+
#: includes/class-export.php:87
|
223 |
+
msgid ""
|
224 |
+
"This is a code snippets export file generated by the Code Snippets WordPress "
|
225 |
+
"plugin."
|
226 |
msgstr ""
|
227 |
|
228 |
+
#: includes/class-export.php:89
|
229 |
+
msgid "To import these snippets a WordPress site follow these steps:"
|
230 |
msgstr ""
|
231 |
|
232 |
+
#: includes/class-export.php:90
|
233 |
+
msgid "1. Log in to that site as an administrator."
|
234 |
msgstr ""
|
235 |
|
236 |
+
#: includes/class-export.php:91
|
237 |
+
msgid ""
|
238 |
+
"2. Install the Code Snippets plugin using the directions provided at the "
|
239 |
+
"above link."
|
240 |
msgstr ""
|
241 |
|
242 |
+
#: includes/class-export.php:92
|
243 |
+
msgid "3. Go to 'Tools: Import' in the WordPress admin panel."
|
|
|
|
|
244 |
msgstr ""
|
245 |
|
246 |
+
#: includes/class-export.php:93
|
247 |
+
msgid "4. Click on the \"Code Snippets\" importer in the list"
|
|
|
248 |
msgstr ""
|
249 |
|
250 |
+
#: includes/class-export.php:94
|
251 |
+
msgid "5. Upload this file using the form provided on that page."
|
252 |
msgstr ""
|
253 |
|
254 |
+
#: includes/class-export.php:95
|
255 |
+
msgid ""
|
256 |
+
"6. Code Snippets will then import all of the snippets and associated "
|
257 |
+
"information contained in this file into your site."
|
258 |
msgstr ""
|
259 |
|
260 |
+
#: includes/class-export.php:96
|
261 |
+
msgid ""
|
262 |
+
"7. You will then have to visit the 'Snippets: Manage' admin menu and "
|
263 |
+
"activate desired snippets."
|
264 |
msgstr ""
|
265 |
|
266 |
+
#: includes/class-list-table.php:58
|
267 |
+
msgid "Snippets per page"
|
268 |
msgstr ""
|
269 |
|
270 |
+
#: includes/class-list-table.php:117 includes/class-list-table.php:361
|
271 |
+
msgid "Network Deactivate"
|
272 |
msgstr ""
|
273 |
|
274 |
+
#: includes/class-list-table.php:117 includes/class-list-table.php:180
|
275 |
+
#: includes/class-list-table.php:361
|
276 |
+
msgid "Deactivate"
|
277 |
msgstr ""
|
278 |
|
279 |
+
#: includes/class-list-table.php:126 includes/class-list-table.php:360
|
280 |
+
msgid "Network Activate"
|
281 |
msgstr ""
|
282 |
|
283 |
+
#: includes/class-list-table.php:126 includes/class-list-table.php:180
|
284 |
+
#: includes/class-list-table.php:360
|
285 |
+
msgid "Activate"
|
|
|
|
|
|
|
|
|
286 |
msgstr ""
|
287 |
|
288 |
+
#: includes/class-list-table.php:136 includes/class-list-table.php:196
|
289 |
+
msgid "Edit"
|
290 |
+
msgstr ""
|
291 |
+
|
292 |
+
#: includes/class-list-table.php:142 includes/class-list-table.php:202
|
293 |
+
#: includes/class-list-table.php:362 includes/views/edit.php:109
|
294 |
+
msgid "Export"
|
295 |
+
msgstr ""
|
296 |
+
|
297 |
+
#: includes/class-list-table.php:151 includes/class-list-table.php:214
|
298 |
+
#: includes/class-list-table.php:363 includes/views/edit.php:121
|
299 |
+
msgid "Delete"
|
300 |
msgstr ""
|
301 |
|
302 |
+
#: includes/class-list-table.php:158 includes/class-list-table.php:224
|
303 |
msgid ""
|
304 |
+
"You are about to permanently delete the selected item.\n"
|
305 |
+
"\t\t\t\t\t'Cancel' to stop, 'OK' to delete."
|
306 |
msgstr ""
|
307 |
|
308 |
+
#: includes/class-list-table.php:244
|
309 |
#, php-format
|
310 |
+
msgid "Untitled #%d"
|
|
|
|
|
|
|
|
|
311 |
msgstr ""
|
312 |
|
313 |
+
#: includes/class-list-table.php:261
|
314 |
+
msgid "Shared on Network"
|
315 |
msgstr ""
|
316 |
|
317 |
+
#: includes/class-list-table.php:322
|
318 |
+
msgid "Name"
|
|
|
|
|
|
|
319 |
msgstr ""
|
320 |
|
321 |
+
#: includes/class-list-table.php:323
|
322 |
+
msgid "ID"
|
323 |
+
msgstr ""
|
324 |
+
|
325 |
+
#: includes/class-list-table.php:364
|
326 |
+
msgid "Export to PHP"
|
327 |
+
msgstr ""
|
328 |
+
|
329 |
+
#: includes/class-list-table.php:402
|
330 |
#, php-format
|
331 |
+
msgid "All <span class=\"count\">(%s)</span>"
|
332 |
+
msgid_plural "All <span class=\"count\">(%s)</span>"
|
333 |
+
msgstr[0] ""
|
334 |
+
msgstr[1] ""
|
335 |
+
|
336 |
+
#: includes/class-list-table.php:403
|
337 |
+
#, php-format
|
338 |
+
msgid "Active <span class=\"count\">(%s)</span>"
|
339 |
+
msgid_plural "Active <span class=\"count\">(%s)</span>"
|
340 |
+
msgstr[0] ""
|
341 |
+
msgstr[1] ""
|
342 |
+
|
343 |
+
#: includes/class-list-table.php:404
|
344 |
+
#, php-format
|
345 |
+
msgid "Inactive <span class=\"count\">(%s)</span>"
|
346 |
+
msgid_plural "Inactive <span class=\"count\">(%s)</span>"
|
347 |
+
msgstr[0] ""
|
348 |
+
msgstr[1] ""
|
349 |
+
|
350 |
+
#: includes/class-list-table.php:405
|
351 |
+
#, php-format
|
352 |
+
msgid "Recently Active <span class=\"count\">(%s)</span>"
|
353 |
+
msgid_plural "Recently Active <span class=\"count\">(%s)</span>"
|
354 |
+
msgstr[0] ""
|
355 |
+
msgstr[1] ""
|
356 |
+
|
357 |
+
#: includes/class-list-table.php:468
|
358 |
+
msgid "Show all tags"
|
359 |
msgstr ""
|
360 |
|
361 |
+
#: includes/class-list-table.php:482
|
362 |
+
msgid "Filter"
|
363 |
msgstr ""
|
364 |
|
365 |
+
#: includes/class-list-table.php:490
|
366 |
+
msgid "Clear List"
|
367 |
msgstr ""
|
368 |
|
369 |
+
#: includes/class-list-table.php:677
|
370 |
+
#, php-format
|
371 |
msgid ""
|
372 |
+
"You do not appear to have any snippets available at this time. <a href=\"%s"
|
373 |
+
"\">Add New→</a>"
|
374 |
msgstr ""
|
375 |
|
376 |
+
#: includes/class-list-table.php:956
|
377 |
+
msgid "Search results"
|
378 |
+
msgstr ""
|
379 |
+
|
380 |
+
#: includes/class-list-table.php:959
|
381 |
#, php-format
|
382 |
+
msgid " for “%s”"
|
|
|
|
|
383 |
msgstr ""
|
384 |
|
385 |
+
#: includes/class-list-table.php:963
|
386 |
+
#, php-format
|
387 |
+
msgid " in tag “%s”"
|
|
|
388 |
msgstr ""
|
389 |
|
390 |
+
#: includes/class-list-table.php:971
|
391 |
+
msgid "Clear Filters"
|
392 |
msgstr ""
|
393 |
|
394 |
+
#: includes/contextual-help.php:19
|
395 |
+
msgid "For more information:"
|
396 |
msgstr ""
|
397 |
|
398 |
+
#: includes/contextual-help.php:20
|
399 |
+
msgid "About Plugin"
|
400 |
msgstr ""
|
401 |
|
402 |
+
#: includes/contextual-help.php:21
|
403 |
+
msgid "FAQ"
|
404 |
msgstr ""
|
405 |
|
406 |
+
#: includes/contextual-help.php:22
|
407 |
+
msgid "Support Forums"
|
408 |
msgstr ""
|
409 |
|
410 |
+
#: includes/contextual-help.php:23
|
411 |
+
msgid "Plugin Website</a>"
|
412 |
msgstr ""
|
413 |
|
414 |
+
#: includes/contextual-help.php:36 includes/contextual-help.php:67
|
415 |
+
#: includes/contextual-help.php:105
|
416 |
+
msgid "Overview"
|
417 |
msgstr ""
|
418 |
|
419 |
+
#: includes/contextual-help.php:38
|
420 |
msgid ""
|
421 |
"Snippets are similar to plugins - they both extend and expand the "
|
422 |
"functionality of WordPress. Snippets are more light-weight, just a few lines "
|
425 |
"deactivating, deleting and exporting."
|
426 |
msgstr ""
|
427 |
|
428 |
+
#: includes/contextual-help.php:43
|
429 |
msgid "Safe Mode"
|
430 |
msgstr ""
|
431 |
|
432 |
+
#: includes/contextual-help.php:45
|
433 |
msgid ""
|
434 |
"Be sure to check your snippets for errors before you activate them, as a "
|
435 |
"faulty snippet could bring your whole blog down. If your site starts doing "
|
436 |
"strange things, deactivate all your snippets and activate them one at a time."
|
437 |
msgstr ""
|
438 |
|
439 |
+
#: includes/contextual-help.php:46
|
440 |
msgid ""
|
441 |
"If something goes wrong with a snippet and you can't use WordPress, you can "
|
442 |
"cause all snippets to stop executing by adding "
|
446 |
"strong> with <strong>false</strong>."
|
447 |
msgstr ""
|
448 |
|
449 |
+
#: includes/contextual-help.php:51
|
450 |
msgid "Uninstall"
|
451 |
msgstr ""
|
452 |
|
453 |
+
#: includes/contextual-help.php:53
|
454 |
#, php-format
|
455 |
msgid ""
|
456 |
"When you delete Code Snippets through the Plugins menu in WordPress it will "
|
460 |
"FTP."
|
461 |
msgstr ""
|
462 |
|
463 |
+
#: includes/contextual-help.php:54
|
464 |
msgid ""
|
465 |
"Even if you're sure that you don't want to use Code Snippets ever again on "
|
466 |
"this WordPress installation, you may want to use the export feature to back "
|
467 |
"up your snippets."
|
468 |
msgstr ""
|
469 |
|
470 |
+
#: includes/contextual-help.php:69
|
|
|
|
|
|
|
|
|
|
|
|
|
471 |
msgid ""
|
472 |
+
"Snippets are similar to plugins - they both extend and expand the "
|
473 |
+
"functionality of WordPress. Snippets are more light-weight, just a few lines "
|
474 |
+
"of code, and do not put as much load on your server. Here you can add a new "
|
475 |
+
"snippet, or edit an existing one."
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
476 |
msgstr ""
|
477 |
|
478 |
+
#: includes/contextual-help.php:74
|
479 |
+
msgid "Finding Snippets"
|
480 |
msgstr ""
|
481 |
|
482 |
+
#: includes/contextual-help.php:76
|
483 |
+
msgid ""
|
484 |
+
"Here are some links to websites which host a large number of snippets that "
|
485 |
+
"you can add to your site.\n"
|
486 |
+
"\t\t\t<ul>\n"
|
487 |
+
"\t\t\t\t<li><a href=\"http://wp-snippets.com\" title=\"WordPress Snippets"
|
488 |
+
"\">WP-Snippets</a></li>\n"
|
489 |
+
"\t\t\t\t<li><a href=\"http://wpsnipp.com\" title=\"WP Snipp\">WP Snipp</a></"
|
490 |
+
"li>\n"
|
491 |
+
"\t\t\t\t<li><a href=\"http://www.catswhocode.com/blog/snippets\" title="
|
492 |
+
"\"Cats Who Code Snippet Library\">Cats Who Code</a></li>\n"
|
493 |
+
"\t\t\t\t<li><a href=\"http://www.wpfunction.me\">WP Function Me</a></li>\n"
|
494 |
+
"\t\t\t</ul>"
|
495 |
msgstr ""
|
496 |
|
497 |
+
#: includes/contextual-help.php:83
|
498 |
+
msgid ""
|
499 |
+
"More places to find snippets, as well as a selection of example snippets, "
|
500 |
+
"can be found in the <a href=\"https://github.com/sheabunge/code-snippets/"
|
501 |
+
"wiki/Finding-snippets\">plugin documentation</a>"
|
502 |
msgstr ""
|
503 |
|
504 |
+
#: includes/contextual-help.php:88
|
505 |
+
msgid "Adding Snippets"
|
506 |
msgstr ""
|
507 |
|
508 |
+
#: includes/contextual-help.php:90
|
509 |
+
msgid ""
|
510 |
+
"You need to fill out the name and code fields for your snippet to be added. "
|
511 |
+
"While the description field will add more information about how your snippet "
|
512 |
+
"works, what is does and where you found it, it is completely optional."
|
513 |
msgstr ""
|
514 |
|
515 |
+
#: includes/contextual-help.php:91
|
516 |
+
msgid ""
|
517 |
+
"Please be sure to check that your snippet is valid PHP code and will not "
|
518 |
+
"produce errors before adding it through this page. While doing so will not "
|
519 |
+
"become active straight away, it will help to minimise the chance of a faulty "
|
520 |
+
"snippet becoming active on your site."
|
521 |
msgstr ""
|
522 |
|
523 |
+
#: includes/contextual-help.php:107
|
524 |
+
msgid ""
|
525 |
+
"Snippets are similar to plugins - they both extend and expand the "
|
526 |
+
"functionality of WordPress. Snippets are more light-weight, just a few lines "
|
527 |
+
"of code, and do not put as much load on your server. Here you can load "
|
528 |
+
"snippets from a Code Snippets (.xml) import file into the database with your "
|
529 |
+
"existing snippets."
|
530 |
msgstr ""
|
531 |
|
532 |
+
#: includes/contextual-help.php:112
|
533 |
+
msgid "Importing"
|
|
|
534 |
msgstr ""
|
535 |
|
536 |
+
#: includes/contextual-help.php:114
|
537 |
+
msgid ""
|
538 |
+
"You can load your snippets from a code snippets (.xml) export file using "
|
539 |
+
"this page."
|
540 |
msgstr ""
|
541 |
|
542 |
+
#: includes/contextual-help.php:115
|
543 |
+
#, php-format
|
544 |
+
msgid ""
|
545 |
+
"Snippets will be added to the database along with your existing snippets. "
|
546 |
+
"Regardless of whether the snippets were active on the previous site, "
|
547 |
+
"imported snippets are always inactive until activated using the <a href=\"%s"
|
548 |
+
"\">Manage Snippets</a> page.</p>"
|
549 |
msgstr ""
|
550 |
|
551 |
+
#: includes/contextual-help.php:120
|
552 |
+
msgid "Exporting"
|
|
|
|
|
553 |
msgstr ""
|
554 |
|
555 |
+
#: includes/contextual-help.php:122
|
556 |
#, php-format
|
557 |
+
msgid ""
|
558 |
+
"You can save your snippets to a Code Snippets (.xml) export file using the "
|
559 |
+
"<a href=\"%s\">Manage Snippets</a> page."
|
560 |
msgstr ""
|
561 |
|
562 |
+
#: includes/settings/class-settings.php:54
|
563 |
+
msgid "Activate by Default"
|
564 |
msgstr ""
|
565 |
|
566 |
+
#: includes/settings/class-settings.php:56
|
567 |
+
msgid ""
|
568 |
+
"Make the 'Save and Activate' button the default action when saving a snippet."
|
569 |
msgstr ""
|
570 |
|
571 |
+
#: includes/settings/class-settings.php:62
|
572 |
+
msgid "Enable Scope Selector"
|
573 |
msgstr ""
|
574 |
|
575 |
+
#: includes/settings/class-settings.php:64
|
576 |
+
msgid "Enable the scope selector when editing a snippet"
|
|
|
577 |
msgstr ""
|
578 |
|
579 |
+
#: includes/settings/class-settings.php:74
|
580 |
+
msgid "Row Height"
|
|
|
581 |
msgstr ""
|
582 |
|
583 |
+
#: includes/settings/class-settings.php:76
|
584 |
+
msgid "rows"
|
|
|
585 |
msgstr ""
|
586 |
|
587 |
+
#: includes/settings/class-settings.php:83
|
588 |
+
msgid "Use Full Editor"
|
|
|
589 |
msgstr ""
|
590 |
|
591 |
+
#: includes/settings/class-settings.php:85
|
592 |
+
msgid "Enable all features of the visual editor"
|
|
|
593 |
msgstr ""
|
594 |
|
595 |
+
#: includes/settings/class-settings.php:91
|
596 |
+
msgid "Media Buttons"
|
|
|
597 |
msgstr ""
|
598 |
|
599 |
+
#: includes/settings/class-settings.php:93
|
600 |
+
msgid "Enable the add media buttons"
|
601 |
msgstr ""
|
602 |
|
603 |
+
#: includes/settings/class-settings.php:103
|
604 |
+
msgid "Theme"
|
605 |
msgstr ""
|
606 |
|
607 |
+
#: includes/settings/class-settings.php:111
|
608 |
+
msgid "Indent With Tabs"
|
609 |
msgstr ""
|
610 |
|
611 |
+
#: includes/settings/class-settings.php:113
|
612 |
+
msgid "Use hard tabs (not spaces) for indentation."
|
|
|
|
|
|
|
613 |
msgstr ""
|
614 |
|
615 |
+
#: includes/settings/class-settings.php:120
|
616 |
+
msgid "Tab Size"
|
617 |
msgstr ""
|
618 |
|
619 |
+
#: includes/settings/class-settings.php:122
|
620 |
+
msgid "The width of a tab character."
|
|
|
621 |
msgstr ""
|
622 |
|
623 |
+
#: includes/settings/class-settings.php:130
|
624 |
+
msgid "Indent Unit"
|
|
|
625 |
msgstr ""
|
626 |
|
627 |
+
#: includes/settings/class-settings.php:132
|
628 |
+
msgid "How many spaces a block should be indented."
|
629 |
msgstr ""
|
630 |
|
631 |
+
#: includes/settings/class-settings.php:140
|
632 |
+
msgid "Wrap Lines"
|
633 |
msgstr ""
|
634 |
|
635 |
+
#: includes/settings/class-settings.php:142
|
636 |
+
msgid "Whether the editor should scroll or wrap for long lines."
|
637 |
msgstr ""
|
638 |
|
639 |
+
#: includes/settings/class-settings.php:149
|
640 |
+
msgid "Line Numbers"
|
641 |
msgstr ""
|
642 |
|
643 |
+
#: includes/settings/class-settings.php:151
|
644 |
+
msgid "Show line numbers to the left of the editor."
|
|
|
645 |
msgstr ""
|
646 |
|
647 |
+
#: includes/settings/class-settings.php:158
|
648 |
+
msgid "Auto Close Brackets"
|
649 |
msgstr ""
|
650 |
|
651 |
+
#: includes/settings/class-settings.php:160
|
652 |
+
msgid "Auto-close brackets and quotes when typed."
|
653 |
msgstr ""
|
654 |
|
655 |
+
#: includes/settings/class-settings.php:167
|
656 |
+
msgid "Highlight Selection Matches"
|
657 |
msgstr ""
|
658 |
|
659 |
+
#: includes/settings/class-settings.php:168
|
660 |
+
msgid "Highlight all instances of a currently selected word."
|
661 |
msgstr ""
|
662 |
|
663 |
+
#: includes/settings/settings.php:86
|
664 |
+
msgid "General"
|
665 |
msgstr ""
|
666 |
|
667 |
+
#: includes/settings/settings.php:87
|
668 |
+
msgid "Description Editor"
|
669 |
msgstr ""
|
670 |
|
671 |
+
#: includes/settings/settings.php:88
|
672 |
+
msgid "Code Editor"
|
673 |
msgstr ""
|
674 |
|
675 |
+
#: includes/settings/settings.php:136
|
676 |
+
msgid "Editor Preview"
|
677 |
msgstr ""
|
678 |
|
679 |
+
#: includes/settings/settings.php:183
|
680 |
+
msgid "Settings saved."
|
681 |
msgstr ""
|
682 |
|
683 |
+
#: includes/views/edit.php:28 includes/views/manage.php:22
|
684 |
+
msgctxt "snippet"
|
685 |
+
msgid "Add New"
|
686 |
msgstr ""
|
687 |
|
688 |
+
#: includes/views/edit.php:48 includes/views/edit.php:49
|
689 |
+
msgid "Name (short title)"
|
690 |
msgstr ""
|
691 |
|
692 |
+
#: includes/views/edit.php:54
|
693 |
+
msgid "Code"
|
694 |
msgstr ""
|
695 |
|
696 |
+
#: includes/views/edit.php:79 includes/views/edit.php:93
|
697 |
+
msgid "Save Changes and Activate"
|
698 |
msgstr ""
|
699 |
|
700 |
+
#: includes/views/edit.php:99
|
701 |
+
msgid "Save Changes and Deactivate"
|
702 |
msgstr ""
|
703 |
|
704 |
+
#: includes/views/edit.php:116
|
705 |
+
msgid ""
|
706 |
+
"You are about to permanently delete this snippet.\n"
|
707 |
+
"'Cancel' to stop, 'OK' to delete."
|
708 |
msgstr ""
|
709 |
|
710 |
+
#: includes/views/import.php:21
|
711 |
+
msgid ""
|
712 |
+
"Howdy! Upload your Code Snippets export file and we’ll import the "
|
713 |
+
"snippets to this site."
|
714 |
msgstr ""
|
715 |
|
716 |
+
#: includes/views/import.php:23
|
717 |
+
#, php-format
|
718 |
+
msgid ""
|
719 |
+
"You will need to go to the <a href=\"%s\">Manage Snippets</a> page to "
|
720 |
+
"activate the imported snippets."
|
721 |
msgstr ""
|
722 |
|
723 |
+
#: includes/views/import.php:25
|
724 |
+
msgid ""
|
725 |
+
"Choose a Code Snippets (.xml) file to upload, then click Upload file and "
|
726 |
+
"import."
|
727 |
msgstr ""
|
728 |
|
729 |
+
#: includes/views/import.php:32
|
730 |
+
msgid "Choose a file from your computer:"
|
731 |
msgstr ""
|
732 |
|
733 |
+
#: includes/views/import.php:33
|
734 |
+
msgid "(Maximum size: 8MB)"
|
735 |
msgstr ""
|
736 |
|
737 |
+
#: includes/views/import.php:39
|
738 |
+
msgid "Upload file and import"
|
739 |
msgstr ""
|
740 |
|
741 |
+
#: includes/views/manage.php:34
|
742 |
+
msgid "Search Installed Snippets"
|
743 |
msgstr ""
|
license.txt
CHANGED
@@ -1,4 +1,4 @@
|
|
1 |
-
Copyright (c) 2012-
|
2 |
|
3 |
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
|
4 |
|
1 |
+
Copyright (c) 2012-2015 Shea Bunge
|
2 |
|
3 |
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
|
4 |
|
readme.txt
CHANGED
@@ -2,9 +2,9 @@
|
|
2 |
Contributors: bungeshea
|
3 |
Donate link: http://bungeshea.com/donate/
|
4 |
Tags: code-snippets, snippets, code, php, network, multisite
|
5 |
-
Requires at least: 3.
|
6 |
-
Tested up to: 4.
|
7 |
-
Stable tag: 2.
|
8 |
License: MIT
|
9 |
License URI: license.txt
|
10 |
|
@@ -116,6 +116,29 @@ That's fantastic! Fork the [repository on GitHub](http://github.com/sheabunge/co
|
|
116 |
|
117 |
== Changelog ==
|
118 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
119 |
= 2.2.3 =
|
120 |
* Fixed broken call to `export_snippet()` function
|
121 |
* Added support for importing and exporting snippet scope
|
@@ -338,6 +361,12 @@ __Fixed__
|
|
338 |
|
339 |
== Upgrade Notice ==
|
340 |
|
|
|
|
|
|
|
|
|
|
|
|
|
341 |
= 2.2.3 =
|
342 |
Fixed error when exporting; snippet scopes can now be imported
|
343 |
|
2 |
Contributors: bungeshea
|
3 |
Donate link: http://bungeshea.com/donate/
|
4 |
Tags: code-snippets, snippets, code, php, network, multisite
|
5 |
+
Requires at least: 3.6
|
6 |
+
Tested up to: 4.3.1
|
7 |
+
Stable tag: 2.4.0
|
8 |
License: MIT
|
9 |
License URI: license.txt
|
10 |
|
116 |
|
117 |
== Changelog ==
|
118 |
|
119 |
+
= 2.4.0 =
|
120 |
+
* Added ability to share network snippets to individual sites on WordPress multisite
|
121 |
+
* Improved code directory and class structure
|
122 |
+
* Remove legacy code for pre-3.6 compatibility
|
123 |
+
* Improved code for printing admin messages
|
124 |
+
* Updated German translation (Joerg Knoerchen)
|
125 |
+
* Added `code_snippets/after_execute_snippet` filter
|
126 |
+
* Added class for individual snippets
|
127 |
+
* Updated `get_snippets()` function to retrieve individual snippets
|
128 |
+
* Removed scope statuses and added fixed tags to indicate scope
|
129 |
+
* Changed admin page headers to use `<h1>` tags instead of `<h2>` tags
|
130 |
+
* Updated CodeMirror to version 5.6
|
131 |
+
* Removed snippet settings page from network admin
|
132 |
+
|
133 |
+
= 2.3.0 =
|
134 |
+
* Removed nested functions
|
135 |
+
* Added icons for admin and front-end snippets to manage table
|
136 |
+
* Improved settings retrieval by caching settings
|
137 |
+
* Updated Russian translation by [Alexey Chumakov](http://chumakov.ru/)
|
138 |
+
* Added filter switch to prevent a snippet from executing ([#25](https://github.com/sheabunge/code-snippets/issues/25))
|
139 |
+
* Fixed errors in string translation
|
140 |
+
* Fixed bug in import process ([#32](https://github.com/sheabunge/code-snippets/issues/32))
|
141 |
+
|
142 |
= 2.2.3 =
|
143 |
* Fixed broken call to `export_snippet()` function
|
144 |
* Added support for importing and exporting snippet scope
|
361 |
|
362 |
== Upgrade Notice ==
|
363 |
|
364 |
+
= 2.4.0 =
|
365 |
+
New snippet sharing feature for multisite networks; new Snippet class
|
366 |
+
|
367 |
+
= 2.3.0 =
|
368 |
+
Numerous fixes and Russian translation update. Props to @signo and @achumakov.
|
369 |
+
|
370 |
= 2.2.3 =
|
371 |
Fixed error when exporting; snippet scopes can now be imported
|
372 |
|
vendor/codemirror/addon/edit/matchbrackets.js
DELETED
@@ -1,120 +0,0 @@
|
|
1 |
-
// CodeMirror, copyright (c) by Marijn Haverbeke and others
|
2 |
-
// Distributed under an MIT license: http://codemirror.net/LICENSE
|
3 |
-
|
4 |
-
(function(mod) {
|
5 |
-
if (typeof exports == "object" && typeof module == "object") // CommonJS
|
6 |
-
mod(require("../../lib/codemirror"));
|
7 |
-
else if (typeof define == "function" && define.amd) // AMD
|
8 |
-
define(["../../lib/codemirror"], mod);
|
9 |
-
else // Plain browser env
|
10 |
-
mod(CodeMirror);
|
11 |
-
})(function(CodeMirror) {
|
12 |
-
var ie_lt8 = /MSIE \d/.test(navigator.userAgent) &&
|
13 |
-
(document.documentMode == null || document.documentMode < 8);
|
14 |
-
|
15 |
-
var Pos = CodeMirror.Pos;
|
16 |
-
|
17 |
-
var matching = {"(": ")>", ")": "(<", "[": "]>", "]": "[<", "{": "}>", "}": "{<"};
|
18 |
-
|
19 |
-
function findMatchingBracket(cm, where, strict, config) {
|
20 |
-
var line = cm.getLineHandle(where.line), pos = where.ch - 1;
|
21 |
-
var match = (pos >= 0 && matching[line.text.charAt(pos)]) || matching[line.text.charAt(++pos)];
|
22 |
-
if (!match) return null;
|
23 |
-
var dir = match.charAt(1) == ">" ? 1 : -1;
|
24 |
-
if (strict && (dir > 0) != (pos == where.ch)) return null;
|
25 |
-
var style = cm.getTokenTypeAt(Pos(where.line, pos + 1));
|
26 |
-
|
27 |
-
var found = scanForBracket(cm, Pos(where.line, pos + (dir > 0 ? 1 : 0)), dir, style || null, config);
|
28 |
-
if (found == null) return null;
|
29 |
-
return {from: Pos(where.line, pos), to: found && found.pos,
|
30 |
-
match: found && found.ch == match.charAt(0), forward: dir > 0};
|
31 |
-
}
|
32 |
-
|
33 |
-
// bracketRegex is used to specify which type of bracket to scan
|
34 |
-
// should be a regexp, e.g. /[[\]]/
|
35 |
-
//
|
36 |
-
// Note: If "where" is on an open bracket, then this bracket is ignored.
|
37 |
-
//
|
38 |
-
// Returns false when no bracket was found, null when it reached
|
39 |
-
// maxScanLines and gave up
|
40 |
-
function scanForBracket(cm, where, dir, style, config) {
|
41 |
-
var maxScanLen = (config && config.maxScanLineLength) || 10000;
|
42 |
-
var maxScanLines = (config && config.maxScanLines) || 1000;
|
43 |
-
|
44 |
-
var stack = [];
|
45 |
-
var re = config && config.bracketRegex ? config.bracketRegex : /[(){}[\]]/;
|
46 |
-
var lineEnd = dir > 0 ? Math.min(where.line + maxScanLines, cm.lastLine() + 1)
|
47 |
-
: Math.max(cm.firstLine() - 1, where.line - maxScanLines);
|
48 |
-
for (var lineNo = where.line; lineNo != lineEnd; lineNo += dir) {
|
49 |
-
var line = cm.getLine(lineNo);
|
50 |
-
if (!line) continue;
|
51 |
-
var pos = dir > 0 ? 0 : line.length - 1, end = dir > 0 ? line.length : -1;
|
52 |
-
if (line.length > maxScanLen) continue;
|
53 |
-
if (lineNo == where.line) pos = where.ch - (dir < 0 ? 1 : 0);
|
54 |
-
for (; pos != end; pos += dir) {
|
55 |
-
var ch = line.charAt(pos);
|
56 |
-
if (re.test(ch) && (style === undefined || cm.getTokenTypeAt(Pos(lineNo, pos + 1)) == style)) {
|
57 |
-
var match = matching[ch];
|
58 |
-
if ((match.charAt(1) == ">") == (dir > 0)) stack.push(ch);
|
59 |
-
else if (!stack.length) return {pos: Pos(lineNo, pos), ch: ch};
|
60 |
-
else stack.pop();
|
61 |
-
}
|
62 |
-
}
|
63 |
-
}
|
64 |
-
return lineNo - dir == (dir > 0 ? cm.lastLine() : cm.firstLine()) ? false : null;
|
65 |
-
}
|
66 |
-
|
67 |
-
function matchBrackets(cm, autoclear, config) {
|
68 |
-
// Disable brace matching in long lines, since it'll cause hugely slow updates
|
69 |
-
var maxHighlightLen = cm.state.matchBrackets.maxHighlightLineLength || 1000;
|
70 |
-
var marks = [], ranges = cm.listSelections();
|
71 |
-
for (var i = 0; i < ranges.length; i++) {
|
72 |
-
var match = ranges[i].empty() && findMatchingBracket(cm, ranges[i].head, false, config);
|
73 |
-
if (match && cm.getLine(match.from.line).length <= maxHighlightLen) {
|
74 |
-
var style = match.match ? "CodeMirror-matchingbracket" : "CodeMirror-nonmatchingbracket";
|
75 |
-
marks.push(cm.markText(match.from, Pos(match.from.line, match.from.ch + 1), {className: style}));
|
76 |
-
if (match.to && cm.getLine(match.to.line).length <= maxHighlightLen)
|
77 |
-
marks.push(cm.markText(match.to, Pos(match.to.line, match.to.ch + 1), {className: style}));
|
78 |
-
}
|
79 |
-
}
|
80 |
-
|
81 |
-
if (marks.length) {
|
82 |
-
// Kludge to work around the IE bug from issue #1193, where text
|
83 |
-
// input stops going to the textare whever this fires.
|
84 |
-
if (ie_lt8 && cm.state.focused) cm.focus();
|
85 |
-
|
86 |
-
var clear = function() {
|
87 |
-
cm.operation(function() {
|
88 |
-
for (var i = 0; i < marks.length; i++) marks[i].clear();
|
89 |
-
});
|
90 |
-
};
|
91 |
-
if (autoclear) setTimeout(clear, 800);
|
92 |
-
else return clear;
|
93 |
-
}
|
94 |
-
}
|
95 |
-
|
96 |
-
var currentlyHighlighted = null;
|
97 |
-
function doMatchBrackets(cm) {
|
98 |
-
cm.operation(function() {
|
99 |
-
if (currentlyHighlighted) {currentlyHighlighted(); currentlyHighlighted = null;}
|
100 |
-
currentlyHighlighted = matchBrackets(cm, false, cm.state.matchBrackets);
|
101 |
-
});
|
102 |
-
}
|
103 |
-
|
104 |
-
CodeMirror.defineOption("matchBrackets", false, function(cm, val, old) {
|
105 |
-
if (old && old != CodeMirror.Init)
|
106 |
-
cm.off("cursorActivity", doMatchBrackets);
|
107 |
-
if (val) {
|
108 |
-
cm.state.matchBrackets = typeof val == "object" ? val : {};
|
109 |
-
cm.on("cursorActivity", doMatchBrackets);
|
110 |
-
}
|
111 |
-
});
|
112 |
-
|
113 |
-
CodeMirror.defineExtension("matchBrackets", function() {matchBrackets(this, true);});
|
114 |
-
CodeMirror.defineExtension("findMatchingBracket", function(pos, strict, config){
|
115 |
-
return findMatchingBracket(this, pos, strict, config);
|
116 |
-
});
|
117 |
-
CodeMirror.defineExtension("scanForBracket", function(pos, dir, style, config){
|
118 |
-
return scanForBracket(this, pos, dir, style, config);
|
119 |
-
});
|
120 |
-
});
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
vendor/codemirror/addon/search/search.js
DELETED
@@ -1,167 +0,0 @@
|
|
1 |
-
// CodeMirror, copyright (c) by Marijn Haverbeke and others
|
2 |
-
// Distributed under an MIT license: http://codemirror.net/LICENSE
|
3 |
-
|
4 |
-
// Define search commands. Depends on dialog.js or another
|
5 |
-
// implementation of the openDialog method.
|
6 |
-
|
7 |
-
// Replace works a little oddly -- it will do the replace on the next
|
8 |
-
// Ctrl-G (or whatever is bound to findNext) press. You prevent a
|
9 |
-
// replace by making sure the match is no longer selected when hitting
|
10 |
-
// Ctrl-G.
|
11 |
-
|
12 |
-
(function(mod) {
|
13 |
-
if (typeof exports == "object" && typeof module == "object") // CommonJS
|
14 |
-
mod(require("../../lib/codemirror"), require("./searchcursor"), require("../dialog/dialog"));
|
15 |
-
else if (typeof define == "function" && define.amd) // AMD
|
16 |
-
define(["../../lib/codemirror", "./searchcursor", "../dialog/dialog"], mod);
|
17 |
-
else // Plain browser env
|
18 |
-
mod(CodeMirror);
|
19 |
-
})(function(CodeMirror) {
|
20 |
-
"use strict";
|
21 |
-
function searchOverlay(query, caseInsensitive) {
|
22 |
-
if (typeof query == "string")
|
23 |
-
query = new RegExp(query.replace(/[\-\[\]\/\{\}\(\)\*\+\?\.\\\^\$\|]/g, "\\$&"), caseInsensitive ? "gi" : "g");
|
24 |
-
else if (!query.global)
|
25 |
-
query = new RegExp(query.source, query.ignoreCase ? "gi" : "g");
|
26 |
-
|
27 |
-
return {token: function(stream) {
|
28 |
-
query.lastIndex = stream.pos;
|
29 |
-
var match = query.exec(stream.string);
|
30 |
-
if (match && match.index == stream.pos) {
|
31 |
-
stream.pos += match[0].length;
|
32 |
-
return "searching";
|
33 |
-
} else if (match) {
|
34 |
-
stream.pos = match.index;
|
35 |
-
} else {
|
36 |
-
stream.skipToEnd();
|
37 |
-
}
|
38 |
-
}};
|
39 |
-
}
|
40 |
-
|
41 |
-
function SearchState() {
|
42 |
-
this.posFrom = this.posTo = this.lastQuery = this.query = null;
|
43 |
-
this.overlay = null;
|
44 |
-
}
|
45 |
-
function getSearchState(cm) {
|
46 |
-
return cm.state.search || (cm.state.search = new SearchState());
|
47 |
-
}
|
48 |
-
function queryCaseInsensitive(query) {
|
49 |
-
return typeof query == "string" && query == query.toLowerCase();
|
50 |
-
}
|
51 |
-
function getSearchCursor(cm, query, pos) {
|
52 |
-
// Heuristic: if the query string is all lowercase, do a case insensitive search.
|
53 |
-
return cm.getSearchCursor(query, pos, queryCaseInsensitive(query));
|
54 |
-
}
|
55 |
-
function dialog(cm, text, shortText, deflt, f) {
|
56 |
-
if (cm.openDialog) cm.openDialog(text, f, {value: deflt, selectValueOnOpen: true});
|
57 |
-
else f(prompt(shortText, deflt));
|
58 |
-
}
|
59 |
-
function confirmDialog(cm, text, shortText, fs) {
|
60 |
-
if (cm.openConfirm) cm.openConfirm(text, fs);
|
61 |
-
else if (confirm(shortText)) fs[0]();
|
62 |
-
}
|
63 |
-
function parseQuery(query) {
|
64 |
-
var isRE = query.match(/^\/(.*)\/([a-z]*)$/);
|
65 |
-
if (isRE) {
|
66 |
-
try { query = new RegExp(isRE[1], isRE[2].indexOf("i") == -1 ? "" : "i"); }
|
67 |
-
catch(e) {} // Not a regular expression after all, do a string search
|
68 |
-
}
|
69 |
-
if (typeof query == "string" ? query == "" : query.test(""))
|
70 |
-
query = /x^/;
|
71 |
-
return query;
|
72 |
-
}
|
73 |
-
var queryDialog =
|
74 |
-
'Search: <input type="text" style="width: 10em" class="CodeMirror-search-field"/> <span style="color: #888" class="CodeMirror-search-hint">(Use /re/ syntax for regexp search)</span>';
|
75 |
-
function doSearch(cm, rev) {
|
76 |
-
var state = getSearchState(cm);
|
77 |
-
if (state.query) return findNext(cm, rev);
|
78 |
-
var q = cm.getSelection() || state.lastQuery;
|
79 |
-
dialog(cm, queryDialog, "Search for:", q, function(query) {
|
80 |
-
cm.operation(function() {
|
81 |
-
if (!query || state.query) return;
|
82 |
-
state.query = parseQuery(query);
|
83 |
-
cm.removeOverlay(state.overlay, queryCaseInsensitive(state.query));
|
84 |
-
state.overlay = searchOverlay(state.query, queryCaseInsensitive(state.query));
|
85 |
-
cm.addOverlay(state.overlay);
|
86 |
-
if (cm.showMatchesOnScrollbar) {
|
87 |
-
if (state.annotate) { state.annotate.clear(); state.annotate = null; }
|
88 |
-
state.annotate = cm.showMatchesOnScrollbar(state.query, queryCaseInsensitive(state.query));
|
89 |
-
}
|
90 |
-
state.posFrom = state.posTo = cm.getCursor();
|
91 |
-
findNext(cm, rev);
|
92 |
-
});
|
93 |
-
});
|
94 |
-
}
|
95 |
-
function findNext(cm, rev) {cm.operation(function() {
|
96 |
-
var state = getSearchState(cm);
|
97 |
-
var cursor = getSearchCursor(cm, state.query, rev ? state.posFrom : state.posTo);
|
98 |
-
if (!cursor.find(rev)) {
|
99 |
-
cursor = getSearchCursor(cm, state.query, rev ? CodeMirror.Pos(cm.lastLine()) : CodeMirror.Pos(cm.firstLine(), 0));
|
100 |
-
if (!cursor.find(rev)) return;
|
101 |
-
}
|
102 |
-
cm.setSelection(cursor.from(), cursor.to());
|
103 |
-
cm.scrollIntoView({from: cursor.from(), to: cursor.to()});
|
104 |
-
state.posFrom = cursor.from(); state.posTo = cursor.to();
|
105 |
-
});}
|
106 |
-
function clearSearch(cm) {cm.operation(function() {
|
107 |
-
var state = getSearchState(cm);
|
108 |
-
state.lastQuery = state.query;
|
109 |
-
if (!state.query) return;
|
110 |
-
state.query = null;
|
111 |
-
cm.removeOverlay(state.overlay);
|
112 |
-
if (state.annotate) { state.annotate.clear(); state.annotate = null; }
|
113 |
-
});}
|
114 |
-
|
115 |
-
var replaceQueryDialog =
|
116 |
-
'Replace: <input type="text" style="width: 10em" class="CodeMirror-search-field"/> <span style="color: #888" class="CodeMirror-search-hint">(Use /re/ syntax for regexp search)</span>';
|
117 |
-
var replacementQueryDialog = 'With: <input type="text" style="width: 10em" class="CodeMirror-search-field"/>';
|
118 |
-
var doReplaceConfirm = "Replace? <button>Yes</button> <button>No</button> <button>Stop</button>";
|
119 |
-
function replace(cm, all) {
|
120 |
-
if (cm.getOption("readOnly")) return;
|
121 |
-
var query = cm.getSelection() || getSearchState().lastQuery;
|
122 |
-
dialog(cm, replaceQueryDialog, "Replace:", query, function(query) {
|
123 |
-
if (!query) return;
|
124 |
-
query = parseQuery(query);
|
125 |
-
dialog(cm, replacementQueryDialog, "Replace with:", "", function(text) {
|
126 |
-
if (all) {
|
127 |
-
cm.operation(function() {
|
128 |
-
for (var cursor = getSearchCursor(cm, query); cursor.findNext();) {
|
129 |
-
if (typeof query != "string") {
|
130 |
-
var match = cm.getRange(cursor.from(), cursor.to()).match(query);
|
131 |
-
cursor.replace(text.replace(/\$(\d)/g, function(_, i) {return match[i];}));
|
132 |
-
} else cursor.replace(text);
|
133 |
-
}
|
134 |
-
});
|
135 |
-
} else {
|
136 |
-
clearSearch(cm);
|
137 |
-
var cursor = getSearchCursor(cm, query, cm.getCursor());
|
138 |
-
var advance = function() {
|
139 |
-
var start = cursor.from(), match;
|
140 |
-
if (!(match = cursor.findNext())) {
|
141 |
-
cursor = getSearchCursor(cm, query);
|
142 |
-
if (!(match = cursor.findNext()) ||
|
143 |
-
(start && cursor.from().line == start.line && cursor.from().ch == start.ch)) return;
|
144 |
-
}
|
145 |
-
cm.setSelection(cursor.from(), cursor.to());
|
146 |
-
cm.scrollIntoView({from: cursor.from(), to: cursor.to()});
|
147 |
-
confirmDialog(cm, doReplaceConfirm, "Replace?",
|
148 |
-
[function() {doReplace(match);}, advance]);
|
149 |
-
};
|
150 |
-
var doReplace = function(match) {
|
151 |
-
cursor.replace(typeof query == "string" ? text :
|
152 |
-
text.replace(/\$(\d)/g, function(_, i) {return match[i];}));
|
153 |
-
advance();
|
154 |
-
};
|
155 |
-
advance();
|
156 |
-
}
|
157 |
-
});
|
158 |
-
});
|
159 |
-
}
|
160 |
-
|
161 |
-
CodeMirror.commands.find = function(cm) {clearSearch(cm); doSearch(cm);};
|
162 |
-
CodeMirror.commands.findNext = doSearch;
|
163 |
-
CodeMirror.commands.findPrev = function(cm) {doSearch(cm, true);};
|
164 |
-
CodeMirror.commands.clearSearch = clearSearch;
|
165 |
-
CodeMirror.commands.replace = replace;
|
166 |
-
CodeMirror.commands.replaceAll = function(cm) {replace(cm, true);};
|
167 |
-
});
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
vendor/codemirror/addon/search/searchcursor.js
DELETED
@@ -1,189 +0,0 @@
|
|
1 |
-
// CodeMirror, copyright (c) by Marijn Haverbeke and others
|
2 |
-
// Distributed under an MIT license: http://codemirror.net/LICENSE
|
3 |
-
|
4 |
-
(function(mod) {
|
5 |
-
if (typeof exports == "object" && typeof module == "object") // CommonJS
|
6 |
-
mod(require("../../lib/codemirror"));
|
7 |
-
else if (typeof define == "function" && define.amd) // AMD
|
8 |
-
define(["../../lib/codemirror"], mod);
|
9 |
-
else // Plain browser env
|
10 |
-
mod(CodeMirror);
|
11 |
-
})(function(CodeMirror) {
|
12 |
-
"use strict";
|
13 |
-
var Pos = CodeMirror.Pos;
|
14 |
-
|
15 |
-
function SearchCursor(doc, query, pos, caseFold) {
|
16 |
-
this.atOccurrence = false; this.doc = doc;
|
17 |
-
if (caseFold == null && typeof query == "string") caseFold = false;
|
18 |
-
|
19 |
-
pos = pos ? doc.clipPos(pos) : Pos(0, 0);
|
20 |
-
this.pos = {from: pos, to: pos};
|
21 |
-
|
22 |
-
// The matches method is filled in based on the type of query.
|
23 |
-
// It takes a position and a direction, and returns an object
|
24 |
-
// describing the next occurrence of the query, or null if no
|
25 |
-
// more matches were found.
|
26 |
-
if (typeof query != "string") { // Regexp match
|
27 |
-
if (!query.global) query = new RegExp(query.source, query.ignoreCase ? "ig" : "g");
|
28 |
-
this.matches = function(reverse, pos) {
|
29 |
-
if (reverse) {
|
30 |
-
query.lastIndex = 0;
|
31 |
-
var line = doc.getLine(pos.line).slice(0, pos.ch), cutOff = 0, match, start;
|
32 |
-
for (;;) {
|
33 |
-
query.lastIndex = cutOff;
|
34 |
-
var newMatch = query.exec(line);
|
35 |
-
if (!newMatch) break;
|
36 |
-
match = newMatch;
|
37 |
-
start = match.index;
|
38 |
-
cutOff = match.index + (match[0].length || 1);
|
39 |
-
if (cutOff == line.length) break;
|
40 |
-
}
|
41 |
-
var matchLen = (match && match[0].length) || 0;
|
42 |
-
if (!matchLen) {
|
43 |
-
if (start == 0 && line.length == 0) {match = undefined;}
|
44 |
-
else if (start != doc.getLine(pos.line).length) {
|
45 |
-
matchLen++;
|
46 |
-
}
|
47 |
-
}
|
48 |
-
} else {
|
49 |
-
query.lastIndex = pos.ch;
|
50 |
-
var line = doc.getLine(pos.line), match = query.exec(line);
|
51 |
-
var matchLen = (match && match[0].length) || 0;
|
52 |
-
var start = match && match.index;
|
53 |
-
if (start + matchLen != line.length && !matchLen) matchLen = 1;
|
54 |
-
}
|
55 |
-
if (match && matchLen)
|
56 |
-
return {from: Pos(pos.line, start),
|
57 |
-
to: Pos(pos.line, start + matchLen),
|
58 |
-
match: match};
|
59 |
-
};
|
60 |
-
} else { // String query
|
61 |
-
var origQuery = query;
|
62 |
-
if (caseFold) query = query.toLowerCase();
|
63 |
-
var fold = caseFold ? function(str){return str.toLowerCase();} : function(str){return str;};
|
64 |
-
var target = query.split("\n");
|
65 |
-
// Different methods for single-line and multi-line queries
|
66 |
-
if (target.length == 1) {
|
67 |
-
if (!query.length) {
|
68 |
-
// Empty string would match anything and never progress, so
|
69 |
-
// we define it to match nothing instead.
|
70 |
-
this.matches = function() {};
|
71 |
-
} else {
|
72 |
-
this.matches = function(reverse, pos) {
|
73 |
-
if (reverse) {
|
74 |
-
var orig = doc.getLine(pos.line).slice(0, pos.ch), line = fold(orig);
|
75 |
-
var match = line.lastIndexOf(query);
|
76 |
-
if (match > -1) {
|
77 |
-
match = adjustPos(orig, line, match);
|
78 |
-
return {from: Pos(pos.line, match), to: Pos(pos.line, match + origQuery.length)};
|
79 |
-
}
|
80 |
-
} else {
|
81 |
-
var orig = doc.getLine(pos.line).slice(pos.ch), line = fold(orig);
|
82 |
-
var match = line.indexOf(query);
|
83 |
-
if (match > -1) {
|
84 |
-
match = adjustPos(orig, line, match) + pos.ch;
|
85 |
-
return {from: Pos(pos.line, match), to: Pos(pos.line, match + origQuery.length)};
|
86 |
-
}
|
87 |
-
}
|
88 |
-
};
|
89 |
-
}
|
90 |
-
} else {
|
91 |
-
var origTarget = origQuery.split("\n");
|
92 |
-
this.matches = function(reverse, pos) {
|
93 |
-
var last = target.length - 1;
|
94 |
-
if (reverse) {
|
95 |
-
if (pos.line - (target.length - 1) < doc.firstLine()) return;
|
96 |
-
if (fold(doc.getLine(pos.line).slice(0, origTarget[last].length)) != target[target.length - 1]) return;
|
97 |
-
var to = Pos(pos.line, origTarget[last].length);
|
98 |
-
for (var ln = pos.line - 1, i = last - 1; i >= 1; --i, --ln)
|
99 |
-
if (target[i] != fold(doc.getLine(ln))) return;
|
100 |
-
var line = doc.getLine(ln), cut = line.length - origTarget[0].length;
|
101 |
-
if (fold(line.slice(cut)) != target[0]) return;
|
102 |
-
return {from: Pos(ln, cut), to: to};
|
103 |
-
} else {
|
104 |
-
if (pos.line + (target.length - 1) > doc.lastLine()) return;
|
105 |
-
var line = doc.getLine(pos.line), cut = line.length - origTarget[0].length;
|
106 |
-
if (fold(line.slice(cut)) != target[0]) return;
|
107 |
-
var from = Pos(pos.line, cut);
|
108 |
-
for (var ln = pos.line + 1, i = 1; i < last; ++i, ++ln)
|
109 |
-
if (target[i] != fold(doc.getLine(ln))) return;
|
110 |
-
if (fold(doc.getLine(ln).slice(0, origTarget[last].length)) != target[last]) return;
|
111 |
-
return {from: from, to: Pos(ln, origTarget[last].length)};
|
112 |
-
}
|
113 |
-
};
|
114 |
-
}
|
115 |
-
}
|
116 |
-
}
|
117 |
-
|
118 |
-
SearchCursor.prototype = {
|
119 |
-
findNext: function() {return this.find(false);},
|
120 |
-
findPrevious: function() {return this.find(true);},
|
121 |
-
|
122 |
-
find: function(reverse) {
|
123 |
-
var self = this, pos = this.doc.clipPos(reverse ? this.pos.from : this.pos.to);
|
124 |
-
function savePosAndFail(line) {
|
125 |
-
var pos = Pos(line, 0);
|
126 |
-
self.pos = {from: pos, to: pos};
|
127 |
-
self.atOccurrence = false;
|
128 |
-
return false;
|
129 |
-
}
|
130 |
-
|
131 |
-
for (;;) {
|
132 |
-
if (this.pos = this.matches(reverse, pos)) {
|
133 |
-
this.atOccurrence = true;
|
134 |
-
return this.pos.match || true;
|
135 |
-
}
|
136 |
-
if (reverse) {
|
137 |
-
if (!pos.line) return savePosAndFail(0);
|
138 |
-
pos = Pos(pos.line-1, this.doc.getLine(pos.line-1).length);
|
139 |
-
}
|
140 |
-
else {
|
141 |
-
var maxLine = this.doc.lineCount();
|
142 |
-
if (pos.line == maxLine - 1) return savePosAndFail(maxLine);
|
143 |
-
pos = Pos(pos.line + 1, 0);
|
144 |
-
}
|
145 |
-
}
|
146 |
-
},
|
147 |
-
|
148 |
-
from: function() {if (this.atOccurrence) return this.pos.from;},
|
149 |
-
to: function() {if (this.atOccurrence) return this.pos.to;},
|
150 |
-
|
151 |
-
replace: function(newText, origin) {
|
152 |
-
if (!this.atOccurrence) return;
|
153 |
-
var lines = CodeMirror.splitLines(newText);
|
154 |
-
this.doc.replaceRange(lines, this.pos.from, this.pos.to, origin);
|
155 |
-
this.pos.to = Pos(this.pos.from.line + lines.length - 1,
|
156 |
-
lines[lines.length - 1].length + (lines.length == 1 ? this.pos.from.ch : 0));
|
157 |
-
}
|
158 |
-
};
|
159 |
-
|
160 |
-
// Maps a position in a case-folded line back to a position in the original line
|
161 |
-
// (compensating for codepoints increasing in number during folding)
|
162 |
-
function adjustPos(orig, folded, pos) {
|
163 |
-
if (orig.length == folded.length) return pos;
|
164 |
-
for (var pos1 = Math.min(pos, orig.length);;) {
|
165 |
-
var len1 = orig.slice(0, pos1).toLowerCase().length;
|
166 |
-
if (len1 < pos) ++pos1;
|
167 |
-
else if (len1 > pos) --pos1;
|
168 |
-
else return pos1;
|
169 |
-
}
|
170 |
-
}
|
171 |
-
|
172 |
-
CodeMirror.defineExtension("getSearchCursor", function(query, pos, caseFold) {
|
173 |
-
return new SearchCursor(this.doc, query, pos, caseFold);
|
174 |
-
});
|
175 |
-
CodeMirror.defineDocExtension("getSearchCursor", function(query, pos, caseFold) {
|
176 |
-
return new SearchCursor(this, query, pos, caseFold);
|
177 |
-
});
|
178 |
-
|
179 |
-
CodeMirror.defineExtension("selectMatches", function(query, caseFold) {
|
180 |
-
var ranges = [], next;
|
181 |
-
var cur = this.getSearchCursor(query, this.getCursor("from"), caseFold);
|
182 |
-
while (next = cur.findNext()) {
|
183 |
-
if (CodeMirror.cmpPos(cur.to(), this.getCursor("to")) > 0) break;
|
184 |
-
ranges.push({anchor: cur.from(), head: cur.to()});
|
185 |
-
}
|
186 |
-
if (ranges.length)
|
187 |
-
this.setSelections(ranges, 0);
|
188 |
-
});
|
189 |
-
});
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
vendor/codemirror/lib/codemirror.css
DELETED
@@ -1,325 +0,0 @@
|
|
1 |
-
/* BASICS */
|
2 |
-
|
3 |
-
.CodeMirror {
|
4 |
-
/* Set height, width, borders, and global font properties here */
|
5 |
-
font-family: monospace;
|
6 |
-
height: 300px;
|
7 |
-
color: black;
|
8 |
-
}
|
9 |
-
|
10 |
-
/* PADDING */
|
11 |
-
|
12 |
-
.CodeMirror-lines {
|
13 |
-
padding: 4px 0; /* Vertical padding around content */
|
14 |
-
}
|
15 |
-
.CodeMirror pre {
|
16 |
-
padding: 0 4px; /* Horizontal padding of content */
|
17 |
-
}
|
18 |
-
|
19 |
-
.CodeMirror-scrollbar-filler, .CodeMirror-gutter-filler {
|
20 |
-
background-color: white; /* The little square between H and V scrollbars */
|
21 |
-
}
|
22 |
-
|
23 |
-
/* GUTTER */
|
24 |
-
|
25 |
-
.CodeMirror-gutters {
|
26 |
-
border-right: 1px solid #ddd;
|
27 |
-
background-color: #f7f7f7;
|
28 |
-
white-space: nowrap;
|
29 |
-
}
|
30 |
-
.CodeMirror-linenumbers {}
|
31 |
-
.CodeMirror-linenumber {
|
32 |
-
padding: 0 3px 0 5px;
|
33 |
-
min-width: 20px;
|
34 |
-
text-align: right;
|
35 |
-
color: #999;
|
36 |
-
white-space: nowrap;
|
37 |
-
}
|
38 |
-
|
39 |
-
.CodeMirror-guttermarker { color: black; }
|
40 |
-
.CodeMirror-guttermarker-subtle { color: #999; }
|
41 |
-
|
42 |
-
/* CURSOR */
|
43 |
-
|
44 |
-
.CodeMirror div.CodeMirror-cursor {
|
45 |
-
border-left: 1px solid black;
|
46 |
-
}
|
47 |
-
/* Shown when moving in bi-directional text */
|
48 |
-
.CodeMirror div.CodeMirror-secondarycursor {
|
49 |
-
border-left: 1px solid silver;
|
50 |
-
}
|
51 |
-
.CodeMirror.cm-fat-cursor div.CodeMirror-cursor {
|
52 |
-
width: auto;
|
53 |
-
border: 0;
|
54 |
-
background: #7e7;
|
55 |
-
}
|
56 |
-
.CodeMirror.cm-fat-cursor div.CodeMirror-cursors {
|
57 |
-
z-index: 1;
|
58 |
-
}
|
59 |
-
|
60 |
-
.cm-animate-fat-cursor {
|
61 |
-
width: auto;
|
62 |
-
border: 0;
|
63 |
-
-webkit-animation: blink 1.06s steps(1) infinite;
|
64 |
-
-moz-animation: blink 1.06s steps(1) infinite;
|
65 |
-
animation: blink 1.06s steps(1) infinite;
|
66 |
-
}
|
67 |
-
@-moz-keyframes blink {
|
68 |
-
0% { background: #7e7; }
|
69 |
-
50% { background: none; }
|
70 |
-
100% { background: #7e7; }
|
71 |
-
}
|
72 |
-
@-webkit-keyframes blink {
|
73 |
-
0% { background: #7e7; }
|
74 |
-
50% { background: none; }
|
75 |
-
100% { background: #7e7; }
|
76 |
-
}
|
77 |
-
@keyframes blink {
|
78 |
-
0% { background: #7e7; }
|
79 |
-
50% { background: none; }
|
80 |
-
100% { background: #7e7; }
|
81 |
-
}
|
82 |
-
|
83 |
-
/* Can style cursor different in overwrite (non-insert) mode */
|
84 |
-
div.CodeMirror-overwrite div.CodeMirror-cursor {}
|
85 |
-
|
86 |
-
.cm-tab { display: inline-block; text-decoration: inherit; }
|
87 |
-
|
88 |
-
.CodeMirror-ruler {
|
89 |
-
border-left: 1px solid #ccc;
|
90 |
-
position: absolute;
|
91 |
-
}
|
92 |
-
|
93 |
-
/* DEFAULT THEME */
|
94 |
-
|
95 |
-
.cm-s-default .cm-keyword {color: #708;}
|
96 |
-
.cm-s-default .cm-atom {color: #219;}
|
97 |
-
.cm-s-default .cm-number {color: #164;}
|
98 |
-
.cm-s-default .cm-def {color: #00f;}
|
99 |
-
.cm-s-default .cm-variable,
|
100 |
-
.cm-s-default .cm-punctuation,
|
101 |
-
.cm-s-default .cm-property,
|
102 |
-
.cm-s-default .cm-operator {}
|
103 |
-
.cm-s-default .cm-variable-2 {color: #05a;}
|
104 |
-
.cm-s-default .cm-variable-3 {color: #085;}
|
105 |
-
.cm-s-default .cm-comment {color: #a50;}
|
106 |
-
.cm-s-default .cm-string {color: #a11;}
|
107 |
-
.cm-s-default .cm-string-2 {color: #f50;}
|
108 |
-
.cm-s-default .cm-meta {color: #555;}
|
109 |
-
.cm-s-default .cm-qualifier {color: #555;}
|
110 |
-
.cm-s-default .cm-builtin {color: #30a;}
|
111 |
-
.cm-s-default .cm-bracket {color: #997;}
|
112 |
-
.cm-s-default .cm-tag {color: #170;}
|
113 |
-
.cm-s-default .cm-attribute {color: #00c;}
|
114 |
-
.cm-s-default .cm-header {color: blue;}
|
115 |
-
.cm-s-default .cm-quote {color: #090;}
|
116 |
-
.cm-s-default .cm-hr {color: #999;}
|
117 |
-
.cm-s-default .cm-link {color: #00c;}
|
118 |
-
|
119 |
-
.cm-negative {color: #d44;}
|
120 |
-
.cm-positive {color: #292;}
|
121 |
-
.cm-header, .cm-strong {font-weight: bold;}
|
122 |
-
.cm-em {font-style: italic;}
|
123 |
-
.cm-link {text-decoration: underline;}
|
124 |
-
.cm-strikethrough {text-decoration: line-through;}
|
125 |
-
|
126 |
-
.cm-s-default .cm-error {color: #f00;}
|
127 |
-
.cm-invalidchar {color: #f00;}
|
128 |
-
|
129 |
-
.CodeMirror-composing { border-bottom: 2px solid; }
|
130 |
-
|
131 |
-
/* Default styles for common addons */
|
132 |
-
|
133 |
-
div.CodeMirror span.CodeMirror-matchingbracket {color: #0f0;}
|
134 |
-
div.CodeMirror span.CodeMirror-nonmatchingbracket {color: #f22;}
|
135 |
-
.CodeMirror-matchingtag { background: rgba(255, 150, 0, .3); }
|
136 |
-
.CodeMirror-activeline-background {background: #e8f2ff;}
|
137 |
-
|
138 |
-
/* STOP */
|
139 |
-
|
140 |
-
/* The rest of this file contains styles related to the mechanics of
|
141 |
-
the editor. You probably shouldn't touch them. */
|
142 |
-
|
143 |
-
.CodeMirror {
|
144 |
-
position: relative;
|
145 |
-
overflow: hidden;
|
146 |
-
background: white;
|
147 |
-
}
|
148 |
-
|
149 |
-
.CodeMirror-scroll {
|
150 |
-
overflow: scroll !important; /* Things will break if this is overridden */
|
151 |
-
/* 30px is the magic margin used to hide the element's real scrollbars */
|
152 |
-
/* See overflow: hidden in .CodeMirror */
|
153 |
-
margin-bottom: -30px; margin-right: -30px;
|
154 |
-
padding-bottom: 30px;
|
155 |
-
height: 100%;
|
156 |
-
outline: none; /* Prevent dragging from highlighting the element */
|
157 |
-
position: relative;
|
158 |
-
}
|
159 |
-
.CodeMirror-sizer {
|
160 |
-
position: relative;
|
161 |
-
border-right: 30px solid transparent;
|
162 |
-
}
|
163 |
-
|
164 |
-
/* The fake, visible scrollbars. Used to force redraw during scrolling
|
165 |
-
before actuall scrolling happens, thus preventing shaking and
|
166 |
-
flickering artifacts. */
|
167 |
-
.CodeMirror-vscrollbar, .CodeMirror-hscrollbar, .CodeMirror-scrollbar-filler, .CodeMirror-gutter-filler {
|
168 |
-
position: absolute;
|
169 |
-
z-index: 6;
|
170 |
-
display: none;
|
171 |
-
}
|
172 |
-
.CodeMirror-vscrollbar {
|
173 |
-
right: 0; top: 0;
|
174 |
-
overflow-x: hidden;
|
175 |
-
overflow-y: scroll;
|
176 |
-
}
|
177 |
-
.CodeMirror-hscrollbar {
|
178 |
-
bottom: 0; left: 0;
|
179 |
-
overflow-y: hidden;
|
180 |
-
overflow-x: scroll;
|
181 |
-
}
|
182 |
-
.CodeMirror-scrollbar-filler {
|
183 |
-
right: 0; bottom: 0;
|
184 |
-
}
|
185 |
-
.CodeMirror-gutter-filler {
|
186 |
-
left: 0; bottom: 0;
|
187 |
-
}
|
188 |
-
|
189 |
-
.CodeMirror-gutters {
|
190 |
-
position: absolute; left: 0; top: 0;
|
191 |
-
z-index: 3;
|
192 |
-
}
|
193 |
-
.CodeMirror-gutter {
|
194 |
-
white-space: normal;
|
195 |
-
height: 100%;
|
196 |
-
display: inline-block;
|
197 |
-
margin-bottom: -30px;
|
198 |
-
/* Hack to make IE7 behave */
|
199 |
-
*zoom:1;
|
200 |
-
*display:inline;
|
201 |
-
}
|
202 |
-
.CodeMirror-gutter-wrapper {
|
203 |
-
position: absolute;
|
204 |
-
z-index: 4;
|
205 |
-
height: 100%;
|
206 |
-
}
|
207 |
-
.CodeMirror-gutter-elt {
|
208 |
-
position: absolute;
|
209 |
-
cursor: default;
|
210 |
-
z-index: 4;
|
211 |
-
}
|
212 |
-
.CodeMirror-gutter-wrapper {
|
213 |
-
-webkit-user-select: none;
|
214 |
-
-moz-user-select: none;
|
215 |
-
user-select: none;
|
216 |
-
}
|
217 |
-
|
218 |
-
.CodeMirror-lines {
|
219 |
-
cursor: text;
|
220 |
-
min-height: 1px; /* prevents collapsing before first draw */
|
221 |
-
}
|
222 |
-
.CodeMirror pre {
|
223 |
-
/* Reset some styles that the rest of the page might have set */
|
224 |
-
-moz-border-radius: 0; -webkit-border-radius: 0; border-radius: 0;
|
225 |
-
border-width: 0;
|
226 |
-
background: transparent;
|
227 |
-
font-family: inherit;
|
228 |
-
font-size: inherit;
|
229 |
-
margin: 0;
|
230 |
-
white-space: pre;
|
231 |
-
word-wrap: normal;
|
232 |
-
line-height: inherit;
|
233 |
-
color: inherit;
|
234 |
-
z-index: 2;
|
235 |
-
position: relative;
|
236 |
-
overflow: visible;
|
237 |
-
-webkit-tap-highlight-color: transparent;
|
238 |
-
}
|
239 |
-
.CodeMirror-wrap pre {
|
240 |
-
word-wrap: break-word;
|
241 |
-
white-space: pre-wrap;
|
242 |
-
word-break: normal;
|
243 |
-
}
|
244 |
-
|
245 |
-
.CodeMirror-linebackground {
|
246 |
-
position: absolute;
|
247 |
-
left: 0; right: 0; top: 0; bottom: 0;
|
248 |
-
z-index: 0;
|
249 |
-
}
|
250 |
-
|
251 |
-
.CodeMirror-linewidget {
|
252 |
-
position: relative;
|
253 |
-
z-index: 2;
|
254 |
-
overflow: auto;
|
255 |
-
}
|
256 |
-
|
257 |
-
.CodeMirror-widget {}
|
258 |
-
|
259 |
-
.CodeMirror-code {
|
260 |
-
outline: none;
|
261 |
-
}
|
262 |
-
|
263 |
-
/* Force content-box sizing for the elements where we expect it */
|
264 |
-
.CodeMirror-scroll,
|
265 |
-
.CodeMirror-sizer,
|
266 |
-
.CodeMirror-gutter,
|
267 |
-
.CodeMirror-gutters,
|
268 |
-
.CodeMirror-linenumber {
|
269 |
-
-moz-box-sizing: content-box;
|
270 |
-
box-sizing: content-box;
|
271 |
-
}
|
272 |
-
|
273 |
-
.CodeMirror-measure {
|
274 |
-
position: absolute;
|
275 |
-
width: 100%;
|
276 |
-
height: 0;
|
277 |
-
overflow: hidden;
|
278 |
-
visibility: hidden;
|
279 |
-
}
|
280 |
-
.CodeMirror-measure pre { position: static; }
|
281 |
-
|
282 |
-
.CodeMirror div.CodeMirror-cursor {
|
283 |
-
position: absolute;
|
284 |
-
border-right: none;
|
285 |
-
width: 0;
|
286 |
-
}
|
287 |
-
|
288 |
-
div.CodeMirror-cursors {
|
289 |
-
visibility: hidden;
|
290 |
-
position: relative;
|
291 |
-
z-index: 3;
|
292 |
-
}
|
293 |
-
.CodeMirror-focused div.CodeMirror-cursors {
|
294 |
-
visibility: visible;
|
295 |
-
}
|
296 |
-
|
297 |
-
.CodeMirror-selected { background: #d9d9d9; }
|
298 |
-
.CodeMirror-focused .CodeMirror-selected { background: #d7d4f0; }
|
299 |
-
.CodeMirror-crosshair { cursor: crosshair; }
|
300 |
-
.CodeMirror ::selection { background: #d7d4f0; }
|
301 |
-
.CodeMirror ::-moz-selection { background: #d7d4f0; }
|
302 |
-
|
303 |
-
.cm-searching {
|
304 |
-
background: #ffa;
|
305 |
-
background: rgba(255, 255, 0, .4);
|
306 |
-
}
|
307 |
-
|
308 |
-
/* IE7 hack to prevent it from returning funny offsetTops on the spans */
|
309 |
-
.CodeMirror span { *vertical-align: text-bottom; }
|
310 |
-
|
311 |
-
/* Used to force a border model for a node */
|
312 |
-
.cm-force-border { padding-right: .1px; }
|
313 |
-
|
314 |
-
@media print {
|
315 |
-
/* Hide the cursor when printing */
|
316 |
-
.CodeMirror div.CodeMirror-cursors {
|
317 |
-
visibility: hidden;
|
318 |
-
}
|
319 |
-
}
|
320 |
-
|
321 |
-
/* See issue #2901 */
|
322 |
-
.cm-tab-wrap-hack:after { content: ''; }
|
323 |
-
|
324 |
-
/* Help users use markselection to safely style text background */
|
325 |
-
span.CodeMirror-selectedtext { background: none; }
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
vendor/codemirror/lib/codemirror.js
DELETED
@@ -1,8738 +0,0 @@
|
|
1 |
-
// CodeMirror, copyright (c) by Marijn Haverbeke and others
|
2 |
-
// Distributed under an MIT license: http://codemirror.net/LICENSE
|
3 |
-
|
4 |
-
// This is CodeMirror (http://codemirror.net), a code editor
|
5 |
-
// implemented in JavaScript on top of the browser's DOM.
|
6 |
-
//
|
7 |
-
// You can find some technical background for some of the code below
|
8 |
-
// at http://marijnhaverbeke.nl/blog/#cm-internals .
|
9 |
-
|
10 |
-
(function(mod) {
|
11 |
-
if (typeof exports == "object" && typeof module == "object") // CommonJS
|
12 |
-
module.exports = mod();
|
13 |
-
else if (typeof define == "function" && define.amd) // AMD
|
14 |
-
return define([], mod);
|
15 |
-
else // Plain browser env
|
16 |
-
this.CodeMirror = mod();
|
17 |
-
})(function() {
|
18 |
-
"use strict";
|
19 |
-
|
20 |
-
// BROWSER SNIFFING
|
21 |
-
|
22 |
-
// Kludges for bugs and behavior differences that can't be feature
|
23 |
-
// detected are enabled based on userAgent etc sniffing.
|
24 |
-
|
25 |
-
var gecko = /gecko\/\d/i.test(navigator.userAgent);
|
26 |
-
var ie_upto10 = /MSIE \d/.test(navigator.userAgent);
|
27 |
-
var ie_11up = /Trident\/(?:[7-9]|\d{2,})\..*rv:(\d+)/.exec(navigator.userAgent);
|
28 |
-
var ie = ie_upto10 || ie_11up;
|
29 |
-
var ie_version = ie && (ie_upto10 ? document.documentMode || 6 : ie_11up[1]);
|
30 |
-
var webkit = /WebKit\//.test(navigator.userAgent);
|
31 |
-
var qtwebkit = webkit && /Qt\/\d+\.\d+/.test(navigator.userAgent);
|
32 |
-
var chrome = /Chrome\//.test(navigator.userAgent);
|
33 |
-
var presto = /Opera\//.test(navigator.userAgent);
|
34 |
-
var safari = /Apple Computer/.test(navigator.vendor);
|
35 |
-
var mac_geMountainLion = /Mac OS X 1\d\D([8-9]|\d\d)\D/.test(navigator.userAgent);
|
36 |
-
var phantom = /PhantomJS/.test(navigator.userAgent);
|
37 |
-
|
38 |
-
var ios = /AppleWebKit/.test(navigator.userAgent) && /Mobile\/\w+/.test(navigator.userAgent);
|
39 |
-
// This is woefully incomplete. Suggestions for alternative methods welcome.
|
40 |
-
var mobile = ios || /Android|webOS|BlackBerry|Opera Mini|Opera Mobi|IEMobile/i.test(navigator.userAgent);
|
41 |
-
var mac = ios || /Mac/.test(navigator.platform);
|
42 |
-
var windows = /win/i.test(navigator.platform);
|
43 |
-
|
44 |
-
var presto_version = presto && navigator.userAgent.match(/Version\/(\d*\.\d*)/);
|
45 |
-
if (presto_version) presto_version = Number(presto_version[1]);
|
46 |
-
if (presto_version && presto_version >= 15) { presto = false; webkit = true; }
|
47 |
-
// Some browsers use the wrong event properties to signal cmd/ctrl on OS X
|
48 |
-
var flipCtrlCmd = mac && (qtwebkit || presto && (presto_version == null || presto_version < 12.11));
|
49 |
-
var captureRightClick = gecko || (ie && ie_version >= 9);
|
50 |
-
|
51 |
-
// Optimize some code when these features are not used.
|
52 |
-
var sawReadOnlySpans = false, sawCollapsedSpans = false;
|
53 |
-
|
54 |
-
// EDITOR CONSTRUCTOR
|
55 |
-
|
56 |
-
// A CodeMirror instance represents an editor. This is the object
|
57 |
-
// that user code is usually dealing with.
|
58 |
-
|
59 |
-
function CodeMirror(place, options) {
|
60 |
-
if (!(this instanceof CodeMirror)) return new CodeMirror(place, options);
|
61 |
-
|
62 |
-
this.options = options = options ? copyObj(options) : {};
|
63 |
-
// Determine effective options based on given values and defaults.
|
64 |
-
copyObj(defaults, options, false);
|
65 |
-
setGuttersForLineNumbers(options);
|
66 |
-
|
67 |
-
var doc = options.value;
|
68 |
-
if (typeof doc == "string") doc = new Doc(doc, options.mode);
|
69 |
-
this.doc = doc;
|
70 |
-
|
71 |
-
var input = new CodeMirror.inputStyles[options.inputStyle](this);
|
72 |
-
var display = this.display = new Display(place, doc, input);
|
73 |
-
display.wrapper.CodeMirror = this;
|
74 |
-
updateGutters(this);
|
75 |
-
themeChanged(this);
|
76 |
-
if (options.lineWrapping)
|
77 |
-
this.display.wrapper.className += " CodeMirror-wrap";
|
78 |
-
if (options.autofocus && !mobile) display.input.focus();
|
79 |
-
initScrollbars(this);
|
80 |
-
|
81 |
-
this.state = {
|
82 |
-
keyMaps: [], // stores maps added by addKeyMap
|
83 |
-
overlays: [], // highlighting overlays, as added by addOverlay
|
84 |
-
modeGen: 0, // bumped when mode/overlay changes, used to invalidate highlighting info
|
85 |
-
overwrite: false,
|
86 |
-
delayingBlurEvent: false,
|
87 |
-
focused: false,
|
88 |
-
suppressEdits: false, // used to disable editing during key handlers when in readOnly mode
|
89 |
-
pasteIncoming: false, cutIncoming: false, // help recognize paste/cut edits in input.poll
|
90 |
-
draggingText: false,
|
91 |
-
highlight: new Delayed(), // stores highlight worker timeout
|
92 |
-
keySeq: null, // Unfinished key sequence
|
93 |
-
specialChars: null
|
94 |
-
};
|
95 |
-
|
96 |
-
var cm = this;
|
97 |
-
|
98 |
-
// Override magic textarea content restore that IE sometimes does
|
99 |
-
// on our hidden textarea on reload
|
100 |
-
if (ie && ie_version < 11) setTimeout(function() { cm.display.input.reset(true); }, 20);
|
101 |
-
|
102 |
-
registerEventHandlers(this);
|
103 |
-
ensureGlobalHandlers();
|
104 |
-
|
105 |
-
startOperation(this);
|
106 |
-
this.curOp.forceUpdate = true;
|
107 |
-
attachDoc(this, doc);
|
108 |
-
|
109 |
-
if ((options.autofocus && !mobile) || cm.hasFocus())
|
110 |
-
setTimeout(bind(onFocus, this), 20);
|
111 |
-
else
|
112 |
-
onBlur(this);
|
113 |
-
|
114 |
-
for (var opt in optionHandlers) if (optionHandlers.hasOwnProperty(opt))
|
115 |
-
optionHandlers[opt](this, options[opt], Init);
|
116 |
-
maybeUpdateLineNumberWidth(this);
|
117 |
-
if (options.finishInit) options.finishInit(this);
|
118 |
-
for (var i = 0; i < initHooks.length; ++i) initHooks[i](this);
|
119 |
-
endOperation(this);
|
120 |
-
// Suppress optimizelegibility in Webkit, since it breaks text
|
121 |
-
// measuring on line wrapping boundaries.
|
122 |
-
if (webkit && options.lineWrapping &&
|
123 |
-
getComputedStyle(display.lineDiv).textRendering == "optimizelegibility")
|
124 |
-
display.lineDiv.style.textRendering = "auto";
|
125 |
-
}
|
126 |
-
|
127 |
-
// DISPLAY CONSTRUCTOR
|
128 |
-
|
129 |
-
// The display handles the DOM integration, both for input reading
|
130 |
-
// and content drawing. It holds references to DOM nodes and
|
131 |
-
// display-related state.
|
132 |
-
|
133 |
-
function Display(place, doc, input) {
|
134 |
-
var d = this;
|
135 |
-
this.input = input;
|
136 |
-
|
137 |
-
// Covers bottom-right square when both scrollbars are present.
|
138 |
-
d.scrollbarFiller = elt("div", null, "CodeMirror-scrollbar-filler");
|
139 |
-
d.scrollbarFiller.setAttribute("cm-not-content", "true");
|
140 |
-
// Covers bottom of gutter when coverGutterNextToScrollbar is on
|
141 |
-
// and h scrollbar is present.
|
142 |
-
d.gutterFiller = elt("div", null, "CodeMirror-gutter-filler");
|
143 |
-
d.gutterFiller.setAttribute("cm-not-content", "true");
|
144 |
-
// Will contain the actual code, positioned to cover the viewport.
|
145 |
-
d.lineDiv = elt("div", null, "CodeMirror-code");
|
146 |
-
// Elements are added to these to represent selection and cursors.
|
147 |
-
d.selectionDiv = elt("div", null, null, "position: relative; z-index: 1");
|
148 |
-
d.cursorDiv = elt("div", null, "CodeMirror-cursors");
|
149 |
-
// A visibility: hidden element used to find the size of things.
|
150 |
-
d.measure = elt("div", null, "CodeMirror-measure");
|
151 |
-
// When lines outside of the viewport are measured, they are drawn in this.
|
152 |
-
d.lineMeasure = elt("div", null, "CodeMirror-measure");
|
153 |
-
// Wraps everything that needs to exist inside the vertically-padded coordinate system
|
154 |
-
d.lineSpace = elt("div", [d.measure, d.lineMeasure, d.selectionDiv, d.cursorDiv, d.lineDiv],
|
155 |
-
null, "position: relative; outline: none");
|
156 |
-
// Moved around its parent to cover visible view.
|
157 |
-
d.mover = elt("div", [elt("div", [d.lineSpace], "CodeMirror-lines")], null, "position: relative");
|
158 |
-
// Set to the height of the document, allowing scrolling.
|
159 |
-
d.sizer = elt("div", [d.mover], "CodeMirror-sizer");
|
160 |
-
d.sizerWidth = null;
|
161 |
-
// Behavior of elts with overflow: auto and padding is
|
162 |
-
// inconsistent across browsers. This is used to ensure the
|
163 |
-
// scrollable area is big enough.
|
164 |
-
d.heightForcer = elt("div", null, null, "position: absolute; height: " + scrollerGap + "px; width: 1px;");
|
165 |
-
// Will contain the gutters, if any.
|
166 |
-
d.gutters = elt("div", null, "CodeMirror-gutters");
|
167 |
-
d.lineGutter = null;
|
168 |
-
// Actual scrollable element.
|
169 |
-
d.scroller = elt("div", [d.sizer, d.heightForcer, d.gutters], "CodeMirror-scroll");
|
170 |
-
d.scroller.setAttribute("tabIndex", "-1");
|
171 |
-
// The element in which the editor lives.
|
172 |
-
d.wrapper = elt("div", [d.scrollbarFiller, d.gutterFiller, d.scroller], "CodeMirror");
|
173 |
-
|
174 |
-
// Work around IE7 z-index bug (not perfect, hence IE7 not really being supported)
|
175 |
-
if (ie && ie_version < 8) { d.gutters.style.zIndex = -1; d.scroller.style.paddingRight = 0; }
|
176 |
-
if (!webkit && !(gecko && mobile)) d.scroller.draggable = true;
|
177 |
-
|
178 |
-
if (place) {
|
179 |
-
if (place.appendChild) place.appendChild(d.wrapper);
|
180 |
-
else place(d.wrapper);
|
181 |
-
}
|
182 |
-
|
183 |
-
// Current rendered range (may be bigger than the view window).
|
184 |
-
d.viewFrom = d.viewTo = doc.first;
|
185 |
-
d.reportedViewFrom = d.reportedViewTo = doc.first;
|
186 |
-
// Information about the rendered lines.
|
187 |
-
d.view = [];
|
188 |
-
d.renderedView = null;
|
189 |
-
// Holds info about a single rendered line when it was rendered
|
190 |
-
// for measurement, while not in view.
|
191 |
-
d.externalMeasured = null;
|
192 |
-
// Empty space (in pixels) above the view
|
193 |
-
d.viewOffset = 0;
|
194 |
-
d.lastWrapHeight = d.lastWrapWidth = 0;
|
195 |
-
d.updateLineNumbers = null;
|
196 |
-
|
197 |
-
d.nativeBarWidth = d.barHeight = d.barWidth = 0;
|
198 |
-
d.scrollbarsClipped = false;
|
199 |
-
|
200 |
-
// Used to only resize the line number gutter when necessary (when
|
201 |
-
// the amount of lines crosses a boundary that makes its width change)
|
202 |
-
d.lineNumWidth = d.lineNumInnerWidth = d.lineNumChars = null;
|
203 |
-
// Set to true when a non-horizontal-scrolling line widget is
|
204 |
-
// added. As an optimization, line widget aligning is skipped when
|
205 |
-
// this is false.
|
206 |
-
d.alignWidgets = false;
|
207 |
-
|
208 |
-
d.cachedCharWidth = d.cachedTextHeight = d.cachedPaddingH = null;
|
209 |
-
|
210 |
-
// Tracks the maximum line length so that the horizontal scrollbar
|
211 |
-
// can be kept static when scrolling.
|
212 |
-
d.maxLine = null;
|
213 |
-
d.maxLineLength = 0;
|
214 |
-
d.maxLineChanged = false;
|
215 |
-
|
216 |
-
// Used for measuring wheel scrolling granularity
|
217 |
-
d.wheelDX = d.wheelDY = d.wheelStartX = d.wheelStartY = null;
|
218 |
-
|
219 |
-
// True when shift is held down.
|
220 |
-
d.shift = false;
|
221 |
-
|
222 |
-
// Used to track whether anything happened since the context menu
|
223 |
-
// was opened.
|
224 |
-
d.selForContextMenu = null;
|
225 |
-
|
226 |
-
d.activeTouch = null;
|
227 |
-
|
228 |
-
input.init(d);
|
229 |
-
}
|
230 |
-
|
231 |
-
// STATE UPDATES
|
232 |
-
|
233 |
-
// Used to get the editor into a consistent state again when options change.
|
234 |
-
|
235 |
-
function loadMode(cm) {
|
236 |
-
cm.doc.mode = CodeMirror.getMode(cm.options, cm.doc.modeOption);
|
237 |
-
resetModeState(cm);
|
238 |
-
}
|
239 |
-
|
240 |
-
function resetModeState(cm) {
|
241 |
-
cm.doc.iter(function(line) {
|
242 |
-
if (line.stateAfter) line.stateAfter = null;
|
243 |
-
if (line.styles) line.styles = null;
|
244 |
-
});
|
245 |
-
cm.doc.frontier = cm.doc.first;
|
246 |
-
startWorker(cm, 100);
|
247 |
-
cm.state.modeGen++;
|
248 |
-
if (cm.curOp) regChange(cm);
|
249 |
-
}
|
250 |
-
|
251 |
-
function wrappingChanged(cm) {
|
252 |
-
if (cm.options.lineWrapping) {
|
253 |
-
addClass(cm.display.wrapper, "CodeMirror-wrap");
|
254 |
-
cm.display.sizer.style.minWidth = "";
|
255 |
-
cm.display.sizerWidth = null;
|
256 |
-
} else {
|
257 |
-
rmClass(cm.display.wrapper, "CodeMirror-wrap");
|
258 |
-
findMaxLine(cm);
|
259 |
-
}
|
260 |
-
estimateLineHeights(cm);
|
261 |
-
regChange(cm);
|
262 |
-
clearCaches(cm);
|
263 |
-
setTimeout(function(){updateScrollbars(cm);}, 100);
|
264 |
-
}
|
265 |
-
|
266 |
-
// Returns a function that estimates the height of a line, to use as
|
267 |
-
// first approximation until the line becomes visible (and is thus
|
268 |
-
// properly measurable).
|
269 |
-
function estimateHeight(cm) {
|
270 |
-
var th = textHeight(cm.display), wrapping = cm.options.lineWrapping;
|
271 |
-
var perLine = wrapping && Math.max(5, cm.display.scroller.clientWidth / charWidth(cm.display) - 3);
|
272 |
-
return function(line) {
|
273 |
-
if (lineIsHidden(cm.doc, line)) return 0;
|
274 |
-
|
275 |
-
var widgetsHeight = 0;
|
276 |
-
if (line.widgets) for (var i = 0; i < line.widgets.length; i++) {
|
277 |
-
if (line.widgets[i].height) widgetsHeight += line.widgets[i].height;
|
278 |
-
}
|
279 |
-
|
280 |
-
if (wrapping)
|
281 |
-
return widgetsHeight + (Math.ceil(line.text.length / perLine) || 1) * th;
|
282 |
-
else
|
283 |
-
return widgetsHeight + th;
|
284 |
-
};
|
285 |
-
}
|
286 |
-
|
287 |
-
function estimateLineHeights(cm) {
|
288 |
-
var doc = cm.doc, est = estimateHeight(cm);
|
289 |
-
doc.iter(function(line) {
|
290 |
-
var estHeight = est(line);
|
291 |
-
if (estHeight != line.height) updateLineHeight(line, estHeight);
|
292 |
-
});
|
293 |
-
}
|
294 |
-
|
295 |
-
function themeChanged(cm) {
|
296 |
-
cm.display.wrapper.className = cm.display.wrapper.className.replace(/\s*cm-s-\S+/g, "") +
|
297 |
-
cm.options.theme.replace(/(^|\s)\s*/g, " cm-s-");
|
298 |
-
clearCaches(cm);
|
299 |
-
}
|
300 |
-
|
301 |
-
function guttersChanged(cm) {
|
302 |
-
updateGutters(cm);
|
303 |
-
regChange(cm);
|
304 |
-
setTimeout(function(){alignHorizontally(cm);}, 20);
|
305 |
-
}
|
306 |
-
|
307 |
-
// Rebuild the gutter elements, ensure the margin to the left of the
|
308 |
-
// code matches their width.
|
309 |
-
function updateGutters(cm) {
|
310 |
-
var gutters = cm.display.gutters, specs = cm.options.gutters;
|
311 |
-
removeChildren(gutters);
|
312 |
-
for (var i = 0; i < specs.length; ++i) {
|
313 |
-
var gutterClass = specs[i];
|
314 |
-
var gElt = gutters.appendChild(elt("div", null, "CodeMirror-gutter " + gutterClass));
|
315 |
-
if (gutterClass == "CodeMirror-linenumbers") {
|
316 |
-
cm.display.lineGutter = gElt;
|
317 |
-
gElt.style.width = (cm.display.lineNumWidth || 1) + "px";
|
318 |
-
}
|
319 |
-
}
|
320 |
-
gutters.style.display = i ? "" : "none";
|
321 |
-
updateGutterSpace(cm);
|
322 |
-
}
|
323 |
-
|
324 |
-
function updateGutterSpace(cm) {
|
325 |
-
var width = cm.display.gutters.offsetWidth;
|
326 |
-
cm.display.sizer.style.marginLeft = width + "px";
|
327 |
-
}
|
328 |
-
|
329 |
-
// Compute the character length of a line, taking into account
|
330 |
-
// collapsed ranges (see markText) that might hide parts, and join
|
331 |
-
// other lines onto it.
|
332 |
-
function lineLength(line) {
|
333 |
-
if (line.height == 0) return 0;
|
334 |
-
var len = line.text.length, merged, cur = line;
|
335 |
-
while (merged = collapsedSpanAtStart(cur)) {
|
336 |
-
var found = merged.find(0, true);
|
337 |
-
cur = found.from.line;
|
338 |
-
len += found.from.ch - found.to.ch;
|
339 |
-
}
|
340 |
-
cur = line;
|
341 |
-
while (merged = collapsedSpanAtEnd(cur)) {
|
342 |
-
var found = merged.find(0, true);
|
343 |
-
len -= cur.text.length - found.from.ch;
|
344 |
-
cur = found.to.line;
|
345 |
-
len += cur.text.length - found.to.ch;
|
346 |
-
}
|
347 |
-
return len;
|
348 |
-
}
|
349 |
-
|
350 |
-
// Find the longest line in the document.
|
351 |
-
function findMaxLine(cm) {
|
352 |
-
var d = cm.display, doc = cm.doc;
|
353 |
-
d.maxLine = getLine(doc, doc.first);
|
354 |
-
d.maxLineLength = lineLength(d.maxLine);
|
355 |
-
d.maxLineChanged = true;
|
356 |
-
doc.iter(function(line) {
|
357 |
-
var len = lineLength(line);
|
358 |
-
if (len > d.maxLineLength) {
|
359 |
-
d.maxLineLength = len;
|
360 |
-
d.maxLine = line;
|
361 |
-
}
|
362 |
-
});
|
363 |
-
}
|
364 |
-
|
365 |
-
// Make sure the gutters options contains the element
|
366 |
-
// "CodeMirror-linenumbers" when the lineNumbers option is true.
|
367 |
-
function setGuttersForLineNumbers(options) {
|
368 |
-
var found = indexOf(options.gutters, "CodeMirror-linenumbers");
|
369 |
-
if (found == -1 && options.lineNumbers) {
|
370 |
-
options.gutters = options.gutters.concat(["CodeMirror-linenumbers"]);
|
371 |
-
} else if (found > -1 && !options.lineNumbers) {
|
372 |
-
options.gutters = options.gutters.slice(0);
|
373 |
-
options.gutters.splice(found, 1);
|
374 |
-
}
|
375 |
-
}
|
376 |
-
|
377 |
-
// SCROLLBARS
|
378 |
-
|
379 |
-
// Prepare DOM reads needed to update the scrollbars. Done in one
|
380 |
-
// shot to minimize update/measure roundtrips.
|
381 |
-
function measureForScrollbars(cm) {
|
382 |
-
var d = cm.display, gutterW = d.gutters.offsetWidth;
|
383 |
-
var docH = Math.round(cm.doc.height + paddingVert(cm.display));
|
384 |
-
return {
|
385 |
-
clientHeight: d.scroller.clientHeight,
|
386 |
-
viewHeight: d.wrapper.clientHeight,
|
387 |
-
scrollWidth: d.scroller.scrollWidth, clientWidth: d.scroller.clientWidth,
|
388 |
-
viewWidth: d.wrapper.clientWidth,
|
389 |
-
barLeft: cm.options.fixedGutter ? gutterW : 0,
|
390 |
-
docHeight: docH,
|
391 |
-
scrollHeight: docH + scrollGap(cm) + d.barHeight,
|
392 |
-
nativeBarWidth: d.nativeBarWidth,
|
393 |
-
gutterWidth: gutterW
|
394 |
-
};
|
395 |
-
}
|
396 |
-
|
397 |
-
function NativeScrollbars(place, scroll, cm) {
|
398 |
-
this.cm = cm;
|
399 |
-
var vert = this.vert = elt("div", [elt("div", null, null, "min-width: 1px")], "CodeMirror-vscrollbar");
|
400 |
-
var horiz = this.horiz = elt("div", [elt("div", null, null, "height: 100%; min-height: 1px")], "CodeMirror-hscrollbar");
|
401 |
-
place(vert); place(horiz);
|
402 |
-
|
403 |
-
on(vert, "scroll", function() {
|
404 |
-
if (vert.clientHeight) scroll(vert.scrollTop, "vertical");
|
405 |
-
});
|
406 |
-
on(horiz, "scroll", function() {
|
407 |
-
if (horiz.clientWidth) scroll(horiz.scrollLeft, "horizontal");
|
408 |
-
});
|
409 |
-
|
410 |
-
this.checkedOverlay = false;
|
411 |
-
// Need to set a minimum width to see the scrollbar on IE7 (but must not set it on IE8).
|
412 |
-
if (ie && ie_version < 8) this.horiz.style.minHeight = this.vert.style.minWidth = "18px";
|
413 |
-
}
|
414 |
-
|
415 |
-
NativeScrollbars.prototype = copyObj({
|
416 |
-
update: function(measure) {
|
417 |
-
var needsH = measure.scrollWidth > measure.clientWidth + 1;
|
418 |
-
var needsV = measure.scrollHeight > measure.clientHeight + 1;
|
419 |
-
var sWidth = measure.nativeBarWidth;
|
420 |
-
|
421 |
-
if (needsV) {
|
422 |
-
this.vert.style.display = "block";
|
423 |
-
this.vert.style.bottom = needsH ? sWidth + "px" : "0";
|
424 |
-
var totalHeight = measure.viewHeight - (needsH ? sWidth : 0);
|
425 |
-
// A bug in IE8 can cause this value to be negative, so guard it.
|
426 |
-
this.vert.firstChild.style.height =
|
427 |
-
Math.max(0, measure.scrollHeight - measure.clientHeight + totalHeight) + "px";
|
428 |
-
} else {
|
429 |
-
this.vert.style.display = "";
|
430 |
-
this.vert.firstChild.style.height = "0";
|
431 |
-
}
|
432 |
-
|
433 |
-
if (needsH) {
|
434 |
-
this.horiz.style.display = "block";
|
435 |
-
this.horiz.style.right = needsV ? sWidth + "px" : "0";
|
436 |
-
this.horiz.style.left = measure.barLeft + "px";
|
437 |
-
var totalWidth = measure.viewWidth - measure.barLeft - (needsV ? sWidth : 0);
|
438 |
-
this.horiz.firstChild.style.width =
|
439 |
-
(measure.scrollWidth - measure.clientWidth + totalWidth) + "px";
|
440 |
-
} else {
|
441 |
-
this.horiz.style.display = "";
|
442 |
-
this.horiz.firstChild.style.width = "0";
|
443 |
-
}
|
444 |
-
|
445 |
-
if (!this.checkedOverlay && measure.clientHeight > 0) {
|
446 |
-
if (sWidth == 0) this.overlayHack();
|
447 |
-
this.checkedOverlay = true;
|
448 |
-
}
|
449 |
-
|
450 |
-
return {right: needsV ? sWidth : 0, bottom: needsH ? sWidth : 0};
|
451 |
-
},
|
452 |
-
setScrollLeft: function(pos) {
|
453 |
-
if (this.horiz.scrollLeft != pos) this.horiz.scrollLeft = pos;
|
454 |
-
},
|
455 |
-
setScrollTop: function(pos) {
|
456 |
-
if (this.vert.scrollTop != pos) this.vert.scrollTop = pos;
|
457 |
-
},
|
458 |
-
overlayHack: function() {
|
459 |
-
var w = mac && !mac_geMountainLion ? "12px" : "18px";
|
460 |
-
this.horiz.style.minHeight = this.vert.style.minWidth = w;
|
461 |
-
var self = this;
|
462 |
-
var barMouseDown = function(e) {
|
463 |
-
if (e_target(e) != self.vert && e_target(e) != self.horiz)
|
464 |
-
operation(self.cm, onMouseDown)(e);
|
465 |
-
};
|
466 |
-
on(this.vert, "mousedown", barMouseDown);
|
467 |
-
on(this.horiz, "mousedown", barMouseDown);
|
468 |
-
},
|
469 |
-
clear: function() {
|
470 |
-
var parent = this.horiz.parentNode;
|
471 |
-
parent.removeChild(this.horiz);
|
472 |
-
parent.removeChild(this.vert);
|
473 |
-
}
|
474 |
-
}, NativeScrollbars.prototype);
|
475 |
-
|
476 |
-
function NullScrollbars() {}
|
477 |
-
|
478 |
-
NullScrollbars.prototype = copyObj({
|
479 |
-
update: function() { return {bottom: 0, right: 0}; },
|
480 |
-
setScrollLeft: function() {},
|
481 |
-
setScrollTop: function() {},
|
482 |
-
clear: function() {}
|
483 |
-
}, NullScrollbars.prototype);
|
484 |
-
|
485 |
-
CodeMirror.scrollbarModel = {"native": NativeScrollbars, "null": NullScrollbars};
|
486 |
-
|
487 |
-
function initScrollbars(cm) {
|
488 |
-
if (cm.display.scrollbars) {
|
489 |
-
cm.display.scrollbars.clear();
|
490 |
-
if (cm.display.scrollbars.addClass)
|
491 |
-
rmClass(cm.display.wrapper, cm.display.scrollbars.addClass);
|
492 |
-
}
|
493 |
-
|
494 |
-
cm.display.scrollbars = new CodeMirror.scrollbarModel[cm.options.scrollbarStyle](function(node) {
|
495 |
-
cm.display.wrapper.insertBefore(node, cm.display.scrollbarFiller);
|
496 |
-
// Prevent clicks in the scrollbars from killing focus
|
497 |
-
on(node, "mousedown", function() {
|
498 |
-
if (cm.state.focused) setTimeout(function() { cm.display.input.focus(); }, 0);
|
499 |
-
});
|
500 |
-
node.setAttribute("cm-not-content", "true");
|
501 |
-
}, function(pos, axis) {
|
502 |
-
if (axis == "horizontal") setScrollLeft(cm, pos);
|
503 |
-
else setScrollTop(cm, pos);
|
504 |
-
}, cm);
|
505 |
-
if (cm.display.scrollbars.addClass)
|
506 |
-
addClass(cm.display.wrapper, cm.display.scrollbars.addClass);
|
507 |
-
}
|
508 |
-
|
509 |
-
function updateScrollbars(cm, measure) {
|
510 |
-
if (!measure) measure = measureForScrollbars(cm);
|
511 |
-
var startWidth = cm.display.barWidth, startHeight = cm.display.barHeight;
|
512 |
-
updateScrollbarsInner(cm, measure);
|
513 |
-
for (var i = 0; i < 4 && startWidth != cm.display.barWidth || startHeight != cm.display.barHeight; i++) {
|
514 |
-
if (startWidth != cm.display.barWidth && cm.options.lineWrapping)
|
515 |
-
updateHeightsInViewport(cm);
|
516 |
-
updateScrollbarsInner(cm, measureForScrollbars(cm));
|
517 |
-
startWidth = cm.display.barWidth; startHeight = cm.display.barHeight;
|
518 |
-
}
|
519 |
-
}
|
520 |
-
|
521 |
-
// Re-synchronize the fake scrollbars with the actual size of the
|
522 |
-
// content.
|
523 |
-
function updateScrollbarsInner(cm, measure) {
|
524 |
-
var d = cm.display;
|
525 |
-
var sizes = d.scrollbars.update(measure);
|
526 |
-
|
527 |
-
d.sizer.style.paddingRight = (d.barWidth = sizes.right) + "px";
|
528 |
-
d.sizer.style.paddingBottom = (d.barHeight = sizes.bottom) + "px";
|
529 |
-
|
530 |
-
if (sizes.right && sizes.bottom) {
|
531 |
-
d.scrollbarFiller.style.display = "block";
|
532 |
-
d.scrollbarFiller.style.height = sizes.bottom + "px";
|
533 |
-
d.scrollbarFiller.style.width = sizes.right + "px";
|
534 |
-
} else d.scrollbarFiller.style.display = "";
|
535 |
-
if (sizes.bottom && cm.options.coverGutterNextToScrollbar && cm.options.fixedGutter) {
|
536 |
-
d.gutterFiller.style.display = "block";
|
537 |
-
d.gutterFiller.style.height = sizes.bottom + "px";
|
538 |
-
d.gutterFiller.style.width = measure.gutterWidth + "px";
|
539 |
-
} else d.gutterFiller.style.display = "";
|
540 |
-
}
|
541 |
-
|
542 |
-
// Compute the lines that are visible in a given viewport (defaults
|
543 |
-
// the the current scroll position). viewport may contain top,
|
544 |
-
// height, and ensure (see op.scrollToPos) properties.
|
545 |
-
function visibleLines(display, doc, viewport) {
|
546 |
-
var top = viewport && viewport.top != null ? Math.max(0, viewport.top) : display.scroller.scrollTop;
|
547 |
-
top = Math.floor(top - paddingTop(display));
|
548 |
-
var bottom = viewport && viewport.bottom != null ? viewport.bottom : top + display.wrapper.clientHeight;
|
549 |
-
|
550 |
-
var from = lineAtHeight(doc, top), to = lineAtHeight(doc, bottom);
|
551 |
-
// Ensure is a {from: {line, ch}, to: {line, ch}} object, and
|
552 |
-
// forces those lines into the viewport (if possible).
|
553 |
-
if (viewport && viewport.ensure) {
|
554 |
-
var ensureFrom = viewport.ensure.from.line, ensureTo = viewport.ensure.to.line;
|
555 |
-
if (ensureFrom < from) {
|
556 |
-
from = ensureFrom;
|
557 |
-
to = lineAtHeight(doc, heightAtLine(getLine(doc, ensureFrom)) + display.wrapper.clientHeight);
|
558 |
-
} else if (Math.min(ensureTo, doc.lastLine()) >= to) {
|
559 |
-
from = lineAtHeight(doc, heightAtLine(getLine(doc, ensureTo)) - display.wrapper.clientHeight);
|
560 |
-
to = ensureTo;
|
561 |
-
}
|
562 |
-
}
|
563 |
-
return {from: from, to: Math.max(to, from + 1)};
|
564 |
-
}
|
565 |
-
|
566 |
-
// LINE NUMBERS
|
567 |
-
|
568 |
-
// Re-align line numbers and gutter marks to compensate for
|
569 |
-
// horizontal scrolling.
|
570 |
-
function alignHorizontally(cm) {
|
571 |
-
var display = cm.display, view = display.view;
|
572 |
-
if (!display.alignWidgets && (!display.gutters.firstChild || !cm.options.fixedGutter)) return;
|
573 |
-
var comp = compensateForHScroll(display) - display.scroller.scrollLeft + cm.doc.scrollLeft;
|
574 |
-
var gutterW = display.gutters.offsetWidth, left = comp + "px";
|
575 |
-
for (var i = 0; i < view.length; i++) if (!view[i].hidden) {
|
576 |
-
if (cm.options.fixedGutter && view[i].gutter)
|
577 |
-
view[i].gutter.style.left = left;
|
578 |
-
var align = view[i].alignable;
|
579 |
-
if (align) for (var j = 0; j < align.length; j++)
|
580 |
-
align[j].style.left = left;
|
581 |
-
}
|
582 |
-
if (cm.options.fixedGutter)
|
583 |
-
display.gutters.style.left = (comp + gutterW) + "px";
|
584 |
-
}
|
585 |
-
|
586 |
-
// Used to ensure that the line number gutter is still the right
|
587 |
-
// size for the current document size. Returns true when an update
|
588 |
-
// is needed.
|
589 |
-
function maybeUpdateLineNumberWidth(cm) {
|
590 |
-
if (!cm.options.lineNumbers) return false;
|
591 |
-
var doc = cm.doc, last = lineNumberFor(cm.options, doc.first + doc.size - 1), display = cm.display;
|
592 |
-
if (last.length != display.lineNumChars) {
|
593 |
-
var test = display.measure.appendChild(elt("div", [elt("div", last)],
|
594 |
-
"CodeMirror-linenumber CodeMirror-gutter-elt"));
|
595 |
-
var innerW = test.firstChild.offsetWidth, padding = test.offsetWidth - innerW;
|
596 |
-
display.lineGutter.style.width = "";
|
597 |
-
display.lineNumInnerWidth = Math.max(innerW, display.lineGutter.offsetWidth - padding) + 1;
|
598 |
-
display.lineNumWidth = display.lineNumInnerWidth + padding;
|
599 |
-
display.lineNumChars = display.lineNumInnerWidth ? last.length : -1;
|
600 |
-
display.lineGutter.style.width = display.lineNumWidth + "px";
|
601 |
-
updateGutterSpace(cm);
|
602 |
-
return true;
|
603 |
-
}
|
604 |
-
return false;
|
605 |
-
}
|
606 |
-
|
607 |
-
function lineNumberFor(options, i) {
|
608 |
-
return String(options.lineNumberFormatter(i + options.firstLineNumber));
|
609 |
-
}
|
610 |
-
|
611 |
-
// Computes display.scroller.scrollLeft + display.gutters.offsetWidth,
|
612 |
-
// but using getBoundingClientRect to get a sub-pixel-accurate
|
613 |
-
// result.
|
614 |
-
function compensateForHScroll(display) {
|
615 |
-
return display.scroller.getBoundingClientRect().left - display.sizer.getBoundingClientRect().left;
|
616 |
-
}
|
617 |
-
|
618 |
-
// DISPLAY DRAWING
|
619 |
-
|
620 |
-
function DisplayUpdate(cm, viewport, force) {
|
621 |
-
var display = cm.display;
|
622 |
-
|
623 |
-
this.viewport = viewport;
|
624 |
-
// Store some values that we'll need later (but don't want to force a relayout for)
|
625 |
-
this.visible = visibleLines(display, cm.doc, viewport);
|
626 |
-
this.editorIsHidden = !display.wrapper.offsetWidth;
|
627 |
-
this.wrapperHeight = display.wrapper.clientHeight;
|
628 |
-
this.wrapperWidth = display.wrapper.clientWidth;
|
629 |
-
this.oldDisplayWidth = displayWidth(cm);
|
630 |
-
this.force = force;
|
631 |
-
this.dims = getDimensions(cm);
|
632 |
-
this.events = [];
|
633 |
-
}
|
634 |
-
|
635 |
-
DisplayUpdate.prototype.signal = function(emitter, type) {
|
636 |
-
if (hasHandler(emitter, type))
|
637 |
-
this.events.push(arguments);
|
638 |
-
};
|
639 |
-
DisplayUpdate.prototype.finish = function() {
|
640 |
-
for (var i = 0; i < this.events.length; i++)
|
641 |
-
signal.apply(null, this.events[i]);
|
642 |
-
};
|
643 |
-
|
644 |
-
function maybeClipScrollbars(cm) {
|
645 |
-
var display = cm.display;
|
646 |
-
if (!display.scrollbarsClipped && display.scroller.offsetWidth) {
|
647 |
-
display.nativeBarWidth = display.scroller.offsetWidth - display.scroller.clientWidth;
|
648 |
-
display.heightForcer.style.height = scrollGap(cm) + "px";
|
649 |
-
display.sizer.style.marginBottom = -display.nativeBarWidth + "px";
|
650 |
-
display.sizer.style.borderRightWidth = scrollGap(cm) + "px";
|
651 |
-
display.scrollbarsClipped = true;
|
652 |
-
}
|
653 |
-
}
|
654 |
-
|
655 |
-
// Does the actual updating of the line display. Bails out
|
656 |
-
// (returning false) when there is nothing to be done and forced is
|
657 |
-
// false.
|
658 |
-
function updateDisplayIfNeeded(cm, update) {
|
659 |
-
var display = cm.display, doc = cm.doc;
|
660 |
-
|
661 |
-
if (update.editorIsHidden) {
|
662 |
-
resetView(cm);
|
663 |
-
return false;
|
664 |
-
}
|
665 |
-
|
666 |
-
// Bail out if the visible area is already rendered and nothing changed.
|
667 |
-
if (!update.force &&
|
668 |
-
update.visible.from >= display.viewFrom && update.visible.to <= display.viewTo &&
|
669 |
-
(display.updateLineNumbers == null || display.updateLineNumbers >= display.viewTo) &&
|
670 |
-
display.renderedView == display.view && countDirtyView(cm) == 0)
|
671 |
-
return false;
|
672 |
-
|
673 |
-
if (maybeUpdateLineNumberWidth(cm)) {
|
674 |
-
resetView(cm);
|
675 |
-
update.dims = getDimensions(cm);
|
676 |
-
}
|
677 |
-
|
678 |
-
// Compute a suitable new viewport (from & to)
|
679 |
-
var end = doc.first + doc.size;
|
680 |
-
var from = Math.max(update.visible.from - cm.options.viewportMargin, doc.first);
|
681 |
-
var to = Math.min(end, update.visible.to + cm.options.viewportMargin);
|
682 |
-
if (display.viewFrom < from && from - display.viewFrom < 20) from = Math.max(doc.first, display.viewFrom);
|
683 |
-
if (display.viewTo > to && display.viewTo - to < 20) to = Math.min(end, display.viewTo);
|
684 |
-
if (sawCollapsedSpans) {
|
685 |
-
from = visualLineNo(cm.doc, from);
|
686 |
-
to = visualLineEndNo(cm.doc, to);
|
687 |
-
}
|
688 |
-
|
689 |
-
var different = from != display.viewFrom || to != display.viewTo ||
|
690 |
-
display.lastWrapHeight != update.wrapperHeight || display.lastWrapWidth != update.wrapperWidth;
|
691 |
-
adjustView(cm, from, to);
|
692 |
-
|
693 |
-
display.viewOffset = heightAtLine(getLine(cm.doc, display.viewFrom));
|
694 |
-
// Position the mover div to align with the current scroll position
|
695 |
-
cm.display.mover.style.top = display.viewOffset + "px";
|
696 |
-
|
697 |
-
var toUpdate = countDirtyView(cm);
|
698 |
-
if (!different && toUpdate == 0 && !update.force && display.renderedView == display.view &&
|
699 |
-
(display.updateLineNumbers == null || display.updateLineNumbers >= display.viewTo))
|
700 |
-
return false;
|
701 |
-
|
702 |
-
// For big changes, we hide the enclosing element during the
|
703 |
-
// update, since that speeds up the operations on most browsers.
|
704 |
-
var focused = activeElt();
|
705 |
-
if (toUpdate > 4) display.lineDiv.style.display = "none";
|
706 |
-
patchDisplay(cm, display.updateLineNumbers, update.dims);
|
707 |
-
if (toUpdate > 4) display.lineDiv.style.display = "";
|
708 |
-
display.renderedView = display.view;
|
709 |
-
// There might have been a widget with a focused element that got
|
710 |
-
// hidden or updated, if so re-focus it.
|
711 |
-
if (focused && activeElt() != focused && focused.offsetHeight) focused.focus();
|
712 |
-
|
713 |
-
// Prevent selection and cursors from interfering with the scroll
|
714 |
-
// width and height.
|
715 |
-
removeChildren(display.cursorDiv);
|
716 |
-
removeChildren(display.selectionDiv);
|
717 |
-
display.gutters.style.height = 0;
|
718 |
-
|
719 |
-
if (different) {
|
720 |
-
display.lastWrapHeight = update.wrapperHeight;
|
721 |
-
display.lastWrapWidth = update.wrapperWidth;
|
722 |
-
startWorker(cm, 400);
|
723 |
-
}
|
724 |
-
|
725 |
-
display.updateLineNumbers = null;
|
726 |
-
|
727 |
-
return true;
|
728 |
-
}
|
729 |
-
|
730 |
-
function postUpdateDisplay(cm, update) {
|
731 |
-
var force = update.force, viewport = update.viewport;
|
732 |
-
for (var first = true;; first = false) {
|
733 |
-
if (first && cm.options.lineWrapping && update.oldDisplayWidth != displayWidth(cm)) {
|
734 |
-
force = true;
|
735 |
-
} else {
|
736 |
-
force = false;
|
737 |
-
// Clip forced viewport to actual scrollable area.
|
738 |
-
if (viewport && viewport.top != null)
|
739 |
-
viewport = {top: Math.min(cm.doc.height + paddingVert(cm.display) - displayHeight(cm), viewport.top)};
|
740 |
-
// Updated line heights might result in the drawn area not
|
741 |
-
// actually covering the viewport. Keep looping until it does.
|
742 |
-
update.visible = visibleLines(cm.display, cm.doc, viewport);
|
743 |
-
if (update.visible.from >= cm.display.viewFrom && update.visible.to <= cm.display.viewTo)
|
744 |
-
break;
|
745 |
-
}
|
746 |
-
if (!updateDisplayIfNeeded(cm, update)) break;
|
747 |
-
updateHeightsInViewport(cm);
|
748 |
-
var barMeasure = measureForScrollbars(cm);
|
749 |
-
updateSelection(cm);
|
750 |
-
setDocumentHeight(cm, barMeasure);
|
751 |
-
updateScrollbars(cm, barMeasure);
|
752 |
-
}
|
753 |
-
|
754 |
-
update.signal(cm, "update", cm);
|
755 |
-
if (cm.display.viewFrom != cm.display.reportedViewFrom || cm.display.viewTo != cm.display.reportedViewTo) {
|
756 |
-
update.signal(cm, "viewportChange", cm, cm.display.viewFrom, cm.display.viewTo);
|
757 |
-
cm.display.reportedViewFrom = cm.display.viewFrom; cm.display.reportedViewTo = cm.display.viewTo;
|
758 |
-
}
|
759 |
-
}
|
760 |
-
|
761 |
-
function updateDisplaySimple(cm, viewport) {
|
762 |
-
var update = new DisplayUpdate(cm, viewport);
|
763 |
-
if (updateDisplayIfNeeded(cm, update)) {
|
764 |
-
updateHeightsInViewport(cm);
|
765 |
-
postUpdateDisplay(cm, update);
|
766 |
-
var barMeasure = measureForScrollbars(cm);
|
767 |
-
updateSelection(cm);
|
768 |
-
setDocumentHeight(cm, barMeasure);
|
769 |
-
updateScrollbars(cm, barMeasure);
|
770 |
-
update.finish();
|
771 |
-
}
|
772 |
-
}
|
773 |
-
|
774 |
-
function setDocumentHeight(cm, measure) {
|
775 |
-
cm.display.sizer.style.minHeight = measure.docHeight + "px";
|
776 |
-
var total = measure.docHeight + cm.display.barHeight;
|
777 |
-
cm.display.heightForcer.style.top = total + "px";
|
778 |
-
cm.display.gutters.style.height = Math.max(total + scrollGap(cm), measure.clientHeight) + "px";
|
779 |
-
}
|
780 |
-
|
781 |
-
// Read the actual heights of the rendered lines, and update their
|
782 |
-
// stored heights to match.
|
783 |
-
function updateHeightsInViewport(cm) {
|
784 |
-
var display = cm.display;
|
785 |
-
var prevBottom = display.lineDiv.offsetTop;
|
786 |
-
for (var i = 0; i < display.view.length; i++) {
|
787 |
-
var cur = display.view[i], height;
|
788 |
-
if (cur.hidden) continue;
|
789 |
-
if (ie && ie_version < 8) {
|
790 |
-
var bot = cur.node.offsetTop + cur.node.offsetHeight;
|
791 |
-
height = bot - prevBottom;
|
792 |
-
prevBottom = bot;
|
793 |
-
} else {
|
794 |
-
var box = cur.node.getBoundingClientRect();
|
795 |
-
height = box.bottom - box.top;
|
796 |
-
}
|
797 |
-
var diff = cur.line.height - height;
|
798 |
-
if (height < 2) height = textHeight(display);
|
799 |
-
if (diff > .001 || diff < -.001) {
|
800 |
-
updateLineHeight(cur.line, height);
|
801 |
-
updateWidgetHeight(cur.line);
|
802 |
-
if (cur.rest) for (var j = 0; j < cur.rest.length; j++)
|
803 |
-
updateWidgetHeight(cur.rest[j]);
|
804 |
-
}
|
805 |
-
}
|
806 |
-
}
|
807 |
-
|
808 |
-
// Read and store the height of line widgets associated with the
|
809 |
-
// given line.
|
810 |
-
function updateWidgetHeight(line) {
|
811 |
-
if (line.widgets) for (var i = 0; i < line.widgets.length; ++i)
|
812 |
-
line.widgets[i].height = line.widgets[i].node.offsetHeight;
|
813 |
-
}
|
814 |
-
|
815 |
-
// Do a bulk-read of the DOM positions and sizes needed to draw the
|
816 |
-
// view, so that we don't interleave reading and writing to the DOM.
|
817 |
-
function getDimensions(cm) {
|
818 |
-
var d = cm.display, left = {}, width = {};
|
819 |
-
var gutterLeft = d.gutters.clientLeft;
|
820 |
-
for (var n = d.gutters.firstChild, i = 0; n; n = n.nextSibling, ++i) {
|
821 |
-
left[cm.options.gutters[i]] = n.offsetLeft + n.clientLeft + gutterLeft;
|
822 |
-
width[cm.options.gutters[i]] = n.clientWidth;
|
823 |
-
}
|
824 |
-
return {fixedPos: compensateForHScroll(d),
|
825 |
-
gutterTotalWidth: d.gutters.offsetWidth,
|
826 |
-
gutterLeft: left,
|
827 |
-
gutterWidth: width,
|
828 |
-
wrapperWidth: d.wrapper.clientWidth};
|
829 |
-
}
|
830 |
-
|
831 |
-
// Sync the actual display DOM structure with display.view, removing
|
832 |
-
// nodes for lines that are no longer in view, and creating the ones
|
833 |
-
// that are not there yet, and updating the ones that are out of
|
834 |
-
// date.
|
835 |
-
function patchDisplay(cm, updateNumbersFrom, dims) {
|
836 |
-
var display = cm.display, lineNumbers = cm.options.lineNumbers;
|
837 |
-
var container = display.lineDiv, cur = container.firstChild;
|
838 |
-
|
839 |
-
function rm(node) {
|
840 |
-
var next = node.nextSibling;
|
841 |
-
// Works around a throw-scroll bug in OS X Webkit
|
842 |
-
if (webkit && mac && cm.display.currentWheelTarget == node)
|
843 |
-
node.style.display = "none";
|
844 |
-
else
|
845 |
-
node.parentNode.removeChild(node);
|
846 |
-
return next;
|
847 |
-
}
|
848 |
-
|
849 |
-
var view = display.view, lineN = display.viewFrom;
|
850 |
-
// Loop over the elements in the view, syncing cur (the DOM nodes
|
851 |
-
// in display.lineDiv) with the view as we go.
|
852 |
-
for (var i = 0; i < view.length; i++) {
|
853 |
-
var lineView = view[i];
|
854 |
-
if (lineView.hidden) {
|
855 |
-
} else if (!lineView.node || lineView.node.parentNode != container) { // Not drawn yet
|
856 |
-
var node = buildLineElement(cm, lineView, lineN, dims);
|
857 |
-
container.insertBefore(node, cur);
|
858 |
-
} else { // Already drawn
|
859 |
-
while (cur != lineView.node) cur = rm(cur);
|
860 |
-
var updateNumber = lineNumbers && updateNumbersFrom != null &&
|
861 |
-
updateNumbersFrom <= lineN && lineView.lineNumber;
|
862 |
-
if (lineView.changes) {
|
863 |
-
if (indexOf(lineView.changes, "gutter") > -1) updateNumber = false;
|
864 |
-
updateLineForChanges(cm, lineView, lineN, dims);
|
865 |
-
}
|
866 |
-
if (updateNumber) {
|
867 |
-
removeChildren(lineView.lineNumber);
|
868 |
-
lineView.lineNumber.appendChild(document.createTextNode(lineNumberFor(cm.options, lineN)));
|
869 |
-
}
|
870 |
-
cur = lineView.node.nextSibling;
|
871 |
-
}
|
872 |
-
lineN += lineView.size;
|
873 |
-
}
|
874 |
-
while (cur) cur = rm(cur);
|
875 |
-
}
|
876 |
-
|
877 |
-
// When an aspect of a line changes, a string is added to
|
878 |
-
// lineView.changes. This updates the relevant part of the line's
|
879 |
-
// DOM structure.
|
880 |
-
function updateLineForChanges(cm, lineView, lineN, dims) {
|
881 |
-
for (var j = 0; j < lineView.changes.length; j++) {
|
882 |
-
var type = lineView.changes[j];
|
883 |
-
if (type == "text") updateLineText(cm, lineView);
|
884 |
-
else if (type == "gutter") updateLineGutter(cm, lineView, lineN, dims);
|
885 |
-
else if (type == "class") updateLineClasses(lineView);
|
886 |
-
else if (type == "widget") updateLineWidgets(cm, lineView, dims);
|
887 |
-
}
|
888 |
-
lineView.changes = null;
|
889 |
-
}
|
890 |
-
|
891 |
-
// Lines with gutter elements, widgets or a background class need to
|
892 |
-
// be wrapped, and have the extra elements added to the wrapper div
|
893 |
-
function ensureLineWrapped(lineView) {
|
894 |
-
if (lineView.node == lineView.text) {
|
895 |
-
lineView.node = elt("div", null, null, "position: relative");
|
896 |
-
if (lineView.text.parentNode)
|
897 |
-
lineView.text.parentNode.replaceChild(lineView.node, lineView.text);
|
898 |
-
lineView.node.appendChild(lineView.text);
|
899 |
-
if (ie && ie_version < 8) lineView.node.style.zIndex = 2;
|
900 |
-
}
|
901 |
-
return lineView.node;
|
902 |
-
}
|
903 |
-
|
904 |
-
function updateLineBackground(lineView) {
|
905 |
-
var cls = lineView.bgClass ? lineView.bgClass + " " + (lineView.line.bgClass || "") : lineView.line.bgClass;
|
906 |
-
if (cls) cls += " CodeMirror-linebackground";
|
907 |
-
if (lineView.background) {
|
908 |
-
if (cls) lineView.background.className = cls;
|
909 |
-
else { lineView.background.parentNode.removeChild(lineView.background); lineView.background = null; }
|
910 |
-
} else if (cls) {
|
911 |
-
var wrap = ensureLineWrapped(lineView);
|
912 |
-
lineView.background = wrap.insertBefore(elt("div", null, cls), wrap.firstChild);
|
913 |
-
}
|
914 |
-
}
|
915 |
-
|
916 |
-
// Wrapper around buildLineContent which will reuse the structure
|
917 |
-
// in display.externalMeasured when possible.
|
918 |
-
function getLineContent(cm, lineView) {
|
919 |
-
var ext = cm.display.externalMeasured;
|
920 |
-
if (ext && ext.line == lineView.line) {
|
921 |
-
cm.display.externalMeasured = null;
|
922 |
-
lineView.measure = ext.measure;
|
923 |
-
return ext.built;
|
924 |
-
}
|
925 |
-
return buildLineContent(cm, lineView);
|
926 |
-
}
|
927 |
-
|
928 |
-
// Redraw the line's text. Interacts with the background and text
|
929 |
-
// classes because the mode may output tokens that influence these
|
930 |
-
// classes.
|
931 |
-
function updateLineText(cm, lineView) {
|
932 |
-
var cls = lineView.text.className;
|
933 |
-
var built = getLineContent(cm, lineView);
|
934 |
-
if (lineView.text == lineView.node) lineView.node = built.pre;
|
935 |
-
lineView.text.parentNode.replaceChild(built.pre, lineView.text);
|
936 |
-
lineView.text = built.pre;
|
937 |
-
if (built.bgClass != lineView.bgClass || built.textClass != lineView.textClass) {
|
938 |
-
lineView.bgClass = built.bgClass;
|
939 |
-
lineView.textClass = built.textClass;
|
940 |
-
updateLineClasses(lineView);
|
941 |
-
} else if (cls) {
|
942 |
-
lineView.text.className = cls;
|
943 |
-
}
|
944 |
-
}
|
945 |
-
|
946 |
-
function updateLineClasses(lineView) {
|
947 |
-
updateLineBackground(lineView);
|
948 |
-
if (lineView.line.wrapClass)
|
949 |
-
ensureLineWrapped(lineView).className = lineView.line.wrapClass;
|
950 |
-
else if (lineView.node != lineView.text)
|
951 |
-
lineView.node.className = "";
|
952 |
-
var textClass = lineView.textClass ? lineView.textClass + " " + (lineView.line.textClass || "") : lineView.line.textClass;
|
953 |
-
lineView.text.className = textClass || "";
|
954 |
-
}
|
955 |
-
|
956 |
-
function updateLineGutter(cm, lineView, lineN, dims) {
|
957 |
-
if (lineView.gutter) {
|
958 |
-
lineView.node.removeChild(lineView.gutter);
|
959 |
-
lineView.gutter = null;
|
960 |
-
}
|
961 |
-
var markers = lineView.line.gutterMarkers;
|
962 |
-
if (cm.options.lineNumbers || markers) {
|
963 |
-
var wrap = ensureLineWrapped(lineView);
|
964 |
-
var gutterWrap = lineView.gutter = elt("div", null, "CodeMirror-gutter-wrapper", "left: " +
|
965 |
-
(cm.options.fixedGutter ? dims.fixedPos : -dims.gutterTotalWidth) +
|
966 |
-
"px; width: " + dims.gutterTotalWidth + "px");
|
967 |
-
cm.display.input.setUneditable(gutterWrap);
|
968 |
-
wrap.insertBefore(gutterWrap, lineView.text);
|
969 |
-
if (lineView.line.gutterClass)
|
970 |
-
gutterWrap.className += " " + lineView.line.gutterClass;
|
971 |
-
if (cm.options.lineNumbers && (!markers || !markers["CodeMirror-linenumbers"]))
|
972 |
-
lineView.lineNumber = gutterWrap.appendChild(
|
973 |
-
elt("div", lineNumberFor(cm.options, lineN),
|
974 |
-
"CodeMirror-linenumber CodeMirror-gutter-elt",
|
975 |
-
"left: " + dims.gutterLeft["CodeMirror-linenumbers"] + "px; width: "
|
976 |
-
+ cm.display.lineNumInnerWidth + "px"));
|
977 |
-
if (markers) for (var k = 0; k < cm.options.gutters.length; ++k) {
|
978 |
-
var id = cm.options.gutters[k], found = markers.hasOwnProperty(id) && markers[id];
|
979 |
-
if (found)
|
980 |
-
gutterWrap.appendChild(elt("div", [found], "CodeMirror-gutter-elt", "left: " +
|
981 |
-
dims.gutterLeft[id] + "px; width: " + dims.gutterWidth[id] + "px"));
|
982 |
-
}
|
983 |
-
}
|
984 |
-
}
|
985 |
-
|
986 |
-
function updateLineWidgets(cm, lineView, dims) {
|
987 |
-
if (lineView.alignable) lineView.alignable = null;
|
988 |
-
for (var node = lineView.node.firstChild, next; node; node = next) {
|
989 |
-
var next = node.nextSibling;
|
990 |
-
if (node.className == "CodeMirror-linewidget")
|
991 |
-
lineView.node.removeChild(node);
|
992 |
-
}
|
993 |
-
insertLineWidgets(cm, lineView, dims);
|
994 |
-
}
|
995 |
-
|
996 |
-
// Build a line's DOM representation from scratch
|
997 |
-
function buildLineElement(cm, lineView, lineN, dims) {
|
998 |
-
var built = getLineContent(cm, lineView);
|
999 |
-
lineView.text = lineView.node = built.pre;
|
1000 |
-
if (built.bgClass) lineView.bgClass = built.bgClass;
|
1001 |
-
if (built.textClass) lineView.textClass = built.textClass;
|
1002 |
-
|
1003 |
-
updateLineClasses(lineView);
|
1004 |
-
updateLineGutter(cm, lineView, lineN, dims);
|
1005 |
-
insertLineWidgets(cm, lineView, dims);
|
1006 |
-
return lineView.node;
|
1007 |
-
}
|
1008 |
-
|
1009 |
-
// A lineView may contain multiple logical lines (when merged by
|
1010 |
-
// collapsed spans). The widgets for all of them need to be drawn.
|
1011 |
-
function insertLineWidgets(cm, lineView, dims) {
|
1012 |
-
insertLineWidgetsFor(cm, lineView.line, lineView, dims, true);
|
1013 |
-
if (lineView.rest) for (var i = 0; i < lineView.rest.length; i++)
|
1014 |
-
insertLineWidgetsFor(cm, lineView.rest[i], lineView, dims, false);
|
1015 |
-
}
|
1016 |
-
|
1017 |
-
function insertLineWidgetsFor(cm, line, lineView, dims, allowAbove) {
|
1018 |
-
if (!line.widgets) return;
|
1019 |
-
var wrap = ensureLineWrapped(lineView);
|
1020 |
-
for (var i = 0, ws = line.widgets; i < ws.length; ++i) {
|
1021 |
-
var widget = ws[i], node = elt("div", [widget.node], "CodeMirror-linewidget");
|
1022 |
-
if (!widget.handleMouseEvents) node.setAttribute("cm-ignore-events", "true");
|
1023 |
-
positionLineWidget(widget, node, lineView, dims);
|
1024 |
-
cm.display.input.setUneditable(node);
|
1025 |
-
if (allowAbove && widget.above)
|
1026 |
-
wrap.insertBefore(node, lineView.gutter || lineView.text);
|
1027 |
-
else
|
1028 |
-
wrap.appendChild(node);
|
1029 |
-
signalLater(widget, "redraw");
|
1030 |
-
}
|
1031 |
-
}
|
1032 |
-
|
1033 |
-
function positionLineWidget(widget, node, lineView, dims) {
|
1034 |
-
if (widget.noHScroll) {
|
1035 |
-
(lineView.alignable || (lineView.alignable = [])).push(node);
|
1036 |
-
var width = dims.wrapperWidth;
|
1037 |
-
node.style.left = dims.fixedPos + "px";
|
1038 |
-
if (!widget.coverGutter) {
|
1039 |
-
width -= dims.gutterTotalWidth;
|
1040 |
-
node.style.paddingLeft = dims.gutterTotalWidth + "px";
|
1041 |
-
}
|
1042 |
-
node.style.width = width + "px";
|
1043 |
-
}
|
1044 |
-
if (widget.coverGutter) {
|
1045 |
-
node.style.zIndex = 5;
|
1046 |
-
node.style.position = "relative";
|
1047 |
-
if (!widget.noHScroll) node.style.marginLeft = -dims.gutterTotalWidth + "px";
|
1048 |
-
}
|
1049 |
-
}
|
1050 |
-
|
1051 |
-
// POSITION OBJECT
|
1052 |
-
|
1053 |
-
// A Pos instance represents a position within the text.
|
1054 |
-
var Pos = CodeMirror.Pos = function(line, ch) {
|
1055 |
-
if (!(this instanceof Pos)) return new Pos(line, ch);
|
1056 |
-
this.line = line; this.ch = ch;
|
1057 |
-
};
|
1058 |
-
|
1059 |
-
// Compare two positions, return 0 if they are the same, a negative
|
1060 |
-
// number when a is less, and a positive number otherwise.
|
1061 |
-
var cmp = CodeMirror.cmpPos = function(a, b) { return a.line - b.line || a.ch - b.ch; };
|
1062 |
-
|
1063 |
-
function copyPos(x) {return Pos(x.line, x.ch);}
|
1064 |
-
function maxPos(a, b) { return cmp(a, b) < 0 ? b : a; }
|
1065 |
-
function minPos(a, b) { return cmp(a, b) < 0 ? a : b; }
|
1066 |
-
|
1067 |
-
// INPUT HANDLING
|
1068 |
-
|
1069 |
-
function ensureFocus(cm) {
|
1070 |
-
if (!cm.state.focused) { cm.display.input.focus(); onFocus(cm); }
|
1071 |
-
}
|
1072 |
-
|
1073 |
-
function isReadOnly(cm) {
|
1074 |
-
return cm.options.readOnly || cm.doc.cantEdit;
|
1075 |
-
}
|
1076 |
-
|
1077 |
-
// This will be set to an array of strings when copying, so that,
|
1078 |
-
// when pasting, we know what kind of selections the copied text
|
1079 |
-
// was made out of.
|
1080 |
-
var lastCopied = null;
|
1081 |
-
|
1082 |
-
function applyTextInput(cm, inserted, deleted, sel, origin) {
|
1083 |
-
var doc = cm.doc;
|
1084 |
-
cm.display.shift = false;
|
1085 |
-
if (!sel) sel = doc.sel;
|
1086 |
-
|
1087 |
-
var textLines = splitLines(inserted), multiPaste = null;
|
1088 |
-
// When pasing N lines into N selections, insert one line per selection
|
1089 |
-
if (cm.state.pasteIncoming && sel.ranges.length > 1) {
|
1090 |
-
if (lastCopied && lastCopied.join("\n") == inserted)
|
1091 |
-
multiPaste = sel.ranges.length % lastCopied.length == 0 && map(lastCopied, splitLines);
|
1092 |
-
else if (textLines.length == sel.ranges.length)
|
1093 |
-
multiPaste = map(textLines, function(l) { return [l]; });
|
1094 |
-
}
|
1095 |
-
|
1096 |
-
// Normal behavior is to insert the new text into every selection
|
1097 |
-
for (var i = sel.ranges.length - 1; i >= 0; i--) {
|
1098 |
-
var range = sel.ranges[i];
|
1099 |
-
var from = range.from(), to = range.to();
|
1100 |
-
if (range.empty()) {
|
1101 |
-
if (deleted && deleted > 0) // Handle deletion
|
1102 |
-
from = Pos(from.line, from.ch - deleted);
|
1103 |
-
else if (cm.state.overwrite && !cm.state.pasteIncoming) // Handle overwrite
|
1104 |
-
to = Pos(to.line, Math.min(getLine(doc, to.line).text.length, to.ch + lst(textLines).length));
|
1105 |
-
}
|
1106 |
-
var updateInput = cm.curOp.updateInput;
|
1107 |
-
var changeEvent = {from: from, to: to, text: multiPaste ? multiPaste[i % multiPaste.length] : textLines,
|
1108 |
-
origin: origin || (cm.state.pasteIncoming ? "paste" : cm.state.cutIncoming ? "cut" : "+input")};
|
1109 |
-
makeChange(cm.doc, changeEvent);
|
1110 |
-
signalLater(cm, "inputRead", cm, changeEvent);
|
1111 |
-
// When an 'electric' character is inserted, immediately trigger a reindent
|
1112 |
-
if (inserted && !cm.state.pasteIncoming && cm.options.electricChars &&
|
1113 |
-
cm.options.smartIndent && range.head.ch < 100 &&
|
1114 |
-
(!i || sel.ranges[i - 1].head.line != range.head.line)) {
|
1115 |
-
var mode = cm.getModeAt(range.head);
|
1116 |
-
var end = changeEnd(changeEvent);
|
1117 |
-
var indented = false;
|
1118 |
-
if (mode.electricChars) {
|
1119 |
-
for (var j = 0; j < mode.electricChars.length; j++)
|
1120 |
-
if (inserted.indexOf(mode.electricChars.charAt(j)) > -1) {
|
1121 |
-
indented = indentLine(cm, end.line, "smart");
|
1122 |
-
break;
|
1123 |
-
}
|
1124 |
-
} else if (mode.electricInput) {
|
1125 |
-
if (mode.electricInput.test(getLine(doc, end.line).text.slice(0, end.ch)))
|
1126 |
-
indented = indentLine(cm, end.line, "smart");
|
1127 |
-
}
|
1128 |
-
if (indented) signalLater(cm, "electricInput", cm, end.line);
|
1129 |
-
}
|
1130 |
-
}
|
1131 |
-
ensureCursorVisible(cm);
|
1132 |
-
cm.curOp.updateInput = updateInput;
|
1133 |
-
cm.curOp.typing = true;
|
1134 |
-
cm.state.pasteIncoming = cm.state.cutIncoming = false;
|
1135 |
-
}
|
1136 |
-
|
1137 |
-
function copyableRanges(cm) {
|
1138 |
-
var text = [], ranges = [];
|
1139 |
-
for (var i = 0; i < cm.doc.sel.ranges.length; i++) {
|
1140 |
-
var line = cm.doc.sel.ranges[i].head.line;
|
1141 |
-
var lineRange = {anchor: Pos(line, 0), head: Pos(line + 1, 0)};
|
1142 |
-
ranges.push(lineRange);
|
1143 |
-
text.push(cm.getRange(lineRange.anchor, lineRange.head));
|
1144 |
-
}
|
1145 |
-
return {text: text, ranges: ranges};
|
1146 |
-
}
|
1147 |
-
|
1148 |
-
function disableBrowserMagic(field) {
|
1149 |
-
field.setAttribute("autocorrect", "off");
|
1150 |
-
field.setAttribute("autocapitalize", "off");
|
1151 |
-
field.setAttribute("spellcheck", "false");
|
1152 |
-
}
|
1153 |
-
|
1154 |
-
// TEXTAREA INPUT STYLE
|
1155 |
-
|
1156 |
-
function TextareaInput(cm) {
|
1157 |
-
this.cm = cm;
|
1158 |
-
// See input.poll and input.reset
|
1159 |
-
this.prevInput = "";
|
1160 |
-
|
1161 |
-
// Flag that indicates whether we expect input to appear real soon
|
1162 |
-
// now (after some event like 'keypress' or 'input') and are
|
1163 |
-
// polling intensively.
|
1164 |
-
this.pollingFast = false;
|
1165 |
-
// Self-resetting timeout for the poller
|
1166 |
-
this.polling = new Delayed();
|
1167 |
-
// Tracks when input.reset has punted to just putting a short
|
1168 |
-
// string into the textarea instead of the full selection.
|
1169 |
-
this.inaccurateSelection = false;
|
1170 |
-
// Used to work around IE issue with selection being forgotten when focus moves away from textarea
|
1171 |
-
this.hasSelection = false;
|
1172 |
-
this.composing = null;
|
1173 |
-
};
|
1174 |
-
|
1175 |
-
function hiddenTextarea() {
|
1176 |
-
var te = elt("textarea", null, null, "position: absolute; padding: 0; width: 1px; height: 1em; outline: none");
|
1177 |
-
var div = elt("div", [te], null, "overflow: hidden; position: relative; width: 3px; height: 0px;");
|
1178 |
-
// The textarea is kept positioned near the cursor to prevent the
|
1179 |
-
// fact that it'll be scrolled into view on input from scrolling
|
1180 |
-
// our fake cursor out of view. On webkit, when wrap=off, paste is
|
1181 |
-
// very slow. So make the area wide instead.
|
1182 |
-
if (webkit) te.style.width = "1000px";
|
1183 |
-
else te.setAttribute("wrap", "off");
|
1184 |
-
// If border: 0; -- iOS fails to open keyboard (issue #1287)
|
1185 |
-
if (ios) te.style.border = "1px solid black";
|
1186 |
-
disableBrowserMagic(te);
|
1187 |
-
return div;
|
1188 |
-
}
|
1189 |
-
|
1190 |
-
TextareaInput.prototype = copyObj({
|
1191 |
-
init: function(display) {
|
1192 |
-
var input = this, cm = this.cm;
|
1193 |
-
|
1194 |
-
// Wrap
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|