Skip to content

Commit

Permalink
2.25.0
Browse files Browse the repository at this point in the history
  • Loading branch information
Alex-D committed Jul 4, 2021
1 parent 8cf7c07 commit 064c9bc
Show file tree
Hide file tree
Showing 34 changed files with 411 additions and 178 deletions.
10 changes: 9 additions & 1 deletion dist/langs/sl.js
Original file line number Diff line number Diff line change
@@ -1,3 +1,11 @@
/* ===========================================================
* sl.js
* Slovenian translation for Trumbowyg
* http://alex-d.github.com/Trumbowyg
* ===========================================================
* Author: Matjaz Zavski (https://github.com/matjaz321)
*/

jQuery.trumbowyg.langs.sl = {
viewHTML: 'Prikaži HTML',

Expand Down Expand Up @@ -33,7 +41,7 @@ jQuery.trumbowyg.langs.sl = {

horizontalRule: 'Vstavite vodoravno črto',
removeformat: 'Odstrani format',

fullscreen: 'Celozaslonski način',

close: 'Zapri',
Expand Down
7 changes: 7 additions & 0 deletions dist/langs/sl.min.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion dist/plugins/colors/ui/sass/trumbowyg.colors.scss
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/**
* Trumbowyg v2.24.0 - A lightweight WYSIWYG editor
* Trumbowyg v2.25.0 - A lightweight WYSIWYG editor
* Default stylesheet for Trumbowyg editor plugin
* ------------------------
* @link http://alex-d.github.io/Trumbowyg
Expand Down
2 changes: 1 addition & 1 deletion dist/plugins/colors/ui/trumbowyg.colors.css
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/**
* Trumbowyg v2.24.0 - A lightweight WYSIWYG editor
* Trumbowyg v2.25.0 - A lightweight WYSIWYG editor
* Trumbowyg plugin stylesheet
* ------------------------
* @link http://alex-d.github.io/Trumbowyg
Expand Down
2 changes: 1 addition & 1 deletion dist/plugins/colors/ui/trumbowyg.colors.min.css

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion dist/plugins/emoji/ui/sass/trumbowyg.emoji.scss
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/**
* Trumbowyg v2.24.0 - A lightweight WYSIWYG editor
* Trumbowyg v2.25.0 - A lightweight WYSIWYG editor
* Default stylesheet for Trumbowyg editor plugin
* ------------------------
* @link http://alex-d.github.io/Trumbowyg
Expand Down
2 changes: 1 addition & 1 deletion dist/plugins/emoji/ui/trumbowyg.emoji.css
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/**
* Trumbowyg v2.24.0 - A lightweight WYSIWYG editor
* Trumbowyg v2.25.0 - A lightweight WYSIWYG editor
* Trumbowyg plugin stylesheet
* ------------------------
* @link http://alex-d.github.io/Trumbowyg
Expand Down
2 changes: 1 addition & 1 deletion dist/plugins/emoji/ui/trumbowyg.emoji.min.css

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion dist/plugins/giphy/ui/sass/trumbowyg.giphy.scss
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/**
* Trumbowyg v2.24.0 - A lightweight WYSIWYG editor
* Trumbowyg v2.25.0 - A lightweight WYSIWYG editor
* Default stylesheet for Trumbowyg editor plugin
* ------------------------
* @link http://alex-d.github.io/Trumbowyg
Expand Down
2 changes: 1 addition & 1 deletion dist/plugins/giphy/ui/trumbowyg.giphy.css
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/**
* Trumbowyg v2.24.0 - A lightweight WYSIWYG editor
* Trumbowyg v2.25.0 - A lightweight WYSIWYG editor
* Trumbowyg plugin stylesheet
* ------------------------
* @link http://alex-d.github.io/Trumbowyg
Expand Down
2 changes: 1 addition & 1 deletion dist/plugins/giphy/ui/trumbowyg.giphy.min.css

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

244 changes: 220 additions & 24 deletions dist/plugins/highlight/trumbowyg.highlight.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,182 @@
'use strict';

// My plugin default options
var defaultOptions = {};
var defaultOptions = {
enableLineHighlight: true,
languageNames: {
// For updated list of languages
// see https://github.com/PrismJS/prism/blob/master/plugins/show-language/prism-show-language.js
'html': 'HTML',
'xml': 'XML',
'svg': 'SVG',
'mathml': 'MathML',
'ssml': 'SSML',
'css': 'CSS',
'clike': 'C-like',
'js': 'JavaScript',
'abap': 'ABAP',
'abnf': 'Augmented Backus–Naur form',
'al': 'AL',
'antlr4': 'ANTLR4',
'g4': 'ANTLR4',
'apacheconf': 'Apache Configuration',
'apl': 'APL',
'aql': 'AQL',
'arff': 'ARFF',
'asciidoc': 'AsciiDoc',
'adoc': 'AsciiDoc',
'asm6502': '6502 Assembly',
'aspnet': 'ASP.NET (C#)',
'autohotkey': 'AutoHotkey',
'autoit': 'AutoIt',
'basic': 'BASIC',
'bbcode': 'BBcode',
'bnf': 'Backus–Naur form',
'rbnf': 'Routing Backus–Naur form',
'conc': 'Concurnas',
'csharp': 'C#',
'cs': 'C#',
'dotnet': 'C#',
'cpp': 'C++',
'cil': 'CIL',
'coffee': 'CoffeeScript',
'cmake': 'CMake',
'csp': 'Content-Security-Policy',
'css-extras': 'CSS Extras',
'dax': 'DAX',
'django': 'Django/Jinja2',
'jinja2': 'Django/Jinja2',
'dns-zone-file': 'DNS zone file',
'dns-zone': 'DNS zone file',
'dockerfile': 'Docker',
'ebnf': 'Extended Backus–Naur form',
'ejs': 'EJS',
'etlua': 'Embedded Lua templating',
'erb': 'ERB',
'excel-formula': 'Excel Formula',
'xlsx': 'Excel Formula',
'xls': 'Excel Formula',
'fsharp': 'F#',
'firestore-security-rules': 'Firestore security rules',
'ftl': 'FreeMarker Template Language',
'gcode': 'G-code',
'gdscript': 'GDScript',
'gedcom': 'GEDCOM',
'glsl': 'GLSL',
'gml': 'GameMaker Language',
'gamemakerlanguage': 'GameMaker Language',
'graphql': 'GraphQL',
'hs': 'Haskell',
'hcl': 'HCL',
'hlsl': 'HLSL',
'http': 'HTTP',
'hpkp': 'HTTP Public-Key-Pins',
'hsts': 'HTTP Strict-Transport-Security',
'ichigojam': 'IchigoJam',
'iecst': 'Structured Text (IEC 61131-3)',
'inform7': 'Inform 7',
'javadoc': 'JavaDoc',
'javadoclike': 'JavaDoc-like',
'javastacktrace': 'Java stack trace',
'jq': 'JQ',
'jsdoc': 'JSDoc',
'js-extras': 'JS Extras',
'js-templates': 'JS Templates',
'json': 'JSON',
'jsonp': 'JSONP',
'json5': 'JSON5',
'latex': 'LaTeX',
'tex': 'TeX',
'context': 'ConTeXt',
'lilypond': 'LilyPond',
'ly': 'LilyPond',
'emacs': 'Lisp',
'elisp': 'Lisp',
'emacs-lisp': 'Lisp',
'llvm': 'LLVM IR',
'lolcode': 'LOLCODE',
'md': 'Markdown',
'markup-templating': 'Markup templating',
'matlab': 'MATLAB',
'mel': 'MEL',
'moon': 'MoonScript',
'n1ql': 'N1QL',
'n4js': 'N4JS',
'n4jsd': 'N4JS',
'nand2tetris-hdl': 'Nand To Tetris HDL',
'nasm': 'NASM',
'neon': 'NEON',
'nginx': 'nginx',
'nsis': 'NSIS',
'objectivec': 'Objective-C',
'objc': 'Objective-C',
'ocaml': 'OCaml',
'opencl': 'OpenCL',
'parigp': 'PARI/GP',
'objectpascal': 'Object Pascal',
'pcaxis': 'PC-Axis',
'px': 'PC-Axis',
'peoplecode': 'PeopleCode',
'pcode': 'PeopleCode',
'php': 'PHP',
'phpdoc': 'PHPDoc',
'php-extras': 'PHP Extras',
'plsql': 'PL/SQL',
'powerquery': 'PowerQuery',
'pq': 'PowerQuery',
'mscript': 'PowerQuery',
'powershell': 'PowerShell',
'properties': '.properties',
'protobuf': 'Protocol Buffers',
'py': 'Python',
'q': 'Q (kdb+ database)',
'qml': 'QML',
'rkt': 'Racket',
'jsx': 'React JSX',
'tsx': 'React TSX',
'renpy': 'Ren\'py',
'rest': 'reST (reStructuredText)',
'robotframework': 'Robot Framework',
'robot': 'Robot Framework',
'rb': 'Ruby',
'sas': 'SAS',
'sass': 'Sass (Sass)',
'scss': 'Sass (Scss)',
'shell-session': 'Shell session',
'solidity': 'Solidity (Ethereum)',
'solution-file': 'Solution file',
'sln': 'Solution file',
'soy': 'Soy (Closure Template)',
'sparql': 'SPARQL',
'rq': 'SPARQL',
'splunk-spl': 'Splunk SPL',
'sqf': 'SQF: Status Quo Function (Arma 3)',
'sql': 'SQL',
'tap': 'TAP',
'toml': 'TOML',
'tt2': 'Template Toolkit 2',
'trig': 'TriG',
'ts': 'TypeScript',
't4-cs': 'T4 Text Templates (C#)',
't4': 'T4 Text Templates (C#)',
't4-vb': 'T4 Text Templates (VB)',
't4-templating': 'T4 templating',
'uscript': 'UnrealScript',
'uc': 'UnrealScript',
'vbnet': 'VB.Net',
'vhdl': 'VHDL',
'vim': 'vim',
'visual-basic': 'Visual Basic',
'vb': 'Visual Basic',
'wasm': 'WebAssembly',
'wiki': 'Wiki markup',
'xeoracube': 'XeoraCube',
'xojo': 'Xojo (REALbasic)',
'xquery': 'XQuery',
'yaml': 'YAML',
'yml': 'YAML'
}
};

function highlightIt(text, language, lineHighlight) {
return [
Expand All @@ -13,34 +188,58 @@
].join('');
}

function escapeHtml(html) {
return $('<div/>').text(html).html();
}

function buildHighlightOptions(trumbowyg) {
var languageNames = trumbowyg.o.plugins.highlight.languageNames;
var languageNameKeys = Object.keys(languageNames);
var prismLanguageKeys = Object.keys(Prism.languages);

var options = prismLanguageKeys.filter(function (languageKey) {
return languageNameKeys.indexOf(languageKey) >= 0;
}).map(function (languageKey) {
return {
id: languageKey,
name: languageNames[languageKey]
};
}).sort(function(a, b){
// Sort languages by name
return a.name.localeCompare(b.name);
}).map(function( language){
// Generate a list of options
return '<option value="' + escapeHtml(language.id) + '">' + escapeHtml(language.name) + '</option>';
}).join('');

return options;
}

function buildLineHighlightFieldIfEnabled(trumbowyg) {
if (trumbowyg.o.plugins.highlight.enableLineHighlight === false) {
return '';
}

return '<div class="' + trumbowyg.o.prefix + 'highlight-form-group">' +
' <input placeholder="' + trumbowyg.lang.highlightLine +
'" class="' + trumbowyg.o.prefix + 'highlight-form-control trumbowyg-line-highlight"/>' +
'</div>';
}

// If my plugin is a button
function buildButtonDef(trumbowyg) {
return {
fn: function () {
var $modal = trumbowyg.openModal('Code', [
'<div class="' + trumbowyg.o.prefix + 'highlight-form-group">',
' <select class="' + trumbowyg.o.prefix + 'highlight-form-control language">',
(function () {
var options = '';

for (var lang in Prism.languages) {
if (Prism.languages.hasOwnProperty(lang)) {
options += '<option value="' + lang + '">' + lang + '</option>';
}
}

return options;
})(),
' <select class="' + trumbowyg.o.prefix + 'highlight-form-control language" autofocus>',
buildHighlightOptions(trumbowyg),
' </select>',
'</div>',
'<div class="' + trumbowyg.o.prefix + 'highlight-form-group">',
' <textarea class="' + trumbowyg.o.prefix + 'highlight-form-control code"></textarea>',
'</div>',
'<div class="' + trumbowyg.o.prefix + 'highlight-form-group">',
' <input title="'+ trumbowyg.lang.prismHighlightPluginAlert +
'" placeholder="' + trumbowyg.lang.highlightLine +
'" class="' + trumbowyg.o.prefix + 'highlight-form-control trumbowyg-line-highlight"/>',
'</div>'
buildLineHighlightFieldIfEnabled(trumbowyg),
].join('\n')),
$language = $modal.find('.language'),
$code = $modal.find('.code'),
Expand Down Expand Up @@ -68,18 +267,15 @@
// jshint camelcase:false
en: {
highlight: 'Code syntax highlight',
highlightLine: 'Highlight lines, e.g.: 1,3-5',
prismHighlightPluginAlert: 'You must have Prism Line Highlight plugin installed'
highlightLine: 'Highlight lines, e.g.: 1,3-5'
},
es: {
highlight: 'Resaltado de sintaxis de código',
highlightLine: 'Resaltar lineas, ej: 1,3-5',
prismHighlightPluginAlert: 'Debes de tener el plugin Prism Line Highlight instalado'
highlightLine: 'Resaltar lineas, ej: 1,3-5'
},
et: {
highlight: 'Koodi esiletoomine',
highlightLine: 'Koodiread, näiteks: 1,3-5',
prismHighlightPluginAlert: 'Teil peab olema paigaldatud plugin nimega Prism Line Highlight'
highlightLine: 'Koodiread, näiteks: 1,3-5'
},
hu: {
highlight: 'Kód kiemelés'
Expand Down
Loading

0 comments on commit 064c9bc

Please sign in to comment.