CoreFiles by mySites.guru
admin-article-readmore.js30 lines, 993 bytes, from Joomla_3.7.0-beta4-Beta-Full_Package.zip
Raw History Compare with 3.7.0-beta3
md5
cbeacc6e29c0044445e34b523854e24a
sha1
e2ffc613c9fb0387c9b07268b9c9fab4f032385b
sha256
a929f1ba4879056d38cee9dbf3f4e51f6227541ae1acdf273cf8e75c00a06471
/**
 * @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 options, content;

	options = window.parent.Joomla.getOptions('xtd-readmore');

	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 4 releases, Joomla 3.7.0-beta4 to 3.7.0-rc3. See them all, or every version of this file.