Add consultation module assets and libraries
This commit is contained in:
@@ -0,0 +1,90 @@
|
||||
/* globals Prism */
|
||||
(function ($, Prism) {
|
||||
'use strict';
|
||||
|
||||
// My plugin default options
|
||||
var defaultOptions = {};
|
||||
|
||||
function highlightIt(text, language) {
|
||||
return [
|
||||
'<pre class="language-' + language + '">',
|
||||
'<code class="language-' + language + '">' + Prism.highlight(text, Prism.languages[language]) + '</code>',
|
||||
'</pre>',
|
||||
].join('');
|
||||
}
|
||||
|
||||
// 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>',
|
||||
'</div>',
|
||||
'<div class="' + trumbowyg.o.prefix + 'highlight-form-group">',
|
||||
' <textarea class="' + trumbowyg.o.prefix + 'highlight-form-control code"></textarea>',
|
||||
'</div>',
|
||||
].join('\n')),
|
||||
$language = $modal.find('.language'),
|
||||
$code = $modal.find('.code');
|
||||
|
||||
// Listen clicks on modal box buttons
|
||||
$modal.on('tbwconfirm', function () {
|
||||
trumbowyg.restoreRange();
|
||||
trumbowyg.execCmd('insertHTML', highlightIt($code.val(), $language.val()));
|
||||
trumbowyg.execCmd('insertHTML', '<p><br></p>');
|
||||
|
||||
trumbowyg.closeModal();
|
||||
});
|
||||
|
||||
$modal.on('tbwcancel', function () {
|
||||
trumbowyg.closeModal();
|
||||
});
|
||||
}
|
||||
};
|
||||
}
|
||||
|
||||
$.extend(true, $.trumbowyg, {
|
||||
// Add some translations
|
||||
langs: {
|
||||
// jshint camelcase:false
|
||||
en: {
|
||||
highlight: 'Code syntax highlight'
|
||||
},
|
||||
pt_br: {
|
||||
highlight: 'Realçar sintaxe de código'
|
||||
},
|
||||
ko: {
|
||||
highlight: '코드 문법 하이라이트'
|
||||
},
|
||||
// jshint camelcase:true
|
||||
},
|
||||
// Add our plugin to Trumbowyg registered plugins
|
||||
plugins: {
|
||||
highlight: {
|
||||
init: function (trumbowyg) {
|
||||
// Fill current Trumbowyg instance with my plugin default options
|
||||
trumbowyg.o.plugins.highlight = $.extend(true, {},
|
||||
defaultOptions,
|
||||
trumbowyg.o.plugins.highlight || {}
|
||||
);
|
||||
|
||||
// If my plugin is a button
|
||||
trumbowyg.addBtnDef('highlight', buildButtonDef(trumbowyg));
|
||||
}
|
||||
}
|
||||
}
|
||||
});
|
||||
})(jQuery, Prism);
|
||||
1
konsultasi/libs/Trumbowyg/plugins/highlight/trumbowyg.highlight.min.js
vendored
Normal file
1
konsultasi/libs/Trumbowyg/plugins/highlight/trumbowyg.highlight.min.js
vendored
Normal file
@@ -0,0 +1 @@
|
||||
!function(i,n){"use strict";function e(i,e){return['<pre class="language-'+e+'">','<code class="language-'+e+'">'+n.highlight(i,n.languages[e])+"</code>","</pre>"].join("")}function o(i){return{fn:function(){var o=i.openModal("Code",['<div class="'+i.o.prefix+'highlight-form-group">',' <select class="'+i.o.prefix+'highlight-form-control language">',function(){var i="";for(var e in n.languages)n.languages.hasOwnProperty(e)&&(i+='<option value="'+e+'">'+e+"</option>");return i}()," </select>","</div>",'<div class="'+i.o.prefix+'highlight-form-group">',' <textarea class="'+i.o.prefix+'highlight-form-control code"></textarea>',"</div>"].join("\n")),t=o.find(".language"),g=o.find(".code");o.on("tbwconfirm",function(){i.restoreRange(),i.execCmd("insertHTML",e(g.val(),t.val())),i.execCmd("insertHTML","<p><br></p>"),i.closeModal()}),o.on("tbwcancel",function(){i.closeModal()})}}}var t={};i.extend(!0,i.trumbowyg,{langs:{en:{highlight:"Code syntax highlight"},pt_br:{highlight:"Realçar sintaxe de código"},ko:{highlight:"코드 문법 하이라이트"}},plugins:{highlight:{init:function(n){n.o.plugins.highlight=i.extend(!0,{},t,n.o.plugins.highlight||{}),n.addBtnDef("highlight",o(n))}}}})}(jQuery,Prism);
|
||||
@@ -0,0 +1,25 @@
|
||||
/**
|
||||
* Trumbowyg v2.21.0 - A lightweight WYSIWYG editor
|
||||
* Default stylesheet for Trumbowyg editor plugin
|
||||
* ------------------------
|
||||
* @link http://alex-d.github.io/Trumbowyg
|
||||
* @license MIT
|
||||
* @author Alexandre Demode (Alex-D)
|
||||
* Twitter : @AlexandreDemode
|
||||
* Website : alex-d.fr
|
||||
*/
|
||||
|
||||
.trumbowyg-highlight-form-group {
|
||||
margin: 15px 10px;
|
||||
|
||||
.trumbowyg-highlight-form-control {
|
||||
width: 100%;
|
||||
border: 1px solid #DEDEDE;
|
||||
font-size: 14px;
|
||||
padding: 7px;
|
||||
|
||||
&.code {
|
||||
height: 200px;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,20 @@
|
||||
/**
|
||||
* Trumbowyg v2.21.0 - A lightweight WYSIWYG editor
|
||||
* Trumbowyg plugin stylesheet
|
||||
* ------------------------
|
||||
* @link http://alex-d.github.io/Trumbowyg
|
||||
* @license MIT
|
||||
* @author Alexandre Demode (Alex-D)
|
||||
* Twitter : @AlexandreDemode
|
||||
* Website : alex-d.fr
|
||||
*/
|
||||
|
||||
.trumbowyg-highlight-form-group {
|
||||
margin: 15px 10px; }
|
||||
.trumbowyg-highlight-form-group .trumbowyg-highlight-form-control {
|
||||
width: 100%;
|
||||
border: 1px solid #DEDEDE;
|
||||
font-size: 14px;
|
||||
padding: 7px; }
|
||||
.trumbowyg-highlight-form-group .trumbowyg-highlight-form-control.code {
|
||||
height: 200px; }
|
||||
2
konsultasi/libs/Trumbowyg/plugins/highlight/ui/trumbowyg.highlight.min.css
vendored
Normal file
2
konsultasi/libs/Trumbowyg/plugins/highlight/ui/trumbowyg.highlight.min.css
vendored
Normal file
@@ -0,0 +1,2 @@
|
||||
/** Trumbowyg v2.21.0 - A lightweight WYSIWYG editor - alex-d.github.io/Trumbowyg - License MIT - Author : Alexandre Demode (Alex-D) / alex-d.fr */
|
||||
.trumbowyg-highlight-form-group{margin:15px 10px}.trumbowyg-highlight-form-group .trumbowyg-highlight-form-control{width:100%;border:1px solid #DEDEDE;font-size:14px;padding:7px}.trumbowyg-highlight-form-group .trumbowyg-highlight-form-control.code{height:200px}
|
||||
Reference in New Issue
Block a user