Proyectos de Subversion Moodle

Rev

Autoría | Ultima modificación | Ver Log |

{"version":3,"file":"defaults.min.js","sources":["../src/defaults.js"],"sourcesContent":["// This file is part of Moodle - http://moodle.org/\n//\n// Moodle is free software: you can redistribute it and/or modify\n// it under the terms of the GNU General Public License as published by\n// the Free Software Foundation, either version 3 of the License, or\n// (at your option) any later version.\n//\n// Moodle is distributed in the hope that it will be useful,\n// but WITHOUT ANY WARRANTY; without even the implied warranty of\n// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the\n// GNU General Public License for more details.\n//\n// You should have received a copy of the GNU General Public License\n// along with Moodle.  If not, see <http://www.gnu.org/licenses/>.\n\n/* eslint-disable max-len,  */\n\n/**\n * TinyMCE Editor Upstream defaults.\n *\n * @module     editor_tiny/defaults\n * @copyright  2022 Andrew Lyons <andrew@nicols.co.uk>\n * @license    http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later\n */\n\n/**\n * The upstream defaults for the TinyMCE Menu.\n *\n * This value is defined in the TinyMCE documentation, but not exported anywhere useful.\n * https://www.tiny.cloud/docs/tinymce/6/menus-configuration-options/#menu\n *\n * @returns {Object}\n */\nexport const getDefaultMenu = () => {\n    return {\n        file: {title: 'File', items: 'newdocument restoredraft | preview | export print | deleteallconversations'},\n        edit: {title: 'Edit', items: 'undo redo | cut copy paste pastetext | selectall | searchreplace'},\n        view: {title: 'View', items: 'code | visualaid visualchars visualblocks | spellchecker | preview fullscreen | showcomments'},\n        insert: {title: 'Insert', items: 'image link media addcomment pageembed template codesample inserttable | charmap emoticons hr | pagebreak nonbreaking anchor tableofcontents | insertdatetime'},\n        format: {title: 'Format', items: 'bold italic underline strikethrough superscript subscript codeformat | styles blocks fontfamily fontsize align lineheight | forecolor backcolor | language | removeformat'},\n        tools: {title: 'Tools', items: 'spellchecker spellcheckerlanguage | a11ycheck code wordcount'},\n        table: {title: 'Table', items: 'inserttable | cell row column | advtablesort | tableprops deletetable'},\n        help: {title: 'Help', items: 'help'}\n    };\n};\n\n/**\n * The default toolbar configuration to use.\n *\n * This is based upon the default value used if no toolbar is specified.\n *\n * https://www.tiny.cloud/docs/tinymce/6/menus-configuration-options/#menu\n *\n * @returns {Object}\n */\nexport const getDefaultToolbar = () => {\n    return [\n        {\n            name: 'history',\n            items: [\n                'undo',\n                'redo',\n            ],\n        },\n        {\n            name: 'formatting',\n            items: [\n                'bold',\n                'italic',\n            ],\n        },\n        {\n            name: 'view',\n            items: ['fullscreen'],\n        },\n        {\n            name: 'alignment',\n            items: [\n                'alignleft',\n                'aligncenter',\n                'alignright',\n                'alignjustify',\n            ],\n        },\n        {\n            name: 'indentation',\n            items: [\n                'outdent',\n                'indent',\n            ],\n        },\n        {\n            name: 'lists',\n            items: [\n                'bullist',\n                'numlist',\n            ],\n        },\n        {\n            name: 'comments',\n            items: ['addcomment'],\n        },\n    ];\n};\n\n/**\n * The default quickbars_insert_toolbar configuration to use.\n *\n * This is based upon the default value used if no toolbar is specified.\n *\n * https://www.tiny.cloud/docs/tinymce/6/quickbars/#quickbars_selection_toolbar\n *\n * @returns {string}\n */\nexport const getDefaultQuickbarsSelectionToolbar = () => 'bold italic | quicklink h2 h3 blockquote';\n\n/**\n * The default quickbars_insert_toolbar configuration to use.\n *\n * This is based upon the default value used if no toolbar is specified.\n *\n * https://www.tiny.cloud/docs/tinymce/6/quickbars/#quickbars_insert_toolbar\n *\n * @returns {string}\n */\nexport const getDefaultQuickbarsInsertToolbar = () => 'quickimage quicktable';\n\n/**\n * The default quickbars_insert_toolbar configuration to use.\n *\n * This is based upon the default value used if no toolbar is specified.\n *\n * https://www.tiny.cloud/docs/tinymce/6/quickbars/#quickbars_image_toolbar\n *\n * @returns {string}\n */\nexport const getDefaultQuickbarsImageToolbar = () => 'alignleft aligncenter alignright';\n\n/**\n * Get the default configuration provided by TinyMCE.\n *\n * @returns {object}\n */\nexport const getDefaultConfiguration = () => ({\n    // Toolbar configuration.\n    // https://www.tiny.cloud/docs/tinymce/6/toolbar-configuration-options/\n    // TODO: Move this configuration to a passed-in option.\n    // eslint-disable-next-line camelcase\n    toolbar_mode: 'sliding',\n    toolbar: getDefaultToolbar(),\n\n    // Quickbars Selection Toolbar configuration.\n    // https://www.tiny.cloud/docs/tinymce/6/quickbars/#quickbars_selection_toolbar\n    // eslint-disable-next-line camelcase\n    quickbars_selection_toolbar: getDefaultQuickbarsSelectionToolbar(),\n\n    // Quickbars Select Toolbar configuration.\n    // https://www.tiny.cloud/docs/tinymce/6/quickbars/#quickbars_insert_toolbar\n    // eslint-disable-next-line camelcase\n    quickbars_insert_toolbar: getDefaultQuickbarsInsertToolbar(),\n\n    // Quickbars Image Toolbar configuration.\n    // https://www.tiny.cloud/docs/tinymce/6/quickbars/#quickbars_image_toolbar\n    // eslint-disable-next-line camelcase\n    quickbars_image_toolbar: getDefaultQuickbarsImageToolbar(),\n\n\n    // Menu configuration.\n    // https://www.tiny.cloud/docs/tinymce/6/menus-configuration-options/\n    // TODO: Move this configuration to a passed-in option.\n    menu: getDefaultMenu(),\n\n    // Mobile configuration.\n    // At this time we will use the default TinyMCE mobile configuration.\n    // https://www.tiny.cloud/docs/tinymce/6/tinymce-for-mobile/\n\n    // Skins\n    skin: 'oxide',\n});\n"],"names":["getDefaultMenu","file","title","items","edit","view","insert","format","tools","table","help","getDefaultToolbar","name","getDefaultQuickbarsSelectionToolbar","getDefaultQuickbarsInsertToolbar","getDefaultQuickbarsImageToolbar","toolbar_mode","toolbar","quickbars_selection_toolbar","quickbars_insert_toolbar","quickbars_image_toolbar","menu","skin"],"mappings":";;;;;;;;MAiCaA,eAAiB,KACnB,CACHC,KAAM,CAACC,MAAO,OAAQC,MAAO,8EAC7BC,KAAM,CAACF,MAAO,OAAQC,MAAO,oEAC7BE,KAAM,CAACH,MAAO,OAAQC,MAAO,gGAC7BG,OAAQ,CAACJ,MAAO,SAAUC,MAAO,gKACjCI,OAAQ,CAACL,MAAO,SAAUC,MAAO,6KACjCK,MAAO,CAACN,MAAO,QAASC,MAAO,gEAC/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