CoreFiles by mySites.guru
admin-article-readmore-es5.js34 lines, 997 bytes, from Joomla_4.2.7-Stable-Full_Package.zip
Raw History Compare with 4.2.6
md5
4c9262792f9953735bee9a5699651098
sha1
ed67d8cd049c7fcb8f6e2676df025d95f543cf9a
sha256
b246b9761d1ea9a7442c5088115d7a851c9a7d9fc9d998a4bd3e287568e6f550
(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 {
        Joomla.renderMessages({
          error: [options.exists]
        });
        return false;
      }

      return true;
    };
  })();

})();

The same content is in 5 releases, Joomla 4.2.7-rc1 to 4.2.9. See them all, or every version of this file.