CoreFiles by mySites.guru
admin-article-readmore-es5.js29 lines, 989 bytes, from Joomla_4.3.0-alpha1-Alpha-Full_Package.zip
Raw History Compare with 4.2.0-alpha3
md5
d766a0b37ce444893b2a73567cb28639
sha1
6a694d6d9b9e5a66a216d501ad160e91aae7bfce
sha256
a391e06be3e4fea9d3544ec55b22a36ccc7e4a1d030e78229cdbad19012fb818
(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 2 releases, Joomla 4.3.0-alpha1 to 4.3.0-alpha2. See them all, or every version of this file.