CoreFiles by mySites.guru
admin-article-readmore.js33 lines, 950 bytes, from Joomla_4.0.0-alpha6-Alpha-Full_Package.zip
Raw History Compare with 4.0.0-alpha5
md5
5ce530f14fe00db5422665f69dcdeeca
sha1
d64ee46168aa4ce70d87a2db8c01ec7a7089fece
sha256
da98d76d893fb573a509c7fa1aa09decbec4c1e92021008a3ceac38837ae1b93
/**
* 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.