CoreFiles by mySites.guru
admin-article-readmore.js32 lines, 1,171 bytes, from Joomla_3.10.0-alpha7-Alpha-Full_Package.zip
Raw History Compare with 3.10.0-alpha6
md5
7d8d4dce05a2e1489515d001e1bf8f74
sha1
e8a22f36c7fb1f68f37941175f510b10d4d612c7
sha256
b50139aa42a971699f29c67bf22114af8767b458ffab0114131cec56ba81c761
/**
 * @copyright  (C) 2017 Open Source Matters, Inc. <https://www.joomla.org>
 * @license    GNU General Public License version 2 or later; see LICENSE.txt
 */

window.insertReadmore = function(editor) {
	"use strict";
	if (!Joomla.getOptions('xtd-readmore')) {
		// Something went wrong!
		return false;
	}

	var content, options = window.Joomla.getOptions('xtd-readmore');

	if (window.Joomla && window.Joomla.editors && window.Joomla.editors.instances && window.Joomla.editors.instances.hasOwnProperty(editor)) {
		content = window.Joomla.editors.instances[editor].getValue();
	} else {
		content = (new Function('return ' + options.editor))();
	}

	if (content.match(/<hr\s+id=("|')system-readmore("|')\s*\/*>/i)) {
		alert(options.exists);
		return false;
	} else {
		/** Use the API, if editor supports it **/
		if (window.Joomla && window.Joomla.editors && window.Joomla.editors.instances && window.Joomla.editors.instances.hasOwnProperty(editor)) {
			window.Joomla.editors.instances[editor].replaceSelection('<hr id="system-readmore" />');
		} else {
			window.jInsertEditorText('<hr id="system-readmore" />', editor);
		}
	}
};

The same content is in 8 releases, Joomla 3.10.0-alpha4 to 3.10.0-rc2. See them all, or every version of this file.