mirror of
https://github.com/moodle/moodle.git
synced 2025-01-18 22:08:20 +01:00
MDL-43858 atto_charmap: New plugin to insert special characters
This commit is contained in:
parent
48bdf86f31
commit
c7829b26e1
281
lib/editor/atto/plugins/charmap/lang/en/atto_charmap.php
Normal file
281
lib/editor/atto/plugins/charmap/lang/en/atto_charmap.php
Normal file
@ -0,0 +1,281 @@
|
||||
<?php
|
||||
// This file is part of Moodle - http://moodle.org/
|
||||
//
|
||||
// Moodle is free software: you can redistribute it and/or modify
|
||||
// it under the terms of the GNU General Public License as published by
|
||||
// the Free Software Foundation, either version 3 of the License, or
|
||||
// (at your option) any later version.
|
||||
//
|
||||
// Moodle is distributed in the hope that it will be useful,
|
||||
// but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
// GNU General Public License for more details.
|
||||
//
|
||||
// You should have received a copy of the GNU General Public License
|
||||
// along with Moodle. If not, see <http://www.gnu.org/licenses/>.
|
||||
|
||||
/**
|
||||
* Strings for component 'atto_charmap', language 'en'.
|
||||
*
|
||||
* @package atto_charmap
|
||||
* @copyright 2014 Frédéric Massart
|
||||
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
|
||||
*/
|
||||
|
||||
$string['insertcharacter'] = 'Insert character';
|
||||
$string['pluginname'] = 'Insert character';
|
||||
|
||||
// The following are not ordered on purpose, they are kept
|
||||
// in the order in which they appear in the user interface.
|
||||
$string['nobreakspace'] = 'no-break space';
|
||||
$string['ampersand'] = 'ampersand';
|
||||
$string['quotationmark'] = 'quotation mark';
|
||||
$string['centsign'] = 'cent sign';
|
||||
$string['eurosign'] = 'euro sign';
|
||||
$string['poundsign'] = 'pound sign';
|
||||
$string['yensign'] = 'yen sign';
|
||||
$string['copyrightsign'] = 'copyright sign';
|
||||
$string['registeredsign'] = 'registered sign';
|
||||
$string['trademarksign'] = 'trade mark sign';
|
||||
$string['permillesign'] = 'per mille sign';
|
||||
$string['microsign'] = 'micro sign';
|
||||
$string['middledot'] = 'middle dot';
|
||||
$string['bullet'] = 'bullet';
|
||||
$string['threedotleader'] = 'three dot leader';
|
||||
$string['minutesfeet'] = 'minutes / feet';
|
||||
$string['secondsinches'] = 'seconds / inches';
|
||||
$string['sectionsign'] = 'section sign';
|
||||
$string['paragraphsign'] = 'paragraph sign';
|
||||
$string['sharpsesszed'] = 'sharp s / ess-zed';
|
||||
$string['singleleftpointinganglequotationmark'] = 'single left-pointing angle quotation mark';
|
||||
$string['singlerightpointinganglequotationmark'] = 'single right-pointing angle quotation mark';
|
||||
$string['leftpointingguillemet'] = 'left pointing guillemet';
|
||||
$string['rightpointingguillemet'] = 'right pointing guillemet';
|
||||
$string['leftsinglequotationmark'] = 'left single quotation mark';
|
||||
$string['rightsinglequotationmark'] = 'right single quotation mark';
|
||||
$string['leftdoublequotationmark'] = 'left double quotation mark';
|
||||
$string['rightdoublequotationmark'] = 'right double quotation mark';
|
||||
$string['singlelow9quotationmark'] = 'single low-9 quotation mark';
|
||||
$string['doublelow9quotationmark'] = 'double low-9 quotation mark';
|
||||
$string['lessthansign'] = 'less-than sign';
|
||||
$string['greaterthansign'] = 'greater-than sign';
|
||||
$string['lessthanorequalto'] = 'less-than or equal to';
|
||||
$string['greaterthanorequalto'] = 'greater-than or equal to';
|
||||
$string['endash'] = 'en dash';
|
||||
$string['emdash'] = 'em dash';
|
||||
$string['macron'] = 'macron';
|
||||
$string['overline'] = 'overline';
|
||||
$string['currencysign'] = 'currency sign';
|
||||
$string['brokenbar'] = 'broken bar';
|
||||
$string['diaeresis'] = 'diaeresis';
|
||||
$string['invertedexclamationmark'] = 'inverted exclamation mark';
|
||||
$string['turnedquestionmark'] = 'turned question mark';
|
||||
$string['circumflexaccent'] = 'circumflex accent';
|
||||
$string['smalltilde'] = 'small tilde';
|
||||
$string['degreesign'] = 'degree sign';
|
||||
$string['minussign'] = 'minus sign';
|
||||
$string['plusminussign'] = 'plus-minus sign';
|
||||
$string['divisionsign'] = 'division sign';
|
||||
$string['fractionslash'] = 'fraction slash';
|
||||
$string['multiplicationsign'] = 'multiplication sign';
|
||||
$string['superscriptone'] = 'superscript one';
|
||||
$string['superscripttwo'] = 'superscript two';
|
||||
$string['superscriptthree'] = 'superscript three';
|
||||
$string['fractiononequarter'] = 'fraction one quarter';
|
||||
$string['fractiononehalf'] = 'fraction one half';
|
||||
$string['fractionthreequarters'] = 'fraction three quarters';
|
||||
$string['functionflorin'] = 'function / florin';
|
||||
$string['integral'] = 'integral';
|
||||
$string['narysumation'] = 'n-ary sumation';
|
||||
$string['infinity'] = 'infinity';
|
||||
$string['squareroot'] = 'square root';
|
||||
$string['similarto'] = 'similar to';
|
||||
$string['approximatelyequalto'] = 'approximately equal to';
|
||||
$string['almostequalto'] = 'almost equal to';
|
||||
$string['notequalto'] = 'not equal to';
|
||||
$string['identicalto'] = 'identical to';
|
||||
$string['elementof'] = 'element of';
|
||||
$string['notanelementof'] = 'not an element of';
|
||||
$string['containsasmember'] = 'contains as member';
|
||||
$string['naryproduct'] = 'n-ary product';
|
||||
$string['logicaland'] = 'logical and';
|
||||
$string['logicalor'] = 'logical or';
|
||||
$string['notsign'] = 'not sign';
|
||||
$string['intersection'] = 'intersection';
|
||||
$string['union'] = 'union';
|
||||
$string['partialdifferential'] = 'partial differential';
|
||||
$string['forall'] = 'for all';
|
||||
$string['thereexists'] = 'there exists';
|
||||
$string['diameter'] = 'diameter';
|
||||
$string['backwarddifference'] = 'backward difference';
|
||||
$string['asteriskoperator'] = 'asterisk operator';
|
||||
$string['proportionalto'] = 'proportional to';
|
||||
$string['angle'] = 'angle';
|
||||
$string['acuteaccent'] = 'acute accent';
|
||||
$string['cedilla'] = 'cedilla';
|
||||
$string['feminineordinalindicator'] = 'feminine ordinal indicator';
|
||||
$string['masculineordinalindicator'] = 'masculine ordinal indicator';
|
||||
$string['dagger'] = 'dagger';
|
||||
$string['doubledagger'] = 'double dagger';
|
||||
$string['agrave_caps'] = 'A - grave';
|
||||
$string['aacute_caps'] = 'A - acute';
|
||||
$string['acircumflex_caps'] = 'A - circumflex';
|
||||
$string['atilde_caps'] = 'A - tilde';
|
||||
$string['adiaeresis_caps'] = 'A - diaeresis';
|
||||
$string['aringabove_caps'] = 'A - ring above';
|
||||
$string['ligatureae_caps'] = 'ligature AE';
|
||||
$string['ccedilla_caps'] = 'C - cedilla';
|
||||
$string['egrave_caps'] = 'E - grave';
|
||||
$string['eacute_caps'] = 'E - acute';
|
||||
$string['ecircumflex_caps'] = 'E - circumflex';
|
||||
$string['ediaeresis_caps'] = 'E - diaeresis';
|
||||
$string['igrave_caps'] = 'I - grave';
|
||||
$string['iacute_caps'] = 'I - acute';
|
||||
$string['icircumflex_caps'] = 'I - circumflex';
|
||||
$string['idiaeresis_caps'] = 'I - diaeresis';
|
||||
$string['eth_caps'] = 'ETH';
|
||||
$string['ntilde_caps'] = 'N - tilde';
|
||||
$string['ograve_caps'] = 'O - grave';
|
||||
$string['oacute_caps'] = 'O - acute';
|
||||
$string['ocircumflex_caps'] = 'O - circumflex';
|
||||
$string['otilde_caps'] = 'O - tilde';
|
||||
$string['odiaeresis_caps'] = 'O - diaeresis';
|
||||
$string['oslash_caps'] = 'O - slash';
|
||||
$string['ligatureoe_caps'] = 'ligature OE';
|
||||
$string['scaron_caps'] = 'S - caron';
|
||||
$string['ugrave_caps'] = 'U - grave';
|
||||
$string['uacute_caps'] = 'U - acute';
|
||||
$string['ucircumflex_caps'] = 'U - circumflex';
|
||||
$string['udiaeresis_caps'] = 'U - diaeresis';
|
||||
$string['yacute_caps'] = 'Y - acute';
|
||||
$string['ydiaeresis_caps'] = 'Y - diaeresis';
|
||||
$string['thorn_caps'] = 'THORN';
|
||||
$string['agrave'] = 'a - grave';
|
||||
$string['aacute'] = 'a - acute';
|
||||
$string['acircumflex'] = 'a - circumflex';
|
||||
$string['atilde'] = 'a - tilde';
|
||||
$string['adiaeresis'] = 'a - diaeresis';
|
||||
$string['aringabove'] = 'a - ring above';
|
||||
$string['ligatureae'] = 'ligature ae';
|
||||
$string['ccedilla'] = 'c - cedilla';
|
||||
$string['egrave'] = 'e - grave';
|
||||
$string['eacute'] = 'e - acute';
|
||||
$string['ecircumflex'] = 'e - circumflex';
|
||||
$string['ediaeresis'] = 'e - diaeresis';
|
||||
$string['igrave'] = 'i - grave';
|
||||
$string['iacute'] = 'i - acute';
|
||||
$string['icircumflex'] = 'i - circumflex';
|
||||
$string['idiaeresis'] = 'i - diaeresis';
|
||||
$string['eth'] = 'eth';
|
||||
$string['ntilde'] = 'n - tilde';
|
||||
$string['ograve'] = 'o - grave';
|
||||
$string['oacute'] = 'o - acute';
|
||||
$string['ocircumflex'] = 'o - circumflex';
|
||||
$string['otilde'] = 'o - tilde';
|
||||
$string['odiaeresis'] = 'o - diaeresis';
|
||||
$string['oslash'] = 'o slash';
|
||||
$string['ligatureoe'] = 'ligature oe';
|
||||
$string['scaron'] = 's - caron';
|
||||
$string['ugrave'] = 'u - grave';
|
||||
$string['uacute'] = 'u - acute';
|
||||
$string['ucircumflex'] = 'u - circumflex';
|
||||
$string['udiaeresis'] = 'u - diaeresis';
|
||||
$string['yacute'] = 'y - acute';
|
||||
$string['thorn'] = 'thorn';
|
||||
$string['ydiaeresis'] = 'y - diaeresis';
|
||||
$string['alpha_caps'] = 'Alpha';
|
||||
$string['beta_caps'] = 'Beta';
|
||||
$string['gamma_caps'] = 'Gamma';
|
||||
$string['delta_caps'] = 'Delta';
|
||||
$string['epsilon_caps'] = 'Epsilon';
|
||||
$string['zeta_caps'] = 'Zeta';
|
||||
$string['eta_caps'] = 'Eta';
|
||||
$string['theta_caps'] = 'Theta';
|
||||
$string['iota_caps'] = 'Iota';
|
||||
$string['kappa_caps'] = 'Kappa';
|
||||
$string['lambda_caps'] = 'Lambda';
|
||||
$string['mu_caps'] = 'Mu';
|
||||
$string['nu_caps'] = 'Nu';
|
||||
$string['xi_caps'] = 'Xi';
|
||||
$string['omicron_caps'] = 'Omicron';
|
||||
$string['pi_caps'] = 'Pi';
|
||||
$string['rho_caps'] = 'Rho';
|
||||
$string['sigma_caps'] = 'Sigma';
|
||||
$string['tau_caps'] = 'Tau';
|
||||
$string['upsilon_caps'] = 'Upsilon';
|
||||
$string['phi_caps'] = 'Phi';
|
||||
$string['chi_caps'] = 'Chi';
|
||||
$string['psi_caps'] = 'Psi';
|
||||
$string['omega_caps'] = 'Omega';
|
||||
$string['alpha'] = 'alpha';
|
||||
$string['beta'] = 'beta';
|
||||
$string['gamma'] = 'gamma';
|
||||
$string['delta'] = 'delta';
|
||||
$string['epsilon'] = 'epsilon';
|
||||
$string['zeta'] = 'zeta';
|
||||
$string['eta'] = 'eta';
|
||||
$string['theta'] = 'theta';
|
||||
$string['iota'] = 'iota';
|
||||
$string['kappa'] = 'kappa';
|
||||
$string['lambda'] = 'lambda';
|
||||
$string['mu'] = 'mu';
|
||||
$string['nu'] = 'nu';
|
||||
$string['xi'] = 'xi';
|
||||
$string['omicron'] = 'omicron';
|
||||
$string['pi'] = 'pi';
|
||||
$string['rho'] = 'rho';
|
||||
$string['finalsigma'] = 'final sigma';
|
||||
$string['sigma'] = 'sigma';
|
||||
$string['tau'] = 'tau';
|
||||
$string['upsilon'] = 'upsilon';
|
||||
$string['phi'] = 'phi';
|
||||
$string['chi'] = 'chi';
|
||||
$string['psi'] = 'psi';
|
||||
$string['omega'] = 'omega';
|
||||
$string['alefsymbol'] = 'alef symbol';
|
||||
$string['pisymbol'] = 'pi symbol';
|
||||
$string['realpartsymbol'] = 'real part symbol';
|
||||
$string['thetasymbol'] = 'theta symbol';
|
||||
$string['upsilonhooksymbol'] = 'upsilon - hook symbol';
|
||||
$string['weierstrassp'] = 'Weierstrass p';
|
||||
$string['imaginarypart'] = 'imaginary part';
|
||||
$string['leftwardsarrow'] = 'leftwards arrow';
|
||||
$string['upwardsarrow'] = 'upwards arrow';
|
||||
$string['rightwardsarrow'] = 'rightwards arrow';
|
||||
$string['downwardsarrow'] = 'downwards arrow';
|
||||
$string['leftrightarrow'] = 'left right arrow';
|
||||
$string['carriagereturn'] = 'carriage return';
|
||||
$string['leftwardsdoublearrow'] = 'leftwards double arrow';
|
||||
$string['upwardsdoublearrow'] = 'upwards double arrow';
|
||||
$string['rightwardsdoublearrow'] = 'rightwards double arrow';
|
||||
$string['downwardsdoublearrow'] = 'downwards double arrow';
|
||||
$string['leftrightdoublearrow'] = 'left right double arrow';
|
||||
$string['therefore'] = 'therefore';
|
||||
$string['subsetof'] = 'subset of';
|
||||
$string['supersetof'] = 'superset of';
|
||||
$string['notasubsetof'] = 'not a subset of';
|
||||
$string['subsetoforequalto'] = 'subset of or equal to';
|
||||
$string['supersetoforequalto'] = 'superset of or equal to';
|
||||
$string['circledplus'] = 'circled plus';
|
||||
$string['circledtimes'] = 'circled times';
|
||||
$string['perpendicular'] = 'perpendicular';
|
||||
$string['dotoperator'] = 'dot operator';
|
||||
$string['leftceiling'] = 'left ceiling';
|
||||
$string['rightceiling'] = 'right ceiling';
|
||||
$string['leftfloor'] = 'left floor';
|
||||
$string['rightfloor'] = 'right floor';
|
||||
$string['leftpointinganglebracket'] = 'left-pointing angle bracket';
|
||||
$string['rightpointinganglebracket'] = 'right-pointing angle bracket';
|
||||
$string['lozenge'] = 'lozenge';
|
||||
$string['blackspadesuit'] = 'black spade suit';
|
||||
$string['blackclubsuit'] = 'black club suit';
|
||||
$string['blackheartsuit'] = 'black heart suit';
|
||||
$string['blackdiamondsuit'] = 'black diamond suit';
|
||||
$string['enspace'] = 'en space';
|
||||
$string['emspace'] = 'em space';
|
||||
$string['thinspace'] = 'thin space';
|
||||
$string['zerowidthnonjoiner'] = 'zero width non-joiner';
|
||||
$string['zerowidthjoiner'] = 'zero width joiner';
|
||||
$string['lefttorightmark'] = 'left-to-right mark';
|
||||
$string['righttoleftmark'] = 'right-to-left mark';
|
||||
$string['softhyphen'] = 'soft hyphen';
|
295
lib/editor/atto/plugins/charmap/lib.php
Normal file
295
lib/editor/atto/plugins/charmap/lib.php
Normal file
@ -0,0 +1,295 @@
|
||||
<?php
|
||||
// This file is part of Moodle - http://moodle.org/
|
||||
//
|
||||
// Moodle is free software: you can redistribute it and/or modify
|
||||
// it under the terms of the GNU General Public License as published by
|
||||
// the Free Software Foundation, either version 3 of the License, or
|
||||
// (at your option) any later version.
|
||||
//
|
||||
// Moodle is distributed in the hope that it will be useful,
|
||||
// but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
// GNU General Public License for more details.
|
||||
//
|
||||
// You should have received a copy of the GNU General Public License
|
||||
// along with Moodle. If not, see <http://www.gnu.org/licenses/>.
|
||||
|
||||
/**
|
||||
* Atto text editor charmap plugin lib.
|
||||
*
|
||||
* @package atto_charmap
|
||||
* @copyright 2014 Frédéric Massart
|
||||
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
|
||||
*/
|
||||
|
||||
defined('MOODLE_INTERNAL') || die();
|
||||
|
||||
/**
|
||||
* Initialise the strings required for JS.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
function atto_charmap_strings_for_js() {
|
||||
global $PAGE;
|
||||
|
||||
// In order to prevent extra strings to be imported, comment/uncomment the characters
|
||||
// which are enabled in the JavaScript part of this plugin.
|
||||
$PAGE->requires->strings_for_js(
|
||||
array(
|
||||
'insertcharacter',
|
||||
'nobreakspace',
|
||||
'ampersand',
|
||||
'quotationmark',
|
||||
'centsign',
|
||||
'eurosign',
|
||||
'poundsign',
|
||||
'yensign',
|
||||
'copyrightsign',
|
||||
'registeredsign',
|
||||
'trademarksign',
|
||||
'permillesign',
|
||||
'microsign',
|
||||
'middledot',
|
||||
'bullet',
|
||||
'threedotleader',
|
||||
'minutesfeet',
|
||||
'secondsinches',
|
||||
'sectionsign',
|
||||
'paragraphsign',
|
||||
'sharpsesszed',
|
||||
'singleleftpointinganglequotationmark',
|
||||
'singlerightpointinganglequotationmark',
|
||||
'leftpointingguillemet',
|
||||
'rightpointingguillemet',
|
||||
'leftsinglequotationmark',
|
||||
'rightsinglequotationmark',
|
||||
'leftdoublequotationmark',
|
||||
'rightdoublequotationmark',
|
||||
'singlelow9quotationmark',
|
||||
'doublelow9quotationmark',
|
||||
'lessthansign',
|
||||
'greaterthansign',
|
||||
'lessthanorequalto',
|
||||
'greaterthanorequalto',
|
||||
'endash',
|
||||
'emdash',
|
||||
'macron',
|
||||
'overline',
|
||||
'currencysign',
|
||||
'brokenbar',
|
||||
'diaeresis',
|
||||
'invertedexclamationmark',
|
||||
'turnedquestionmark',
|
||||
'circumflexaccent',
|
||||
'smalltilde',
|
||||
'degreesign',
|
||||
'minussign',
|
||||
'plusminussign',
|
||||
'divisionsign',
|
||||
'fractionslash',
|
||||
'multiplicationsign',
|
||||
'superscriptone',
|
||||
'superscripttwo',
|
||||
'superscriptthree',
|
||||
'fractiononequarter',
|
||||
'fractiononehalf',
|
||||
'fractionthreequarters',
|
||||
'functionflorin',
|
||||
'integral',
|
||||
'narysumation',
|
||||
'infinity',
|
||||
'squareroot',
|
||||
// 'similarto',
|
||||
// 'approximatelyequalto',
|
||||
'almostequalto',
|
||||
'notequalto',
|
||||
'identicalto',
|
||||
// 'elementof',
|
||||
// 'notanelementof',
|
||||
// 'containsasmember',
|
||||
'naryproduct',
|
||||
// 'logicaland',
|
||||
// 'logicalor',
|
||||
'notsign',
|
||||
'intersection',
|
||||
// 'union',
|
||||
'partialdifferential',
|
||||
// 'forall',
|
||||
// 'thereexists',
|
||||
// 'diameter',
|
||||
// 'backwarddifference',
|
||||
// 'asteriskoperator',
|
||||
// 'proportionalto',
|
||||
// 'angle',
|
||||
'acuteaccent',
|
||||
'cedilla',
|
||||
'feminineordinalindicator',
|
||||
'masculineordinalindicator',
|
||||
'dagger',
|
||||
'doubledagger',
|
||||
'agrave_caps',
|
||||
'aacute_caps',
|
||||
'acircumflex_caps',
|
||||
'atilde_caps',
|
||||
'adiaeresis_caps',
|
||||
'aringabove_caps',
|
||||
'ligatureae_caps',
|
||||
'ccedilla_caps',
|
||||
'egrave_caps',
|
||||
'eacute_caps',
|
||||
'ecircumflex_caps',
|
||||
'ediaeresis_caps',
|
||||
'igrave_caps',
|
||||
'iacute_caps',
|
||||
'icircumflex_caps',
|
||||
'idiaeresis_caps',
|
||||
'eth_caps',
|
||||
'ntilde_caps',
|
||||
'ograve_caps',
|
||||
'oacute_caps',
|
||||
'ocircumflex_caps',
|
||||
'otilde_caps',
|
||||
'odiaeresis_caps',
|
||||
'oslash_caps',
|
||||
'ligatureoe_caps',
|
||||
'scaron_caps',
|
||||
'ugrave_caps',
|
||||
'uacute_caps',
|
||||
'ucircumflex_caps',
|
||||
'udiaeresis_caps',
|
||||
'yacute_caps',
|
||||
'ydiaeresis_caps',
|
||||
'thorn_caps',
|
||||
'agrave',
|
||||
'aacute',
|
||||
'acircumflex',
|
||||
'atilde',
|
||||
'adiaeresis',
|
||||
'aringabove',
|
||||
'ligatureae',
|
||||
'ccedilla',
|
||||
'egrave',
|
||||
'eacute',
|
||||
'ecircumflex',
|
||||
'ediaeresis',
|
||||
'igrave',
|
||||
'iacute',
|
||||
'icircumflex',
|
||||
'idiaeresis',
|
||||
'eth',
|
||||
'ntilde',
|
||||
'ograve',
|
||||
'oacute',
|
||||
'ocircumflex',
|
||||
'otilde',
|
||||
'odiaeresis',
|
||||
'oslash',
|
||||
'ligatureoe',
|
||||
'scaron',
|
||||
'ugrave',
|
||||
'uacute',
|
||||
'ucircumflex',
|
||||
'udiaeresis',
|
||||
'yacute',
|
||||
'thorn',
|
||||
'ydiaeresis',
|
||||
'alpha_caps',
|
||||
'beta_caps',
|
||||
'gamma_caps',
|
||||
'delta_caps',
|
||||
'epsilon_caps',
|
||||
'zeta_caps',
|
||||
'eta_caps',
|
||||
'theta_caps',
|
||||
'iota_caps',
|
||||
'kappa_caps',
|
||||
'lambda_caps',
|
||||
'mu_caps',
|
||||
'nu_caps',
|
||||
'xi_caps',
|
||||
'omicron_caps',
|
||||
'pi_caps',
|
||||
'rho_caps',
|
||||
'sigma_caps',
|
||||
'tau_caps',
|
||||
'upsilon_caps',
|
||||
'phi_caps',
|
||||
'chi_caps',
|
||||
'psi_caps',
|
||||
'omega_caps',
|
||||
'alpha',
|
||||
'beta',
|
||||
'gamma',
|
||||
'delta',
|
||||
'epsilon',
|
||||
'zeta',
|
||||
'eta',
|
||||
'theta',
|
||||
'iota',
|
||||
'kappa',
|
||||
'lambda',
|
||||
'mu',
|
||||
'nu',
|
||||
'xi',
|
||||
'omicron',
|
||||
'pi',
|
||||
'rho',
|
||||
'finalsigma',
|
||||
'sigma',
|
||||
'tau',
|
||||
'upsilon',
|
||||
'phi',
|
||||
'chi',
|
||||
'psi',
|
||||
'omega',
|
||||
// 'alefsymbol',
|
||||
// 'pisymbol',
|
||||
// 'realpartsymbol',
|
||||
// 'thetasymbol',
|
||||
// 'upsilonhooksymbol',
|
||||
// 'weierstrassp',
|
||||
// 'imaginarypart',
|
||||
'leftwardsarrow',
|
||||
'upwardsarrow',
|
||||
'rightwardsarrow',
|
||||
'downwardsarrow',
|
||||
'leftrightarrow',
|
||||
// 'carriagereturn',
|
||||
// 'leftwardsdoublearrow',
|
||||
// 'upwardsdoublearrow',
|
||||
// 'rightwardsdoublearrow',
|
||||
// 'downwardsdoublearrow',
|
||||
// 'leftrightdoublearrow',
|
||||
// 'therefore',
|
||||
// 'subsetof',
|
||||
// 'supersetof',
|
||||
// 'notasubsetof',
|
||||
// 'subsetoforequalto',
|
||||
// 'supersetoforequalto',
|
||||
// 'circledplus',
|
||||
// 'circledtimes',
|
||||
// 'perpendicular',
|
||||
// 'dotoperator',
|
||||
// 'leftceiling',
|
||||
// 'rightceiling',
|
||||
// 'leftfloor',
|
||||
// 'rightfloor',
|
||||
// 'leftpointinganglebracket',
|
||||
// 'rightpointinganglebracket',
|
||||
'lozenge',
|
||||
'blackspadesuit',
|
||||
'blackclubsuit',
|
||||
'blackheartsuit',
|
||||
'blackdiamondsuit',
|
||||
// 'enspace',
|
||||
// 'emspace',
|
||||
// 'thinspace',
|
||||
// 'zerowidthnonjoiner',
|
||||
// 'zerowidthjoiner',
|
||||
// 'lefttorightmark',
|
||||
// 'righttoleftmark',
|
||||
// 'softhyphen',
|
||||
),
|
||||
'atto_charmap'
|
||||
);
|
||||
}
|
4
lib/editor/atto/plugins/charmap/styles.css
Normal file
4
lib/editor/atto/plugins/charmap/styles.css
Normal file
@ -0,0 +1,4 @@
|
||||
.atto_charmap_selector button {
|
||||
width: 2em;
|
||||
padding: 0 3px;
|
||||
}
|
29
lib/editor/atto/plugins/charmap/version.php
Normal file
29
lib/editor/atto/plugins/charmap/version.php
Normal file
@ -0,0 +1,29 @@
|
||||
<?php
|
||||
// This file is part of Moodle - http://moodle.org/
|
||||
//
|
||||
// Moodle is free software: you can redistribute it and/or modify
|
||||
// it under the terms of the GNU General Public License as published by
|
||||
// the Free Software Foundation, either version 3 of the License, or
|
||||
// (at your option) any later version.
|
||||
//
|
||||
// Moodle is distributed in the hope that it will be useful,
|
||||
// but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
// GNU General Public License for more details.
|
||||
//
|
||||
// You should have received a copy of the GNU General Public License
|
||||
// along with Moodle. If not, see <http://www.gnu.org/licenses/>.
|
||||
|
||||
/**
|
||||
* Atto text editor charmap plugin version file.
|
||||
*
|
||||
* @package atto_charmap
|
||||
* @copyright 2014 Frédéric Massart
|
||||
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
|
||||
*/
|
||||
|
||||
defined('MOODLE_INTERNAL') || die();
|
||||
|
||||
$plugin->version = 2014013000; // The current plugin version (Date: YYYYMMDDXX).
|
||||
$plugin->requires = 2013110500; // Requires this Moodle version.
|
||||
$plugin->component = 'atto_charmap'; // Full name of the plugin (used for diagnostics).
|
@ -0,0 +1,444 @@
|
||||
YUI.add('moodle-atto_charmap-button', function (Y, NAME) {
|
||||
|
||||
// This file is part of Moodle - http://moodle.org/
|
||||
//
|
||||
// Moodle is free software: you can redistribute it and/or modify
|
||||
// it under the terms of the GNU General Public License as published by
|
||||
// the Free Software Foundation, either version 3 of the License, or
|
||||
// (at your option) any later version.
|
||||
//
|
||||
// Moodle is distributed in the hope that it will be useful,
|
||||
// but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
// GNU General Public License for more details.
|
||||
//
|
||||
// You should have received a copy of the GNU General Public License
|
||||
// along with Moodle. If not, see <http://www.gnu.org/licenses/>.
|
||||
|
||||
/**
|
||||
* Atto text editor charmap plugin.
|
||||
*
|
||||
* @package atto_charmap
|
||||
* @copyright 2014 Frédéric Massart
|
||||
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
|
||||
*/
|
||||
|
||||
/**
|
||||
* CSS classes and IDs.
|
||||
*
|
||||
* @type {Object}
|
||||
*/
|
||||
var CSS = {
|
||||
BUTTON: 'atto_charmap_character',
|
||||
CHARMAP: 'atto_charmap_selector'
|
||||
},
|
||||
/**
|
||||
* Selectors.
|
||||
*
|
||||
* @type {Object}
|
||||
*/
|
||||
SELECTORS = {
|
||||
BUTTON: '.atto_charmap_character'
|
||||
},
|
||||
/**
|
||||
* Map of special characters, kindly borrowed from TinyMCE.
|
||||
*
|
||||
* Each entries contains in order:
|
||||
* - {String} HTML code
|
||||
* - {String} HTML numerical code
|
||||
* - {Boolean} Whether or not to include it in the list
|
||||
* - {String} The language string key
|
||||
*
|
||||
* @type {Array}
|
||||
*/
|
||||
CHARMAP = [
|
||||
[' ', ' ', true, 'nobreakspace'],
|
||||
['&', '&', true, 'ampersand'],
|
||||
['"', '"', true, 'quotationmark'],
|
||||
// Finance.
|
||||
['¢', '¢', true, 'centsign'],
|
||||
['€', '€', true, 'eurosign'],
|
||||
['£', '£', true, 'poundsign'],
|
||||
['¥', '¥', true, 'yensign'],
|
||||
// Signs.
|
||||
['©', '©', true, 'copyrightsign'],
|
||||
['®', '®', true, 'registeredsign'],
|
||||
['™', '™', true, 'trademarksign'],
|
||||
['‰', '‰', true, 'permillesign'],
|
||||
['µ', 'µ', true, 'microsign'],
|
||||
['·', '·', true, 'middledot'],
|
||||
['•', '•', true, 'bullet'],
|
||||
['…', '…', true, 'threedotleader'],
|
||||
['′', '′', true, 'minutesfeet'],
|
||||
['″', '″', true, 'secondsinches'],
|
||||
['§', '§', true, 'sectionsign'],
|
||||
['¶', '¶', true, 'paragraphsign'],
|
||||
['ß', 'ß', true, 'sharpsesszed'],
|
||||
// Quotations.
|
||||
['‹', '‹', true, 'singleleftpointinganglequotationmark'],
|
||||
['›', '›', true, 'singlerightpointinganglequotationmark'],
|
||||
['«', '«', true, 'leftpointingguillemet'],
|
||||
['»', '»', true, 'rightpointingguillemet'],
|
||||
['‘', '‘', true, 'leftsinglequotationmark'],
|
||||
['’', '’', true, 'rightsinglequotationmark'],
|
||||
['“', '“', true, 'leftdoublequotationmark'],
|
||||
['”', '”', true, 'rightdoublequotationmark'],
|
||||
['‚', '‚', true, 'singlelow9quotationmark'],
|
||||
['„', '„', true, 'doublelow9quotationmark'],
|
||||
['<', '<', true, 'lessthansign'],
|
||||
['>', '>', true, 'greaterthansign'],
|
||||
['≤', '≤', true, 'lessthanorequalto'],
|
||||
['≥', '≥', true, 'greaterthanorequalto'],
|
||||
['–', '–', true, 'endash'],
|
||||
['—', '—', true, 'emdash'],
|
||||
['¯', '¯', true, 'macron'],
|
||||
['‾', '‾', true, 'overline'],
|
||||
['¤', '¤', true, 'currencysign'],
|
||||
['¦', '¦', true, 'brokenbar'],
|
||||
['¨', '¨', true, 'diaeresis'],
|
||||
['¡', '¡', true, 'invertedexclamationmark'],
|
||||
['¿', '¿', true, 'turnedquestionmark'],
|
||||
['ˆ', 'ˆ', true, 'circumflexaccent'],
|
||||
['˜', '˜', true, 'smalltilde'],
|
||||
['°', '°', true, 'degreesign'],
|
||||
['−', '−', true, 'minussign'],
|
||||
['±', '±', true, 'plusminussign'],
|
||||
['÷', '÷', true, 'divisionsign'],
|
||||
['⁄', '⁄', true, 'fractionslash'],
|
||||
['×', '×', true, 'multiplicationsign'],
|
||||
['¹', '¹', true, 'superscriptone'],
|
||||
['²', '²', true, 'superscripttwo'],
|
||||
['³', '³', true, 'superscriptthree'],
|
||||
['¼', '¼', true, 'fractiononequarter'],
|
||||
['½', '½', true, 'fractiononehalf'],
|
||||
['¾', '¾', true, 'fractionthreequarters'],
|
||||
// Math / logical.
|
||||
['ƒ', 'ƒ', true, 'functionflorin'],
|
||||
['∫', '∫', true, 'integral'],
|
||||
['∑', '∑', true, 'narysumation'],
|
||||
['∞', '∞', true, 'infinity'],
|
||||
['√', '√', true, 'squareroot'],
|
||||
['∼', '∼', false,'similarto'],
|
||||
['≅', '≅', false,'approximatelyequalto'],
|
||||
['≈', '≈', true, 'almostequalto'],
|
||||
['≠', '≠', true, 'notequalto'],
|
||||
['≡', '≡', true, 'identicalto'],
|
||||
['∈', '∈', false,'elementof'],
|
||||
['∉', '∉', false,'notanelementof'],
|
||||
['∋', '∋', false,'containsasmember'],
|
||||
['∏', '∏', true, 'naryproduct'],
|
||||
['∧', '∧', false,'logicaland'],
|
||||
['∨', '∨', false,'logicalor'],
|
||||
['¬', '¬', true, 'notsign'],
|
||||
['∩', '∩', true, 'intersection'],
|
||||
['∪', '∪', false,'union'],
|
||||
['∂', '∂', true, 'partialdifferential'],
|
||||
['∀', '∀', false,'forall'],
|
||||
['∃', '∃', false,'thereexists'],
|
||||
['∅', '∅', false,'diameter'],
|
||||
['∇', '∇', false,'backwarddifference'],
|
||||
['∗', '∗', false,'asteriskoperator'],
|
||||
['∝', '∝', false,'proportionalto'],
|
||||
['∠', '∠', false,'angle'],
|
||||
// Undefined.
|
||||
['´', '´', true, 'acuteaccent'],
|
||||
['¸', '¸', true, 'cedilla'],
|
||||
['ª', 'ª', true, 'feminineordinalindicator'],
|
||||
['º', 'º', true, 'masculineordinalindicator'],
|
||||
['†', '†', true, 'dagger'],
|
||||
['‡', '‡', true, 'doubledagger'],
|
||||
// Alphabetical special chars.
|
||||
['À', 'À', true, 'agrave_caps'],
|
||||
['Á', 'Á', true, 'aacute_caps'],
|
||||
['Â', 'Â', true, 'acircumflex_caps'],
|
||||
['Ã', 'Ã', true, 'atilde_caps'],
|
||||
['Ä', 'Ä', true, 'adiaeresis_caps'],
|
||||
['Å', 'Å', true, 'aringabove_caps'],
|
||||
['Æ', 'Æ', true, 'ligatureae_caps'],
|
||||
['Ç', 'Ç', true, 'ccedilla_caps'],
|
||||
['È', 'È', true, 'egrave_caps'],
|
||||
['É', 'É', true, 'eacute_caps'],
|
||||
['Ê', 'Ê', true, 'ecircumflex_caps'],
|
||||
['Ë', 'Ë', true, 'ediaeresis_caps'],
|
||||
['Ì', 'Ì', true, 'igrave_caps'],
|
||||
['Í', 'Í', true, 'iacute_caps'],
|
||||
['Î', 'Î', true, 'icircumflex_caps'],
|
||||
['Ï', 'Ï', true, 'idiaeresis_caps'],
|
||||
['Ð', 'Ð', true, 'eth_caps'],
|
||||
['Ñ', 'Ñ', true, 'ntilde_caps'],
|
||||
['Ò', 'Ò', true, 'ograve_caps'],
|
||||
['Ó', 'Ó', true, 'oacute_caps'],
|
||||
['Ô', 'Ô', true, 'ocircumflex_caps'],
|
||||
['Õ', 'Õ', true, 'otilde_caps'],
|
||||
['Ö', 'Ö', true, 'odiaeresis_caps'],
|
||||
['Ø', 'Ø', true, 'oslash_caps'],
|
||||
['Œ', 'Œ', true, 'ligatureoe_caps'],
|
||||
['Š', 'Š', true, 'scaron_caps'],
|
||||
['Ù', 'Ù', true, 'ugrave_caps'],
|
||||
['Ú', 'Ú', true, 'uacute_caps'],
|
||||
['Û', 'Û', true, 'ucircumflex_caps'],
|
||||
['Ü', 'Ü', true, 'udiaeresis_caps'],
|
||||
['Ý', 'Ý', true, 'yacute_caps'],
|
||||
['Ÿ', 'Ÿ', true, 'ydiaeresis_caps'],
|
||||
['Þ', 'Þ', true, 'thorn_caps'],
|
||||
['à', 'à', true, 'agrave'],
|
||||
['á', 'á', true, 'aacute'],
|
||||
['â', 'â', true, 'acircumflex'],
|
||||
['ã', 'ã', true, 'atilde'],
|
||||
['ä', 'ä', true, 'adiaeresis'],
|
||||
['å', 'å', true, 'aringabove'],
|
||||
['æ', 'æ', true, 'ligatureae'],
|
||||
['ç', 'ç', true, 'ccedilla'],
|
||||
['è', 'è', true, 'egrave'],
|
||||
['é', 'é', true, 'eacute'],
|
||||
['ê', 'ê', true, 'ecircumflex'],
|
||||
['ë', 'ë', true, 'ediaeresis'],
|
||||
['ì', 'ì', true, 'igrave'],
|
||||
['í', 'í', true, 'iacute'],
|
||||
['î', 'î', true, 'icircumflex'],
|
||||
['ï', 'ï', true, 'idiaeresis'],
|
||||
['ð', 'ð', true, 'eth'],
|
||||
['ñ', 'ñ', true, 'ntilde'],
|
||||
['ò', 'ò', true, 'ograve'],
|
||||
['ó', 'ó', true, 'oacute'],
|
||||
['ô', 'ô', true, 'ocircumflex'],
|
||||
['õ', 'õ', true, 'otilde'],
|
||||
['ö', 'ö', true, 'odiaeresis'],
|
||||
['ø', 'ø', true, 'oslash'],
|
||||
['œ', 'œ', true, 'ligatureoe'],
|
||||
['š', 'š', true, 'scaron'],
|
||||
['ù', 'ù', true, 'ugrave'],
|
||||
['ú', 'ú', true, 'uacute'],
|
||||
['û', 'û', true, 'ucircumflex'],
|
||||
['ü', 'ü', true, 'udiaeresis'],
|
||||
['ý', 'ý', true, 'yacute'],
|
||||
['þ', 'þ', true, 'thorn'],
|
||||
['ÿ', 'ÿ', true, 'ydiaeresis'],
|
||||
['Α', 'Α', true, 'alpha_caps'],
|
||||
['Β', 'Β', true, 'beta_caps'],
|
||||
['Γ', 'Γ', true, 'gamma_caps'],
|
||||
['Δ', 'Δ', true, 'delta_caps'],
|
||||
['Ε', 'Ε', true, 'epsilon_caps'],
|
||||
['Ζ', 'Ζ', true, 'zeta_caps'],
|
||||
['Η', 'Η', true, 'eta_caps'],
|
||||
['Θ', 'Θ', true, 'theta_caps'],
|
||||
['Ι', 'Ι', true, 'iota_caps'],
|
||||
['Κ', 'Κ', true, 'kappa_caps'],
|
||||
['Λ', 'Λ', true, 'lambda_caps'],
|
||||
['Μ', 'Μ', true, 'mu_caps'],
|
||||
['Ν', 'Ν', true, 'nu_caps'],
|
||||
['Ξ', 'Ξ', true, 'xi_caps'],
|
||||
['Ο', 'Ο', true, 'omicron_caps'],
|
||||
['Π', 'Π', true, 'pi_caps'],
|
||||
['Ρ', 'Ρ', true, 'rho_caps'],
|
||||
['Σ', 'Σ', true, 'sigma_caps'],
|
||||
['Τ', 'Τ', true, 'tau_caps'],
|
||||
['Υ', 'Υ', true, 'upsilon_caps'],
|
||||
['Φ', 'Φ', true, 'phi_caps'],
|
||||
['Χ', 'Χ', true, 'chi_caps'],
|
||||
['Ψ', 'Ψ', true, 'psi_caps'],
|
||||
['Ω', 'Ω', true, 'omega_caps'],
|
||||
['α', 'α', true, 'alpha'],
|
||||
['β', 'β', true, 'beta'],
|
||||
['γ', 'γ', true, 'gamma'],
|
||||
['δ', 'δ', true, 'delta'],
|
||||
['ε', 'ε', true, 'epsilon'],
|
||||
['ζ', 'ζ', true, 'zeta'],
|
||||
['η', 'η', true, 'eta'],
|
||||
['θ', 'θ', true, 'theta'],
|
||||
['ι', 'ι', true, 'iota'],
|
||||
['κ', 'κ', true, 'kappa'],
|
||||
['λ', 'λ', true, 'lambda'],
|
||||
['μ', 'μ', true, 'mu'],
|
||||
['ν', 'ν', true, 'nu'],
|
||||
['ξ', 'ξ', true, 'xi'],
|
||||
['ο', 'ο', true, 'omicron'],
|
||||
['π', 'π', true, 'pi'],
|
||||
['ρ', 'ρ', true, 'rho'],
|
||||
['ς', 'ς', true, 'finalsigma'],
|
||||
['σ', 'σ', true, 'sigma'],
|
||||
['τ', 'τ', true, 'tau'],
|
||||
['υ', 'υ', true, 'upsilon'],
|
||||
['φ', 'φ', true, 'phi'],
|
||||
['χ', 'χ', true, 'chi'],
|
||||
['ψ', 'ψ', true, 'psi'],
|
||||
['ω', 'ω', true, 'omega'],
|
||||
// Symbols.
|
||||
['ℵ', 'ℵ', false,'alefsymbol'],
|
||||
['ϖ', 'ϖ', false,'pisymbol'],
|
||||
['ℜ', 'ℜ', false,'realpartsymbol'],
|
||||
['ϑ','ϑ', false,'thetasymbol'],
|
||||
['ϒ', 'ϒ', false,'upsilonhooksymbol'],
|
||||
['℘', '℘', false,'weierstrassp'],
|
||||
['ℑ', 'ℑ', false,'imaginarypart'],
|
||||
// Arrows.
|
||||
['←', '←', true, 'leftwardsarrow'],
|
||||
['↑', '↑', true, 'upwardsarrow'],
|
||||
['→', '→', true, 'rightwardsarrow'],
|
||||
['↓', '↓', true, 'downwardsarrow'],
|
||||
['↔', '↔', true, 'leftrightarrow'],
|
||||
['↵', '↵', false,'carriagereturn'],
|
||||
['⇐', '⇐', false,'leftwardsdoublearrow'],
|
||||
['⇑', '⇑', false,'upwardsdoublearrow'],
|
||||
['⇒', '⇒', false,'rightwardsdoublearrow'],
|
||||
['⇓', '⇓', false,'downwardsdoublearrow'],
|
||||
['⇔', '⇔', false,'leftrightdoublearrow'],
|
||||
['∴', '∴', false,'therefore'],
|
||||
['⊂', '⊂', false,'subsetof'],
|
||||
['⊃', '⊃', false,'supersetof'],
|
||||
['⊄', '⊄', false,'notasubsetof'],
|
||||
['⊆', '⊆', false,'subsetoforequalto'],
|
||||
['⊇', '⊇', false,'supersetoforequalto'],
|
||||
['⊕', '⊕', false,'circledplus'],
|
||||
['⊗', '⊗', false,'circledtimes'],
|
||||
['⊥', '⊥', false,'perpendicular'],
|
||||
['⋅', '⋅', false,'dotoperator'],
|
||||
['⌈', '⌈', false,'leftceiling'],
|
||||
['⌉', '⌉', false,'rightceiling'],
|
||||
['⌊', '⌊', false,'leftfloor'],
|
||||
['⌋', '⌋', false,'rightfloor'],
|
||||
['⟨', '〈', false,'leftpointinganglebracket'],
|
||||
['⟩', '〉', false,'rightpointinganglebracket'],
|
||||
['◊', '◊', true, 'lozenge'],
|
||||
['♠', '♠', true, 'blackspadesuit'],
|
||||
['♣', '♣', true, 'blackclubsuit'],
|
||||
['♥', '♥', true, 'blackheartsuit'],
|
||||
['♦', '♦', true, 'blackdiamondsuit'],
|
||||
[' ', ' ', false,'enspace'],
|
||||
[' ', ' ', false,'emspace'],
|
||||
[' ', ' ', false,'thinspace'],
|
||||
['‌', '‌', false,'zerowidthnonjoiner'],
|
||||
['‍', '‍', false,'zerowidthjoiner'],
|
||||
['‎', '‎', false,'lefttorightmark'],
|
||||
['‏', '‏', false,'righttoleftmark'],
|
||||
['­', '­', false,'softhyphen']
|
||||
];
|
||||
|
||||
M.atto_charmap = M.atto_charmap || {
|
||||
|
||||
/**
|
||||
* The ID of the current editor.
|
||||
*
|
||||
* @type {String}
|
||||
*/
|
||||
currentElementId: null,
|
||||
|
||||
/**
|
||||
* The dialogue to select a character.
|
||||
*
|
||||
* @type {M.core.dialogue}
|
||||
*/
|
||||
dialogue: null,
|
||||
|
||||
/**
|
||||
* Keeps track of the selection made by the user.
|
||||
*
|
||||
* @type {Mixed}
|
||||
*/
|
||||
selection: null,
|
||||
|
||||
/**
|
||||
* Init.
|
||||
*
|
||||
* @param {Object} params
|
||||
*
|
||||
* @return {Void}
|
||||
*/
|
||||
init: function(params) {
|
||||
|
||||
var display_chooser = function(e, elementid) {
|
||||
e.preventDefault();
|
||||
if (!M.editor_atto.is_active(elementid)) {
|
||||
M.editor_atto.focus(elementid);
|
||||
}
|
||||
M.atto_charmap.selection = M.editor_atto.get_selection();
|
||||
if (M.atto_charmap.selection === false) {
|
||||
return;
|
||||
}
|
||||
|
||||
// Stores what editor we are working on.
|
||||
M.atto_charmap.currentElementId = elementid;
|
||||
|
||||
// Initialising the dialogue.
|
||||
var dialogue;
|
||||
if (!M.atto_charmap.dialogue) {
|
||||
dialogue = new M.core.dialogue({
|
||||
visible: false,
|
||||
modal: true,
|
||||
close: true,
|
||||
draggable: true
|
||||
});
|
||||
|
||||
// Setting up the content of the dialogue.
|
||||
dialogue.set('bodyContent', M.atto_charmap.getDialogueContent());
|
||||
dialogue.set('headerContent', M.util.get_string('insertcharacter', 'atto_charmap'));
|
||||
dialogue.render();
|
||||
dialogue.centerDialogue();
|
||||
M.atto_charmap.dialogue = dialogue;
|
||||
} else {
|
||||
dialogue = M.atto_charmap.dialogue;
|
||||
}
|
||||
|
||||
dialogue.show();
|
||||
};
|
||||
|
||||
var iconurl = M.util.image_url('e/special_character', 'core');
|
||||
M.editor_atto.add_toolbar_button(params.elementid, 'charmap', iconurl, params.group, display_chooser);
|
||||
},
|
||||
|
||||
/**
|
||||
* Generates the content of the dialogue.
|
||||
*
|
||||
* @return {Node} Node containing the dialogue content
|
||||
*/
|
||||
getDialogueContent: function() {
|
||||
var content,
|
||||
html = '<div class="' + CSS.CHARMAP + '">',
|
||||
i;
|
||||
|
||||
for (i = 0; i < CHARMAP.length; i++) {
|
||||
if (!CHARMAP[i][2]) {
|
||||
continue;
|
||||
}
|
||||
html += '<button class="' + CSS.BUTTON + '" ' +
|
||||
'aria-label="' + Y.Escape.html(M.util.get_string(CHARMAP[i][3], 'atto_charmap')) + '" ' +
|
||||
'title="' + Y.Escape.html(M.util.get_string(CHARMAP[i][3], 'atto_charmap')) + '" ' +
|
||||
'data-character="' + CHARMAP[i][0] + '" ' +
|
||||
'>' +
|
||||
CHARMAP[i][0] +
|
||||
'</button>';
|
||||
}
|
||||
html += '</div>';
|
||||
|
||||
content = Y.Node.create(html);
|
||||
Y.delegate('click', M.atto_charmap.insertChar, content, SELECTORS.BUTTON, this);
|
||||
return content;
|
||||
},
|
||||
|
||||
/**
|
||||
* Insert the picked character in Atto.
|
||||
*
|
||||
* @param {Event} e The event
|
||||
* @return {Void}
|
||||
*/
|
||||
insertChar: function(e) {
|
||||
var character = e.target.getData('character');
|
||||
|
||||
e.preventDefault();
|
||||
e.stopPropagation();
|
||||
M.atto_charmap.dialogue.hide();
|
||||
|
||||
M.editor_atto.set_selection(M.atto_charmap.selection);
|
||||
if (document.selection && document.selection.createRange().pasteHTML) {
|
||||
document.selection.createRange().pasteHTML(character);
|
||||
} else {
|
||||
document.execCommand('insertHTML', false, character);
|
||||
}
|
||||
|
||||
// Clean the YUI ids from the HTML.
|
||||
M.editor_atto.text_updated(M.atto_charmap.currentElementId);
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
}, '@VERSION@', {"requires": ["node", "escape"]});
|
File diff suppressed because one or more lines are too long
444
lib/editor/atto/plugins/charmap/yui/build/moodle-atto_charmap-button/moodle-atto_charmap-button.js
vendored
Normal file
444
lib/editor/atto/plugins/charmap/yui/build/moodle-atto_charmap-button/moodle-atto_charmap-button.js
vendored
Normal file
@ -0,0 +1,444 @@
|
||||
YUI.add('moodle-atto_charmap-button', function (Y, NAME) {
|
||||
|
||||
// This file is part of Moodle - http://moodle.org/
|
||||
//
|
||||
// Moodle is free software: you can redistribute it and/or modify
|
||||
// it under the terms of the GNU General Public License as published by
|
||||
// the Free Software Foundation, either version 3 of the License, or
|
||||
// (at your option) any later version.
|
||||
//
|
||||
// Moodle is distributed in the hope that it will be useful,
|
||||
// but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
// GNU General Public License for more details.
|
||||
//
|
||||
// You should have received a copy of the GNU General Public License
|
||||
// along with Moodle. If not, see <http://www.gnu.org/licenses/>.
|
||||
|
||||
/**
|
||||
* Atto text editor charmap plugin.
|
||||
*
|
||||
* @package atto_charmap
|
||||
* @copyright 2014 Frédéric Massart
|
||||
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
|
||||
*/
|
||||
|
||||
/**
|
||||
* CSS classes and IDs.
|
||||
*
|
||||
* @type {Object}
|
||||
*/
|
||||
var CSS = {
|
||||
BUTTON: 'atto_charmap_character',
|
||||
CHARMAP: 'atto_charmap_selector'
|
||||
},
|
||||
/**
|
||||
* Selectors.
|
||||
*
|
||||
* @type {Object}
|
||||
*/
|
||||
SELECTORS = {
|
||||
BUTTON: '.atto_charmap_character'
|
||||
},
|
||||
/**
|
||||
* Map of special characters, kindly borrowed from TinyMCE.
|
||||
*
|
||||
* Each entries contains in order:
|
||||
* - {String} HTML code
|
||||
* - {String} HTML numerical code
|
||||
* - {Boolean} Whether or not to include it in the list
|
||||
* - {String} The language string key
|
||||
*
|
||||
* @type {Array}
|
||||
*/
|
||||
CHARMAP = [
|
||||
[' ', ' ', true, 'nobreakspace'],
|
||||
['&', '&', true, 'ampersand'],
|
||||
['"', '"', true, 'quotationmark'],
|
||||
// Finance.
|
||||
['¢', '¢', true, 'centsign'],
|
||||
['€', '€', true, 'eurosign'],
|
||||
['£', '£', true, 'poundsign'],
|
||||
['¥', '¥', true, 'yensign'],
|
||||
// Signs.
|
||||
['©', '©', true, 'copyrightsign'],
|
||||
['®', '®', true, 'registeredsign'],
|
||||
['™', '™', true, 'trademarksign'],
|
||||
['‰', '‰', true, 'permillesign'],
|
||||
['µ', 'µ', true, 'microsign'],
|
||||
['·', '·', true, 'middledot'],
|
||||
['•', '•', true, 'bullet'],
|
||||
['…', '…', true, 'threedotleader'],
|
||||
['′', '′', true, 'minutesfeet'],
|
||||
['″', '″', true, 'secondsinches'],
|
||||
['§', '§', true, 'sectionsign'],
|
||||
['¶', '¶', true, 'paragraphsign'],
|
||||
['ß', 'ß', true, 'sharpsesszed'],
|
||||
// Quotations.
|
||||
['‹', '‹', true, 'singleleftpointinganglequotationmark'],
|
||||
['›', '›', true, 'singlerightpointinganglequotationmark'],
|
||||
['«', '«', true, 'leftpointingguillemet'],
|
||||
['»', '»', true, 'rightpointingguillemet'],
|
||||
['‘', '‘', true, 'leftsinglequotationmark'],
|
||||
['’', '’', true, 'rightsinglequotationmark'],
|
||||
['“', '“', true, 'leftdoublequotationmark'],
|
||||
['”', '”', true, 'rightdoublequotationmark'],
|
||||
['‚', '‚', true, 'singlelow9quotationmark'],
|
||||
['„', '„', true, 'doublelow9quotationmark'],
|
||||
['<', '<', true, 'lessthansign'],
|
||||
['>', '>', true, 'greaterthansign'],
|
||||
['≤', '≤', true, 'lessthanorequalto'],
|
||||
['≥', '≥', true, 'greaterthanorequalto'],
|
||||
['–', '–', true, 'endash'],
|
||||
['—', '—', true, 'emdash'],
|
||||
['¯', '¯', true, 'macron'],
|
||||
['‾', '‾', true, 'overline'],
|
||||
['¤', '¤', true, 'currencysign'],
|
||||
['¦', '¦', true, 'brokenbar'],
|
||||
['¨', '¨', true, 'diaeresis'],
|
||||
['¡', '¡', true, 'invertedexclamationmark'],
|
||||
['¿', '¿', true, 'turnedquestionmark'],
|
||||
['ˆ', 'ˆ', true, 'circumflexaccent'],
|
||||
['˜', '˜', true, 'smalltilde'],
|
||||
['°', '°', true, 'degreesign'],
|
||||
['−', '−', true, 'minussign'],
|
||||
['±', '±', true, 'plusminussign'],
|
||||
['÷', '÷', true, 'divisionsign'],
|
||||
['⁄', '⁄', true, 'fractionslash'],
|
||||
['×', '×', true, 'multiplicationsign'],
|
||||
['¹', '¹', true, 'superscriptone'],
|
||||
['²', '²', true, 'superscripttwo'],
|
||||
['³', '³', true, 'superscriptthree'],
|
||||
['¼', '¼', true, 'fractiononequarter'],
|
||||
['½', '½', true, 'fractiononehalf'],
|
||||
['¾', '¾', true, 'fractionthreequarters'],
|
||||
// Math / logical.
|
||||
['ƒ', 'ƒ', true, 'functionflorin'],
|
||||
['∫', '∫', true, 'integral'],
|
||||
['∑', '∑', true, 'narysumation'],
|
||||
['∞', '∞', true, 'infinity'],
|
||||
['√', '√', true, 'squareroot'],
|
||||
['∼', '∼', false,'similarto'],
|
||||
['≅', '≅', false,'approximatelyequalto'],
|
||||
['≈', '≈', true, 'almostequalto'],
|
||||
['≠', '≠', true, 'notequalto'],
|
||||
['≡', '≡', true, 'identicalto'],
|
||||
['∈', '∈', false,'elementof'],
|
||||
['∉', '∉', false,'notanelementof'],
|
||||
['∋', '∋', false,'containsasmember'],
|
||||
['∏', '∏', true, 'naryproduct'],
|
||||
['∧', '∧', false,'logicaland'],
|
||||
['∨', '∨', false,'logicalor'],
|
||||
['¬', '¬', true, 'notsign'],
|
||||
['∩', '∩', true, 'intersection'],
|
||||
['∪', '∪', false,'union'],
|
||||
['∂', '∂', true, 'partialdifferential'],
|
||||
['∀', '∀', false,'forall'],
|
||||
['∃', '∃', false,'thereexists'],
|
||||
['∅', '∅', false,'diameter'],
|
||||
['∇', '∇', false,'backwarddifference'],
|
||||
['∗', '∗', false,'asteriskoperator'],
|
||||
['∝', '∝', false,'proportionalto'],
|
||||
['∠', '∠', false,'angle'],
|
||||
// Undefined.
|
||||
['´', '´', true, 'acuteaccent'],
|
||||
['¸', '¸', true, 'cedilla'],
|
||||
['ª', 'ª', true, 'feminineordinalindicator'],
|
||||
['º', 'º', true, 'masculineordinalindicator'],
|
||||
['†', '†', true, 'dagger'],
|
||||
['‡', '‡', true, 'doubledagger'],
|
||||
// Alphabetical special chars.
|
||||
['À', 'À', true, 'agrave_caps'],
|
||||
['Á', 'Á', true, 'aacute_caps'],
|
||||
['Â', 'Â', true, 'acircumflex_caps'],
|
||||
['Ã', 'Ã', true, 'atilde_caps'],
|
||||
['Ä', 'Ä', true, 'adiaeresis_caps'],
|
||||
['Å', 'Å', true, 'aringabove_caps'],
|
||||
['Æ', 'Æ', true, 'ligatureae_caps'],
|
||||
['Ç', 'Ç', true, 'ccedilla_caps'],
|
||||
['È', 'È', true, 'egrave_caps'],
|
||||
['É', 'É', true, 'eacute_caps'],
|
||||
['Ê', 'Ê', true, 'ecircumflex_caps'],
|
||||
['Ë', 'Ë', true, 'ediaeresis_caps'],
|
||||
['Ì', 'Ì', true, 'igrave_caps'],
|
||||
['Í', 'Í', true, 'iacute_caps'],
|
||||
['Î', 'Î', true, 'icircumflex_caps'],
|
||||
['Ï', 'Ï', true, 'idiaeresis_caps'],
|
||||
['Ð', 'Ð', true, 'eth_caps'],
|
||||
['Ñ', 'Ñ', true, 'ntilde_caps'],
|
||||
['Ò', 'Ò', true, 'ograve_caps'],
|
||||
['Ó', 'Ó', true, 'oacute_caps'],
|
||||
['Ô', 'Ô', true, 'ocircumflex_caps'],
|
||||
['Õ', 'Õ', true, 'otilde_caps'],
|
||||
['Ö', 'Ö', true, 'odiaeresis_caps'],
|
||||
['Ø', 'Ø', true, 'oslash_caps'],
|
||||
['Œ', 'Œ', true, 'ligatureoe_caps'],
|
||||
['Š', 'Š', true, 'scaron_caps'],
|
||||
['Ù', 'Ù', true, 'ugrave_caps'],
|
||||
['Ú', 'Ú', true, 'uacute_caps'],
|
||||
['Û', 'Û', true, 'ucircumflex_caps'],
|
||||
['Ü', 'Ü', true, 'udiaeresis_caps'],
|
||||
['Ý', 'Ý', true, 'yacute_caps'],
|
||||
['Ÿ', 'Ÿ', true, 'ydiaeresis_caps'],
|
||||
['Þ', 'Þ', true, 'thorn_caps'],
|
||||
['à', 'à', true, 'agrave'],
|
||||
['á', 'á', true, 'aacute'],
|
||||
['â', 'â', true, 'acircumflex'],
|
||||
['ã', 'ã', true, 'atilde'],
|
||||
['ä', 'ä', true, 'adiaeresis'],
|
||||
['å', 'å', true, 'aringabove'],
|
||||
['æ', 'æ', true, 'ligatureae'],
|
||||
['ç', 'ç', true, 'ccedilla'],
|
||||
['è', 'è', true, 'egrave'],
|
||||
['é', 'é', true, 'eacute'],
|
||||
['ê', 'ê', true, 'ecircumflex'],
|
||||
['ë', 'ë', true, 'ediaeresis'],
|
||||
['ì', 'ì', true, 'igrave'],
|
||||
['í', 'í', true, 'iacute'],
|
||||
['î', 'î', true, 'icircumflex'],
|
||||
['ï', 'ï', true, 'idiaeresis'],
|
||||
['ð', 'ð', true, 'eth'],
|
||||
['ñ', 'ñ', true, 'ntilde'],
|
||||
['ò', 'ò', true, 'ograve'],
|
||||
['ó', 'ó', true, 'oacute'],
|
||||
['ô', 'ô', true, 'ocircumflex'],
|
||||
['õ', 'õ', true, 'otilde'],
|
||||
['ö', 'ö', true, 'odiaeresis'],
|
||||
['ø', 'ø', true, 'oslash'],
|
||||
['œ', 'œ', true, 'ligatureoe'],
|
||||
['š', 'š', true, 'scaron'],
|
||||
['ù', 'ù', true, 'ugrave'],
|
||||
['ú', 'ú', true, 'uacute'],
|
||||
['û', 'û', true, 'ucircumflex'],
|
||||
['ü', 'ü', true, 'udiaeresis'],
|
||||
['ý', 'ý', true, 'yacute'],
|
||||
['þ', 'þ', true, 'thorn'],
|
||||
['ÿ', 'ÿ', true, 'ydiaeresis'],
|
||||
['Α', 'Α', true, 'alpha_caps'],
|
||||
['Β', 'Β', true, 'beta_caps'],
|
||||
['Γ', 'Γ', true, 'gamma_caps'],
|
||||
['Δ', 'Δ', true, 'delta_caps'],
|
||||
['Ε', 'Ε', true, 'epsilon_caps'],
|
||||
['Ζ', 'Ζ', true, 'zeta_caps'],
|
||||
['Η', 'Η', true, 'eta_caps'],
|
||||
['Θ', 'Θ', true, 'theta_caps'],
|
||||
['Ι', 'Ι', true, 'iota_caps'],
|
||||
['Κ', 'Κ', true, 'kappa_caps'],
|
||||
['Λ', 'Λ', true, 'lambda_caps'],
|
||||
['Μ', 'Μ', true, 'mu_caps'],
|
||||
['Ν', 'Ν', true, 'nu_caps'],
|
||||
['Ξ', 'Ξ', true, 'xi_caps'],
|
||||
['Ο', 'Ο', true, 'omicron_caps'],
|
||||
['Π', 'Π', true, 'pi_caps'],
|
||||
['Ρ', 'Ρ', true, 'rho_caps'],
|
||||
['Σ', 'Σ', true, 'sigma_caps'],
|
||||
['Τ', 'Τ', true, 'tau_caps'],
|
||||
['Υ', 'Υ', true, 'upsilon_caps'],
|
||||
['Φ', 'Φ', true, 'phi_caps'],
|
||||
['Χ', 'Χ', true, 'chi_caps'],
|
||||
['Ψ', 'Ψ', true, 'psi_caps'],
|
||||
['Ω', 'Ω', true, 'omega_caps'],
|
||||
['α', 'α', true, 'alpha'],
|
||||
['β', 'β', true, 'beta'],
|
||||
['γ', 'γ', true, 'gamma'],
|
||||
['δ', 'δ', true, 'delta'],
|
||||
['ε', 'ε', true, 'epsilon'],
|
||||
['ζ', 'ζ', true, 'zeta'],
|
||||
['η', 'η', true, 'eta'],
|
||||
['θ', 'θ', true, 'theta'],
|
||||
['ι', 'ι', true, 'iota'],
|
||||
['κ', 'κ', true, 'kappa'],
|
||||
['λ', 'λ', true, 'lambda'],
|
||||
['μ', 'μ', true, 'mu'],
|
||||
['ν', 'ν', true, 'nu'],
|
||||
['ξ', 'ξ', true, 'xi'],
|
||||
['ο', 'ο', true, 'omicron'],
|
||||
['π', 'π', true, 'pi'],
|
||||
['ρ', 'ρ', true, 'rho'],
|
||||
['ς', 'ς', true, 'finalsigma'],
|
||||
['σ', 'σ', true, 'sigma'],
|
||||
['τ', 'τ', true, 'tau'],
|
||||
['υ', 'υ', true, 'upsilon'],
|
||||
['φ', 'φ', true, 'phi'],
|
||||
['χ', 'χ', true, 'chi'],
|
||||
['ψ', 'ψ', true, 'psi'],
|
||||
['ω', 'ω', true, 'omega'],
|
||||
// Symbols.
|
||||
['ℵ', 'ℵ', false,'alefsymbol'],
|
||||
['ϖ', 'ϖ', false,'pisymbol'],
|
||||
['ℜ', 'ℜ', false,'realpartsymbol'],
|
||||
['ϑ','ϑ', false,'thetasymbol'],
|
||||
['ϒ', 'ϒ', false,'upsilonhooksymbol'],
|
||||
['℘', '℘', false,'weierstrassp'],
|
||||
['ℑ', 'ℑ', false,'imaginarypart'],
|
||||
// Arrows.
|
||||
['←', '←', true, 'leftwardsarrow'],
|
||||
['↑', '↑', true, 'upwardsarrow'],
|
||||
['→', '→', true, 'rightwardsarrow'],
|
||||
['↓', '↓', true, 'downwardsarrow'],
|
||||
['↔', '↔', true, 'leftrightarrow'],
|
||||
['↵', '↵', false,'carriagereturn'],
|
||||
['⇐', '⇐', false,'leftwardsdoublearrow'],
|
||||
['⇑', '⇑', false,'upwardsdoublearrow'],
|
||||
['⇒', '⇒', false,'rightwardsdoublearrow'],
|
||||
['⇓', '⇓', false,'downwardsdoublearrow'],
|
||||
['⇔', '⇔', false,'leftrightdoublearrow'],
|
||||
['∴', '∴', false,'therefore'],
|
||||
['⊂', '⊂', false,'subsetof'],
|
||||
['⊃', '⊃', false,'supersetof'],
|
||||
['⊄', '⊄', false,'notasubsetof'],
|
||||
['⊆', '⊆', false,'subsetoforequalto'],
|
||||
['⊇', '⊇', false,'supersetoforequalto'],
|
||||
['⊕', '⊕', false,'circledplus'],
|
||||
['⊗', '⊗', false,'circledtimes'],
|
||||
['⊥', '⊥', false,'perpendicular'],
|
||||
['⋅', '⋅', false,'dotoperator'],
|
||||
['⌈', '⌈', false,'leftceiling'],
|
||||
['⌉', '⌉', false,'rightceiling'],
|
||||
['⌊', '⌊', false,'leftfloor'],
|
||||
['⌋', '⌋', false,'rightfloor'],
|
||||
['⟨', '〈', false,'leftpointinganglebracket'],
|
||||
['⟩', '〉', false,'rightpointinganglebracket'],
|
||||
['◊', '◊', true, 'lozenge'],
|
||||
['♠', '♠', true, 'blackspadesuit'],
|
||||
['♣', '♣', true, 'blackclubsuit'],
|
||||
['♥', '♥', true, 'blackheartsuit'],
|
||||
['♦', '♦', true, 'blackdiamondsuit'],
|
||||
[' ', ' ', false,'enspace'],
|
||||
[' ', ' ', false,'emspace'],
|
||||
[' ', ' ', false,'thinspace'],
|
||||
['‌', '‌', false,'zerowidthnonjoiner'],
|
||||
['‍', '‍', false,'zerowidthjoiner'],
|
||||
['‎', '‎', false,'lefttorightmark'],
|
||||
['‏', '‏', false,'righttoleftmark'],
|
||||
['­', '­', false,'softhyphen']
|
||||
];
|
||||
|
||||
M.atto_charmap = M.atto_charmap || {
|
||||
|
||||
/**
|
||||
* The ID of the current editor.
|
||||
*
|
||||
* @type {String}
|
||||
*/
|
||||
currentElementId: null,
|
||||
|
||||
/**
|
||||
* The dialogue to select a character.
|
||||
*
|
||||
* @type {M.core.dialogue}
|
||||
*/
|
||||
dialogue: null,
|
||||
|
||||
/**
|
||||
* Keeps track of the selection made by the user.
|
||||
*
|
||||
* @type {Mixed}
|
||||
*/
|
||||
selection: null,
|
||||
|
||||
/**
|
||||
* Init.
|
||||
*
|
||||
* @param {Object} params
|
||||
*
|
||||
* @return {Void}
|
||||
*/
|
||||
init: function(params) {
|
||||
|
||||
var display_chooser = function(e, elementid) {
|
||||
e.preventDefault();
|
||||
if (!M.editor_atto.is_active(elementid)) {
|
||||
M.editor_atto.focus(elementid);
|
||||
}
|
||||
M.atto_charmap.selection = M.editor_atto.get_selection();
|
||||
if (M.atto_charmap.selection === false) {
|
||||
return;
|
||||
}
|
||||
|
||||
// Stores what editor we are working on.
|
||||
M.atto_charmap.currentElementId = elementid;
|
||||
|
||||
// Initialising the dialogue.
|
||||
var dialogue;
|
||||
if (!M.atto_charmap.dialogue) {
|
||||
dialogue = new M.core.dialogue({
|
||||
visible: false,
|
||||
modal: true,
|
||||
close: true,
|
||||
draggable: true
|
||||
});
|
||||
|
||||
// Setting up the content of the dialogue.
|
||||
dialogue.set('bodyContent', M.atto_charmap.getDialogueContent());
|
||||
dialogue.set('headerContent', M.util.get_string('insertcharacter', 'atto_charmap'));
|
||||
dialogue.render();
|
||||
dialogue.centerDialogue();
|
||||
M.atto_charmap.dialogue = dialogue;
|
||||
} else {
|
||||
dialogue = M.atto_charmap.dialogue;
|
||||
}
|
||||
|
||||
dialogue.show();
|
||||
};
|
||||
|
||||
var iconurl = M.util.image_url('e/special_character', 'core');
|
||||
M.editor_atto.add_toolbar_button(params.elementid, 'charmap', iconurl, params.group, display_chooser);
|
||||
},
|
||||
|
||||
/**
|
||||
* Generates the content of the dialogue.
|
||||
*
|
||||
* @return {Node} Node containing the dialogue content
|
||||
*/
|
||||
getDialogueContent: function() {
|
||||
var content,
|
||||
html = '<div class="' + CSS.CHARMAP + '">',
|
||||
i;
|
||||
|
||||
for (i = 0; i < CHARMAP.length; i++) {
|
||||
if (!CHARMAP[i][2]) {
|
||||
continue;
|
||||
}
|
||||
html += '<button class="' + CSS.BUTTON + '" ' +
|
||||
'aria-label="' + Y.Escape.html(M.util.get_string(CHARMAP[i][3], 'atto_charmap')) + '" ' +
|
||||
'title="' + Y.Escape.html(M.util.get_string(CHARMAP[i][3], 'atto_charmap')) + '" ' +
|
||||
'data-character="' + CHARMAP[i][0] + '" ' +
|
||||
'>' +
|
||||
CHARMAP[i][0] +
|
||||
'</button>';
|
||||
}
|
||||
html += '</div>';
|
||||
|
||||
content = Y.Node.create(html);
|
||||
Y.delegate('click', M.atto_charmap.insertChar, content, SELECTORS.BUTTON, this);
|
||||
return content;
|
||||
},
|
||||
|
||||
/**
|
||||
* Insert the picked character in Atto.
|
||||
*
|
||||
* @param {Event} e The event
|
||||
* @return {Void}
|
||||
*/
|
||||
insertChar: function(e) {
|
||||
var character = e.target.getData('character');
|
||||
|
||||
e.preventDefault();
|
||||
e.stopPropagation();
|
||||
M.atto_charmap.dialogue.hide();
|
||||
|
||||
M.editor_atto.set_selection(M.atto_charmap.selection);
|
||||
if (document.selection && document.selection.createRange().pasteHTML) {
|
||||
document.selection.createRange().pasteHTML(character);
|
||||
} else {
|
||||
document.execCommand('insertHTML', false, character);
|
||||
}
|
||||
|
||||
// Clean the YUI ids from the HTML.
|
||||
M.editor_atto.text_updated(M.atto_charmap.currentElementId);
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
}, '@VERSION@', {"requires": ["node", "escape"]});
|
10
lib/editor/atto/plugins/charmap/yui/src/button/build.json
Normal file
10
lib/editor/atto/plugins/charmap/yui/src/button/build.json
Normal file
@ -0,0 +1,10 @@
|
||||
{
|
||||
"name": "moodle-atto_charmap-button",
|
||||
"builds": {
|
||||
"moodle-atto_charmap-button": {
|
||||
"jsfiles": [
|
||||
"button.js"
|
||||
]
|
||||
}
|
||||
}
|
||||
}
|
439
lib/editor/atto/plugins/charmap/yui/src/button/js/button.js
vendored
Normal file
439
lib/editor/atto/plugins/charmap/yui/src/button/js/button.js
vendored
Normal file
@ -0,0 +1,439 @@
|
||||
// This file is part of Moodle - http://moodle.org/
|
||||
//
|
||||
// Moodle is free software: you can redistribute it and/or modify
|
||||
// it under the terms of the GNU General Public License as published by
|
||||
// the Free Software Foundation, either version 3 of the License, or
|
||||
// (at your option) any later version.
|
||||
//
|
||||
// Moodle is distributed in the hope that it will be useful,
|
||||
// but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
// GNU General Public License for more details.
|
||||
//
|
||||
// You should have received a copy of the GNU General Public License
|
||||
// along with Moodle. If not, see <http://www.gnu.org/licenses/>.
|
||||
|
||||
/**
|
||||
* Atto text editor charmap plugin.
|
||||
*
|
||||
* @package atto_charmap
|
||||
* @copyright 2014 Frédéric Massart
|
||||
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
|
||||
*/
|
||||
|
||||
/**
|
||||
* CSS classes and IDs.
|
||||
*
|
||||
* @type {Object}
|
||||
*/
|
||||
var CSS = {
|
||||
BUTTON: 'atto_charmap_character',
|
||||
CHARMAP: 'atto_charmap_selector'
|
||||
},
|
||||
/**
|
||||
* Selectors.
|
||||
*
|
||||
* @type {Object}
|
||||
*/
|
||||
SELECTORS = {
|
||||
BUTTON: '.atto_charmap_character'
|
||||
},
|
||||
/**
|
||||
* Map of special characters, kindly borrowed from TinyMCE.
|
||||
*
|
||||
* Each entries contains in order:
|
||||
* - {String} HTML code
|
||||
* - {String} HTML numerical code
|
||||
* - {Boolean} Whether or not to include it in the list
|
||||
* - {String} The language string key
|
||||
*
|
||||
* @type {Array}
|
||||
*/
|
||||
CHARMAP = [
|
||||
[' ', ' ', true, 'nobreakspace'],
|
||||
['&', '&', true, 'ampersand'],
|
||||
['"', '"', true, 'quotationmark'],
|
||||
// Finance.
|
||||
['¢', '¢', true, 'centsign'],
|
||||
['€', '€', true, 'eurosign'],
|
||||
['£', '£', true, 'poundsign'],
|
||||
['¥', '¥', true, 'yensign'],
|
||||
// Signs.
|
||||
['©', '©', true, 'copyrightsign'],
|
||||
['®', '®', true, 'registeredsign'],
|
||||
['™', '™', true, 'trademarksign'],
|
||||
['‰', '‰', true, 'permillesign'],
|
||||
['µ', 'µ', true, 'microsign'],
|
||||
['·', '·', true, 'middledot'],
|
||||
['•', '•', true, 'bullet'],
|
||||
['…', '…', true, 'threedotleader'],
|
||||
['′', '′', true, 'minutesfeet'],
|
||||
['″', '″', true, 'secondsinches'],
|
||||
['§', '§', true, 'sectionsign'],
|
||||
['¶', '¶', true, 'paragraphsign'],
|
||||
['ß', 'ß', true, 'sharpsesszed'],
|
||||
// Quotations.
|
||||
['‹', '‹', true, 'singleleftpointinganglequotationmark'],
|
||||
['›', '›', true, 'singlerightpointinganglequotationmark'],
|
||||
['«', '«', true, 'leftpointingguillemet'],
|
||||
['»', '»', true, 'rightpointingguillemet'],
|
||||
['‘', '‘', true, 'leftsinglequotationmark'],
|
||||
['’', '’', true, 'rightsinglequotationmark'],
|
||||
['“', '“', true, 'leftdoublequotationmark'],
|
||||
['”', '”', true, 'rightdoublequotationmark'],
|
||||
['‚', '‚', true, 'singlelow9quotationmark'],
|
||||
['„', '„', true, 'doublelow9quotationmark'],
|
||||
['<', '<', true, 'lessthansign'],
|
||||
['>', '>', true, 'greaterthansign'],
|
||||
['≤', '≤', true, 'lessthanorequalto'],
|
||||
['≥', '≥', true, 'greaterthanorequalto'],
|
||||
['–', '–', true, 'endash'],
|
||||
['—', '—', true, 'emdash'],
|
||||
['¯', '¯', true, 'macron'],
|
||||
['‾', '‾', true, 'overline'],
|
||||
['¤', '¤', true, 'currencysign'],
|
||||
['¦', '¦', true, 'brokenbar'],
|
||||
['¨', '¨', true, 'diaeresis'],
|
||||
['¡', '¡', true, 'invertedexclamationmark'],
|
||||
['¿', '¿', true, 'turnedquestionmark'],
|
||||
['ˆ', 'ˆ', true, 'circumflexaccent'],
|
||||
['˜', '˜', true, 'smalltilde'],
|
||||
['°', '°', true, 'degreesign'],
|
||||
['−', '−', true, 'minussign'],
|
||||
['±', '±', true, 'plusminussign'],
|
||||
['÷', '÷', true, 'divisionsign'],
|
||||
['⁄', '⁄', true, 'fractionslash'],
|
||||
['×', '×', true, 'multiplicationsign'],
|
||||
['¹', '¹', true, 'superscriptone'],
|
||||
['²', '²', true, 'superscripttwo'],
|
||||
['³', '³', true, 'superscriptthree'],
|
||||
['¼', '¼', true, 'fractiononequarter'],
|
||||
['½', '½', true, 'fractiononehalf'],
|
||||
['¾', '¾', true, 'fractionthreequarters'],
|
||||
// Math / logical.
|
||||
['ƒ', 'ƒ', true, 'functionflorin'],
|
||||
['∫', '∫', true, 'integral'],
|
||||
['∑', '∑', true, 'narysumation'],
|
||||
['∞', '∞', true, 'infinity'],
|
||||
['√', '√', true, 'squareroot'],
|
||||
['∼', '∼', false,'similarto'],
|
||||
['≅', '≅', false,'approximatelyequalto'],
|
||||
['≈', '≈', true, 'almostequalto'],
|
||||
['≠', '≠', true, 'notequalto'],
|
||||
['≡', '≡', true, 'identicalto'],
|
||||
['∈', '∈', false,'elementof'],
|
||||
['∉', '∉', false,'notanelementof'],
|
||||
['∋', '∋', false,'containsasmember'],
|
||||
['∏', '∏', true, 'naryproduct'],
|
||||
['∧', '∧', false,'logicaland'],
|
||||
['∨', '∨', false,'logicalor'],
|
||||
['¬', '¬', true, 'notsign'],
|
||||
['∩', '∩', true, 'intersection'],
|
||||
['∪', '∪', false,'union'],
|
||||
['∂', '∂', true, 'partialdifferential'],
|
||||
['∀', '∀', false,'forall'],
|
||||
['∃', '∃', false,'thereexists'],
|
||||
['∅', '∅', false,'diameter'],
|
||||
['∇', '∇', false,'backwarddifference'],
|
||||
['∗', '∗', false,'asteriskoperator'],
|
||||
['∝', '∝', false,'proportionalto'],
|
||||
['∠', '∠', false,'angle'],
|
||||
// Undefined.
|
||||
['´', '´', true, 'acuteaccent'],
|
||||
['¸', '¸', true, 'cedilla'],
|
||||
['ª', 'ª', true, 'feminineordinalindicator'],
|
||||
['º', 'º', true, 'masculineordinalindicator'],
|
||||
['†', '†', true, 'dagger'],
|
||||
['‡', '‡', true, 'doubledagger'],
|
||||
// Alphabetical special chars.
|
||||
['À', 'À', true, 'agrave_caps'],
|
||||
['Á', 'Á', true, 'aacute_caps'],
|
||||
['Â', 'Â', true, 'acircumflex_caps'],
|
||||
['Ã', 'Ã', true, 'atilde_caps'],
|
||||
['Ä', 'Ä', true, 'adiaeresis_caps'],
|
||||
['Å', 'Å', true, 'aringabove_caps'],
|
||||
['Æ', 'Æ', true, 'ligatureae_caps'],
|
||||
['Ç', 'Ç', true, 'ccedilla_caps'],
|
||||
['È', 'È', true, 'egrave_caps'],
|
||||
['É', 'É', true, 'eacute_caps'],
|
||||
['Ê', 'Ê', true, 'ecircumflex_caps'],
|
||||
['Ë', 'Ë', true, 'ediaeresis_caps'],
|
||||
['Ì', 'Ì', true, 'igrave_caps'],
|
||||
['Í', 'Í', true, 'iacute_caps'],
|
||||
['Î', 'Î', true, 'icircumflex_caps'],
|
||||
['Ï', 'Ï', true, 'idiaeresis_caps'],
|
||||
['Ð', 'Ð', true, 'eth_caps'],
|
||||
['Ñ', 'Ñ', true, 'ntilde_caps'],
|
||||
['Ò', 'Ò', true, 'ograve_caps'],
|
||||
['Ó', 'Ó', true, 'oacute_caps'],
|
||||
['Ô', 'Ô', true, 'ocircumflex_caps'],
|
||||
['Õ', 'Õ', true, 'otilde_caps'],
|
||||
['Ö', 'Ö', true, 'odiaeresis_caps'],
|
||||
['Ø', 'Ø', true, 'oslash_caps'],
|
||||
['Œ', 'Œ', true, 'ligatureoe_caps'],
|
||||
['Š', 'Š', true, 'scaron_caps'],
|
||||
['Ù', 'Ù', true, 'ugrave_caps'],
|
||||
['Ú', 'Ú', true, 'uacute_caps'],
|
||||
['Û', 'Û', true, 'ucircumflex_caps'],
|
||||
['Ü', 'Ü', true, 'udiaeresis_caps'],
|
||||
['Ý', 'Ý', true, 'yacute_caps'],
|
||||
['Ÿ', 'Ÿ', true, 'ydiaeresis_caps'],
|
||||
['Þ', 'Þ', true, 'thorn_caps'],
|
||||
['à', 'à', true, 'agrave'],
|
||||
['á', 'á', true, 'aacute'],
|
||||
['â', 'â', true, 'acircumflex'],
|
||||
['ã', 'ã', true, 'atilde'],
|
||||
['ä', 'ä', true, 'adiaeresis'],
|
||||
['å', 'å', true, 'aringabove'],
|
||||
['æ', 'æ', true, 'ligatureae'],
|
||||
['ç', 'ç', true, 'ccedilla'],
|
||||
['è', 'è', true, 'egrave'],
|
||||
['é', 'é', true, 'eacute'],
|
||||
['ê', 'ê', true, 'ecircumflex'],
|
||||
['ë', 'ë', true, 'ediaeresis'],
|
||||
['ì', 'ì', true, 'igrave'],
|
||||
['í', 'í', true, 'iacute'],
|
||||
['î', 'î', true, 'icircumflex'],
|
||||
['ï', 'ï', true, 'idiaeresis'],
|
||||
['ð', 'ð', true, 'eth'],
|
||||
['ñ', 'ñ', true, 'ntilde'],
|
||||
['ò', 'ò', true, 'ograve'],
|
||||
['ó', 'ó', true, 'oacute'],
|
||||
['ô', 'ô', true, 'ocircumflex'],
|
||||
['õ', 'õ', true, 'otilde'],
|
||||
['ö', 'ö', true, 'odiaeresis'],
|
||||
['ø', 'ø', true, 'oslash'],
|
||||
['œ', 'œ', true, 'ligatureoe'],
|
||||
['š', 'š', true, 'scaron'],
|
||||
['ù', 'ù', true, 'ugrave'],
|
||||
['ú', 'ú', true, 'uacute'],
|
||||
['û', 'û', true, 'ucircumflex'],
|
||||
['ü', 'ü', true, 'udiaeresis'],
|
||||
['ý', 'ý', true, 'yacute'],
|
||||
['þ', 'þ', true, 'thorn'],
|
||||
['ÿ', 'ÿ', true, 'ydiaeresis'],
|
||||
['Α', 'Α', true, 'alpha_caps'],
|
||||
['Β', 'Β', true, 'beta_caps'],
|
||||
['Γ', 'Γ', true, 'gamma_caps'],
|
||||
['Δ', 'Δ', true, 'delta_caps'],
|
||||
['Ε', 'Ε', true, 'epsilon_caps'],
|
||||
['Ζ', 'Ζ', true, 'zeta_caps'],
|
||||
['Η', 'Η', true, 'eta_caps'],
|
||||
['Θ', 'Θ', true, 'theta_caps'],
|
||||
['Ι', 'Ι', true, 'iota_caps'],
|
||||
['Κ', 'Κ', true, 'kappa_caps'],
|
||||
['Λ', 'Λ', true, 'lambda_caps'],
|
||||
['Μ', 'Μ', true, 'mu_caps'],
|
||||
['Ν', 'Ν', true, 'nu_caps'],
|
||||
['Ξ', 'Ξ', true, 'xi_caps'],
|
||||
['Ο', 'Ο', true, 'omicron_caps'],
|
||||
['Π', 'Π', true, 'pi_caps'],
|
||||
['Ρ', 'Ρ', true, 'rho_caps'],
|
||||
['Σ', 'Σ', true, 'sigma_caps'],
|
||||
['Τ', 'Τ', true, 'tau_caps'],
|
||||
['Υ', 'Υ', true, 'upsilon_caps'],
|
||||
['Φ', 'Φ', true, 'phi_caps'],
|
||||
['Χ', 'Χ', true, 'chi_caps'],
|
||||
['Ψ', 'Ψ', true, 'psi_caps'],
|
||||
['Ω', 'Ω', true, 'omega_caps'],
|
||||
['α', 'α', true, 'alpha'],
|
||||
['β', 'β', true, 'beta'],
|
||||
['γ', 'γ', true, 'gamma'],
|
||||
['δ', 'δ', true, 'delta'],
|
||||
['ε', 'ε', true, 'epsilon'],
|
||||
['ζ', 'ζ', true, 'zeta'],
|
||||
['η', 'η', true, 'eta'],
|
||||
['θ', 'θ', true, 'theta'],
|
||||
['ι', 'ι', true, 'iota'],
|
||||
['κ', 'κ', true, 'kappa'],
|
||||
['λ', 'λ', true, 'lambda'],
|
||||
['μ', 'μ', true, 'mu'],
|
||||
['ν', 'ν', true, 'nu'],
|
||||
['ξ', 'ξ', true, 'xi'],
|
||||
['ο', 'ο', true, 'omicron'],
|
||||
['π', 'π', true, 'pi'],
|
||||
['ρ', 'ρ', true, 'rho'],
|
||||
['ς', 'ς', true, 'finalsigma'],
|
||||
['σ', 'σ', true, 'sigma'],
|
||||
['τ', 'τ', true, 'tau'],
|
||||
['υ', 'υ', true, 'upsilon'],
|
||||
['φ', 'φ', true, 'phi'],
|
||||
['χ', 'χ', true, 'chi'],
|
||||
['ψ', 'ψ', true, 'psi'],
|
||||
['ω', 'ω', true, 'omega'],
|
||||
// Symbols.
|
||||
['ℵ', 'ℵ', false,'alefsymbol'],
|
||||
['ϖ', 'ϖ', false,'pisymbol'],
|
||||
['ℜ', 'ℜ', false,'realpartsymbol'],
|
||||
['ϑ','ϑ', false,'thetasymbol'],
|
||||
['ϒ', 'ϒ', false,'upsilonhooksymbol'],
|
||||
['℘', '℘', false,'weierstrassp'],
|
||||
['ℑ', 'ℑ', false,'imaginarypart'],
|
||||
// Arrows.
|
||||
['←', '←', true, 'leftwardsarrow'],
|
||||
['↑', '↑', true, 'upwardsarrow'],
|
||||
['→', '→', true, 'rightwardsarrow'],
|
||||
['↓', '↓', true, 'downwardsarrow'],
|
||||
['↔', '↔', true, 'leftrightarrow'],
|
||||
['↵', '↵', false,'carriagereturn'],
|
||||
['⇐', '⇐', false,'leftwardsdoublearrow'],
|
||||
['⇑', '⇑', false,'upwardsdoublearrow'],
|
||||
['⇒', '⇒', false,'rightwardsdoublearrow'],
|
||||
['⇓', '⇓', false,'downwardsdoublearrow'],
|
||||
['⇔', '⇔', false,'leftrightdoublearrow'],
|
||||
['∴', '∴', false,'therefore'],
|
||||
['⊂', '⊂', false,'subsetof'],
|
||||
['⊃', '⊃', false,'supersetof'],
|
||||
['⊄', '⊄', false,'notasubsetof'],
|
||||
['⊆', '⊆', false,'subsetoforequalto'],
|
||||
['⊇', '⊇', false,'supersetoforequalto'],
|
||||
['⊕', '⊕', false,'circledplus'],
|
||||
['⊗', '⊗', false,'circledtimes'],
|
||||
['⊥', '⊥', false,'perpendicular'],
|
||||
['⋅', '⋅', false,'dotoperator'],
|
||||
['⌈', '⌈', false,'leftceiling'],
|
||||
['⌉', '⌉', false,'rightceiling'],
|
||||
['⌊', '⌊', false,'leftfloor'],
|
||||
['⌋', '⌋', false,'rightfloor'],
|
||||
['⟨', '〈', false,'leftpointinganglebracket'],
|
||||
['⟩', '〉', false,'rightpointinganglebracket'],
|
||||
['◊', '◊', true, 'lozenge'],
|
||||
['♠', '♠', true, 'blackspadesuit'],
|
||||
['♣', '♣', true, 'blackclubsuit'],
|
||||
['♥', '♥', true, 'blackheartsuit'],
|
||||
['♦', '♦', true, 'blackdiamondsuit'],
|
||||
[' ', ' ', false,'enspace'],
|
||||
[' ', ' ', false,'emspace'],
|
||||
[' ', ' ', false,'thinspace'],
|
||||
['‌', '‌', false,'zerowidthnonjoiner'],
|
||||
['‍', '‍', false,'zerowidthjoiner'],
|
||||
['‎', '‎', false,'lefttorightmark'],
|
||||
['‏', '‏', false,'righttoleftmark'],
|
||||
['­', '­', false,'softhyphen']
|
||||
];
|
||||
|
||||
M.atto_charmap = M.atto_charmap || {
|
||||
|
||||
/**
|
||||
* The ID of the current editor.
|
||||
*
|
||||
* @type {String}
|
||||
*/
|
||||
currentElementId: null,
|
||||
|
||||
/**
|
||||
* The dialogue to select a character.
|
||||
*
|
||||
* @type {M.core.dialogue}
|
||||
*/
|
||||
dialogue: null,
|
||||
|
||||
/**
|
||||
* Keeps track of the selection made by the user.
|
||||
*
|
||||
* @type {Mixed}
|
||||
*/
|
||||
selection: null,
|
||||
|
||||
/**
|
||||
* Init.
|
||||
*
|
||||
* @param {Object} params
|
||||
*
|
||||
* @return {Void}
|
||||
*/
|
||||
init: function(params) {
|
||||
|
||||
var display_chooser = function(e, elementid) {
|
||||
e.preventDefault();
|
||||
if (!M.editor_atto.is_active(elementid)) {
|
||||
M.editor_atto.focus(elementid);
|
||||
}
|
||||
M.atto_charmap.selection = M.editor_atto.get_selection();
|
||||
if (M.atto_charmap.selection === false) {
|
||||
return;
|
||||
}
|
||||
|
||||
// Stores what editor we are working on.
|
||||
M.atto_charmap.currentElementId = elementid;
|
||||
|
||||
// Initialising the dialogue.
|
||||
var dialogue;
|
||||
if (!M.atto_charmap.dialogue) {
|
||||
dialogue = new M.core.dialogue({
|
||||
visible: false,
|
||||
modal: true,
|
||||
close: true,
|
||||
draggable: true
|
||||
});
|
||||
|
||||
// Setting up the content of the dialogue.
|
||||
dialogue.set('bodyContent', M.atto_charmap.getDialogueContent());
|
||||
dialogue.set('headerContent', M.util.get_string('insertcharacter', 'atto_charmap'));
|
||||
dialogue.render();
|
||||
dialogue.centerDialogue();
|
||||
M.atto_charmap.dialogue = dialogue;
|
||||
} else {
|
||||
dialogue = M.atto_charmap.dialogue;
|
||||
}
|
||||
|
||||
dialogue.show();
|
||||
};
|
||||
|
||||
var iconurl = M.util.image_url('e/special_character', 'core');
|
||||
M.editor_atto.add_toolbar_button(params.elementid, 'charmap', iconurl, params.group, display_chooser);
|
||||
},
|
||||
|
||||
/**
|
||||
* Generates the content of the dialogue.
|
||||
*
|
||||
* @return {Node} Node containing the dialogue content
|
||||
*/
|
||||
getDialogueContent: function() {
|
||||
var content,
|
||||
html = '<div class="' + CSS.CHARMAP + '">',
|
||||
i;
|
||||
|
||||
for (i = 0; i < CHARMAP.length; i++) {
|
||||
if (!CHARMAP[i][2]) {
|
||||
continue;
|
||||
}
|
||||
html += '<button class="' + CSS.BUTTON + '" ' +
|
||||
'aria-label="' + Y.Escape.html(M.util.get_string(CHARMAP[i][3], 'atto_charmap')) + '" ' +
|
||||
'title="' + Y.Escape.html(M.util.get_string(CHARMAP[i][3], 'atto_charmap')) + '" ' +
|
||||
'data-character="' + CHARMAP[i][0] + '" ' +
|
||||
'>' +
|
||||
CHARMAP[i][0] +
|
||||
'</button>';
|
||||
}
|
||||
html += '</div>';
|
||||
|
||||
content = Y.Node.create(html);
|
||||
Y.delegate('click', M.atto_charmap.insertChar, content, SELECTORS.BUTTON, this);
|
||||
return content;
|
||||
},
|
||||
|
||||
/**
|
||||
* Insert the picked character in Atto.
|
||||
*
|
||||
* @param {Event} e The event
|
||||
* @return {Void}
|
||||
*/
|
||||
insertChar: function(e) {
|
||||
var character = e.target.getData('character');
|
||||
|
||||
e.preventDefault();
|
||||
e.stopPropagation();
|
||||
M.atto_charmap.dialogue.hide();
|
||||
|
||||
M.editor_atto.set_selection(M.atto_charmap.selection);
|
||||
if (document.selection && document.selection.createRange().pasteHTML) {
|
||||
document.selection.createRange().pasteHTML(character);
|
||||
} else {
|
||||
document.execCommand('insertHTML', false, character);
|
||||
}
|
||||
|
||||
// Clean the YUI ids from the HTML.
|
||||
M.editor_atto.text_updated(M.atto_charmap.currentElementId);
|
||||
}
|
||||
};
|
@ -0,0 +1,8 @@
|
||||
{
|
||||
"moodle-atto_charmap-button": {
|
||||
"requires": [
|
||||
"node",
|
||||
"escape"
|
||||
]
|
||||
}
|
||||
}
|
@ -33,7 +33,7 @@ if ($ADMIN->fulltree) {
|
||||
$default = 'style = bold, italic, underline, strike, clear, title' . "\n" .
|
||||
'paragraph = indent, outdent, orderedlist, unorderedlist' . "\n" .
|
||||
'links = link, unlink' . "\n" .
|
||||
'insert = table, image, media' . "\n" .
|
||||
'insert = table, image, media, charmap' . "\n" .
|
||||
'other = html';
|
||||
$setting = new admin_setting_configtextarea('editor_atto/toolbar',
|
||||
$name,
|
||||
|
Loading…
x
Reference in New Issue
Block a user