From 08a2bdc560b949f359008f8c2c8d32a294ac48f8 Mon Sep 17 00:00:00 2001 From: Jacob Schatz Date: Thu, 21 Jul 2016 19:16:14 -0400 Subject: All files now JS instead of CS --- app/assets/javascripts/syntax_highlight.js | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) create mode 100644 app/assets/javascripts/syntax_highlight.js (limited to 'app/assets/javascripts/syntax_highlight.js') diff --git a/app/assets/javascripts/syntax_highlight.js b/app/assets/javascripts/syntax_highlight.js new file mode 100644 index 00000000000..dba62638c78 --- /dev/null +++ b/app/assets/javascripts/syntax_highlight.js @@ -0,0 +1,18 @@ +(function() { + $.fn.syntaxHighlight = function() { + var $children; + if ($(this).hasClass('js-syntax-highlight')) { + return $(this).addClass(gon.user_color_scheme); + } else { + $children = $(this).find('.js-syntax-highlight'); + if ($children.length) { + return $children.syntaxHighlight(); + } + } + }; + + $(document).on('ready page:load', function() { + return $('.js-syntax-highlight').syntaxHighlight(); + }); + +}).call(this); -- cgit v1.2.1