CoreFiles by mySites.guru
admin-article-readmore-es5.js33 lines, 993 bytes, from Joomla_4.2.2-Stable-Full_Package.zip
Raw History Compare with 4.2.1
md5
fcb13228d35b23c95d89361bcca61634
sha1
35738132d648286778613b529840ce9c790a96fa
sha256
7ccfe1ec07c3ec597a096544b0f001fd4d22532ca41c46ea10d9197adc30f27f
(function () {
  'use strict';

  /**
   * @copyright  (C) 2018 Open Source Matters, Inc. <https://www.joomla.org>
   * @license    GNU General Public License version 2 or later; see LICENSE.txt
   */
  (function () {
    var options = window.Joomla.getOptions('xtd-readmore');

    window.insertReadmore = function (editor) {
      if (!options) {
        // Something went wrong!
        throw new Error('XTD Button \'read more\' not properly initialized');
      }

      var 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 {
        // @todo replace with joomla-alert
        alert(options.exists);
        return false;
      }

      return true;
    };
  })();

})();

The same content is in 35 releases, Joomla 4.1.0-rc1 to 4.2.6. See them all, or every version of this file.