mirror of
https://github.com/wahyd4/gitlabhq.git
synced 2026-08-12 06:06:05 +10:00
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.
10 lines
277 B
CoffeeScript
10 lines
277 B
CoffeeScript
# 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)
|