Inital
This commit is contained in:
@@ -0,0 +1,85 @@
|
||||
/* ===========================================================
|
||||
* trumbowyg.specialchars.js v0.99
|
||||
* Unicode characters picker plugin for Trumbowyg
|
||||
* http://alex-d.github.com/Trumbowyg
|
||||
* ===========================================================
|
||||
* Author : Renaud Hoyoux (geektortoise)
|
||||
*/
|
||||
|
||||
(function ($) {
|
||||
'use strict';
|
||||
|
||||
var defaultOptions = {
|
||||
symbolList: [
|
||||
// currencies
|
||||
'0024', '20AC', '00A3', '00A2', '00A5', '00A4', '2030', null,
|
||||
// legal signs
|
||||
'00A9', '00AE', '2122', null,
|
||||
// textual sign
|
||||
'00A7', '00B6', '00C6', '00E6', '0152', '0153', null,
|
||||
'2022', '25CF', '2023', '25B6', '2B29', '25C6', null,
|
||||
//maths
|
||||
'00B1', '00D7', '00F7', '21D2', '21D4', '220F', '2211', '2243', '2264', '2265'
|
||||
]
|
||||
};
|
||||
|
||||
$.extend(true, $.trumbowyg, {
|
||||
langs: {
|
||||
en: {
|
||||
specialChars: 'Special characters'
|
||||
},
|
||||
et: {
|
||||
specialChars: 'Erimärgid'
|
||||
},
|
||||
fr: {
|
||||
specialChars: 'Caractères spéciaux'
|
||||
},
|
||||
hu: {
|
||||
specialChars: 'Speciális karakterek'
|
||||
},
|
||||
ko: {
|
||||
specialChars: '특수문자'
|
||||
},
|
||||
},
|
||||
plugins: {
|
||||
specialchars: {
|
||||
init: function (trumbowyg) {
|
||||
trumbowyg.o.plugins.specialchars = trumbowyg.o.plugins.specialchars || defaultOptions;
|
||||
var specialCharsBtnDef = {
|
||||
dropdown: buildDropdown(trumbowyg)
|
||||
};
|
||||
|
||||
trumbowyg.addBtnDef('specialChars', specialCharsBtnDef);
|
||||
}
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
function buildDropdown(trumbowyg) {
|
||||
var dropdown = [];
|
||||
$.each(trumbowyg.o.plugins.specialchars.symbolList, function (i, symbol) {
|
||||
if (symbol === null) {
|
||||
symbol = ' ';
|
||||
} else {
|
||||
symbol = '&#x' + symbol;
|
||||
}
|
||||
|
||||
var btn = symbol.replace(/:/g, ''),
|
||||
defaultSymbolBtnName = 'symbol-' + btn,
|
||||
defaultSymbolBtnDef = {
|
||||
text: symbol,
|
||||
hasIcon: false,
|
||||
fn: function () {
|
||||
var encodedSymbol = String.fromCodePoint(parseInt(symbol.replace('&#', '0')));
|
||||
trumbowyg.execCmd('insertText', encodedSymbol);
|
||||
return true;
|
||||
}
|
||||
};
|
||||
|
||||
trumbowyg.addBtnDef(defaultSymbolBtnName, defaultSymbolBtnDef);
|
||||
dropdown.push(defaultSymbolBtnName);
|
||||
});
|
||||
|
||||
return dropdown;
|
||||
}
|
||||
})(jQuery);
|
||||
@@ -0,0 +1,4 @@
|
||||
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 72 72" fill-rule="evenodd">
|
||||
<path d="M36 3c18.213 0 33 14.787 33 33S54.213 69 36 69 3 54.213 3 36 17.787 3 36 3zm0 6.735c14.496 0 26.265 11.769 26.265 26.265S50.496 62.265 36 62.265 9.735 50.496 9.735 36 21.504 9.735 36 9.735z"/>
|
||||
<path d="M45.248 40.04h8.816C52.23 48.325 44.833 54.52 36 54.52c-10.222 0-18.52-8.298-18.52-18.52S25.778 17.48 36 17.48c8.712 0 16.027 6.028 17.977 14.142h-8.912A10.009 10.009 0 0036 25.898c-5.575 0-10.102 4.527-10.102 10.102S30.425 46.102 36 46.102a10.08 10.08 0 009.248-6.061z"/>
|
||||
</svg>
|
||||
|
After Width: | Height: | Size: 580 B |
@@ -0,0 +1,45 @@
|
||||
.trumbowyg-symbol-\ -dropdown-button {
|
||||
display: none !important;
|
||||
}
|
||||
.trumbowyg-symbol-\ -dropdown-button + button {
|
||||
clear: both;
|
||||
}
|
||||
|
||||
.trumbowyg-dropdown-specialChars {
|
||||
width: 248px;
|
||||
padding: 5px 3px 3px;
|
||||
}
|
||||
|
||||
.trumbowyg-dropdown-specialChars button {
|
||||
display: block;
|
||||
position: relative;
|
||||
float: left;
|
||||
height: 26px;
|
||||
width: 26px;
|
||||
padding: 0;
|
||||
margin: 2px;
|
||||
line-height: 24px;
|
||||
text-align: center;
|
||||
|
||||
&:hover,
|
||||
&:focus {
|
||||
&::after {
|
||||
display: block;
|
||||
position: absolute;
|
||||
top: -5px;
|
||||
left: -5px;
|
||||
height: 27px;
|
||||
width: 27px;
|
||||
background: inherit;
|
||||
box-shadow: #000 0 0 2px;
|
||||
z-index: 10;
|
||||
background-color: transparent;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
.trumbowyg .specialChars {
|
||||
width: 22px;
|
||||
height: 22px;
|
||||
display: inline-block;
|
||||
}
|
||||
Reference in New Issue
Block a user