[ Index ] |
PHP Cross Reference of Joomla 4.2.2 documentation |
[Summary view] [Print] [Text view]
1 /** 2 * @copyright (C) 2018 Open Source Matters, Inc. <https://www.joomla.org> 3 * @license GNU General Public License version 2 or later; see LICENSE.txt 4 */ 5 (() => { 6 7 const options = window.Joomla.getOptions('xtd-readmore'); 8 9 window.insertReadmore = editor => { 10 if (!options) { 11 // Something went wrong! 12 throw new Error('XTD Button \'read more\' not properly initialized'); 13 } 14 15 const content = window.Joomla.editors.instances[editor].getValue(); 16 17 if (!content) { 18 Joomla.editors.instances[editor].replaceSelection('<hr id="system-readmore">'); 19 } else if (content && !content.match(/<hr\s+id=("|')system-readmore("|')\s*\/*>/i)) { 20 Joomla.editors.instances[editor].replaceSelection('<hr id="system-readmore">'); 21 } else { 22 // @todo replace with joomla-alert 23 alert(options.exists); 24 return false; 25 } 26 27 return true; 28 }; 29 })();
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 |