Merge pull request #1 from ONLYOFFICE/develop

Develop
This commit is contained in:
Oleg Korshul
2020-05-28 06:57:44 +00:00
committed by GitHub
48 changed files with 20105 additions and 23 deletions

View File

@ -1,11 +1,10 @@
# Highlight code plugin
## Overview
The Highlight code plugin allows you to highlight syntax of the code in text documents, spreadsheets, and presentations with the ability to select the necessary programming language, style, background color.
Highlight syntax of the code selecting the necessary language, style, and background color.
The plugin uses the [highlight.js](https://highlightjs.org/) engine.
The plugin is pre-installed in ONLYOFFICE Enterprise Edition, Community Edition (Document Server + Community Server), ONLYOFFICE Integration Edition, ONLYOFFICE cloud service, and ONLYOFFICE Personal.
It is installed by default in cloud, [self-hosted](https://github.com/ONLYOFFICE/DocumentServer) and [desktop version](https://github.com/ONLYOFFICE/DesktopEditors) of ONLYOFFICE editors.
## Supported languages and styles
Supported languages: apache, bash, shell, matlab, erlang, javascript, profile, ruby, prolong, swift, sql, java, http, fortran, perl, xml, cpp, json, cs, nginx, basic, markdown, css, python, objectivec, php, delphi.
@ -14,22 +13,7 @@ Supported styles: Googlecode, GitHub, GitHub Gist, Android Studio, Visual Studio
## How to use
1. Select a part of the text you would like to highlight as a code.
2. Choose Highlight code from the Plugins tab.
3. Select the necessary programming language (e.g. JavaScript, Ruby, Python, etc).
4. Select the necessary style (e.g. GitHub, XCode, Idea, etc).
5. Apply any background color.
6. If necessary, replace tabs with spaces using the corresponding option.
7. Click the Ok button.
## Documentation
Plugins structure and installation https://api.onlyoffice.com/plugin/basic.
Plugins code and methods https://api.onlyoffice.com/docbuilder/basic.
## User feedback and support
To ask questions and share feedback, use Issues in this repository.
1. Find the plugin in the Plugins tab.
2. Insert your code.
3. Set the language you use. It will be defined automatically, but you can also change it manually.
4. Choose style/background color and press OK to insert your code into the document.

591
code.js Normal file
View File

@ -0,0 +1,591 @@
(function(window, undefined){
window.oncontextmenu = function(e)
{
if (e.preventDefault)
e.preventDefault();
if (e.stopPropagation)
e.stopPropagation();
return false;
};
var language = hljs.listLanguages(), //array languages
isInitLang = false, //flag init lang select
style_value, //current value style
curLang, //current language
code_field, //field for higlight code
container, //scrollable conteiner
timer, //for timer
f_Paste = false; //flag paste
const isIE = checkInternetExplorer(); //check IE
const isDE = (window.AscDesktopEditor) ? true : false; //check desktope editor
var myscroll = window.Asc.ScrollableDiv;
window.Asc.plugin.init = function(text){
$('#style_id').select2({
minimumResultsForSearch: Infinity
}).on('select2:select', function (e) {
document.getElementById("style").href = "highlight/styles/" + e.params.data.id;
window.Asc.plugin.loadModule("./highlight/styles/" + e.params.data.id , function(content){
style_value = content;
if (isDE) {
$("#jq_color").spectrum("set", (hexc($(container).css('backgroundColor'))));
} else {
background_color.value = hexc($(container).css('backgroundColor'));
}
});
});
$('#language_id').select2({
data : createLangForSelect(),
minimumResultsForSearch: Infinity
}).on('select2:select', function (e) {
text = code_field.innerText;
curLang = e.params.data.text; // change current language
ChangeCode(curLang);
flag = true;
});
myscroll = window.Asc.ScrollableDiv;
myscroll.create_div("TabColor",{
width: "",
height: "",
left: "10px",
right: "10px",
top: "90px",
bottom: "5px"
});
myscroll.addEventListener();
code_field = document.getElementById("conteiner_id1");
container = document.getElementById('scrollable-container-id1');
$(container).addClass('codefield');
$(code_field).addClass('content');
$(container).addClass('hljs');
var background_color = document.getElementById("background_color");
var temp_code,
flag = false; //flag change code (true = changed)
if (isIE)
{
document.getElementById("btn_highlight").style.display ="inline";
document.getElementById("tabselect").style.display ="none";
document.getElementById("language_id").style.flex ="0.95";
}
if (isDE) {
document.getElementById("jq_color").style.display ="inline";
document.getElementById("background_color").style.display ="none";
initSpectrum("#FFFFFF");
}
background_color.onchange = function () {
container.style.background = background_color.value;
};
if (!isInitLang)
{
window.Asc.plugin.loadModule("./highlight/styles/googlecode.css", function(content){
style_value = content;
if (isDE) {
$("#jq_color").spectrum("set", (hexc($(container).css('backgroundColor'))));
} else {
background_color.value = hexc($(container).css('backgroundColor'));
}
});
}
function hexc (colorval) {
var parts = colorval.match(/^rgb\((\d+),\s*(\d+),\s*(\d+)\)$/);
delete(parts[0]);
for (var i = 1; i <= 3; ++i) {
parts[i] = parseInt(parts[i]).toString(16);
if (parts[i].length == 1) parts[i] = '0' + parts[i];
}
return ('#' + parts.join(''));
};
function createLangForSelect () {
var tmpArr = [{id:0,text:"Auto"}];
for (var i = 0; i < language.length; i++) {
tmpArr.push({
id : i+1,
text : language[i]
});
}
return tmpArr;
};
curLang = $('#language_id')[0].options[$('#language_id').val()].text; //get current language
function deleteSelected(start,end) {
text = code_field.innerText;
text = text.substring(0,start) + text.substring(end);
clearTimeout(timer);
timer = setTimeout(ChangeCode,35,curLang);
};
if (!flag)
{
text = text.replace(/<span style="mso-tab-count:1;"> <\/span>/g,"%%%bpmn%%%");
text = text.replace(/<p/g,"<div");
text = text.replace(/<\/p>/g,"</div>");
code_field.focus();
code_field.innerHTML = text;
text = code_field.innerText;
code_field.innerText = text;
text = code_field.innerHTML;
text = text.replace(/%%%bpmn%%%/g,"\t");
//text = text.replace(/&nbsp;&nbsp;&nbsp;&nbsp;/g,"\t");
code_field.innerHTML = "";
text = text.replace(/&nbsp;/g," ");
text = text.replace(/<br>/g,"\n");
text = text.replace(/&lt;/g,"<");
text = text.replace(/&gt;/g,">");
ChangeCode(curLang);
}
function ChangeCode(curLang){
if ((curLang == "Auto") && text)
{
temp_code = hljs.highlightAuto(text, language);
createPreview(temp_code,text);
}else if (text)
{
temp_code = hljs.highlight(curLang, text, true, 0);
createPreview(temp_code,text);
}else
{
code_field.innerHTML = "";
}
};
$("#conteiner_id1").keydown(function(event){
if( (event.keyCode == 13) && !isIE )
{
cancelEvent(event);
var range = $("#conteiner_id1").get_selection_range();
if (range.end == code_field.innerText.length)
insertHTML("\n");
insertHTML("\n");
deleteSelected(range.start+1,range.end+1);
myscroll.updateScroll(code_field);
myscroll.updateScroll(code_field);
$("#conteiner_id1").set_selection(range.start+1, range.start+1);
}
if( (event.keyCode == 9) && !isIE )
{
cancelEvent(event);
tab_untab(event);
myscroll.updateScroll(code_field);
myscroll.updateScroll(code_field);
}
});
function tab_untab(event){
let one_line = false;
let right_tab = false;
var range = $("#conteiner_id1").get_selection_range();
text = $("#conteiner_id1").text();
let substr_left = text.substring(range.start,range.start-1);
let substr_right = text.substring(range.start,range.end+1);
if((substr_left =="\t" && event.shiftKey))
range.start--;
let start = range.start;
let end = range.end;
let arr = text.substring(range.start,range.end);
arr = arr.split("\n");
if(!event.shiftKey)
{
if(range.start!=range.end)
one_line = true;
for (let i in arr) {
arr[i] = '\t' + arr[i];
end++;
if(i==0)
start++;
}
}else{
if((end==0) && (start==0) && (text.substring(0,1) == "\t") )
{
text = text.substring(1);
code_field.innerText= text;
ChangeCode(curLang);
return;
}
if (range.start!=range.end)
for (let i in arr)
if (arr[i][0] == "\t")
one_line = true;
if((substr_left != "\t") && !one_line && (substr_left != "\n") && (substr_right != "\t"))
return;
if((substr_left == "\t") && !one_line && arr.length>1)
end--;
if(((range.start == range.end) || !one_line) && (substr_left != "\n") && (substr_right != "\t"))
range.start--;
for (let i in arr) {
if ( text.substring(range.end,range.end+1) == '\t')
{
text = text.slice(0, range.end) + text.slice((range.end+1));
right_tab = true;
continue;
}
if (arr[i][0] == '\t')
arr[i] = arr[i].substr(1);
else if (arr.length>1)
end++;
if(substr_left != "\n")
end--;
}
}
arr = arr.join('\n');
text = text.slice(0, range.start) + arr + text.slice(range.end);
range.start = range.start != range.end ? range.start : end;
range.end = end;
if(right_tab)
range.start = end;
if(!event.shiftKey && one_line)
range.start= start;
code_field.innerText= text;
ChangeCode(curLang);
$("#conteiner_id1").set_selection(range.start, range.end);
};
document.getElementById("btn_highlight").onclick = function(event){
text = code_field.innerHTML;
if( text != code_field.innerText )
{
text = text.replace(/<p/g,"<div");
text = text.replace(/<\/p>/g,"</div>");
}
code_field.innerHTML = text;
text = code_field.innerText;
ChangeCode(curLang);
};
document.addEventListener('paste', function(){
var range = $("#conteiner_id1").get_selection_range();
text = code_field.innerText.substring(0,range.start) + "%%%bpmn%%%" + code_field.innerText.substring(range.end);
f_Paste = true;
code_field.innerHTML ="";
});
$("#conteiner_id1").on("input", function(event){
if(f_Paste){
grab();
f_Paste = false;
return;
}
clearTimeout(timer);
if (!isIE)
timer = setTimeout(grab,1000);
});
function grab(){
if(f_Paste)
{
let count = code_field.innerHTML;
if( count != code_field.innerText )
{
count = count.replace(/<p/g,"<div");
count = count.replace(/<\/p>/g,"</div>");
}
code_field.innerHTML = count;
count = code_field.innerText;
count = count.substring(0);
count = count.split("\n");
if (navigator.userAgent.search(/Firefox/) <= 0)
if(count[count.length-1] == "")
count.pop();
text = text.replace(/&nbsp;/g," ");
text = text.split("%%%bpmn%%%");
let new_text = text[0] + count.join('\n') + text[1];
if (navigator.userAgent.search(/Firefox/) > 0)
new_text = new_text.replace(/\n/g,"╫");
code_field.innerText = new_text;
var start = (new_text.length - text[1].length);
$("#conteiner_id1").set_selection((start), (start));
text = code_field.innerText;
if (navigator.userAgent.search(/Firefox/) > 0)
text = text.replace(/╫/g,"\n");
ChangeCode(curLang);
}else{
var range = $("#conteiner_id1").get_selection_range();
text = code_field.innerHTML;
code_field.innerHTML = text;
text = code_field.innerText;
ChangeCode(curLang);
$("#conteiner_id1").set_selection(range.start, range.start);
}
};
window.Asc.plugin.resizeWindow(800, 600, 800, 600, 0, 0); //resize plugin window
window.onresize = function(){
myscroll.updateScroll(code_field);
myscroll.updateScroll(code_field);
};
};
function initSpectrum (clr) {
$("#jq_color").spectrum({
color: clr,
showInput: true,
className: "full-spectrum",
showInitial: true,
showPalette: true,
showSelectionPalette: true,
maxSelectionSize: 10,
preferredFormat: "hex",
move: function (color) {
},
show: function () {
},
beforeShow: function () {
},
hide: function (color) {
container.style.background = color.toHexString();
background_color.value = color.toHexString();
},
change: function() {
},
palette: [
["rgb(0, 0, 0)", "rgb(67, 67, 67)", "rgb(102, 102, 102)",
"rgb(204, 204, 204)", "rgb(217, 217, 217)","rgb(255, 255, 255)"],
["rgb(152, 0, 0)", "rgb(255, 0, 0)", "rgb(255, 153, 0)", "rgb(255, 255, 0)", "rgb(0, 255, 0)",
"rgb(0, 255, 255)", "rgb(74, 134, 232)", "rgb(0, 0, 255)", "rgb(153, 0, 255)", "rgb(255, 0, 255)"],
["rgb(230, 184, 175)", "rgb(244, 204, 204)", "rgb(252, 229, 205)", "rgb(255, 242, 204)", "rgb(217, 234, 211)",
"rgb(208, 224, 227)", "rgb(201, 218, 248)", "rgb(207, 226, 243)", "rgb(217, 210, 233)", "rgb(234, 209, 220)",
"rgb(221, 126, 107)", "rgb(234, 153, 153)", "rgb(249, 203, 156)", "rgb(255, 229, 153)", "rgb(182, 215, 168)",
"rgb(162, 196, 201)", "rgb(164, 194, 244)", "rgb(159, 197, 232)", "rgb(180, 167, 214)", "rgb(213, 166, 189)",
"rgb(204, 65, 37)", "rgb(224, 102, 102)", "rgb(246, 178, 107)", "rgb(255, 217, 102)", "rgb(147, 196, 125)",
"rgb(118, 165, 175)", "rgb(109, 158, 235)", "rgb(111, 168, 220)", "rgb(142, 124, 195)", "rgb(194, 123, 160)",
"rgb(166, 28, 0)", "rgb(204, 0, 0)", "rgb(230, 145, 56)", "rgb(241, 194, 50)", "rgb(106, 168, 79)",
"rgb(69, 129, 142)", "rgb(60, 120, 216)", "rgb(61, 133, 198)", "rgb(103, 78, 167)", "rgb(166, 77, 121)",
"rgb(91, 15, 0)", "rgb(102, 0, 0)", "rgb(120, 63, 4)", "rgb(127, 96, 0)", "rgb(39, 78, 19)",
"rgb(12, 52, 61)", "rgb(28, 69, 135)", "rgb(7, 55, 99)", "rgb(32, 18, 77)", "rgb(76, 17, 48)"]
]
});
};
function insertHTML(html){
try {
var selection = window.getSelection(),
range = selection.getRangeAt(0),
temp = document.createElement("div"),
insertion = document.createDocumentFragment();
temp.innerHTML = html;
while (temp.firstChild) {
insertion.appendChild(temp.firstChild);
}
//range.deleteContents(); //delete the value
range.insertNode(insertion);
} catch (z) {
try {
document.selection.createRange().pasteHTML(html);
} catch (z) {}
}
var range = $("#conteiner_id1").get_selection_range();
$("#conteiner_id1").set_selection(range.end, range.end);
};
function createPreview(code,text){
var range = $("#conteiner_id1").get_selection_range();
code_field.innerHTML = code.value; // paste the value
if(isIE)
{
document.getElementById("btn_highlight").focus();
}else{
$("#conteiner_id1").set_selection(range.start, range.end);
}
for (var i=0; i<$('#language_id')[0].length;i++)
{
if ($('#language_id')[0].options[i].text == code.language)
{
curLang = code.language;
$('#language_id').val(i).trigger("change");
break;
}
}
myscroll.updateScroll(code_field);
myscroll.updateScroll(code_field);
};
function createHTML(code){
var tab_rep_count = $('#tab_replace_id option:selected')[0].value;
if(tab_rep_count == 2)
{
code = code.replace(/\t/g,"&nbsp;&nbsp;");
}else if (tab_rep_count == 4) {
code = code.replace(/\t/g,"&nbsp;&nbsp;&nbsp;&nbsp;");
}
else{
code = code.replace(/\t/g,"<span style='mso-tab-count:1'></span>");
}
code = code.split("\n");
for (var i in code)
if ( code[i] == "" )
{code[i] = "<p>&nbsp</p>"}
else
{code[i] = "<p>" +code[i] + "</p>"}
if (code[code.length-1] == "<p>&nbsp</p>")
code.pop();
window.Asc.plugin.executeMethod("PasteHtml",['<html lang=\"en\"><head><style> p{background:'+background_color.value+'}'+style_value +'</style></head><body><div style = \"white-space: pre;\"><span style =\"font-size:12pt;\">'+code.join("")+'</span></div></body></html>']);
};
$.fn.get_selection_range = function(){
var range = window.getSelection().getRangeAt(0);
var cloned_range = range.cloneRange();
cloned_range.selectNodeContents(this.get(0));
cloned_range.setEnd(range.startContainer, range.startOffset);
var start = cloned_range.toString().length;
var selected_text = range.toString();
var end = start + selected_text.length;
var result = {
start: start,
end: end,
selected_text: selected_text
}
return result;
};
$.fn.set_selection = function(start, end){
var target_element = this.get(0);
start = start || 0;
if (typeof(target_element.selectionStart) == "undefined"){
if (typeof(end) == "undefined") end = target_element.innerHTML.length;
var character_index = 0;
var range = document.createRange();
range.setStart(target_element, 0);
range.collapse(true);
var node_stack = [target_element];
var node = null;
var start_found = false;
var stop = false;
while (!stop && (node = node_stack.pop())) {
if (node.nodeType == 3){
var next_character_index = character_index + node.length;
if (!start_found && start >= character_index && start <= next_character_index){
range.setStart(node, start - character_index);
start_found = true;
}
if (start_found && end >= character_index && end <= next_character_index){
range.setEnd(node, end - character_index);
stop = true;
}
character_index = next_character_index;
}else{
var child_counter = node.childNodes.length;
while (child_counter --){
node_stack.push(node.childNodes[child_counter]);
}
}
}
var selection = window.getSelection();
selection.removeAllRanges();
selection.addRange(range);
}else{
if (typeof(end) == "undefined") end = target_element.value.length;
target_element.focus();
target_element.selectionStart = start;
target_element.selectionEnd = end;
}
};
function checkInternetExplorer(){
var rv = -1;
if (window.navigator.appName == 'Microsoft Internet Explorer') {
const ua = window.navigator.userAgent;
const re = new RegExp('MSIE ([0-9]{1,}[\.0-9]{0,})');
if (re.exec(ua) != null) {
rv = parseFloat(RegExp.$1);
}
} else if (window.navigator.appName == 'Netscape') {
const ua = window.navigator.userAgent;
const re = new RegExp('Trident/.*rv:([0-9]{1,}[\.0-9]{0,})');
if (re.exec(ua) != null) {
rv = parseFloat(RegExp.$1);
}
}
return rv !== -1;
};
function cancelEvent(e){
if (e && e.preventDefault) {
e.stopPropagation(); // DOM style (return false doesn't always work in FF)
e.preventDefault();
}
else {
window.event.cancelBubble = true;//IE stopPropagation
}
};
window.Asc.plugin.button = function(id)
{
if(id==0)
{
createHTML(code_field.innerHTML);
this.executeCommand("close", "");
}
if((id==-1) || (id==1))
{
this.executeCommand("close", "");
}
};
window.Asc.plugin.onExternalMouseUp = function()
{
var evt = document.createEvent("MouseEvents");
evt.initMouseEvent("mouseup", true, true, window, 1, 0, 0, 0, 0,
false, false, false, false, 0, null);
document.dispatchEvent(evt);
};
window.Asc.plugin.onTranslate = function()
{
var lb_lanuage = document.getElementById("lb_lanuage");
if (lb_lanuage)
lb_lanuage.innerHTML = window.Asc.plugin.tr("Language");
var btn_highlight = document.getElementById("btn_highlight");
if (btn_highlight)
btn_highlight.innerHTML = window.Asc.plugin.tr("Highlight");
var lb_style = document.getElementById("lb_style");
if (lb_style)
lb_style.innerHTML = window.Asc.plugin.tr("Style");
var lb_repTab = document.getElementById("lb_repTab");
if (lb_repTab)
lb_repTab.innerHTML = window.Asc.plugin.tr("Replace Tab with spaces");
var opt_DontRep = document.getElementById("opt_DontRep");
if (opt_DontRep)
opt_DontRep.innerHTML = window.Asc.plugin.tr("Don`t replace");
var opt_2sp = document.getElementById("opt_2sp");
if (opt_2sp)
opt_2sp.innerHTML = window.Asc.plugin.tr("Replace by 2 spaces");
var opt_4sp = document.getElementById("opt_4sp");
if (opt_4sp)
opt_4sp.innerHTML = window.Asc.plugin.tr("Replace by 4 spaces");
var lb_bgColor = document.getElementById("lb_bgColor");
if (lb_bgColor)
lb_bgColor.innerHTML = window.Asc.plugin.tr("Choose background color");
var btn_sp_cancel = document.getElementById("btn_sp_cancel");
if (btn_sp_cancel)
btn_sp_cancel.innerHTML = window.Asc.plugin.tr("Cancel");
var btn_sp_choose = document.getElementById("btn_sp_choose");
if (btn_sp_choose)
btn_sp_choose.innerHTML = window.Asc.plugin.tr("Choose");
$('#tab_replace_id').select2({
minimumResultsForSearch: Infinity
});
};
})(window, undefined);

55
config.json Normal file
View File

@ -0,0 +1,55 @@
{
"name": "Highlight code",
"nameLocale": {
"ru": "Подсветка кода",
"fr": "Code en surbrillance",
"es": "Resaltar el código",
"de": "Code hervorheben"
},
"guid": "asc.{BE5CBF95-C0AD-4842-B157-AC40FEDD9841}",
"variations": [
{
"description": "Highlight code",
"descriptionLocale": {
"ru": "Подсветка кода",
"fr": "Code en surbrillance",
"es": "Resaltar el código",
"de": "Code hervorheben"
},
"url": "index.html",
"icons": [ "icon.png", "icon@2x.png", "icon.png", "icon@2x.png" ],
"isViewer": false,
"EditorsSupport": [ "word", "cell", "slide" ],
"isVisual": true,
"isModal": true,
"isInsideMode": false,
"initDataType": "html",
"initData": "",
"isUpdateOleOnResize": false,
"buttons": [
{
"text": "Ok",
"primary": true
},
{
"text": "Cancel",
"primary": false,
"textLocale": {
"ru": "Отмена",
"fr": "Annuler",
"es": "Cancelar",
"de": "Abbrechen"
}
}
],
"initOnSelectionChanged": true
}
]
}

1646
highlight/CHANGES.md Normal file

File diff suppressed because it is too large Load Diff

24
highlight/LICENSE Normal file
View File

@ -0,0 +1,24 @@
Copyright (c) 2006, Ivan Sagalaev
All rights reserved.
Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions are met:
* Redistributions of source code must retain the above copyright
notice, this list of conditions and the following disclaimer.
* Redistributions in binary form must reproduce the above copyright
notice, this list of conditions and the following disclaimer in the
documentation and/or other materials provided with the distribution.
* Neither the name of highlight.js nor the names of its contributors
may be used to endorse or promote products derived from this software
without specific prior written permission.
THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND ANY
EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
DISCLAIMED. IN NO EVENT SHALL THE REGENTS AND CONTRIBUTORS BE LIABLE FOR ANY
DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.

150
highlight/README.md Normal file
View File

@ -0,0 +1,150 @@
# Highlight.js
[![Build Status](https://travis-ci.org/isagalaev/highlight.js.svg?branch=master)](https://travis-ci.org/isagalaev/highlight.js)
Highlight.js is a syntax highlighter written in JavaScript. It works in
the browser as well as on the server. It works with pretty much any
markup, doesnt depend on any framework and has automatic language
detection.
## Getting Started
The bare minimum for using highlight.js on a web page is linking to the
library along with one of the styles and calling
[`initHighlightingOnLoad`][1]:
```html
<link rel="stylesheet" href="/path/to/styles/default.css">
<script src="/path/to/highlight.pack.js"></script>
<script>hljs.initHighlightingOnLoad();</script>
```
This will find and highlight code inside of `<pre><code>` tags; it tries
to detect the language automatically. If automatic detection doesnt
work for you, you can specify the language in the `class` attribute:
```html
<pre><code class="html">...</code></pre>
```
The list of supported language classes is available in the [class
reference][2]. Classes can also be prefixed with either `language-` or
`lang-`.
To disable highlighting altogether use the `nohighlight` class:
```html
<pre><code class="nohighlight">...</code></pre>
```
## Custom Initialization
When you need a bit more control over the initialization of
highlight.js, you can use the [`highlightBlock`][3] and [`configure`][4]
functions. This allows you to control *what* to highlight and *when*.
Heres an equivalent way to calling [`initHighlightingOnLoad`][1] using
jQuery:
```javascript
$(document).ready(function() {
$('pre code').each(function(i, block) {
hljs.highlightBlock(block);
});
});
```
You can use any tags instead of `<pre><code>` to mark up your code. If
you don't use a container that preserve line breaks you will need to
configure highlight.js to use the `<br>` tag:
```javascript
hljs.configure({useBR: true});
$('div.code').each(function(i, block) {
hljs.highlightBlock(block);
});
```
For other options refer to the documentation for [`configure`][4].
## Web Workers
You can run highlighting inside a web worker to avoid freezing the browser
window while dealing with very big chunks of code.
In your main script:
```javascript
addEventListener('load', function() {
var code = document.querySelector('#code');
var worker = new Worker('worker.js');
worker.onmessage = function(event) { code.innerHTML = event.data; }
worker.postMessage(code.textContent);
})
```
In worker.js:
```javascript
onmessage = function(event) {
importScripts('<path>/highlight.pack.js');
var result = self.hljs.highlightAuto(event.data);
postMessage(result.value);
}
```
## Getting the Library
You can get highlight.js as a hosted, or custom-build, browser script or
as a server module. Right out of the box the browser script supports
both AMD and CommonJS, so if you wish you can use RequireJS or
Browserify without having to build from source. The server module also
works perfectly fine with Browserify, but there is the option to use a
build specific to browsers rather than something meant for a server.
Head over to the [download page][5] for all the options.
**Don't link to GitHub directly.** The library is not supposed to work straight
from the source, it requires building. If none of the pre-packaged options
work for you refer to the [building documentation][6].
**The CDN-hosted package doesn't have all the languages.** Otherwise it'd be
too big. If you don't see the language you need in the ["Common" section][5],
it can be added manually:
```html
<script src="//cdnjs.cloudflare.com/ajax/libs/highlight.js/9.4.0/languages/go.min.js"></script>
```
**On Almond.** You need to use the optimizer to give the module a name. For
example:
```
r.js -o name=hljs paths.hljs=/path/to/highlight out=highlight.js
```
## License
Highlight.js is released under the BSD License. See [LICENSE][7] file
for details.
## Links
The official site for the library is at <https://highlightjs.org/>.
Further in-depth documentation for the API and other topics is at
<http://highlightjs.readthedocs.io/>.
Authors and contributors are listed in the [AUTHORS.en.txt][8] file.
[1]: http://highlightjs.readthedocs.io/en/latest/api.html#inithighlightingonload
[2]: http://highlightjs.readthedocs.io/en/latest/css-classes-reference.html
[3]: http://highlightjs.readthedocs.io/en/latest/api.html#highlightblock-block
[4]: http://highlightjs.readthedocs.io/en/latest/api.html#configure-options
[5]: https://highlightjs.org/download/
[6]: http://highlightjs.readthedocs.io/en/latest/building-testing.html
[7]: https://github.com/isagalaev/highlight.js/blob/master/LICENSE
[8]: https://github.com/isagalaev/highlight.js/blob/master/AUTHORS.en.txt

142
highlight/README.ru.md Normal file
View File

@ -0,0 +1,142 @@
# Highlight.js
Highlight.js — это инструмент для подсветки синтаксиса, написанный на JavaScript. Он работает
и в браузере, и на сервере. Он работает с практически любой HTML разметкой, не
зависит от каких-либо фреймворков и умеет автоматически определять язык.
## Начало работы
Минимум, что нужно сделать для использования highlight.js на веб-странице — это
подключить библиотеку, CSS-стили и вызывать [`initHighlightingOnLoad`][1]:
```html
<link rel="stylesheet" href="/path/to/styles/default.css">
<script src="/path/to/highlight.pack.js"></script>
<script>hljs.initHighlightingOnLoad();</script>
```
Библиотека найдёт и раскрасит код внутри тегов `<pre><code>`, попытавшись
автоматически определить язык. Когда автоопределение не срабатывает, можно явно
указать язык в атрибуте class:
```html
<pre><code class="html">...</code></pre>
```
Список поддерживаемых классов языков доступен в [справочнике по классам][2].
Класс также можно предварить префиксами `language-` или `lang-`.
Чтобы отключить подсветку для какого-то блока, используйте класс `nohighlight`:
```html
<pre><code class="nohighlight">...</code></pre>
```
## Инициализация вручную
Чтобы иметь чуть больше контроля за инициализацией подсветки, вы можете
использовать функции [`highlightBlock`][3] и [`configure`][4]. Таким образом
можно управлять тем, *что* и *когда* подсвечивать.
Вот пример инициализации, эквивалентной вызову [`initHighlightingOnLoad`][1], но
с использованием jQuery:
```javascript
$(document).ready(function() {
$('pre code').each(function(i, block) {
hljs.highlightBlock(block);
});
});
```
Вы можете использовать любые теги разметки вместо `<pre><code>`. Если
используете контейнер, не сохраняющий переводы строк, вам нужно сказать
highlight.js использовать для них тег `<br>`:
```javascript
hljs.configure({useBR: true});
$('div.code').each(function(i, block) {
hljs.highlightBlock(block);
});
```
Другие опции можно найти в документации функции [`configure`][4].
## Web Workers
Подсветку можно запустить внутри web worker'а, чтобы окно
браузера не подтормаживало при работе с большими кусками кода.
В основном скрипте:
```javascript
addEventListener('load', function() {
var code = document.querySelector('#code');
var worker = new Worker('worker.js');
worker.onmessage = function(event) { code.innerHTML = event.data; }
worker.postMessage(code.textContent);
})
```
В worker.js:
```javascript
onmessage = function(event) {
importScripts('<path>/highlight.pack.js');
var result = self.hljs.highlightAuto(event.data);
postMessage(result.value);
}
```
## Установка библиотеки
Highlight.js можно использовать в браузере прямо с CDN хостинга или скачать
индивидуальную сборку, а также установив модуль на сервере. На
[странице загрузки][5] подробно описаны все варианты.
**Не подключайте GitHub напрямую.** Библиотека не предназначена для
использования в виде исходного кода, а требует отдельной сборки. Если вам не
подходит ни один из готовых вариантов, читайте [документацию по сборке][6].
**Файл на CDN содержит не все языки.** Иначе он будет слишком большого размера.
Если нужного вам языка нет в [категории "Common"][5], можно дообавить его
вручную:
```html
<script src="//cdnjs.cloudflare.com/ajax/libs/highlight.js/9.4.0/languages/go.min.js"></script>
```
**Про Almond.** Нужно задать имя модуля в оптимизаторе, например:
```
r.js -o name=hljs paths.hljs=/path/to/highlight out=highlight.js
```
## Лицензия
Highlight.js распространяется под лицензией BSD. Подробнее читайте файл
[LICENSE][7].
## Ссылки
Официальный сайт билиотеки расположен по адресу <https://highlightjs.org/>.
Более подробная документация по API и другим темам расположена на
<http://highlightjs.readthedocs.io/>.
Авторы и контрибьюторы перечислены в файле [AUTHORS.ru.txt][8] file.
[1]: http://highlightjs.readthedocs.io/en/latest/api.html#inithighlightingonload
[2]: http://highlightjs.readthedocs.io/en/latest/css-classes-reference.html
[3]: http://highlightjs.readthedocs.io/en/latest/api.html#highlightblock-block
[4]: http://highlightjs.readthedocs.io/en/latest/api.html#configure-options
[5]: https://highlightjs.org/download/
[6]: http://highlightjs.readthedocs.io/en/latest/building-testing.html
[7]: https://github.com/isagalaev/highlight.js/blob/master/LICENSE
[8]: https://github.com/isagalaev/highlight.js/blob/master/AUTHORS.ru.txt

File diff suppressed because one or more lines are too long

View File

@ -0,0 +1,72 @@
/*
Date: 24 Fev 2015
Author: Pedro Oliveira <kanytu@gmail . com>
*/
.hljs {
color: #a9b7c6;
background: #282b2e;
display: block;
overflow-x: auto;
padding: 0.5em;
}
p {
margin: 0;
line-height: 1;
font-family: 'Consolas';
color: #a9b7c6;
}
.hljs-number,
.hljs-literal,
.hljs-symbol,
.hljs-bullet {
color: #6897BB;
}
.hljs-keyword,
.hljs-selector-tag,
.hljs-deletion {
color: #cc7832;
}
.hljs-variable,
.hljs-template-variable,
.hljs-link {
color: #629755;
}
.hljs-comment,
.hljs-quote {
color: #808080;
}
.hljs-meta {
color: #bbb529;
}
.hljs-string,
.hljs-attribute,
.hljs-addition {
color: #6A8759;
}
.hljs-section,
.hljs-title,
.hljs-type {
color: #ffc66d;
}
.hljs-name,
.hljs-selector-id,
.hljs-selector-class {
color: #e8bf6a;
}
.hljs-emphasis {
font-style: italic;
}
.hljs-strong {
font-weight: bold;
}

78
highlight/styles/far.css Normal file
View File

@ -0,0 +1,78 @@
/*
FAR Style (c) MajestiC <majestic2k@gmail.com>
*/
.hljs {
display: block;
overflow-x: auto;
padding: 0.5em;
background: #000080;
}
p {
margin: 0;
line-height: 1;
font-family: 'Consolas';
color: #0ff;
}
.hljs,
.hljs-subst {
color: #0ff;
}
.hljs-string,
.hljs-attribute,
.hljs-symbol,
.hljs-bullet,
.hljs-built_in,
.hljs-builtin-name,
.hljs-template-tag,
.hljs-template-variable,
.hljs-addition {
color: #ff0;
}
.hljs-keyword,
.hljs-selector-tag,
.hljs-section,
.hljs-type,
.hljs-name,
.hljs-selector-id,
.hljs-selector-class,
.hljs-variable {
color: #fff;
}
.hljs-comment,
.hljs-quote,
.hljs-doctag,
.hljs-deletion {
color: #888;
}
.hljs-number,
.hljs-regexp,
.hljs-literal,
.hljs-link {
color: #0f0;
}
.hljs-meta {
color: #008080;
}
.hljs-keyword,
.hljs-selector-tag,
.hljs-title,
.hljs-section,
.hljs-name,
.hljs-strong {
font-weight: bold;
}
.hljs-emphasis {
font-style: italic;
}

95
highlight/styles/foundation.css vendored Normal file
View File

@ -0,0 +1,95 @@
/*
Description: Foundation 4 docs style for highlight.js
Author: Dan Allen <dan.j.allen@gmail.com>
Website: http://foundation.zurb.com/docs/
Version: 1.0
Date: 2013-04-02
*/
.hljs {
display: block;
overflow-x: auto;
padding: 0.5em;
background: #eee; color: black;
}
p {
margin: 0;
line-height: 1;
font-family: 'Consolas';
color: black;
}
.hljs-link,
.hljs-emphasis,
.hljs-attribute,
.hljs-addition {
color: #070;
}
.hljs-emphasis {
font-style: italic;
}
.hljs-strong,
.hljs-string,
.hljs-deletion {
color: #d14;
}
.hljs-strong {
font-weight: bold;
}
.hljs-quote,
.hljs-comment {
color: #998;
font-style: italic;
}
.hljs-section,
.hljs-title {
color: #900;
}
.hljs-class .hljs-title,
.hljs-type {
color: #458;
}
.hljs-variable,
.hljs-template-variable {
color: #336699;
}
.hljs-bullet {
color: #997700;
}
.hljs-meta {
color: #3344bb;
}
.hljs-code,
.hljs-number,
.hljs-literal,
.hljs-keyword,
.hljs-selector-tag {
color: #099;
}
.hljs-regexp {
background-color: #fff0ff;
color: #880088;
}
.hljs-symbol {
color: #990073;
}
.hljs-tag,
.hljs-name,
.hljs-selector-id,
.hljs-selector-class {
color: #007700;
}

View File

@ -0,0 +1,78 @@
/**
* GitHub Gist Theme
* Author : Louis Barranqueiro - https://github.com/LouisBarranqueiro
*/
.hljs {
display: block;
background: white;
padding: 0.5em;
color: #333333;
overflow-x: auto;
}
p {
margin: 0;
line-height: 1;
font-family: 'Consolas';
color: #333333;
}
.hljs-comment,
.hljs-meta {
color: #969896;
}
.hljs-string,
.hljs-variable,
.hljs-template-variable,
.hljs-strong,
.hljs-emphasis,
.hljs-quote {
color: #df5000;
}
.hljs-keyword,
.hljs-selector-tag,
.hljs-type {
color: #a71d5d;
}
.hljs-literal,
.hljs-symbol,
.hljs-bullet,
.hljs-attribute {
color: #0086b3;
}
.hljs-section,
.hljs-name {
color: #63a35c;
}
.hljs-tag {
color: #333333;
}
.hljs-title,
.hljs-attr,
.hljs-selector-id,
.hljs-selector-class,
.hljs-selector-attr,
.hljs-selector-pseudo {
color: #795da3;
}
.hljs-addition {
color: #55a532;
background-color: #eaffea;
}
.hljs-deletion {
color: #bd2c00;
background-color: #ffecec;
}
.hljs-link {
text-decoration: underline;
}

106
highlight/styles/github.css Normal file
View File

@ -0,0 +1,106 @@
/*
github.com style (c) Vasily Polovnyov <vast@whiteants.net>
*/
.hljs {
display: block;
overflow-x: auto;
padding: 0.5em;
color: #333;
background: #f8f8f8;
}
p {
margin: 0;
line-height: 1;
font-family: 'Consolas';
color: #333;
}
.hljs-comment,
.hljs-quote {
color: #998;
font-style: italic;
}
.hljs-keyword,
.hljs-selector-tag,
.hljs-subst {
color: #333;
font-weight: bold;
}
.hljs-number,
.hljs-literal,
.hljs-variable,
.hljs-template-variable,
.hljs-tag .hljs-attr {
color: #008080;
}
.hljs-string,
.hljs-doctag {
color: #d14;
}
.hljs-title,
.hljs-section,
.hljs-selector-id {
color: #900;
font-weight: bold;
}
.hljs-subst {
font-weight: normal;
}
.hljs-type,
.hljs-class .hljs-title {
color: #458;
font-weight: bold;
}
.hljs-tag,
.hljs-name,
.hljs-attribute {
color: #000080;
font-weight: normal;
}
.hljs-regexp,
.hljs-link {
color: #009926;
}
.hljs-symbol,
.hljs-bullet {
color: #990073;
}
.hljs-built_in,
.hljs-builtin-name {
color: #0086b3;
}
.hljs-meta {
color: #999;
font-weight: bold;
}
.hljs-deletion {
background: #fdd;
}
.hljs-addition {
background: #dfd;
}
.hljs-emphasis {
font-style: italic;
}
.hljs-strong {
font-weight: bold;
}

View File

@ -0,0 +1,96 @@
/*
Google Code style (c) Aahan Krish <geekpanth3r@gmail.com>
*/
.hljs {
display: block;
overflow-x: auto;
padding: 0.5em;
background: white;
color: black;
}
p {
margin: 0;
line-height: 1;
font-family: 'Consolas';
color: black;
}
.hljs-comment,
.hljs-quote {
color: #800;
}
.hljs-keyword,
.hljs-selector-tag,
.hljs-section,
.hljs-title,
.hljs-name {
color: #008;
}
.hljs-variable,
.hljs-template-variable {
color: #660;
}
.hljs-string,
.hljs-selector-attr,
.hljs-selector-pseudo,
.hljs-regexp {
color: #080;
}
.hljs-literal,
.hljs-symbol,
.hljs-bullet,
.hljs-meta,
.hljs-number,
.hljs-link {
color: #066;
}
.hljs-title,
.hljs-doctag,
.hljs-type,
.hljs-attr,
.hljs-built_in,
.hljs-builtin-name,
.hljs-params {
color: #606;
}
.hljs-attribute,
.hljs-subst {
color: #000;
}
.hljs-formula {
background-color: #eee;
font-style: italic;
}
.hljs-selector-id,
.hljs-selector-class {
color: #9B703F
}
.hljs-addition {
background-color: #baeeba;
}
.hljs-deletion {
background-color: #ffc8bd;
}
.hljs-doctag,
.hljs-strong {
font-weight: bold;
}
.hljs-emphasis {
font-style: italic;
}

104
highlight/styles/idea.css Normal file
View File

@ -0,0 +1,104 @@
/*
Intellij Idea-like styling (c) Vasily Polovnyov <vast@whiteants.net>
*/
.hljs {
display: block;
overflow-x: auto;
padding: 0.5em;
color: #000;
background: #fff;
}
p {
margin: 0;
line-height: 1;
font-family: 'Consolas';
color: #000;
}
.hljs-subst,
.hljs-title {
font-weight: normal;
color: #000;
}
.hljs-comment,
.hljs-quote {
color: #808080;
font-style: italic;
}
.hljs-meta {
color: #808000;
}
.hljs-tag {
background: #efefef;
}
.hljs-section,
.hljs-name,
.hljs-literal,
.hljs-keyword,
.hljs-selector-tag,
.hljs-type,
.hljs-selector-id,
.hljs-selector-class {
font-weight: bold;
color: #000080;
}
.hljs-attribute,
.hljs-number,
.hljs-regexp,
.hljs-link {
font-weight: bold;
color: #0000ff;
}
.hljs-number,
.hljs-regexp,
.hljs-link {
font-weight: normal;
}
.hljs-string {
color: #008000;
font-weight: bold;
}
.hljs-symbol,
.hljs-bullet,
.hljs-formula {
color: #000;
background: #d0eded;
font-style: italic;
}
.hljs-doctag {
text-decoration: underline;
}
.hljs-variable,
.hljs-template-variable {
color: #660e7a;
}
.hljs-addition {
background: #baeeba;
}
.hljs-deletion {
background: #ffc8bd;
}
.hljs-emphasis {
font-style: italic;
}
.hljs-strong {
font-weight: bold;
}

View File

@ -0,0 +1,90 @@
/*
Qt Creator dark color scheme
*/
.hljs {
display: block;
overflow-x: auto;
padding: 0.5em;
background: #000000;
}
p {
margin: 0;
line-height: 1;
font-family: 'Consolas';
color: #aaaaaa;
}
.hljs,
.hljs-subst,
.hljs-tag,
.hljs-title {
color: #aaaaaa;
}
.hljs-strong,
.hljs-emphasis {
color: #a8a8a2;
}
.hljs-bullet,
.hljs-quote,
.hljs-number,
.hljs-regexp,
.hljs-literal {
color: #ff55ff;
}
.hljs-code
.hljs-selector-class {
color: #aaaaff;
}
.hljs-emphasis,
.hljs-stronge,
.hljs-type {
font-style: italic;
}
.hljs-keyword,
.hljs-selector-tag,
.hljs-function,
.hljs-section,
.hljs-symbol,
.hljs-name {
color: #ffff55;
}
.hljs-attribute {
color: #ff5555;
}
.hljs-variable,
.hljs-params,
.hljs-class .hljs-title {
color: #8888ff;
}
.hljs-string,
.hljs-selector-id,
.hljs-selector-attr,
.hljs-selector-pseudo,
.hljs-type,
.hljs-built_in,
.hljs-builtin-name,
.hljs-template-tag,
.hljs-template-variable,
.hljs-addition,
.hljs-link {
color: #ff55ff;
}
.hljs-comment,
.hljs-meta,
.hljs-deletion {
color: #55ffff;
}

View File

@ -0,0 +1,89 @@
/*
Qt Creator light color scheme
*/
.hljs {
display: block;
overflow-x: auto;
padding: 0.5em;
background: #ffffff;
}
p {
margin: 0;
line-height: 1;
font-family: 'Consolas';
}
.hljs,
.hljs-subst,
.hljs-tag,
.hljs-title {
color: #000000;
}
.hljs-strong,
.hljs-emphasis {
color: #000000;
}
.hljs-bullet,
.hljs-quote,
.hljs-number,
.hljs-regexp,
.hljs-literal {
color: #000080;
}
.hljs-code
.hljs-selector-class {
color: #800080;
}
.hljs-emphasis,
.hljs-stronge,
.hljs-type {
font-style: italic;
}
.hljs-keyword,
.hljs-selector-tag,
.hljs-function,
.hljs-section,
.hljs-symbol,
.hljs-name {
color: #808000;
}
.hljs-attribute {
color: #800000;
}
.hljs-variable,
.hljs-params,
.hljs-class .hljs-title {
color: #0055AF;
}
.hljs-string,
.hljs-selector-id,
.hljs-selector-attr,
.hljs-selector-pseudo,
.hljs-type,
.hljs-built_in,
.hljs-builtin-name,
.hljs-template-tag,
.hljs-template-variable,
.hljs-addition,
.hljs-link {
color: #008000;
}
.hljs-comment,
.hljs-meta,
.hljs-deletion {
color: #008000;
}

75
highlight/styles/vs.css Normal file
View File

@ -0,0 +1,75 @@
/*
Visual Studio-like style based on original C# coloring by Jason Diamond <jason@diamond.name>
*/
.hljs {
display: block;
overflow-x: auto;
padding: 0.5em;
background: white;
color: black;
}
p {
margin: 0;
line-height: 1;
font-family: 'Consolas';
color: black;
}
.hljs-comment,
.hljs-quote,
.hljs-variable {
color: #008000;
}
.hljs-keyword,
.hljs-selector-tag,
.hljs-built_in,
.hljs-name,
.hljs-tag {
color: #00f;
}
.hljs-string,
.hljs-title,
.hljs-section,
.hljs-attribute,
.hljs-literal,
.hljs-template-tag,
.hljs-template-variable,
.hljs-type,
.hljs-addition {
color: #a31515;
}
.hljs-deletion,
.hljs-selector-attr,
.hljs-selector-pseudo,
.hljs-meta {
color: #2b91af;
}
.hljs-doctag {
color: #808080;
}
.hljs-attr {
color: #f00;
}
.hljs-symbol,
.hljs-bullet,
.hljs-link {
color: #00b0e8;
}
.hljs-emphasis {
font-style: italic;
}
.hljs-strong {
font-weight: bold;
}

122
highlight/styles/vs2015.css Normal file
View File

@ -0,0 +1,122 @@
/*
* Visual Studio 2015 dark style
* Author: Nicolas LLOBERA <nllobera@gmail.com>
*/
.hljs {
display: block;
overflow-x: auto;
padding: 0.5em;
background: #1E1E1E;
color: #DCDCDC;
}
p {
margin: 0;
line-height: 1;
font-family: 'Consolas';
color: #DCDCDC;
}
.hljs-keyword,
.hljs-literal,
.hljs-symbol,
.hljs-name {
color: #569CD6;
}
.hljs-link {
color: #569CD6;
text-decoration: underline;
}
.hljs-built_in,
.hljs-type {
color: #4EC9B0;
}
.hljs-number,
.hljs-class {
color: #B8D7A3;
}
.hljs-string,
.hljs-meta-string {
color: #D69D85;
}
.hljs-regexp,
.hljs-template-tag {
color: #9A5334;
}
.hljs-subst,
.hljs-function,
.hljs-title,
.hljs-params,
.hljs-formula {
color: #DCDCDC;
}
.hljs-comment,
.hljs-quote {
color: #57A64A;
font-style: italic;
}
.hljs-doctag {
color: #608B4E;
}
.hljs-meta,
.hljs-meta-keyword,
.hljs-tag {
color: #9B9B9B;
}
.hljs-variable,
.hljs-template-variable {
color: #BD63C5;
}
.hljs-attr,
.hljs-attribute,
.hljs-builtin-name {
color: #9CDCFE;
}
.hljs-section {
color: gold;
}
.hljs-emphasis {
font-style: italic;
}
.hljs-strong {
font-weight: bold;
}
/*.hljs-code {
font-family:'Monospace';
}*/
.hljs-bullet,
.hljs-selector-tag,
.hljs-selector-id,
.hljs-selector-class,
.hljs-selector-attr,
.hljs-selector-pseudo {
color: #D7BA7D;
}
.hljs-addition {
background-color: #144212;
display: inline-block;
width: 100%;
}
.hljs-deletion {
background-color: #600;
display: inline-block;
width: 100%;
}

100
highlight/styles/xcode.css Normal file
View File

@ -0,0 +1,100 @@
/*
XCode style (c) Angel Garcia <angelgarcia.mail@gmail.com>
*/
.hljs {
display: block;
overflow-x: auto;
padding: 0.5em;
background: #fff;
color: black;
}
p {
margin: 0;
line-height: 1;
font-family: 'Consolas';
color: black;
}
.hljs-comment,
.hljs-quote {
color: #006a00;
}
.hljs-keyword,
.hljs-selector-tag,
.hljs-literal {
color: #aa0d91;
}
.hljs-name {
color: #008;
}
.hljs-variable,
.hljs-template-variable {
color: #660;
}
.hljs-string {
color: #c41a16;
}
.hljs-regexp,
.hljs-link {
color: #080;
}
.hljs-title,
.hljs-tag,
.hljs-symbol,
.hljs-bullet,
.hljs-number,
.hljs-meta {
color: #1c00cf;
}
.hljs-section,
.hljs-class .hljs-title,
.hljs-type,
.hljs-attr,
.hljs-built_in,
.hljs-builtin-name,
.hljs-params {
color: #5c2699;
}
.hljs-attribute,
.hljs-subst {
color: #000;
}
.hljs-formula {
background-color: #eee;
font-style: italic;
}
.hljs-addition {
background-color: #baeeba;
}
.hljs-deletion {
background-color: #ffc8bd;
}
.hljs-selector-id,
.hljs-selector-class {
color: #9b703f;
}
.hljs-doctag,
.hljs-strong {
font-weight: bold;
}
.hljs-emphasis {
font-style: italic;
}

View File

@ -0,0 +1,31 @@
.hljs {
display: block;
overflow-x: auto;
padding: 0.5em;
background: white;
color: black;
}
p {
margin: 0;
line-height: 1;
font-family: 'Consolas';
color: black;
}
.hljs-tag{
color: #2008c0;
}
.hljs-name {
color: #ad3b3d;
}
.hljs-meta {
color: #2008c0;
}
.hljs-string {
color: #2008c0;
}
.php {
color: #2008c0;
}
.hljs-attr {
color: red;
}

View File

@ -0,0 +1,31 @@
.hljs {
display: block;
overflow-x: auto;
padding: 0.5em;
background: white;
color: black;
}
p {
margin: 0;
line-height: 1;
font-family: 'Consolas';
color: black;
}
.hljs-tag{
color: #2008c0;
}
.hljs-name {
color: #ad3b3d;
}
.hljs-meta {
color: #2008c0;
}
.hljs-string {
color: black;
}
.php {
color: #2008c0;
}
.hljs-attr {
color: #ad3b3d;
}

BIN
icon.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 658 B

BIN
icon@2x.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 663 B

63
index.html Normal file
View File

@ -0,0 +1,63 @@
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>Highligh code</title>
<script type="text/javascript" src="https://onlyoffice.github.io/sdkjs-plugins/v1/plugins.js"></script>
<script type="text/javascript" src="https://onlyoffice.github.io/sdkjs-plugins/v1/plugins-ui.js"></script>
<link rel="stylesheet" href="https://onlyoffice.github.io/sdkjs-plugins/v1/plugins.css">
<link rel="stylesheet" href="https://fonts.googleapis.com/icon?family=Material+Icons">
<link id = "style" rel="stylesheet" href="highlight/styles/googlecode.css">
<link rel="stylesheet" type="text/css" href="spectrum/spectrum.css">
<link rel="stylesheet" href="plugin_style.css">
<link rel="stylesheet" href="select2-4.0.6-rc.1/dist/css/select2.css"/>
<script src="https://ajax.googleapis.com/ajax/libs/jquery/2.2.2/jquery.min.js"></script>
<script src="highlight/highlight.pack.js"></script>
<script src="code.js"></script>
<script src="scrollable_div.js"></script>
<script type="text/javascript" src="spectrum/spectrum.js"></script>
<script src="select2-4.0.6-rc.1/dist/js/select2.js"></script>
</head>
<body spellcheck="false">
<label id="lb_lanuage" class="label" style = "padding: 5px 0px 0px 12px">Language</label>
<div class="language">
<select id="language_id" style="flex: 1" class="combo"></select>
<button class = "button" id ="btn_highlight" style="display: none;">Highlight</button>
</div>
<div id="TabColor" class="TabColor">
<div class="styleselect">
<label id="lb_style" class="label" style = "padding: 5px 0px 0px 2px">Style</label>
<select id="style_id" class="combo">
<option value = "googlecode.css">Googlecode</option>
<option value = "github.css">GitHub</option>
<option value = "github-gist.css">GitHub Gist</option>
<option value = "androidstudio.css">Android Studio</option>
<option value = "vs.css">Visual Studio</option>
<option value = "vs2015.css">Visual Studio 2015</option>
<option value = "idea.css">Idea</option>
<option value = "qtcreator_dark.css">Qtcreator Dark</option>
<option value = "qtcreator_light.css">Qtcreator Light</option>
<option value = "xcode.css">XCode</option>
<option value = "far.css">Fortran</option>
<option value = "foundation.css">Foundation</option>
<option value = "xml_1.css">XML 1</option>
<option value = "xml_2.css">XML 2</option>
</select>
</div>
<div id="tabselect" class="tabselect">
<label id="lb_repTab" class="label">Replace Tab with spaces</label>
<select id="tab_replace_id" class="combo">
<option id="opt_DontRep" value="0">Don`t replace</option>
<option id="opt_2sp" value="2">Replace by 2 spaces</option>
<option id="opt_4sp" value="4">Replace by 4 spaces</option>
</select>
</div>
<div id="colorselect" class="colorselect">
<label id="lb_bgColor" for="background_color" class="label">Choose background color</label>
<input id="background_color" style="padding: 0" type="color" value="#ffffff">
<input type='text' style="display: none; padding: 0" id="jq_color"/>
</div>
</div>
</body>
</html>

115
plugin_style.css Normal file
View File

@ -0,0 +1,115 @@
html, body {
min-height: 100% !important;
height: 100%;
overflow-y:hidden;
overflow-x: hidden;
display: flex;
flex-flow: column;
width: 100%;
margin: 0;
}
.noselect {
-khtml-user-select: none;
user-select: none;
-moz-user-select: none;
-webkit-user-select: none;
width: 100%;
}
.codefield {
border-width: 3px;
border-style: solid;
border-color: rgba(68,68,68,0.266666666666);
}
.content{
font-weight: bold;
font-size: 14px;
font-family: "Helvetica Neue", Helvetica, Consolas, sans-serif;
}
.content::selection {
background: #D8DADC; /* WebKit/Blink Browsers */
}
.content::-moz-selection {
background: #D8DADC; /* Gecko Browsers */
}
.combo {
background: #fff;
border: 1px solid #cfcfcf;
border-radius: 2px;
color: #444444;
font-size: 11px;
font-family: "Helvetica Neue", Helvetica, Arial, sans-serif;
height: 22px;
cursor: pointer;
margin: 0px 0px 10px 0px;
box-sizing: border-box;
flex: 0.95;
outline-color: #D8DADC;
}
select:focus > option:checked {
background: #D8DADC !important;
}
.label {
font-family: "Helvetica Neue", Helvetica, Arial, sans-serif;
font-size: 11px;
-khtml-user-select: none;
user-select: none;
-moz-user-select: none;
-webkit-user-select: none;
}
.language {
display: flex;
margin: 0px;
padding: 2px 10px 0px;
box-sizing: border-box;
width: 100%;
}
.TabColor {
display: inline-flex;
padding-left: 10px;
}
.tabselect {
padding-left: 10px;
padding-top: 5px;
-khtml-user-select: none;
user-select: none;
-moz-user-select: none;
-webkit-user-select: none;
}
.styleselect{
padding-top: 5px;
}
.button {
color: #fff;
background-color: #7d858c;
border: 1px solid #cfcfcf;
border-radius: 2px;
outline: none;
font-size: 11px;
font-family: "Helvetica Neue", Helvetica, Arial, sans-serif;
height: 22px;
cursor: pointer;
flex: 0.05;
}
.colorselect {
padding-left: 10px;
padding-top: 2px;
-khtml-user-select: none;
user-select: none;
-moz-user-select: none;
-webkit-user-select: none;
}
.divbutton {
padding: 15px 0px 0px 10px;
}
.label
{
font-family: "Helvetica Neue", Helvetica, Arial, sans-serif;
font-size: 13px;
}
span::selection {
background: #D8DADC; /* WebKit/Blink Browsers */
}
span::-moz-selection {
background: #D8DADC; /* Gecko Browsers */
}

207
scrollable_div.js Normal file
View File

@ -0,0 +1,207 @@
/*
Before use this module you need include in your script JQuery library
If you need to create a scrollable div, you must create an instance of ScrollableDiv, like this
your_instance = window.Asc.ScrollableDiv;
after use the function in your code for create div
your_instance.create_div(parent_id,{
width: "value",
height: "value",
left: "value",
right: "value",
top: "value",
bottom: "value"
});
your_instance.addEventListener(); - this function add event listener
parent_id - id of the element, after which the div is inserted;
width - width div;
height - height div;
top, right, left, bottom - the distance from the parent element to the div
If you need to add new properties to a div, you can add them to deffaul_settings {}
div has position: absolute and overflow: hidden
For update scroll use funcrion myscroll.updateScroll(id_innerDiv);
After the creation outer div has id = "scrollable-container-id" + count, and inner div has id = "conteiner_id" + count
count - element serial number
You can apply your classes to this divs
*/
(function(window,undefined) {
window.Asc.ScrollableDiv = window.Asc.ScrollableDiv || {
cout: 0,
lockMouseInterval: -1,
mousePos: { x : 0, y : 0 },
create_div: function (parent_id, settings) {
if ((!parent_id) && (!document.getElementById(parent_id)))
return;
this.cout++;
container = document.createElement("div");
container.id = "scrollable-container-id" + this.cout;
textElem = document.createElement("div");
textElem.id = "conteiner_id" + this.cout;
textElem.contentEditable = "true";
var deffaul_settings = {
position: "absolute",
overflow: "hidden",
width: "",
height: "",
left: "10px",
right: "10px",
top: "90px",
bottom: "5px",
};
for (var i in settings)
deffaul_settings[i] = settings[i];
for (var i in deffaul_settings)
container.style[i] = deffaul_settings[i];
var inner_settings = {
minWidth: "98%",
minHeight: "95%",
width: "fit-content",
height: "fit-content",
padding: "0 15px 15px 0",
outline: "none",
whiteSpace: "pre",
float: "left"
}
if (navigator.userAgent.search(/Firefox/) > 0)
{
inner_settings.width = "-moz-fit-content";
inner_settings.height = "-moz-fit-content";
}
for (var i in inner_settings)
textElem.style[i] = inner_settings[i];
container.appendChild(textElem);
$(container).insertAfter(("#" + parent_id));
ScrollableDiv.initialize();
},
updateScroll: function (div)
{
Ps.update();
if (!div.parentNode)
return;
var _elemV = div.parentNode.getElementsByClassName("ps__rail-y")[0];
var _elemH = div.parentNode.getElementsByClassName("ps__rail-x")[0];
if (!_elemH || !_elemV)
return;
var _styleV = window.getComputedStyle(_elemV);
var _styleH = window.getComputedStyle(_elemH);
var _visibleV = (_styleV && _styleV.display == "none") ? false : true;
var _visibleH = (_styleH && _styleH.display == "none") ? false : true;
if (_visibleH && _visibleV)
{
if ("13px" != _elemV.style.marginBottom)
_elemV.style.marginBottom = "13px";
if ("13px" != _elemH.style.marginRight)
_elemH.style.marginRight = "13px";
}
else
{
if ("2px" != _elemV.style.marginBottom)
_elemV.style.marginBottom = "2px";
if ("2px" != _elemH.style.marginRight)
_elemH.style.marginRight = "2px";
}
},
onSelectWheel: function (div)
{
var $textElem = $(div);
var position = $textElem.offset();
var width = $textElem.outerWidth();
var height = $textElem.outerHeight();
var maxX = div.scrollWidth;
var maxY = div.scrollHeight;
var scrollX = div.scrollLeft;
var scrollY = div.scrollTop;
var left = position.left;
var top = position.top;
var step = 20;
if (ScrollableDiv.mousePos.x < left)
scrollX -= step;
else if (ScrollableDiv.mousePos.x > (left + width))
scrollX += step;
if (ScrollableDiv.mousePos.y < top)
scrollY -= step;
else if (ScrollableDiv.mousePos.y > (top + height))
scrollY += step;
if (scrollX < 0)
scrollX = 0;
if (scrollX > maxX)
scrollX = maxX;
if (scrollY < 0)
scrollY = 0;
if (scrollY > maxY)
scrollY = maxY;
div.scrollLeft = scrollX;
div.scrollTop = scrollY;
},
initialize: function() {
Ps = new PerfectScrollbar('#' + container.id, {});
},
addEventListener: function() {
textElem.oninput = function(e){
ScrollableDiv.updateScroll(this);
ScrollableDiv.updateScroll(this);
};
window.addEventListener('mouseup', function() {
if (-1 != ScrollableDiv.lockMouseInterval)
clearInterval(ScrollableDiv.lockMouseInterval);
ScrollableDiv.lockMouseInterval = -1;
}, false);
window.addEventListener('mousemove', function(e) {
if (-1 == ScrollableDiv.lockMouseInterval)
return;
ScrollableDiv.mousePos.x = e.pageX || e.clientX;
ScrollableDiv.mousePos.y = e.pageY || e.clientY;
}, false);
container.onmouseup = function(e) {
if (-1 != ScrollableDiv.lockMouseInterval)
clearInterval(ScrollableDiv.lockMouseInterval);
ScrollableDiv.lockMouseInterval = -1;
};
container.onmousedown = function(e) {
if (-1 == ScrollableDiv.lockMouseInterval)
ScrollableDiv.lockMouseInterval = setInterval(ScrollableDiv.onSelectWheel, 20, this);
ScrollableDiv.mousePos.x = e.pageX || e.clientX;
ScrollableDiv.mousePos.y = e.pageY || e.clientY;
};
}
};
var ScrollableDiv = window.Asc.ScrollableDiv;
})(window,undefined);

View File

@ -0,0 +1,21 @@
The MIT License (MIT)
Copyright (c) 2012-2017 Kevin Brown, Igor Vaynberg, and Select2 contributors
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in
all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
THE SOFTWARE.

View File

@ -0,0 +1,123 @@
Select2
=======
[![Build Status][travis-ci-image]][travis-ci-status]
Select2 is a jQuery-based replacement for select boxes. It supports searching,
remote data sets, and pagination of results.
To get started, checkout examples and documentation at
https://select2.org/
Use cases
---------
* Enhancing native selects with search.
* Enhancing native selects with a better multi-select interface.
* Loading data from JavaScript: easily load items via AJAX and have them
searchable.
* Nesting optgroups: native selects only support one level of nesting. Select2
does not have this restriction.
* Tagging: ability to add new items on the fly.
* Working with large, remote datasets: ability to partially load a dataset based
on the search term.
* Paging of large datasets: easy support for loading more pages when the results
are scrolled to the end.
* Templating: support for custom rendering of results and selections.
Browser compatibility
---------------------
* IE 8+
* Chrome 8+
* Firefox 10+
* Safari 3+
* Opera 10.6+
Select2 is automatically tested on the following browsers.
[![Sauce Labs Test Status][saucelabs-matrix]][saucelabs-status]
Usage
-----
You can source Select2 directly from a CDN like [JSDliver][jsdelivr] or
[CDNJS][cdnjs], [download it from this GitHub repo][releases], or use one of
the integrations below.
Integrations
------------
Third party developers have created plugins for platforms which allow Select2 to be integrated more natively and quickly. For many platforms, additional plugins are not required because Select2 acts as a standard `<select>` box.
Plugins
* [Django]
- [django-autocomplete-light]
- [django-easy-select2]
- [django-select2]
* [Meteor] - [meteor-select2]
* [Ruby on Rails][ruby-on-rails] - [select2-rails]
* [Wicket] - [wicketstuff-select2]
* [Yii 2][yii2] - [yii2-widget-select2]
Themes
- [Bootstrap 3][bootstrap3] - [select2-bootstrap-theme]
- [Flat UI][flat-ui] - [select2-flat-theme]
- [Metro UI][metro-ui] - [select2-metro]
Missing an integration? Modify this `README` and make a pull request back here to Select2 on GitHub.
Internationalization (i18n)
---------------------------
Select2 supports multiple languages by simply including the right language JS
file (`dist/js/i18n/it.js`, `dist/js/i18n/nl.js`, etc.) after
`dist/js/select2.js`.
Missing a language? Just copy `src/js/select2/i18n/en.js`, translate it, and
make a pull request back to Select2 here on GitHub.
Documentation
-------------
The documentation for Select2 is available
[through GitHub Pages][documentation] and is located within this repository
in the [`docs` folder][documentation-folder].
Community
---------
You can find out about the different ways to get in touch with the Select2
community at the [Select2 community page][community].
Copyright and license
---------------------
The license is available within the repository in the [LICENSE][license] file.
[cdnjs]: http://www.cdnjs.com/libraries/select2
[community]: https://select2.org/getting-help
[documentation]: https://select2.org
[documentation-folder]: https://github.com/select2/select2/tree/master/docs
[freenode]: https://freenode.net/
[jsdelivr]: http://www.jsdelivr.com/#!select2
[license]: LICENSE.md
[releases]: https://github.com/select2/select2/releases
[saucelabs-matrix]: https://saucelabs.com/browser-matrix/select2.svg
[saucelabs-status]: https://saucelabs.com/u/select2
[travis-ci-image]: https://img.shields.io/travis/select2/select2/master.svg
[travis-ci-status]: https://travis-ci.org/select2/select2
[bootstrap3]: https://getbootstrap.com/
[django]: https://www.djangoproject.com/
[django-autocomplete-light]: https://github.com/yourlabs/django-autocomplete-light
[django-easy-select2]: https://github.com/asyncee/django-easy-select2
[django-select2]: https://github.com/applegrew/django-select2
[flat-ui]: http://designmodo.github.io/Flat-UI/
[meteor]: https://www.meteor.com/
[meteor-select2]: https://github.com/nate-strauser/meteor-select2
[metro-ui]: http://metroui.org.ua/
[select2-metro]: http://metroui.org.ua/select2.html
[ruby-on-rails]: http://rubyonrails.org/
[select2-bootstrap-theme]: https://github.com/select2/select2-bootstrap-theme
[select2-flat-theme]: https://github.com/techhysahil/select2-Flat_Theme
[select2-rails]: https://github.com/argerim/select2-rails
[vue.js]: http://vuejs.org/
[select2-vue]: http://vuejs.org/examples/select2.html
[wicket]: https://wicket.apache.org/
[wicketstuff-select2]: https://github.com/wicketstuff/core/tree/master/select2-parent
[yii2]: http://www.yiiframework.com/
[yii2-widget-select2]: https://github.com/kartik-v/yii2-widget-select2

489
select2-4.0.6-rc.1/dist/css/select2.css vendored Normal file
View File

@ -0,0 +1,489 @@
.select2-container {
box-sizing: border-box;
display: inline-block;
margin: 0;
position: relative;
vertical-align: middle; }
.select2-container .select2-selection--single {
box-sizing: border-box;
cursor: pointer;
display: block;
height: 22px;
user-select: none;
-webkit-user-select: none; }
.select2-container .select2-selection--single .select2-selection__rendered {
font-size: 12px;
display: block;
padding-left: 8px;
padding-right: 20px;
overflow: hidden;
text-overflow: ellipsis;
white-space: nowrap; }
.select2-container .select2-selection--single .select2-selection__clear {
position: relative; }
.select2-container[dir="rtl"] .select2-selection--single .select2-selection__rendered {
padding-right: 8px;
padding-left: 20px; }
.select2-container .select2-selection--multiple {
box-sizing: border-box;
cursor: pointer;
display: block;
min-height: 32px;
user-select: none;
-webkit-user-select: none; }
.select2-container .select2-selection--multiple .select2-selection__rendered {
display: inline-block;
overflow: hidden;
padding-left: 8px;
text-overflow: ellipsis;
white-space: nowrap; }
.select2-container .select2-search--inline {
float: left; }
.select2-container .select2-search--inline .select2-search__field {
box-sizing: border-box;
border: none;
font-size: 100%;
margin-top: 5px;
padding: 0; }
.select2-container .select2-search--inline .select2-search__field::-webkit-search-cancel-button {
-webkit-appearance: none; }
.select2-dropdown {
background-color: white;
border: 1px solid #aaa;
border-radius: 2px;
box-sizing: border-box;
display: block;
position: absolute;
left: -100000px;
width: 100%;
z-index: 1051; }
.select2-results {
display: block; }
.select2-results__options {
font-size: 12px;
list-style: none;
margin: 0;
padding: 0; }
.select2-results__option {
padding: 6px;
user-select: none;
-webkit-user-select: none; }
.select2-results__option[aria-selected] {
cursor: pointer; }
.select2-container--open .select2-dropdown {
left: 0; }
.select2-container--open .select2-dropdown--above {
border-bottom: none;
border-bottom-left-radius: 0;
border-bottom-right-radius: 0; }
.select2-container--open .select2-dropdown--below {
border-top: none;
border-top-left-radius: 0;
border-top-right-radius: 0; }
.select2-search--dropdown {
display: block;
padding: 4px; }
.select2-search--dropdown .select2-search__field {
padding: 4px;
width: 100%;
box-sizing: border-box; }
.select2-search--dropdown .select2-search__field::-webkit-search-cancel-button {
-webkit-appearance: none; }
.select2-search--dropdown.select2-search--hide {
display: none; }
.select2-close-mask {
border: 0;
margin: 0;
padding: 0;
display: block;
position: fixed;
left: 0;
top: 0;
min-height: 100%;
min-width: 100%;
height: auto;
width: auto;
opacity: 0;
z-index: 99;
background-color: #fff;
filter: alpha(opacity=0); }
.select2-hidden-accessible {
border: 0 !important;
clip: rect(0 0 0 0) !important;
-webkit-clip-path: inset(50%) !important;
clip-path: inset(50%) !important;
height: 1px !important;
overflow: hidden !important;
padding: 0 !important;
position: absolute !important;
width: 1px !important;
white-space: nowrap !important; }
.select2-container--default .select2-selection--single {
outline: none;
background-color: #fff;
border: 1px solid #aaa;
border-radius: 2px; }
.select2-container--default .select2-selection--single .select2-selection__rendered {
font-family: "Helvetica Neue", Helvetica, Arial, sans-serif;
color: #444;
line-height: 22px; }
.select2-container--default .select2-selection--single .select2-selection__clear {
cursor: pointer;
float: right;
font-weight: bold; }
.select2-container--default .select2-selection--single .select2-selection__placeholder {
color: #999; }
.select2-container--default .select2-selection--single .select2-selection__arrow {
height: 20px;
position: absolute;
top: 1px;
right: 1px;
width: 20px; }
.select2-container--default .select2-selection--single .select2-selection__arrow b {
border-color: #888 transparent transparent transparent;
border-style: solid;
border-width: 5px 4px 0 4px;
height: 0;
left: 50%;
margin-left: -4px;
margin-top: -2px;
position: absolute;
top: 50%;
width: 0; }
.select2-container--default[dir="rtl"] .select2-selection--single .select2-selection__clear {
float: left; }
.select2-container--default[dir="rtl"] .select2-selection--single .select2-selection__arrow {
left: 1px;
right: auto; }
.select2-container--default.select2-container--disabled .select2-selection--single {
background-color: #eee;
cursor: default; }
.select2-container--default.select2-container--disabled .select2-selection--single .select2-selection__clear {
display: none; }
.select2-container--default.select2-container--open .select2-selection--single .select2-selection__arrow b {
border-color: transparent transparent #888 transparent;
border-width: 0 4px 5px 4px; }
.select2-container--default .select2-selection--multiple {
background-color: white;
border: 1px solid #aaa;
border-radius: 2px;
cursor: text; }
.select2-container--default .select2-selection--multiple .select2-selection__rendered {
box-sizing: border-box;
list-style: none;
margin: 0;
padding: 0 5px;
width: 100%; }
.select2-container--default .select2-selection--multiple .select2-selection__rendered li {
list-style: none; }
.select2-container--default .select2-selection--multiple .select2-selection__placeholder {
color: #999;
margin-top: 5px;
float: left; }
.select2-container--default .select2-selection--multiple .select2-selection__clear {
cursor: pointer;
float: right;
font-weight: bold;
margin-top: 5px;
margin-right: 10px; }
.select2-container--default .select2-selection--multiple .select2-selection__choice {
background-color: #e4e4e4;
border: 1px solid #aaa;
border-radius: 2px;
cursor: default;
float: left;
margin-right: 5px;
margin-top: 5px;
padding: 0 5px; }
.select2-container--default .select2-selection--multiple .select2-selection__choice__remove {
color: #999;
cursor: pointer;
display: inline-block;
font-weight: bold;
margin-right: 2px; }
.select2-container--default .select2-selection--multiple .select2-selection__choice__remove:hover {
color: #333; }
.select2-container--default[dir="rtl"] .select2-selection--multiple .select2-selection__choice, .select2-container--default[dir="rtl"] .select2-selection--multiple .select2-selection__placeholder, .select2-container--default[dir="rtl"] .select2-selection--multiple .select2-search--inline {
float: right; }
.select2-container--default[dir="rtl"] .select2-selection--multiple .select2-selection__choice {
margin-left: 5px;
margin-right: auto; }
.select2-container--default[dir="rtl"] .select2-selection--multiple .select2-selection__choice__remove {
margin-left: 2px;
margin-right: auto; }
.select2-container--default.select2-container--focus .select2-selection--multiple {
border: solid black 1px;
outline: 0; }
.select2-container--default.select2-container--disabled .select2-selection--multiple {
background-color: #eee;
cursor: default; }
.select2-container--default.select2-container--disabled .select2-selection__choice__remove {
display: none; }
.select2-container--default.select2-container--open.select2-container--above .select2-selection--single, .select2-container--default.select2-container--open.select2-container--above .select2-selection--multiple {
border-top-left-radius: 0;
border-top-right-radius: 0; }
.select2-container--default.select2-container--open.select2-container--below .select2-selection--single, .select2-container--default.select2-container--open.select2-container--below .select2-selection--multiple {
border-bottom-left-radius: 0;
border-bottom-right-radius: 0; }
.select2-container--default .select2-search--dropdown .select2-search__field {
outline-color: #7d858c;
border: 1px solid #aaa; }
.select2-container--default .select2-search--inline .select2-search__field {
background: transparent;
border: none;
outline: 0;
box-shadow: none;
-webkit-appearance: textfield; }
.select2-container--default .select2-results > .select2-results__options {
font-family: "Helvetica Neue", Helvetica, Arial, sans-serif;
max-height: 200px;
overflow-y: auto; }
.select2-container--default .select2-results__option[role=group] {
padding: 0; }
.select2-container--default .select2-results__option[aria-disabled=true] {
color: #999; }
.select2-container--default .select2-results__option[aria-selected=true] {
background-color: #7d858c; }
.select2-container--default .select2-results__option .select2-results__option {
padding-left: 1em; }
.select2-container--default .select2-results__option .select2-results__option .select2-results__group {
padding-left: 0; }
.select2-container--default .select2-results__option .select2-results__option .select2-results__option {
margin-left: -1em;
padding-left: 2em; }
.select2-container--default .select2-results__option .select2-results__option .select2-results__option .select2-results__option {
margin-left: -2em;
padding-left: 3em; }
.select2-container--default .select2-results__option .select2-results__option .select2-results__option .select2-results__option .select2-results__option {
margin-left: -3em;
padding-left: 4em; }
.select2-container--default .select2-results__option .select2-results__option .select2-results__option .select2-results__option .select2-results__option .select2-results__option {
margin-left: -4em;
padding-left: 5em; }
.select2-container--default .select2-results__option .select2-results__option .select2-results__option .select2-results__option .select2-results__option .select2-results__option .select2-results__option {
margin-left: -5em;
padding-left: 6em; }
.select2-container--default .select2-results__option--highlighted[aria-selected] {
background-color: rgba(200, 200, 200, 0.5);}
.select2-container--default .select2-results__group {
cursor: default;
display: block;
padding: 6px; }
.select2-container--classic .select2-selection--single {
background-color: #f7f7f7;
border: 1px solid #aaa;
border-radius: 2px;
outline: 0;
background-image: -webkit-linear-gradient(top, white 50%, #eeeeee 100%);
background-image: -o-linear-gradient(top, white 50%, #eeeeee 100%);
background-image: linear-gradient(to bottom, white 50%, #eeeeee 100%);
background-repeat: repeat-x;
filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#FFFFFFFF', endColorstr='#FFEEEEEE', GradientType=0); }
.select2-container--classic .select2-selection--single:focus {
border: 1px solid #5897fb; }
.select2-container--classic .select2-selection--single .select2-selection__rendered {
color: #444;
line-height: 22px; }
.select2-container--classic .select2-selection--single .select2-selection__clear {
cursor: pointer;
float: right;
font-weight: bold;
margin-right: 10px; }
.select2-container--classic .select2-selection--single .select2-selection__placeholder {
color: #999; }
.select2-container--classic .select2-selection--single .select2-selection__arrow {
background-color: #ddd;
border: none;
border-left: 1px solid #aaa;
border-top-right-radius: 2px;
border-bottom-right-radius: 2px;
height: 20px;
position: absolute;
top: 1px;
right: 1px;
width: 20px;
background-image: -webkit-linear-gradient(top, #eeeeee 50%, #cccccc 100%);
background-image: -o-linear-gradient(top, #eeeeee 50%, #cccccc 100%);
background-image: linear-gradient(to bottom, #eeeeee 50%, #cccccc 100%);
background-repeat: repeat-x;
filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#FFEEEEEE', endColorstr='#FFCCCCCC', GradientType=0); }
.select2-container--classic .select2-selection--single .select2-selection__arrow b {
border-color: #888 transparent transparent transparent;
border-style: solid;
border-width: 5px 4px 0 4px;
height: 0;
left: 50%;
margin-left: -4px;
margin-top: -2px;
position: absolute;
top: 50%;
width: 0; }
.select2-container--classic[dir="rtl"] .select2-selection--single .select2-selection__clear {
float: left; }
.select2-container--classic[dir="rtl"] .select2-selection--single .select2-selection__arrow {
border: none;
border-right: 1px solid #aaa;
border-radius: 0;
border-top-left-radius: 2px;
border-bottom-left-radius: 2px;
left: 1px;
right: auto; }
.select2-container--classic.select2-container--open .select2-selection--single {
border: 1px solid #5897fb; }
.select2-container--classic.select2-container--open .select2-selection--single .select2-selection__arrow {
background: transparent;
border: none; }
.select2-container--classic.select2-container--open .select2-selection--single .select2-selection__arrow b {
border-color: transparent transparent #888 transparent;
border-width: 0 4px 5px 4px; }
.select2-container--classic.select2-container--open.select2-container--above .select2-selection--single {
border-top: none;
border-top-left-radius: 0;
border-top-right-radius: 0;
background-image: -webkit-linear-gradient(top, white 0%, #eeeeee 50%);
background-image: -o-linear-gradient(top, white 0%, #eeeeee 50%);
background-image: linear-gradient(to bottom, white 0%, #eeeeee 50%);
background-repeat: repeat-x;
filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#FFFFFFFF', endColorstr='#FFEEEEEE', GradientType=0); }
.select2-container--classic.select2-container--open.select2-container--below .select2-selection--single {
border-bottom: none;
border-bottom-left-radius: 0;
border-bottom-right-radius: 0;
background-image: -webkit-linear-gradient(top, #eeeeee 50%, white 100%);
background-image: -o-linear-gradient(top, #eeeeee 50%, white 100%);
background-image: linear-gradient(to bottom, #eeeeee 50%, white 100%);
background-repeat: repeat-x;
filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#FFEEEEEE', endColorstr='#FFFFFFFF', GradientType=0); }
.select2-container--classic .select2-selection--multiple {
background-color: white;
border: 1px solid #aaa;
border-radius: 2px;
cursor: text;
outline: 0; }
.select2-container--classic .select2-selection--multiple:focus {
border: 1px solid #5897fb; }
.select2-container--classic .select2-selection--multiple .select2-selection__rendered {
list-style: none;
margin: 0;
padding: 0 5px; }
.select2-container--classic .select2-selection--multiple .select2-selection__clear {
display: none; }
.select2-container--classic .select2-selection--multiple .select2-selection__choice {
background-color: #e4e4e4;
border: 1px solid #aaa;
border-radius: 2px;
cursor: default;
float: left;
margin-right: 5px;
margin-top: 5px;
padding: 0 5px; }
.select2-container--classic .select2-selection--multiple .select2-selection__choice__remove {
color: #888;
cursor: pointer;
display: inline-block;
font-weight: bold;
margin-right: 2px; }
.select2-container--classic .select2-selection--multiple .select2-selection__choice__remove:hover {
color: #555; }
.select2-container--classic[dir="rtl"] .select2-selection--multiple .select2-selection__choice {
float: right;
margin-left: 5px;
margin-right: auto; }
.select2-container--classic[dir="rtl"] .select2-selection--multiple .select2-selection__choice__remove {
margin-left: 2px;
margin-right: auto; }
.select2-container--classic.select2-container--open .select2-selection--multiple {
border: 1px solid #5897fb; }
.select2-container--classic.select2-container--open.select2-container--above .select2-selection--multiple {
border-top: none;
border-top-left-radius: 0;
border-top-right-radius: 0; }
.select2-container--classic.select2-container--open.select2-container--below .select2-selection--multiple {
border-bottom: none;
border-bottom-left-radius: 0;
border-bottom-right-radius: 0; }
.select2-container--classic .select2-search--dropdown .select2-search__field {
border: 1px solid #aaa;
outline: 0; }
.select2-container--classic .select2-search--inline .select2-search__field {
outline: 0;
box-shadow: none; }
.select2-container--classic .select2-dropdown {
background-color: white;
border: 1px solid transparent; }
.select2-container--classic .select2-dropdown--above {
border-bottom: none; }
.select2-container--classic .select2-dropdown--below {
border-top: none; }
.select2-container--classic .select2-results > .select2-results__options {
max-height: 200px;
overflow-y: auto; }
.select2-container--classic .select2-results__option[role=group] {
padding: 0; }
.select2-container--classic .select2-results__option[aria-disabled=true] {
color: grey; }
.select2-container--classic .select2-results__option--highlighted[aria-selected] {
background-color: #3875d7;
color: white; }
.select2-container--classic .select2-results__group {
cursor: default;
display: block;
padding: 6px; }
.select2-container--classic.select2-container--open .select2-dropdown {
border-color: #5897fb; }

File diff suppressed because one or more lines are too long

6559
select2-4.0.6-rc.1/dist/js/select2.full.js vendored Normal file

File diff suppressed because it is too large Load Diff

File diff suppressed because one or more lines are too long

5847
select2-4.0.6-rc.1/dist/js/select2.js vendored Normal file

File diff suppressed because it is too large Load Diff

File diff suppressed because one or more lines are too long

View File

@ -0,0 +1 @@
Effective beginning September 10, 2017, the Select2 documentation repository is now available at [`select2/docs`](https://github.com/select2/docs).

View File

@ -0,0 +1,12 @@
<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<title>select2</title>
</head>
<body>
<script>
window.location = 'https://select2.org/upgrading/new-in-40';
</script>
</body>
</html>

View File

@ -0,0 +1,12 @@
<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<title>select2</title>
</head>
<body>
<script>
window.location = 'https://select2.org/getting-help';
</script>
</body>
</html>

View File

@ -0,0 +1,12 @@
<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<title>select2</title>
</head>
<body>
<script>
window.location = 'https://select2.org/getting-started/basic-usage';
</script>
</body>
</html>

View File

@ -0,0 +1,12 @@
<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<title>select2</title>
</head>
<body>
<script>
window.location = 'https://select2.org';
</script>
</body>
</html>

View File

@ -0,0 +1,12 @@
<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<title>select2</title>
</head>
<body>
<script>
window.location = 'https://select2.org/configuration';
</script>
</body>
</html>

View File

@ -0,0 +1,12 @@
<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<title>select2</title>
</head>
<body>
<script>
window.location = 'https://select2.org/configuration';
</script>
</body>
</html>

446
spectrum/spectrum.css Normal file
View File

@ -0,0 +1,446 @@
/***
Spectrum Colorpicker v1.8.0
https://github.com/bgrins/spectrum
Author: Brian Grinstead
License: MIT
***/
.sp-container {
position:absolute;
top:0;
left:0;
display:inline-block;
*display: inline;
*zoom: 1;
/* https://github.com/bgrins/spectrum/issues/40 */
z-index: 9999994;
overflow: hidden;
}
.sp-container.sp-flat {
position: relative;
}
/* Fix for * { box-sizing: border-box; } */
.sp-container,
.sp-container * {
-webkit-box-sizing: content-box;
-moz-box-sizing: content-box;
box-sizing: content-box;
}
/* http://ansciath.tumblr.com/post/7347495869/css-aspect-ratio */
.sp-top {
position:relative;
width: 100%;
display:inline-block;
}
.sp-top-inner {
position:absolute;
top:0;
left:0;
bottom:0;
right:0;
}
.sp-color {
position: absolute;
top:0;
left:0;
bottom:0;
right:20%;
}
.sp-hue {
position: absolute;
top:0;
right:0;
bottom:0;
left:84%;
height: 100%;
}
.sp-clear-enabled .sp-hue {
top:33px;
height: 77.5%;
}
.sp-fill {
padding-top: 80%;
}
.sp-sat, .sp-val {
position: absolute;
top:0;
left:0;
right:0;
bottom:0;
}
.sp-alpha-enabled .sp-top {
margin-bottom: 18px;
}
.sp-alpha-enabled .sp-alpha {
display: block;
}
.sp-alpha-handle {
position:absolute;
top:-4px;
bottom: -4px;
width: 6px;
left: 50%;
cursor: pointer;
border: 1px solid black;
background: white;
opacity: .8;
}
.sp-alpha {
display: none;
position: absolute;
bottom: -14px;
right: 0;
left: 0;
height: 8px;
}
.sp-alpha-inner {
border: solid 1px #333;
}
.sp-clear {
display: none;
}
.sp-clear.sp-clear-display {
background-position: center;
}
.sp-clear-enabled .sp-clear {
display: block;
position:absolute;
top:0px;
right:0;
bottom:0;
left:84%;
height: 28px;
}
/* Don't allow text selection */
.sp-container, .sp-replacer, .sp-preview, .sp-dragger, .sp-slider, .sp-alpha, .sp-clear, .sp-alpha-handle, .sp-container.sp-dragging .sp-input, .sp-container button {
-webkit-user-select:none;
-moz-user-select: -moz-none;
-o-user-select:none;
user-select: none;
}
.sp-container.sp-input-disabled .sp-input-container {
display: none;
}
.sp-container.sp-buttons-disabled .sp-button-container {
display: none;
}
.sp-container.sp-palette-buttons-disabled .sp-palette-button-container {
display: none;
}
.sp-palette-only .sp-picker-container {
display: none;
}
.sp-palette-disabled .sp-palette-container {
display: none;
}
.sp-initial-disabled .sp-initial {
display: none;
}
/* Gradients for hue, saturation and value instead of images. Not pretty... but it works */
.sp-sat {
background-image: -webkit-gradient(linear, 0 0, 100% 0, from(#FFF), to(rgba(204, 154, 129, 0)));
background-image: -webkit-linear-gradient(left, #FFF, rgba(204, 154, 129, 0));
background-image: -moz-linear-gradient(left, #fff, rgba(204, 154, 129, 0));
background-image: -o-linear-gradient(left, #fff, rgba(204, 154, 129, 0));
background-image: -ms-linear-gradient(left, #fff, rgba(204, 154, 129, 0));
background-image: linear-gradient(to right, #fff, rgba(204, 154, 129, 0));
-ms-filter: "progid:DXImageTransform.Microsoft.gradient(GradientType = 1, startColorstr=#FFFFFFFF, endColorstr=#00CC9A81)";
filter : progid:DXImageTransform.Microsoft.gradient(GradientType = 1, startColorstr='#FFFFFFFF', endColorstr='#00CC9A81');
}
.sp-val {
background-image: -webkit-gradient(linear, 0 100%, 0 0, from(#000000), to(rgba(204, 154, 129, 0)));
background-image: -webkit-linear-gradient(bottom, #000000, rgba(204, 154, 129, 0));
background-image: -moz-linear-gradient(bottom, #000, rgba(204, 154, 129, 0));
background-image: -o-linear-gradient(bottom, #000, rgba(204, 154, 129, 0));
background-image: -ms-linear-gradient(bottom, #000, rgba(204, 154, 129, 0));
background-image: linear-gradient(to top, #000, rgba(204, 154, 129, 0));
-ms-filter: "progid:DXImageTransform.Microsoft.gradient(startColorstr=#00CC9A81, endColorstr=#FF000000)";
filter : progid:DXImageTransform.Microsoft.gradient(startColorstr='#00CC9A81', endColorstr='#FF000000');
}
.sp-hue {
background: -moz-linear-gradient(top, #ff0000 0%, #ffff00 17%, #00ff00 33%, #00ffff 50%, #0000ff 67%, #ff00ff 83%, #ff0000 100%);
background: -ms-linear-gradient(top, #ff0000 0%, #ffff00 17%, #00ff00 33%, #00ffff 50%, #0000ff 67%, #ff00ff 83%, #ff0000 100%);
background: -o-linear-gradient(top, #ff0000 0%, #ffff00 17%, #00ff00 33%, #00ffff 50%, #0000ff 67%, #ff00ff 83%, #ff0000 100%);
background: -webkit-gradient(linear, left top, left bottom, from(#ff0000), color-stop(0.17, #ffff00), color-stop(0.33, #00ff00), color-stop(0.5, #00ffff), color-stop(0.67, #0000ff), color-stop(0.83, #ff00ff), to(#ff0000));
background: -webkit-linear-gradient(top, #ff0000 0%, #ffff00 17%, #00ff00 33%, #00ffff 50%, #0000ff 67%, #ff00ff 83%, #ff0000 100%);
background: linear-gradient(to bottom, #ff0000 0%, #ffff00 17%, #00ff00 33%, #00ffff 50%, #0000ff 67%, #ff00ff 83%, #ff0000 100%);
}
/* IE filters do not support multiple color stops.
Generate 6 divs, line them up, and do two color gradients for each.
Yes, really.
*/
.sp-1 {
height:17%;
filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#ff0000', endColorstr='#ffff00');
}
.sp-2 {
height:16%;
filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#ffff00', endColorstr='#00ff00');
}
.sp-3 {
height:17%;
filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#00ff00', endColorstr='#00ffff');
}
.sp-4 {
height:17%;
filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#00ffff', endColorstr='#0000ff');
}
.sp-5 {
height:16%;
filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#0000ff', endColorstr='#ff00ff');
}
.sp-6 {
height:17%;
filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#ff00ff', endColorstr='#ff0000');
}
.sp-hidden {
display: none !important;
}
/* Clearfix hack */
.sp-cf:before, .sp-cf:after { content: ""; display: table; }
.sp-cf:after { clear: both; }
.sp-cf { *zoom: 1; }
/* Mobile devices, make hue slider bigger so it is easier to slide */
@media (max-device-width: 480px) {
.sp-color { right: 40%; }
.sp-hue { left: 63%; }
.sp-fill { padding-top: 60%; }
}
.sp-dragger {
border-radius: 5px;
height: 5px;
width: 5px;
border: 1px solid #fff;
background: #000;
cursor: pointer;
position:absolute;
top:0;
left: 0;
}
.sp-slider {
position: absolute;
top:0;
cursor:pointer;
height: 3px;
left: -1px;
right: -1px;
border: 1px solid #000;
background: white;
opacity: .8;
}
/*
Theme authors:
Here are the basic themeable display options (colors, fonts, global widths).
See http://bgrins.github.io/spectrum/themes/ for instructions.
*/
.sp-container {
border-radius: 0;
background-color: #ECECEC;
border: solid 1px #f0c49B;
padding: 0;
}
.sp-container, .sp-container button, .sp-container input, .sp-color, .sp-hue, .sp-clear {
font: normal 12px "Lucida Grande", "Lucida Sans Unicode", "Lucida Sans", Geneva, Verdana, sans-serif;
-webkit-box-sizing: border-box;
-moz-box-sizing: border-box;
-ms-box-sizing: border-box;
box-sizing: border-box;
}
.sp-top {
margin-bottom: 3px;
}
.sp-color, .sp-hue, .sp-clear {
border: solid 1px #666;
}
/* Input */
.sp-input-container {
float:right;
width: 100px;
margin-bottom: 4px;
}
.sp-initial-disabled .sp-input-container {
width: 100%;
}
.sp-input {
font-size: 12px !important;
border: 1px solid #cfcfcf;
padding: 4px 5px;
margin: 0;
width: 100%;
outline-color: #7d858c;
}
.sp-input.sp-validation-error {
border: 1px solid rgb(217, 83, 79);;
background: #fdd;
}
.sp-picker-container , .sp-palette-container {
float:left;
position: relative;
padding: 10px;
padding-bottom: 300px;
margin-bottom: -290px;
}
.sp-picker-container {
width: 172px;
border-left: solid 1px #fff;
}
/* Palettes */
.sp-palette-container {
border-right: solid 1px #ccc;
}
.sp-palette-only .sp-palette-container {
border: 0;
}
.sp-palette .sp-thumb-el {
display: block;
position:relative;
float:left;
width: 24px;
height: 15px;
margin: 3px;
cursor: pointer;
border:solid 2px transparent;
}
.sp-palette .sp-thumb-el:hover, .sp-palette .sp-thumb-el.sp-thumb-active {
border-color: orange;
}
.sp-thumb-el {
position:relative;
}
/* Initial */
.sp-initial {
float: left;
border: solid 1px #333;
}
.sp-initial span {
width: 30px;
height: 25px;
border:none;
display:block;
float:left;
margin:0;
}
.sp-initial .sp-clear-display {
background-position: center;
}
/* Buttons */
.sp-palette-button-container,
.sp-button-container {
float: right;
}
/* Replacer (the little preview div that shows up instead of the <input>) */
.sp-replacer {
margin-bottom:5px;
overflow:hidden;
cursor:pointer;
padding: 1px;
display:inline-block;
*zoom: 1;
*display: inline;
border: solid 1px #91765d;
background: #eee;
color: #333;
vertical-align: middle;
}
.sp-replacer:hover, .sp-replacer.sp-active {
border-color: #F0C49B;
color: #111;
}
.sp-replacer.sp-disabled {
cursor:default;
border-color: silver;
color: silver;
}
.sp-dd {
padding: 2px 0;
height: 16px;
line-height: 16px;
float:left;
font-size:10px;
}
.sp-preview {
position:relative;
width:25px;
height: 20px;
border: solid 1px #222;
margin-right: 5px;
float:left;
z-index: 0;
}
.sp-palette {
*width: 220px;
max-width: 220px;
}
.sp-palette .sp-thumb-el {
width:16px;
height: 16px;
margin:2px 1px;
border: solid 1px #d0d0d0;
}
.sp-container {
padding-bottom:0;
}
.sp-palette span:hover, .sp-palette span.sp-thumb-active {
border-color: #000;
}
.sp-preview, .sp-alpha, .sp-thumb-el {
position:relative;
background-image: url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAwAAAAMCAIAAADZF8uwAAAAGUlEQVQYV2M4gwH+YwCGIasIUwhT25BVBADtzYNYrHvv4gAAAABJRU5ErkJggg==);
}
.sp-preview-inner, .sp-alpha-inner, .sp-thumb-inner {
display:block;
position:absolute;
top:0;left:0;bottom:0;right:0;
}
.sp-palette .sp-thumb-inner {
background-position: 50% 50%;
background-repeat: no-repeat;
}
.sp-palette .sp-thumb-light.sp-thumb-active .sp-thumb-inner {
background-image: url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABIAAAASCAYAAABWzo5XAAAAGXRFWHRTb2Z0d2FyZQBBZG9iZSBJbWFnZVJlYWR5ccllPAAAAIVJREFUeNpiYBhsgJFMffxAXABlN5JruT4Q3wfi/0DsT64h8UD8HmpIPCWG/KemIfOJCUB+Aoacx6EGBZyHBqI+WsDCwuQ9mhxeg2A210Ntfo8klk9sOMijaURm7yc1UP2RNCMbKE9ODK1HM6iegYLkfx8pligC9lCD7KmRof0ZhjQACDAAceovrtpVBRkAAAAASUVORK5CYII=);
}
.sp-palette .sp-thumb-dark.sp-thumb-active .sp-thumb-inner {
background-image: url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABIAAAASCAYAAABWzo5XAAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8YQUAAAAJcEhZcwAADsMAAA7DAcdvqGQAAAAadEVYdFNvZnR3YXJlAFBhaW50Lk5FVCB2My41LjEwMPRyoQAAAMdJREFUOE+tkgsNwzAMRMugEAahEAahEAZhEAqlEAZhEAohEAYh81X2dIm8fKpEspLGvudPOsUYpxE2BIJCroJmEW9qJ+MKaBFhEMNabSy9oIcIPwrB+afvAUFoK4H0tMaQ3XtlrggDhOVVMuT4E5MMG0FBbCEYzjYT7OxLEvIHQLY2zWwQ3D+9luyOQTfKDiFD3iUIfPk8VqrKjgAiSfGFPecrg6HN6m/iBcwiDAo7WiBeawa+Kwh7tZoSCGLMqwlSAzVDhoK+6vH4G0P5wdkAAAAASUVORK5CYII=);
}
.sp-clear-display {
background-repeat:no-repeat;
background-position: center;
background-image: url(data:image/gif;base64,R0lGODlhFAAUAPcAAAAAAJmZmZ2dnZ6enqKioqOjo6SkpKWlpaampqenp6ioqKmpqaqqqqurq/Hx8fLy8vT09PX19ff39/j4+Pn5+fr6+vv7+wAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAACH5BAEAAP8ALAAAAAAUABQAAAihAP9FoPCvoMGDBy08+EdhQAIJCCMybCDAAYUEARBAlFiQQoMABQhKUJBxY0SPICEYHBnggEmDKAuoPMjS5cGYMxHW3IiT478JJA8M/CjTZ0GgLRekNGpwAsYABHIypcAgQMsITDtWJYBR6NSqMico9cqR6tKfY7GeBCuVwlipDNmefAtTrkSzB1RaIAoXodsABiZAEFB06gIBWC1mLVgBa0AAOw==);
}

2323
spectrum/spectrum.js Normal file

File diff suppressed because it is too large Load Diff

13
translations/de-De.json Normal file
View File

@ -0,0 +1,13 @@
{
"Auto": "Auto",
"Language": "Sprache",
"Highlight": "Hervorheben",
"Style": "Stil",
"Qtcreator Dark": "Qtcreator Dark",
"Qtcreator Light": "Qtcreator Light",
"Replace Tab with spaces": "Registerkarte durch Leerzeichen ersetzen",
"Don`t replace": "Nicht ersetzen",
"Replace by 2 spaces": "Durch 2 Leerzeichen ersetzen",
"Replace by 4 spaces": "Durch 4 Leerzeichen ersetzen",
"Choose background color": "Hintergrundfarbe wählen"
}

13
translations/es-ES.json Normal file
View File

@ -0,0 +1,13 @@
{
"Auto": "Auto",
"Language": "Idioma",
"Highlight": "Resaltado",
"Style": "Estilo",
"Qtcreator Dark": "Qtcreator Oscuro",
"Qtcreator Light": "Qtcreator Claro",
"Replace Tab with spaces": "Sustituir tabulación por espacios",
"Don`t replace": "No sustituir",
"Replace by 2 spaces": "Sustituir por 2 espacios",
"Replace by 4 spaces": "Sustituir por 4 espacios",
"Choose background color": "Seleccionar color del fondo"
}

13
translations/fr-FR.json Normal file
View File

@ -0,0 +1,13 @@
{
"Auto": "Auto",
"Language": "Langue",
"Highlight": "Surbrillance",
"Style": "Style",
"Qtcreator Dark": "Qtcreator Sombre",
"Qtcreator Light": "Qtcreator Lumineux",
"Replace Tab with spaces": "Remplacer tabulation par des espaces",
"Don`t replace": "Ne pas remplacer",
"Replace by 2 spaces": "Remplacer par 2 espaces",
"Replace by 4 spaces": "Remplacer par 4 espaces",
"Choose background color": "Choisir une couleur de fond"
}

13
translations/ru-RU.json Normal file
View File

@ -0,0 +1,13 @@
{
"Auto": "Авто",
"Language": "Язык",
"Highlight": "Подсветка",
"Style": "Стиль",
"Qtcreator Dark": "Qtcreator - темная тема",
"Qtcreator Light": "Qtcreator - светлая тема",
"Replace Tab with spaces": "Заменять табуляцию пробелами",
"Don`t replace": "Не заменять",
"Replace by 2 spaces": "Заменять на 2 пробела",
"Replace by 4 spaces": "Заменять на 4 пробела",
"Choose background color": "Выбрать цвет фона"
}