Welcome to mirror list, hosted at ThFree Co, Russian Federation.

gitlab.com/gitlab-org/gitlab-foss.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRobert Speicher <rspeicher@gmail.com>2015-08-26 01:24:53 +0300
committerRobert Speicher <rspeicher@gmail.com>2015-08-26 01:32:38 +0300
commit2c3e42e4a44e2f40e521cbafc8144e5d7c366b76 (patch)
tree805e249cd96c5cb968cbedd096061beab081b3aa /app/assets/javascripts/syntax_highlight.coffee
parent59180c4f5a553938ee79968e7983aee6ce584ff5 (diff)
Remove user_color_scheme_class
Instead of rendering this value server-side, we use Javascript and Gon to apply the user's color scheme (or the default) to any syntax highlighted code blocks. This will make it easier to cache these blocks in the future because they're no longer state-dependent.
Diffstat (limited to 'app/assets/javascripts/syntax_highlight.coffee')
-rw-r--r--app/assets/javascripts/syntax_highlight.coffee9
1 files changed, 9 insertions, 0 deletions
diff --git a/app/assets/javascripts/syntax_highlight.coffee b/app/assets/javascripts/syntax_highlight.coffee
new file mode 100644
index 00000000000..510f15d1b49
--- /dev/null
+++ b/app/assets/javascripts/syntax_highlight.coffee
@@ -0,0 +1,9 @@
+# Applies a syntax highlighting color scheme CSS class to any element with the
+# `js-syntax-highlight` class
+#
+# ### Example Markup
+#
+# <div class="js-syntax-highlight"></div>
+#
+$(document).on 'ready page:load', ->
+ $('.js-syntax-highlight').addClass(gon.user_color_scheme)