The branch, master has been updated via 0e53f3bf835cbab761adccb2c15324e3481e005b (commit) from ea8b7f0176564d79858893c7d4d015c46c47634d (commit)
- Log ----------------------------------------------------------------- commit 0e53f3bf835cbab761adccb2c15324e3481e005b Author: Michal Čihař mcihar@suse.cz Date: Wed Aug 10 08:21:43 2011 +0200
Fix codemirror syntax highlighting
-----------------------------------------------------------------------
Summary of changes: js/codemirror/mode/mysql/mysql.js | 25 ++-- themes/original/css/theme_right.css.php | 251 +++++++++++++++---------------- themes/pmahomme/css/theme_right.css.php | 23 ++-- 3 files changed, 148 insertions(+), 151 deletions(-)
diff --git a/js/codemirror/mode/mysql/mysql.js b/js/codemirror/mode/mysql/mysql.js index fd53d6c..657942d 100644 --- a/js/codemirror/mode/mysql/mysql.js +++ b/js/codemirror/mode/mysql/mysql.js @@ -24,11 +24,11 @@ CodeMirror.defineMode("mysql", function(config, parserConfig) { return chain(stream, state, tokenString(ch)); // is it one of the special signs []{}().,;? Seperator? else if (/[[]{}(),;.]/.test(ch)) - return ret(ch); + return ret(ch, "separator"); // start of a number value? else if (/\d/.test(ch)) { - stream.eatWhile(/[\w.]/) - return ret("number", "mysql-number"); + stream.eatWhile(/[\w.]/); + return ret("number", "number"); } // multi line comment or simple operator? else if (ch == "/") { @@ -37,41 +37,41 @@ CodeMirror.defineMode("mysql", function(config, parserConfig) { } else { stream.eatWhile(isOperatorChar); - return ret("operator", "mysql-operator"); + return ret("operator", "operator"); } } // single line comment or simple operator? else if (ch == "-") { if (stream.eat("-")) { stream.skipToEnd(); - return ret("comment", "mysql-comment"); + return ret("comment", "comment"); } else { stream.eatWhile(isOperatorChar); - return ret("operator", "mysql-operator"); + return ret("operator", "operator"); } } // pl/sql variable? else if (ch == "@" || ch == "$") { stream.eatWhile(/[\w\d$_]/); - return ret("word", "mysql-var"); + return ret("word", "variable"); } // is it a operator? else if (isOperatorChar.test(ch)) { stream.eatWhile(isOperatorChar); - return ret("operator", "mysql-operator"); + return ret("operator", "operator"); } else { // get the whole word stream.eatWhile(/[\w$_]/); // is it one of the listed keywords? - if (keywords && keywords.propertyIsEnumerable(stream.current().toLowerCase())) return ret("keyword", "mysql-keyword"); + if (keywords && keywords.propertyIsEnumerable(stream.current().toLowerCase())) return ret("keyword", "keyword"); // is it one of the listed functions? - if (functions && functions.propertyIsEnumerable(stream.current().toLowerCase())) return ret("keyword", "mysql-function"); + if (functions && functions.propertyIsEnumerable(stream.current().toLowerCase())) return ret("keyword", "builtin"); // is it one of the listed types? - if (types && types.propertyIsEnumerable(stream.current().toLowerCase())) return ret("keyword", "mysql-type"); + if (types && types.propertyIsEnumerable(stream.current().toLowerCase())) return ret("keyword", "variable-2"); // is it one of the listed attributes? - if (attributes && attributes.propertyIsEnumerable(stream.current().toLowerCase())) return ret("keyword", "mysql-attribute"); + if (attributes && attributes.propertyIsEnumerable(stream.current().toLowerCase())) return ret("keyword", "variable-3"); // default: just a "word" return ret("word", "mysql-word"); } @@ -108,7 +108,6 @@ CodeMirror.defineMode("mysql", function(config, parserConfig) { startState: function(basecolumn) { return { tokenize: tokenBase, - indented: 0, startOfLine: true }; }, diff --git a/themes/original/css/theme_right.css.php b/themes/original/css/theme_right.css.php index 710ec0d..862f85f 100644 --- a/themes/original/css/theme_right.css.php +++ b/themes/original/css/theme_right.css.php @@ -158,131 +158,131 @@ button { background: url(<?php echo $_SESSION['PMA_Theme']->getImgPath(); ?>iconsprites.png) no-repeat top left; }
-.ic_b_bookmark { background-position: 0 0; } -.ic_b_browse { background-position: 0 -18px; } -.ic_b_calendar { background-position: 0 -36px; } -.ic_b_chart { background-position: 0 -54px; } -.ic_b_close { background-position: 0 -72px; } -.ic_b_comment { background-position: 0 -90px; } -.ic_b_dbstatistics { background-position: 0 -108px; } -.ic_b_deltbl { background-position: 0 -126px; } -.ic_b_docs { background-position: 0 -144px; } -.ic_b_drop { background-position: 0 -162px; } -.ic_b_edit { background-position: 0 -180px; } -.ic_b_empty { background-position: 0 -198px; } -.ic_b_engine { background-position: 0 -216px; } -.ic_b_event_add { background-position: 0 -234px; } -.ic_b_events { background-position: 0 -252px; } -.ic_b_export { background-position: 0 -270px; } -.ic_b_ftext { background-position: 0 -288px; } -.ic_b_globe { background-position: 0 -306px; } -.ic_b_help { background-position: 0 -324px; width: 11px; height: 11px; } -.ic_b_home { background-position: 0 -337px; } -.ic_b_import { background-position: 0 -355px; } -.ic_b_index { background-position: 0 -373px; } -.ic_b_info { background-position: 0 -391px; width: 11px; height: 11px; } -.ic_b_inline_edit { background-position: 0 -404px; } -.ic_b_insrow { background-position: 0 -422px; } -.ic_b_minus { background-position: 0 -440px; width: 9px; height: 9px; } -.ic_b_more { background-position: 0 -451px; } -.ic_b_newdb { background-position: 0 -469px; } -.ic_b_newtbl { background-position: 0 -487px; } -.ic_b_nextpage, .ic_play { background-position: 0 -505px; } -.ic_b_plus { background-position: 0 -523px; width: 9px; height: 9px; } -.ic_b_primary { background-position: 0 -534px; } -.ic_b_print { background-position: 0 -552px; } -.ic_b_props { background-position: 0 -570px; } -.ic_b_relations { background-position: 0 -588px; } -.ic_b_routine_add { background-position: 0 -606px; } -.ic_b_routines { background-position: 0 -624px; } -.ic_b_save { background-position: 0 -642px; } -.ic_b_sbrowse { background-position: 0 -660px; width: 10px; height: 10px; } -.ic_b_search { background-position: 0 -672px; } -.ic_b_selboard { background-position: 0 -690px; } -.ic_b_select { background-position: 0 -708px; } -.ic_b_snewtbl { background-position: 0 -726px; width: 10px; height: 10px; } -.ic_b_spatial { background-position: 0 -738px; } -.ic_b_sql { background-position: 0 -756px; } -.ic_b_sqlhelp { background-position: 0 -774px; } -.ic_b_tblanalyse { background-position: 0 -792px; } -.ic_b_tblexport { background-position: 0 -810px; } -.ic_b_tblimport { background-position: 0 -828px; } -.ic_b_tblops { background-position: 0 -846px; } -.ic_b_tbloptimize { background-position: 0 -864px; } -.ic_b_tipp { background-position: 0 -882px; } -.ic_b_trigger_add { background-position: 0 -900px; } -.ic_b_triggers { background-position: 0 -918px; } -.ic_b_unique { background-position: 0 -936px; } -.ic_b_usradd { background-position: 0 -954px; } -.ic_b_usrcheck { background-position: 0 -972px; } -.ic_b_usrdrop { background-position: 0 -990px; } -.ic_b_usredit { background-position: 0 -1008px; } -.ic_b_usrlist { background-position: 0 -1026px; } -.ic_b_view { background-position: 0 -1044px; } -.ic_b_views { background-position: 0 -1062px; } -.ic_bd_browse { background-position: 0 -1080px; } -.ic_bd_deltbl { background-position: 0 -1098px; } -.ic_bd_drop { background-position: 0 -1116px; } -.ic_bd_edit { background-position: 0 -1134px; } -.ic_bd_empty { background-position: 0 -1152px; } -.ic_bd_export { background-position: 0 -1170px; } -.ic_bd_ftext { background-position: 0 -1188px; } -.ic_bd_index { background-position: 0 -1206px; } -.ic_bd_insrow { background-position: 0 -1224px; } -.ic_bd_nextpage { background-position: 0 -1242px; width: 8px; height: 13px; } -.ic_bd_primary { background-position: 0 -1257px; } -.ic_bd_sbrowse { background-position: 0 -1275px; width: 10px; height: 10px; } -.ic_bd_select { background-position: 0 -1287px; } -.ic_bd_spatial { background-position: 0 -1305px; } -.ic_bd_unique { background-position: 0 -1323px; } -.ic_col_drop { background-position: 0 -1341px; } -.ic_eye { background-position: 0 -1359px; } -.ic_eye_grey { background-position: 0 -1377px; } -.ic_item_ltr { background-position: 0 -1395px; width: 5px; height: 9px; } -.ic_item_rtl { background-position: 0 -1406px; width: 5px; height: 9px; } -.ic_more { background-position: 0 -1417px; width: 13px; height: 8px; } -.ic_pause { background-position: 0 -1427px; } -.ic_s_asc { background-position: 0 -1445px; width: 11px; height: 9px; } -.ic_s_asci { background-position: 0 -1456px; } -.ic_s_cancel { background-position: 0 -1474px; } -.ic_s_cog { background-position: 0 -1492px; } -.ic_s_db { background-position: 0 -1510px; } -.ic_s_desc { background-position: 0 -1528px; width: 11px; height: 9px; } -.ic_s_error { background-position: 0 -1539px; } -.ic_s_error2 { background-position: 0 -1557px; width: 11px; height: 11px; } -.ic_s_host { background-position: 0 -1570px; } -.ic_s_lang { background-position: 0 -1588px; } -.ic_s_loggoff { background-position: 0 -1606px; } -.ic_s_notice { background-position: 0 -1624px; } -.ic_s_passwd { background-position: 0 -1642px; } -.ic_s_really { background-position: 0 -1660px; width: 11px; height: 11px; } -.ic_s_reload { background-position: 0 -1673px; } -.ic_s_replication { background-position: 0 -1691px; } -.ic_s_rights { background-position: 0 -1709px; } -.ic_s_sortable { background-position: 0 -1727px; } -.ic_s_status { background-position: 0 -1745px; } -.ic_s_success { background-position: 0 -1763px; } -.ic_s_sync { background-position: 0 -1781px; } -.ic_s_tbl { background-position: 0 -1799px; } -.ic_s_theme { background-position: 0 -1817px; } -.ic_s_vars { background-position: 0 -1835px; } -.ic_s_views { background-position: 0 -1853px; width: 10px; height: 10px; } -.ic_window-new { background-position: 0 -1865px; } +.ic_b_bookmark { background-position: 0 0; } +.ic_b_browse { background-position: 0 -18px; } +.ic_b_calendar { background-position: 0 -36px; } +.ic_b_chart { background-position: 0 -54px; } +.ic_b_close { background-position: 0 -72px; } +.ic_b_comment { background-position: 0 -90px; } +.ic_b_dbstatistics { background-position: 0 -108px; } +.ic_b_deltbl { background-position: 0 -126px; } +.ic_b_docs { background-position: 0 -144px; } +.ic_b_drop { background-position: 0 -162px; } +.ic_b_edit { background-position: 0 -180px; } +.ic_b_empty { background-position: 0 -198px; } +.ic_b_engine { background-position: 0 -216px; } +.ic_b_event_add { background-position: 0 -234px; } +.ic_b_events { background-position: 0 -252px; } +.ic_b_export { background-position: 0 -270px; } +.ic_b_ftext { background-position: 0 -288px; } +.ic_b_globe { background-position: 0 -306px; } +.ic_b_help { background-position: 0 -324px; width: 11px; height: 11px; } +.ic_b_home { background-position: 0 -337px; } +.ic_b_import { background-position: 0 -355px; } +.ic_b_index { background-position: 0 -373px; } +.ic_b_info { background-position: 0 -391px; width: 11px; height: 11px; } +.ic_b_inline_edit { background-position: 0 -404px; } +.ic_b_insrow { background-position: 0 -422px; } +.ic_b_minus { background-position: 0 -440px; width: 9px; height: 9px; } +.ic_b_more { background-position: 0 -451px; } +.ic_b_newdb { background-position: 0 -469px; } +.ic_b_newtbl { background-position: 0 -487px; } +.ic_b_nextpage, .ic_play { background-position: 0 -505px; } +.ic_b_plus { background-position: 0 -523px; width: 9px; height: 9px; } +.ic_b_primary { background-position: 0 -534px; } +.ic_b_print { background-position: 0 -552px; } +.ic_b_props { background-position: 0 -570px; } +.ic_b_relations { background-position: 0 -588px; } +.ic_b_routine_add { background-position: 0 -606px; } +.ic_b_routines { background-position: 0 -624px; } +.ic_b_save { background-position: 0 -642px; } +.ic_b_sbrowse { background-position: 0 -660px; width: 10px; height: 10px; } +.ic_b_search { background-position: 0 -672px; } +.ic_b_selboard { background-position: 0 -690px; } +.ic_b_select { background-position: 0 -708px; } +.ic_b_snewtbl { background-position: 0 -726px; width: 10px; height: 10px; } +.ic_b_spatial { background-position: 0 -738px; } +.ic_b_sql { background-position: 0 -756px; } +.ic_b_sqlhelp { background-position: 0 -774px; } +.ic_b_tblanalyse { background-position: 0 -792px; } +.ic_b_tblexport { background-position: 0 -810px; } +.ic_b_tblimport { background-position: 0 -828px; } +.ic_b_tblops { background-position: 0 -846px; } +.ic_b_tbloptimize { background-position: 0 -864px; } +.ic_b_tipp { background-position: 0 -882px; } +.ic_b_trigger_add { background-position: 0 -900px; } +.ic_b_triggers { background-position: 0 -918px; } +.ic_b_unique { background-position: 0 -936px; } +.ic_b_usradd { background-position: 0 -954px; } +.ic_b_usrcheck { background-position: 0 -972px; } +.ic_b_usrdrop { background-position: 0 -990px; } +.ic_b_usredit { background-position: 0 -1008px; } +.ic_b_usrlist { background-position: 0 -1026px; } +.ic_b_view { background-position: 0 -1044px; } +.ic_b_views { background-position: 0 -1062px; } +.ic_bd_browse { background-position: 0 -1080px; } +.ic_bd_deltbl { background-position: 0 -1098px; } +.ic_bd_drop { background-position: 0 -1116px; } +.ic_bd_edit { background-position: 0 -1134px; } +.ic_bd_empty { background-position: 0 -1152px; } +.ic_bd_export { background-position: 0 -1170px; } +.ic_bd_ftext { background-position: 0 -1188px; } +.ic_bd_index { background-position: 0 -1206px; } +.ic_bd_insrow { background-position: 0 -1224px; } +.ic_bd_nextpage { background-position: 0 -1242px; width: 8px; height: 13px; } +.ic_bd_primary { background-position: 0 -1257px; } +.ic_bd_sbrowse { background-position: 0 -1275px; width: 10px; height: 10px; } +.ic_bd_select { background-position: 0 -1287px; } +.ic_bd_spatial { background-position: 0 -1305px; } +.ic_bd_unique { background-position: 0 -1323px; } +.ic_col_drop { background-position: 0 -1341px; } +.ic_eye { background-position: 0 -1359px; } +.ic_eye_grey { background-position: 0 -1377px; } +.ic_item_ltr { background-position: 0 -1395px; width: 5px; height: 9px; } +.ic_item_rtl { background-position: 0 -1406px; width: 5px; height: 9px; } +.ic_more { background-position: 0 -1417px; width: 13px; height: 8px; } +.ic_pause { background-position: 0 -1427px; } +.ic_s_asc { background-position: 0 -1445px; width: 11px; height: 9px; } +.ic_s_asci { background-position: 0 -1456px; } +.ic_s_cancel { background-position: 0 -1474px; } +.ic_s_cog { background-position: 0 -1492px; } +.ic_s_db { background-position: 0 -1510px; } +.ic_s_desc { background-position: 0 -1528px; width: 11px; height: 9px; } +.ic_s_error { background-position: 0 -1539px; } +.ic_s_error2 { background-position: 0 -1557px; width: 11px; height: 11px; } +.ic_s_host { background-position: 0 -1570px; } +.ic_s_lang { background-position: 0 -1588px; } +.ic_s_loggoff { background-position: 0 -1606px; } +.ic_s_notice { background-position: 0 -1624px; } +.ic_s_passwd { background-position: 0 -1642px; } +.ic_s_really { background-position: 0 -1660px; width: 11px; height: 11px; } +.ic_s_reload { background-position: 0 -1673px; } +.ic_s_replication { background-position: 0 -1691px; } +.ic_s_rights { background-position: 0 -1709px; } +.ic_s_sortable { background-position: 0 -1727px; } +.ic_s_status { background-position: 0 -1745px; } +.ic_s_success { background-position: 0 -1763px; } +.ic_s_sync { background-position: 0 -1781px; } +.ic_s_tbl { background-position: 0 -1799px; } +.ic_s_theme { background-position: 0 -1817px; } +.ic_s_vars { background-position: 0 -1835px; } +.ic_s_views { background-position: 0 -1853px; width: 10px; height: 10px; } +.ic_window-new { background-position: 0 -1865px; }
/* Same as s_notice */ -.ic_s_attention { background-position: 0 -1624px; } +.ic_s_attention { background-position: 0 -1624px; }
/* Same as ic_b_help, but applied to place where width=11, height=11 attributes were used */ -.ic_b_help_s { background-position: -324px 0; width: 11px; height: 11px; } +.ic_b_help_s { background-position: -324px 0; width: 11px; height: 11px; }
/* Same as ic_s_sortable */ img.sortableIcon { background-position: -1727px 0; }
/* Same as s_asc */ -th.headerSortUp img.sortableIcon { background-position: 0 -1445px; width: 11px; height: 9px; } +th.headerSortUp img.sortableIcon { background-position: 0 -1445px; width: 11px; height: 9px; }
/* Same as s_desc */ -th.headerSortDown img.sortableIcon { background-position: 0 -1528px; width: 11px; height: 9px; } +th.headerSortDown img.sortableIcon { background-position: 0 -1528px; width: 11px; height: 9px; }
/******************************************************************************/ /* classes */ @@ -2260,38 +2260,37 @@ span.CodeMirror-selected { .CodeMirror-matchingbracket {color: #0f0 !important;} .CodeMirror-nonmatchingbracket {color: #f22 !important;}
- -span.mysql-keyword { +span.cm-keyword { color: <?php echo $GLOBALS['cfg']['SQP']['fmtColor']['alpha_reservedWord']; ?>; } -span.mysql-var { +span.cm-variable { color: <?php echo $GLOBALS['cfg']['SQP']['fmtColor']['alpha_identifier']; ?>; } -span.mysql-comment { +span.cm-comment { color: <?php echo $GLOBALS['cfg']['SQP']['fmtColor']['comment']; ?>; } -span.mysql-string { +span.cm-mysql-string { color: <?php echo $GLOBALS['cfg']['SQP']['fmtColor']['quote']; ?>; } -span.mysql-operator { +span.cm-operator { color: <?php echo $GLOBALS['cfg']['SQP']['fmtColor']['punct']; ?>; } -span.mysql-word { +span.cm-mysql-word { color: <?php echo $GLOBALS['cfg']['SQP']['fmtColor']['alpha']; ?>; } -span.mysql-function { +span.cm-builtin { color: <?php echo $GLOBALS['cfg']['SQP']['fmtColor']['alpha_functionName']; ?>; } -span.mysql-type { +span.cm-variable-2 { color: <?php echo $GLOBALS['cfg']['SQP']['fmtColor']['alpha_columnType']; ?>; } -span.mysql-attribute { +span.cm-variable-3 { color: <?php echo $GLOBALS['cfg']['SQP']['fmtColor']['alpha_columnAttrib']; ?>; } -span.mysql-separator { +span.cm-separator { color: <?php echo $GLOBALS['cfg']['SQP']['fmtColor']['punct']; ?>; } -span.mysql-number { +span.cm-number { color: <?php echo $GLOBALS['cfg']['SQP']['fmtColor']['digit_integer']; ?>; }
diff --git a/themes/pmahomme/css/theme_right.css.php b/themes/pmahomme/css/theme_right.css.php index f7089af..fc114ce 100644 --- a/themes/pmahomme/css/theme_right.css.php +++ b/themes/pmahomme/css/theme_right.css.php @@ -2677,38 +2677,37 @@ span.CodeMirror-selected { .CodeMirror-matchingbracket {color: #0f0 !important;} .CodeMirror-nonmatchingbracket {color: #f22 !important;}
- -span.mysql-keyword { +span.cm-keyword { color: <?php echo $GLOBALS['cfg']['SQP']['fmtColor']['alpha_reservedWord']; ?>; } -span.mysql-var { +span.cm-variable { color: <?php echo $GLOBALS['cfg']['SQP']['fmtColor']['alpha_identifier']; ?>; } -span.mysql-comment { +span.cm-comment { color: <?php echo $GLOBALS['cfg']['SQP']['fmtColor']['comment']; ?>; } -span.mysql-string { +span.cm-mysql-string { color: <?php echo $GLOBALS['cfg']['SQP']['fmtColor']['quote']; ?>; } -span.mysql-operator { +span.cm-operator { color: <?php echo $GLOBALS['cfg']['SQP']['fmtColor']['punct']; ?>; } -span.mysql-word { +span.cm-mysql-word { color: <?php echo $GLOBALS['cfg']['SQP']['fmtColor']['alpha']; ?>; } -span.mysql-function { +span.cm-builtin { color: <?php echo $GLOBALS['cfg']['SQP']['fmtColor']['alpha_functionName']; ?>; } -span.mysql-type { +span.cm-variable-2 { color: <?php echo $GLOBALS['cfg']['SQP']['fmtColor']['alpha_columnType']; ?>; } -span.mysql-attribute { +span.cm-variable-3 { color: <?php echo $GLOBALS['cfg']['SQP']['fmtColor']['alpha_columnAttrib']; ?>; } -span.mysql-separator { +span.cm-separator { color: <?php echo $GLOBALS['cfg']['SQP']['fmtColor']['punct']; ?>; } -span.mysql-number { +span.cm-number { color: <?php echo $GLOBALS['cfg']['SQP']['fmtColor']['digit_integer']; ?>; }
hooks/post-receive