CoreFiles by mySites.guru
admin-article-readmore.js26 lines, 895 bytes, from Joomla_4.4.13-Stable-Full_Package.zip
Raw History Compare with 4.4.12
md5
8793a4cffc125d17bbae1b25478c7d49
sha1
83b542376f188ca086a6157ffe198fae68d84a77
sha256
f803ff6921f1c7620ec792128a4af8e3ab693e66f7e3ccc70813bcef60a0f4aa
/**
 * @copyright  (C) 2018 Open Source Matters, Inc. <https://www.joomla.org>
 * @license    GNU General Public License version 2 or later; see LICENSE.txt
 */
(() => {

  const options = window.Joomla.getOptions('xtd-readmore');
  window.insertReadmore = editor => {
    if (!options) {
      // Something went wrong!
      throw new Error('XTD Button \'read more\' not properly initialized');
    }
    const content = window.Joomla.editors.instances[editor].getValue();
    if (!content) {
      Joomla.editors.instances[editor].replaceSelection('<hr id="system-readmore">');
    } else if (content && !content.match(/<hr\s+id=("|')system-readmore("|')\s*\/*>/i)) {
      Joomla.editors.instances[editor].replaceSelection('<hr id="system-readmore">');
    } else {
      Joomla.renderMessages({
        error: [options.exists]
      });
      return false;
    }
    return true;
  };
})();

The same content is in 58 releases, Joomla 4.3.0-alpha3 to 5.0.0-alpha4. See them all, or every version of this file.