CoreFiles by mySites.guru
admin-article-pagebreak.es6.js32 lines, 1,091 bytes, from Joomla_4.0.0-beta3-Beta-Full_Package.zip
Raw History Compare with 4.0.0-beta2
md5
3d097eeecd57a40754501e0f9799bc27
sha1
2f9206d0c9d00fece50f750781cf8c80d5d426bb
sha256
5a600b1a672796bc9b8145983d1d71241c4ae472e5db96dfeddc8608bcca5daa
/**
* 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 - 2020 Open Source Matters, Inc. All rights reserved.
 * @license    GNU General Public License version 2 or later; see LICENSE.txt
 */
(() => {
  'use strict';

  window.insertPagebreak = editor => {
    // Get the pagebreak title
    let title = document.getElementById('title').value;

    if (!window.parent.Joomla.getOptions('xtd-pagebreak')) {
      // Something went wrong!
      window.parent.Joomla.Modal.getCurrent().close();
      return false;
    } // Get the pagebreak toc alias -- not inserting for now don't know which attribute to use..


    let alt = document.getElementById('alt').value;
    title = title !== '' ? `title="${title}"` : '';
    alt = alt !== '' ? `alt="${alt}"` : '';
    const tag = `<hr class="system-pagebreak" ${title} ${alt}>`;
    window.parent.Joomla.editors.instances[editor].replaceSelection(tag);
    window.parent.Joomla.Modal.getCurrent().close();
    return false;
  };
})();

The same content is in 5 releases, Joomla 4.0.0-beta to 4.0.0-beta5. See them all, or every version of this file.