CoreFiles by mySites.guru
admin-article-readmore.js32 lines, 1,236 bytes, from Joomla_3.7.0-Stable-Full_Package.zip
Raw History Compare with 3.6.5
md5
7e918c974df569003b5c5013989e8498
sha1
4ebc2eaa276b0479a711472ab20f96b3ecd64a65
sha256
055c40e2b544b0b2c8b745fa74a541e61da05700c7beac89b4fa75946bf86aa1
/**
 * @copyright  Copyright (C) 2005 - 2017 Open Source Matters, Inc. All rights reserved.
 * @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.parent.Joomla.getOptions('xtd-readmore');

	if (window.parent.Joomla && window.parent.Joomla.editors && window.parent.Joomla.editors.instances && window.parent.Joomla.editors.instances.hasOwnProperty(editor)) {
		content = window.parent.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.parent.Joomla && window.parent.Joomla.editors && window.parent.Joomla.editors.instances && window.parent.Joomla.editors.instances.hasOwnProperty(editor)) {
			window.parent.Joomla.editors.instances[editor].replaceSelection('<hr id="system-readmore" />');
		} else {
			window.parent.jInsertEditorText('<hr id="system-readmore" />', editor);
		}
	}
};

The same content is in 2 releases, Joomla 3.7.0-rc4 to 3.7.0. See them all, or every version of this file.