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:
authorJared Deckard <jared.deckard@gmail.com>2016-07-27 06:32:10 +0300
committerJared Deckard <jared.deckard@gmail.com>2016-09-08 20:23:12 +0300
commit7f6474b269a5cfa454d28c0c0da969490c9eb33e (patch)
treeaafe7df9bc2683712a466595a046adb57e222565 /app/assets/javascripts/syntax_highlight.js
parent4c833a1d4ead49c27f6a81e607d10a5c6f0fcc2b (diff)
Restore comments lost when converting CoffeeScript to JavaScript
Diffstat (limited to 'app/assets/javascripts/syntax_highlight.js')
-rw-r--r--app/assets/javascripts/syntax_highlight.js11
1 files changed, 11 insertions, 0 deletions
diff --git a/app/assets/javascripts/syntax_highlight.js b/app/assets/javascripts/syntax_highlight.js
index dba62638c78..2ae7bf5fc15 100644
--- a/app/assets/javascripts/syntax_highlight.js
+++ b/app/assets/javascripts/syntax_highlight.js
@@ -1,9 +1,20 @@
+// Syntax Highlighter
+//
+// 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>
+//
(function() {
$.fn.syntaxHighlight = function() {
var $children;
if ($(this).hasClass('js-syntax-highlight')) {
+ // Given the element itself, apply highlighting
return $(this).addClass(gon.user_color_scheme);
} else {
+ // Given a parent element, recurse to any of its applicable children
$children = $(this).find('.js-syntax-highlight');
if ($children.length) {
return $children.syntaxHighlight();