CoreFiles by mySites.guru
admin-article-readmore.js32 lines, 950 bytes, from Joomla_4.0.0-alpha5-Alpha-Full_Package.zip
Raw History Compare with 4.0.0-alpha3
md5
54d3e2cebfe17b3433d9ed49a8c2d4be
sha1
1a7183972444868036d2158a02df7a51763b233f
sha256
e099dade9f7acc4359ac75250dd445ae3bb8e6979d2de78257a872632b4cf470
/**
* PLEASE DO NOT MODIFY THIS FILE. WORK ON THE ES6 VERSION.
* OTHERWISE YOUR CHANGES WILL BE REPLACED ON THE NEXT BUILD.
**/

/**
 * @copyright  Copyright (C) 2005 - 2018 Open Source Matters, Inc. All rights reserved.
 * @license    GNU General Public License version 2 or later; see LICENSE.txt
 */
(function () {
  'use strict';

  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 && !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;
  };
})();

No other release has this exact content. See every version of this file.