CoreFiles by mySites.guru
admin-article-pagebreak.js34 lines, 1,069 bytes, from Joomla_4.0.0-alpha3-Alpha-Full_Package.zip
Raw History Compare with 4.0.0-alpha2
md5
10a7e57abfc018ad1041af73ad38125d
sha1
6874c4df47b95b82b3ced105cc0e2275012439e9
sha256
02ab38beeff8a9546432dfb119e3481776ac86d1d881830e140716c43b9b956f
/**
 * @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";

	window.insertPagebreak = function(editor) {
		/** Get the pagebreak title **/
		var alt, tag, title = document.getElementById('title').value;

		if (!window.parent.Joomla.getOptions('xtd-pagebreak')) {
			throw new Error('Joomla API is not properly initialised')
		}

		/** Get the pagebreak toc alias -- not inserting for now **/
		/** don't know which attribute to use... **/
		alt = document.getElementById('alt').value;

		title  = (title != '') ? 'title="' + title + '"' : '';
		alt    = (alt != '') ? 'alt="' + alt + '"' : '';

		tag = '<hr class="system-pagebreak" ' + title + ' ' + alt + '>';

		window.parent.Joomla.editors.instances[editor].replaceSelection(tag);

		if (window.parent.Joomla.currentModal) {
			// @TODO Remove jQuery, use Joomla-UI
			parent.window.jQuery(window.parent.Joomla.currentModal).modal('hide');
		}

		return false;
	};
})();

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