forked from highlightjs/highlight.js
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge remote-tracking branch 'refs/remotes/isagalaev/master'
- Loading branch information
Showing
26 changed files
with
273 additions
and
84 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,88 +1,119 @@ | ||
function resizeLists() { | ||
var | ||
categories = $('#categories'), | ||
styles = $('#styles'); | ||
categories.css('max-height', $(window).height() / 4); | ||
categories.perfectScrollbar('update'); | ||
styles.height($(window).height() - styles.position().top - 20); | ||
styles.perfectScrollbar('update'); | ||
} | ||
|
||
function selectCategory(category) { | ||
$('#languages div').each(function(i, div) { | ||
div = $(div); | ||
if (div.hasClass(category)) { | ||
var code = div.find('code'); | ||
if (!code.hasClass('hljs')) { | ||
hljs.highlightBlock(code.get(0)); | ||
(function() { | ||
'use strict'; | ||
|
||
var $window = $(window), | ||
$languages = $('#languages div'), | ||
$linkTitle = $('link[title]'), | ||
$categoryContainer = $('#categories'), | ||
$styleContainer = $('#styles'); | ||
|
||
function resizeLists() { | ||
var screenHeight = $window.height() | ||
|
||
$categoryContainer.css('max-height', screenHeight / 4); | ||
$categoryContainer.perfectScrollbar('update'); | ||
$styleContainer.height( | ||
screenHeight - $styleContainer.position().top - 20 | ||
); | ||
$styleContainer.perfectScrollbar('update'); | ||
} | ||
|
||
function selectCategory(category) { | ||
$languages.each(function(i, language) { | ||
var $language = $(language); | ||
|
||
if ($language.hasClass(category)) { | ||
var code = $language.find('code'); | ||
|
||
if (!code.hasClass('hljs')) { | ||
hljs.highlightBlock(code.get(0)); | ||
} | ||
|
||
$language.show(); | ||
} else { | ||
$language.hide(); | ||
} | ||
div.show(); | ||
} else { | ||
div.hide(); | ||
} | ||
}); | ||
}); | ||
|
||
$(document).scrollTop(0); | ||
} | ||
|
||
$(document).scrollTop(0); | ||
} | ||
|
||
function categoryKey(c) { | ||
return c === 'common' ? '' : c === 'misc' ? 'z' : c === 'all' ? 'zz' : c; | ||
} | ||
|
||
function initCategories() { | ||
var categories = {}; | ||
$('#languages div').each(function(i, div) { | ||
if (!div.className) { | ||
div.className += 'misc'; | ||
} | ||
div.className += ' all'; | ||
div.className.split(' ').forEach(function(c) { | ||
categories[c] = (categories[c] || 0) + 1; | ||
function categoryKey(c) { | ||
return c === 'common' ? '' : c === 'misc' ? 'z' : c === 'all' ? 'zz' : c; | ||
} | ||
|
||
function initCategories() { | ||
var $categories, categoryNames; | ||
var categories = {}; | ||
|
||
$languages.each(function(i, div) { | ||
if (!div.className) { | ||
div.className += 'misc'; | ||
} | ||
div.className += ' all'; | ||
div.className.split(' ').forEach(function(c) { | ||
categories[c] = (categories[c] || 0) + 1; | ||
}); | ||
}); | ||
}); | ||
var ul = $('#categories'); | ||
var category_names = Object.keys(categories); | ||
category_names.sort(function(a, b) { | ||
a = categoryKey(a); | ||
b = categoryKey(b); | ||
return a < b ? -1 : a > b ? 1 : 0; | ||
}); | ||
category_names.forEach(function(c) { | ||
ul.append('<li data-category="' + c + '">' + c + ' (' + categories[c] +')</li>'); | ||
}); | ||
$('#categories li').click(function(e) { | ||
$('#categories li').removeClass('current'); | ||
$(this).addClass('current'); | ||
selectCategory($(this).data('category')); | ||
}); | ||
$('#categories li:first-child').click(); | ||
ul.perfectScrollbar(); | ||
} | ||
|
||
function selectStyle(style) { | ||
$('link[title]').each(function(i, link) { | ||
link.disabled = (link.title != style); | ||
}); | ||
} | ||
categoryNames = Object.keys(categories); | ||
|
||
function initStyles() { | ||
var ul = $('#styles'); | ||
$('link[title]').each(function(i, link) { | ||
ul.append('<li>' + link.title + '</li>'); | ||
}); | ||
$('#styles li').click(function(e) { | ||
$('#styles li').removeClass('current'); | ||
$(this).addClass('current'); | ||
selectStyle($(this).text()); | ||
}); | ||
$('#styles li:first-child').click(); | ||
ul.perfectScrollbar(); | ||
} | ||
categoryNames.sort(function(a, b) { | ||
a = categoryKey(a); | ||
b = categoryKey(b); | ||
return a < b ? -1 : a > b ? 1 : 0; | ||
}); | ||
|
||
categoryNames.forEach(function(c) { | ||
$categoryContainer.append( | ||
'<li data-category="' + c + '">' + c + ' (' + categories[c] +')</li>' | ||
); | ||
}); | ||
|
||
$categories = $categoryContainer.find('li'); | ||
|
||
$categories.click(function() { | ||
var $category = $(this); | ||
|
||
$categories.removeClass('current'); | ||
$category.addClass('current'); | ||
selectCategory($category.data('category')); | ||
}); | ||
|
||
$categories.first().click(); | ||
$categoryContainer.perfectScrollbar(); | ||
} | ||
|
||
$(document).ready(function() { | ||
initCategories(); | ||
initStyles(); | ||
$(window).resize(resizeLists); | ||
resizeLists(); | ||
}); | ||
function selectStyle(style) { | ||
$linkTitle.each(function(i, link) { | ||
link.disabled = (link.title !== style); | ||
}); | ||
} | ||
|
||
function initStyles() { | ||
var $styles; | ||
|
||
$linkTitle.each(function(i, link) { | ||
$styleContainer.append('<li>' + link.title + '</li>'); | ||
}); | ||
|
||
$styles = $styleContainer.find('li'); | ||
|
||
$styles.click(function() { | ||
var $style = $(this); | ||
|
||
$styles.removeClass('current'); | ||
$style.addClass('current'); | ||
selectStyle($style.text()); | ||
}); | ||
$styles.first().click(); | ||
$styleContainer.perfectScrollbar(); | ||
} | ||
|
||
$(function() { | ||
initCategories(); | ||
initStyles(); | ||
$window.resize(resizeLists); | ||
resizeLists(); | ||
}); | ||
}).call(this); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,40 @@ | ||
/* | ||
Language: SubUnit | ||
Author: Sergey Bronnikov <[email protected]> | ||
Website: https://bronevichok.ru/ | ||
*/ | ||
|
||
function(hljs) { | ||
var DETAILS = { | ||
className: 'string', | ||
begin: '\\[\n(multipart)?', end: '\\]\n' | ||
}; | ||
var TIME = { | ||
className: 'string', | ||
begin: '\\d{4}-\\d{2}-\\d{2}(\\s+)\\d{2}:\\d{2}:\\d{2}\.\\d+Z' | ||
}; | ||
var PROGRESSVALUE = { | ||
className: 'string', | ||
begin: '(\\+|-)\\d+' | ||
}; | ||
var KEYWORDS = { | ||
className: 'keyword', | ||
relevance: 10, | ||
variants: [ | ||
{ begin: '^(test|testing|success|successful|failure|error|skip|xfail|uxsuccess)(:?)\\s+(test)?' }, | ||
{ begin: '^progress(:?)(\\s+)?(pop|push)?' }, | ||
{ begin: '^tags:' }, | ||
{ begin: '^time:' } | ||
], | ||
}; | ||
return { | ||
aliases: ['subunit'], | ||
case_insensitive: true, | ||
contains: [ | ||
DETAILS, | ||
TIME, | ||
PROGRESSVALUE, | ||
KEYWORDS | ||
] | ||
}; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
progress: 28704 | ||
time: 2016-07-05 12:17:02.290433Z | ||
test: bzrlib.doc.api.DocFileTest(/usr/lib64/python2.7/site-packages/bzrlib/doc/api/branch.txt) | ||
time: 2016-07-05 12:17:02.314892Z | ||
successful: bzrlib.doc.api.DocFileTest(/usr/lib64/python2.7/site-packages/bzrlib/doc/api/branch.txt) | ||
time: 2016-07-05 12:17:02.314939Z | ||
time: 2016-07-05 12:17:02.314991Z | ||
test: bzrlib.doc.api.DocFileTest(/usr/lib64/python2.7/site-packages/bzrlib/doc/api/transport.txt) | ||
time: 2016-07-05 12:17:02.315665Z | ||
successful: bzrlib.doc.api.DocFileTest(/usr/lib64/python2.7/site-packages/bzrlib/doc/api/transport.txt) | ||
time: 2016-07-05 12:17:02.315691Z | ||
time: 2016-07-05 12:17:02.315770Z | ||
test: bzrlib.tests.blackbox.test_add.TestAdd.test_add_control_dir(pre-views) | ||
time: 2016-07-05 12:17:02.368936Z | ||
successful: bzrlib.tests.blackbox.test_add.TestAdd.test_add_control_dir(pre-views) [ multipart | ||
] | ||
time: 2016-07-05 12:17:02.368993Z | ||
time: 2016-07-05 12:17:02.369079Z |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
<span class="hljs-keyword">error: test</span> simplename | ||
<span class="hljs-keyword">error: test</span> simple name |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
error: test simplename | ||
error: test simple name |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
<span class="hljs-keyword">failure: test</span> simplename1 | ||
<span class="hljs-keyword">failure test</span> simplename1 | ||
<span class="hljs-keyword">failure: test</span> simple name1 | ||
<span class="hljs-keyword">failure test</span> simple name1 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
failure: test simplename1 | ||
failure test simplename1 | ||
failure: test simple name1 | ||
failure test simple name1 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
<span class="hljs-keyword">progress: </span><span class="hljs-string">+5</span> | ||
<span class="hljs-keyword">progress: </span><span class="hljs-string">+12</span> | ||
<span class="hljs-keyword">progress: </span>29 | ||
<span class="hljs-keyword">progress: </span><span class="hljs-string">-3</span> | ||
<span class="hljs-keyword">progress: </span><span class="hljs-string">-91</span> | ||
<span class="hljs-keyword">progress: push</span> | ||
<span class="hljs-keyword">progress: pop</span> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
progress: +5 | ||
progress: +12 | ||
progress: 29 | ||
progress: -3 | ||
progress: -91 | ||
progress: push | ||
progress: pop |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
<span class="hljs-keyword">skip test</span> simplename | ||
<span class="hljs-keyword">skip: test</span> simple name | ||
<span class="hljs-keyword">skip test</span> simple name |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
skip test simplename | ||
skip: test simple name | ||
skip test simple name |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
<span class="hljs-keyword">success test</span> simplename1 | ||
<span class="hljs-keyword">success: test</span> simplename2 | ||
<span class="hljs-keyword">successful test</span> simplename3 | ||
<span class="hljs-keyword">successful: test</span> simplename4 | ||
<span class="hljs-keyword">success test</span> simple name1 | ||
<span class="hljs-keyword">success: test</span> simple name2 | ||
<span class="hljs-keyword">successful test</span> simple name3 | ||
<span class="hljs-keyword">successful: test</span> simple name4 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
success test simplename1 | ||
success: test simplename2 | ||
successful test simplename3 | ||
successful: test simplename4 | ||
success test simple name1 | ||
success: test simple name2 | ||
successful test simple name3 | ||
successful: test simple name4 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
<span class="hljs-keyword">tags:</span> fuzz unit beta functional | ||
<span class="hljs-keyword">tags:</span> -functional basic -beta | ||
<span class="hljs-keyword">tags:</span> -unit | ||
<span class="hljs-keyword">tags:</span> unit | ||
<span class="hljs-keyword">tags:</span> ddd |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
tags: fuzz unit beta functional | ||
tags: -functional basic -beta | ||
tags: -unit | ||
tags: unit | ||
tags: ddd |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
<span class="hljs-keyword">test: test</span> basicsuite1 | ||
<span class="hljs-keyword">testing: test</span> basicsuite1 | ||
<span class="hljs-keyword">test test</span> basicsuite1 | ||
<span class="hljs-keyword">testing test</span> basicsuite1 | ||
<span class="hljs-keyword">test: test</span> basic suite1 | ||
<span class="hljs-keyword">testing: test</span> basic suite1 | ||
<span class="hljs-keyword">test test</span> basic suite1 | ||
<span class="hljs-keyword">testing test</span> basic suite1 | ||
<span class="hljs-keyword">testing test</span> basic | ||
<span class="hljs-keyword">test test</span> 222 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
test: test basicsuite1 | ||
testing: test basicsuite1 | ||
test test basicsuite1 | ||
testing test basicsuite1 | ||
test: test basic suite1 | ||
testing: test basic suite1 | ||
test test basic suite1 | ||
testing test basic suite1 | ||
testing test basic | ||
test test 222 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
<span class="hljs-keyword">time:</span> <span class="hljs-string">2016-03-13 18:12:37.231080Z</span> | ||
<span class="hljs-keyword">time:</span> <span class="hljs-string">1917-10-25 09:05:37.231080Z</span> | ||
<span class="hljs-keyword">time:</span> <span class="hljs-string">1984-03-24 07:02:09.231080Z</span> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
time: 2016-03-13 18:12:37.231080Z | ||
time: 1917-10-25 09:05:37.231080Z | ||
time: 1984-03-24 07:02:09.231080Z |
Oops, something went wrong.