The branch, master has been updated via 19ab72bf8584affddda369cae8d16a0b00c5cc4a (commit) from a59daa10b5b5dc58a754b9cd53de3ce1ab52d633 (commit)
- Log ----------------------------------------------------------------- commit 19ab72bf8584affddda369cae8d16a0b00c5cc4a Author: Michal Čihař michal@cihar.com Date: Mon Aug 22 15:52:35 2011 +0200
One place to generate CodeMirror CSS
-----------------------------------------------------------------------
Summary of changes: libraries/Theme.class.php | 43 +++++++++++++++++++++++++++++++ themes/original/css/theme_right.css.php | 34 +----------------------- themes/pmahomme/css/theme_right.css.php | 34 +----------------------- 3 files changed, 45 insertions(+), 66 deletions(-)
diff --git a/libraries/Theme.class.php b/libraries/Theme.class.php index 155d34d..1aca278d 100644 --- a/libraries/Theme.class.php +++ b/libraries/Theme.class.php @@ -377,5 +377,48 @@ class PMA_Theme } return implode("\n", $result); } + + /** + * Returns CSS styles for CodeMirror editor based on query formatter colors. + * + * @return string CSS code. + */ + function getCssCodeMirror() + { + $result[] = 'span.cm-keyword, span.cm-statement-verb {'; + $result[] = ' color: ' . $GLOBALS['cfg']['SQP']['fmtColor']['alpha_reservedWord'] . ';'; + $result[] = '}'; + $result[] = 'span.cm-variable {'; + $result[] = ' color: ' . $GLOBALS['cfg']['SQP']['fmtColor']['alpha_identifier'] . ';'; + $result[] = '}'; + $result[] = 'span.cm-comment {'; + $result[] = ' color: ' . $GLOBALS['cfg']['SQP']['fmtColor']['comment'] . ';'; + $result[] = '}'; + $result[] = 'span.cm-mysql-string {'; + $result[] = ' color: ' . $GLOBALS['cfg']['SQP']['fmtColor']['quote'] . ';'; + $result[] = '}'; + $result[] = 'span.cm-operator {'; + $result[] = ' color: ' . $GLOBALS['cfg']['SQP']['fmtColor']['punct'] . ';'; + $result[] = '}'; + $result[] = 'span.cm-mysql-word {'; + $result[] = ' color: ' . $GLOBALS['cfg']['SQP']['fmtColor']['alpha'] . ';'; + $result[] = '}'; + $result[] = 'span.cm-builtin {'; + $result[] = ' color: ' . $GLOBALS['cfg']['SQP']['fmtColor']['alpha_functionName'] . ';'; + $result[] = '}'; + $result[] = 'span.cm-variable-2 {'; + $result[] = ' color: ' . $GLOBALS['cfg']['SQP']['fmtColor']['alpha_columnType'] . ';'; + $result[] = '}'; + $result[] = 'span.cm-variable-3 {'; + $result[] = ' color: ' . $GLOBALS['cfg']['SQP']['fmtColor']['alpha_columnAttrib'] . ';'; + $result[] = '}'; + $result[] = 'span.cm-separator {'; + $result[] = ' color: ' . $GLOBALS['cfg']['SQP']['fmtColor']['punct'] . ';'; + $result[] = '}'; + $result[] = 'span.cm-number {'; + $result[] = ' color: ' . $GLOBALS['cfg']['SQP']['fmtColor']['digit_integer'] . ';'; + $result[] = '}'; + return implode("\n", $result); + } } ?> diff --git a/themes/original/css/theme_right.css.php b/themes/original/css/theme_right.css.php index 64b4b00..badeb92 100644 --- a/themes/original/css/theme_right.css.php +++ b/themes/original/css/theme_right.css.php @@ -2299,39 +2299,7 @@ span.CodeMirror-selected { .CodeMirror-matchingbracket {color: #0f0 !important;} .CodeMirror-nonmatchingbracket {color: #f22 !important;}
-span.cm-keyword, span.cm-statement-verb { - color: <?php echo $GLOBALS['cfg']['SQP']['fmtColor']['alpha_reservedWord']; ?>; -} -span.cm-variable { - color: <?php echo $GLOBALS['cfg']['SQP']['fmtColor']['alpha_identifier']; ?>; -} -span.cm-comment { - color: <?php echo $GLOBALS['cfg']['SQP']['fmtColor']['comment']; ?>; -} -span.cm-mysql-string { - color: <?php echo $GLOBALS['cfg']['SQP']['fmtColor']['quote']; ?>; -} -span.cm-operator { - color: <?php echo $GLOBALS['cfg']['SQP']['fmtColor']['punct']; ?>; -} -span.cm-mysql-word { - color: <?php echo $GLOBALS['cfg']['SQP']['fmtColor']['alpha']; ?>; -} -span.cm-builtin { - color: <?php echo $GLOBALS['cfg']['SQP']['fmtColor']['alpha_functionName']; ?>; -} -span.cm-variable-2 { - color: <?php echo $GLOBALS['cfg']['SQP']['fmtColor']['alpha_columnType']; ?>; -} -span.cm-variable-3 { - color: <?php echo $GLOBALS['cfg']['SQP']['fmtColor']['alpha_columnAttrib']; ?>; -} -span.cm-separator { - color: <?php echo $GLOBALS['cfg']['SQP']['fmtColor']['punct']; ?>; -} -span.cm-number { - color: <?php echo $GLOBALS['cfg']['SQP']['fmtColor']['digit_integer']; ?>; -} +<?php echo $_SESSION['PMA_Theme']->getCssCodeMirror(); ?>
.colborder { border-right: solid 1px #FFFFFF; diff --git a/themes/pmahomme/css/theme_right.css.php b/themes/pmahomme/css/theme_right.css.php index fdfa404..c52a973 100644 --- a/themes/pmahomme/css/theme_right.css.php +++ b/themes/pmahomme/css/theme_right.css.php @@ -2670,39 +2670,7 @@ span.CodeMirror-selected { .CodeMirror-matchingbracket {color: #0f0 !important;} .CodeMirror-nonmatchingbracket {color: #f22 !important;}
-span.cm-keyword, span.cm-statement-verb { - color: <?php echo $GLOBALS['cfg']['SQP']['fmtColor']['alpha_reservedWord']; ?>; -} -span.cm-variable { - color: <?php echo $GLOBALS['cfg']['SQP']['fmtColor']['alpha_identifier']; ?>; -} -span.cm-comment { - color: <?php echo $GLOBALS['cfg']['SQP']['fmtColor']['comment']; ?>; -} -span.cm-mysql-string { - color: <?php echo $GLOBALS['cfg']['SQP']['fmtColor']['quote']; ?>; -} -span.cm-operator { - color: <?php echo $GLOBALS['cfg']['SQP']['fmtColor']['punct']; ?>; -} -span.cm-mysql-word { - color: <?php echo $GLOBALS['cfg']['SQP']['fmtColor']['alpha']; ?>; -} -span.cm-builtin { - color: <?php echo $GLOBALS['cfg']['SQP']['fmtColor']['alpha_functionName']; ?>; -} -span.cm-variable-2 { - color: <?php echo $GLOBALS['cfg']['SQP']['fmtColor']['alpha_columnType']; ?>; -} -span.cm-variable-3 { - color: <?php echo $GLOBALS['cfg']['SQP']['fmtColor']['alpha_columnAttrib']; ?>; -} -span.cm-separator { - color: <?php echo $GLOBALS['cfg']['SQP']['fmtColor']['punct']; ?>; -} -span.cm-number { - color: <?php echo $GLOBALS['cfg']['SQP']['fmtColor']['digit_integer']; ?>; -} +<?php echo $_SESSION['PMA_Theme']->getCssCodeMirror(); ?>
.colborder { border-right: 1px solid #FFF;
hooks/post-receive