[ Index ] |
PHP Cross Reference of Joomla 4.2.2 documentation |
[Summary view] [Print] [Text view]
1 /** 2 * Copyright (c) Tiny Technologies, Inc. All rights reserved. 3 * Licensed under the LGPL or a commercial license. 4 * For LGPL see License.txt in the project root for license information. 5 * For commercial licenses see https://www.tiny.cloud/ 6 * 7 * Version: 5.10.5 (2022-05-25) 8 */ 9 (function () { 10 'use strict'; 11 12 var global$1 = tinymce.util.Tools.resolve('tinymce.PluginManager'); 13 14 var getKeyboardSpaces = function (editor) { 15 var spaces = editor.getParam('nonbreaking_force_tab', 0); 16 if (typeof spaces === 'boolean') { 17 return spaces === true ? 3 : 0; 18 } else { 19 return spaces; 20 } 21 }; 22 var wrapNbsps = function (editor) { 23 return editor.getParam('nonbreaking_wrap', true, 'boolean'); 24 }; 25 26 var stringRepeat = function (string, repeats) { 27 var str = ''; 28 for (var index = 0; index < repeats; index++) { 29 str += string; 30 } 31 return str; 32 }; 33 var isVisualCharsEnabled = function (editor) { 34 return editor.plugins.visualchars ? editor.plugins.visualchars.isEnabled() : false; 35 }; 36 var insertNbsp = function (editor, times) { 37 var classes = function () { 38 return isVisualCharsEnabled(editor) ? 'mce-nbsp-wrap mce-nbsp' : 'mce-nbsp-wrap'; 39 }; 40 var nbspSpan = function () { 41 return '<span class="' + classes() + '" contenteditable="false">' + stringRepeat(' ', times) + '</span>'; 42 }; 43 var shouldWrap = wrapNbsps(editor); 44 var html = shouldWrap || editor.plugins.visualchars ? nbspSpan() : stringRepeat(' ', times); 45 editor.undoManager.transact(function () { 46 return editor.insertContent(html); 47 }); 48 }; 49 50 var register$1 = function (editor) { 51 editor.addCommand('mceNonBreaking', function () { 52 insertNbsp(editor, 1); 53 }); 54 }; 55 56 var global = tinymce.util.Tools.resolve('tinymce.util.VK'); 57 58 var setup = function (editor) { 59 var spaces = getKeyboardSpaces(editor); 60 if (spaces > 0) { 61 editor.on('keydown', function (e) { 62 if (e.keyCode === global.TAB && !e.isDefaultPrevented()) { 63 if (e.shiftKey) { 64 return; 65 } 66 e.preventDefault(); 67 e.stopImmediatePropagation(); 68 insertNbsp(editor, spaces); 69 } 70 }); 71 } 72 }; 73 74 var register = function (editor) { 75 var onAction = function () { 76 return editor.execCommand('mceNonBreaking'); 77 }; 78 editor.ui.registry.addButton('nonbreaking', { 79 icon: 'non-breaking', 80 tooltip: 'Nonbreaking space', 81 onAction: onAction 82 }); 83 editor.ui.registry.addMenuItem('nonbreaking', { 84 icon: 'non-breaking', 85 text: 'Nonbreaking space', 86 onAction: onAction 87 }); 88 }; 89 90 function Plugin () { 91 global$1.add('nonbreaking', function (editor) { 92 register$1(editor); 93 register(editor); 94 setup(editor); 95 }); 96 } 97 98 Plugin(); 99 100 }());
title
Description
Body
title
Description
Body
title
Description
Body
title
Body
Generated: Wed Sep 7 05:41:13 2022 | Chilli.vc Blog - For Webmaster,Blog-Writer,System Admin and Domainer |