Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 49a7f12

Browse files
committed
Include CodeMirror globally
1 parent 285b9d0 commit 49a7f12

14 files changed

Lines changed: 5 additions & 60 deletions

db_events.php

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -19,11 +19,6 @@
1919
$GLOBALS['js_include'][] = 'rte/common.js';
2020
$GLOBALS['js_include'][] = 'rte/events.js';
2121

22-
if ($GLOBALS['cfg']['CodemirrorEnable']) {
23-
$GLOBALS['js_include'][] = 'codemirror/lib/codemirror.js';
24-
$GLOBALS['js_include'][] = 'codemirror/mode/mysql/mysql.js';
25-
}
26-
2722
/**
2823
* Include all other files
2924
*/

db_routines.php

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -25,11 +25,6 @@
2525
$GLOBALS['js_include'][] = 'rte/common.js';
2626
$GLOBALS['js_include'][] = 'rte/routines.js';
2727

28-
if ($GLOBALS['cfg']['CodemirrorEnable']) {
29-
$GLOBALS['js_include'][] = 'codemirror/lib/codemirror.js';
30-
$GLOBALS['js_include'][] = 'codemirror/mode/mysql/mysql.js';
31-
}
32-
3328
/**
3429
* Include all other files
3530
*/

db_sql.php

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -17,11 +17,6 @@
1717
$GLOBALS['js_include'][] = 'makegrid.js';
1818
$GLOBALS['js_include'][] = 'sql.js';
1919

20-
if ($GLOBALS['cfg']['CodemirrorEnable']) {
21-
$GLOBALS['js_include'][] = 'codemirror/lib/codemirror.js';
22-
$GLOBALS['js_include'][] = 'codemirror/mode/mysql/mysql.js';
23-
}
24-
2520
require 'libraries/db_common.inc.php';
2621
require_once 'libraries/sql_query_form.lib.php';
2722

db_triggers.php

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -18,11 +18,6 @@
1818
$GLOBALS['js_include'][] = 'rte/common.js';
1919
$GLOBALS['js_include'][] = 'rte/triggers.js';
2020

21-
if ($GLOBALS['cfg']['CodemirrorEnable']) {
22-
$GLOBALS['js_include'][] = 'codemirror/lib/codemirror.js';
23-
$GLOBALS['js_include'][] = 'codemirror/mode/mysql/mysql.js';
24-
}
25-
2621
/**
2722
* Include all other files
2823
*/

js/server_status.js

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -159,9 +159,6 @@ $(function() {
159159
'js/jquery/timepicker.js',
160160
'js/jquery/jquery.json-2.2.js',
161161
'js/jquery/jquery.sortableTable.js'];
162-
if (cfg_CodemirrorEnable) {
163-
scripts.push('js/codemirror/lib/codemirror.js', 'js/codemirror/mode/mysql/mysql.js');
164-
}
165162
scripts.push('js/server_status_monitor.js');
166163
loadJavascript(scripts);
167164
}, 50);

libraries/header_scripts.inc.php

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,11 @@
3636

3737
$GLOBALS['js_include'][] = 'functions.js';
3838
$GLOBALS['js_include'][] = 'jquery/jquery.qtip-1.0.0-rc3.js';
39+
if ($GLOBALS['cfg']['CodemirrorEnable']) {
40+
$GLOBALS['js_include'][] = 'codemirror/lib/codemirror.js';
41+
$GLOBALS['js_include'][] = 'codemirror/mode/mysql/mysql.js';
42+
}
43+
3944
$params = array('lang' => $GLOBALS['lang']);
4045
if (isset($GLOBALS['db'])) {
4146
$params['db'] = $GLOBALS['db'];

querywindow.php

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -121,11 +121,6 @@
121121
$js_include[] = 'common.js';
122122
$js_include[] = 'querywindow.js';
123123

124-
if ($GLOBALS['cfg']['CodemirrorEnable']) {
125-
$GLOBALS['js_include'][] = 'codemirror/lib/codemirror.js';
126-
$GLOBALS['js_include'][] = 'codemirror/mode/mysql/mysql.js';
127-
}
128-
129124
if (PMA_isValid($_REQUEST['auto_commit'], 'identical', 'true')) {
130125
$js_events[] = array(
131126
'event' => 'load',

server_privileges.php

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -16,10 +16,6 @@
1616
$GLOBALS['js_include'][] = 'server_privileges.js';
1717
$GLOBALS['js_include'][] = 'functions.js';
1818

19-
if ($GLOBALS['cfg']['CodemirrorEnable']) {
20-
$GLOBALS['js_include'][] = 'codemirror/lib/codemirror.js';
21-
$GLOBALS['js_include'][] = 'codemirror/mode/mysql/mysql.js';
22-
}
2319
$_add_user_error = false;
2420

2521
/**

server_sql.php

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -17,11 +17,6 @@
1717
$GLOBALS['js_include'][] = 'makegrid.js';
1818
$GLOBALS['js_include'][] = 'sql.js';
1919

20-
if ($GLOBALS['cfg']['CodemirrorEnable']) {
21-
$GLOBALS['js_include'][] = 'codemirror/lib/codemirror.js';
22-
$GLOBALS['js_include'][] = 'codemirror/mode/mysql/mysql.js';
23-
}
24-
2520
require_once 'libraries/server_common.inc.php';
2621
require_once 'libraries/sql_query_form.lib.php';
2722

server_status.php

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -430,8 +430,6 @@
430430
* JS Includes
431431
*/
432432

433-
// needed to decide whether to load codemirror.js in server_status.js
434-
PMA_AddJSVar('cfg_CodemirrorEnable', $GLOBALS['cfg']['CodemirrorEnable'] ? 1 : 0);
435433
$GLOBALS['js_include'][] = 'server_status.js';
436434

437435
$GLOBALS['js_include'][] = 'jquery/jquery.tablesorter.js';

0 commit comments

Comments
 (0)