wire/modules/Inputfield/InputfieldCKEditor/InputfieldCKEditor.js
/**
 * Initialize a normal CKEditor instance for the given textarea ID
 * 
 * @param editorID
 * 
 */
Initialize a normal CKEditor instance for the given textarea ID

@param editorID
Initialize a normal CKEditor instance for the given textarea ID @param editorID
function ckeInitNormal(editorID) {
	var $editor = $('#' + editorID);
	var $parent = $editor.parent();
	if(typeof ProcessWire.config.InputfieldCKEditor.editors[editorID] != "undefined") {
		var configName = ProcessWire.config.InputfieldCKEditor.editors[editorID];
	} else {
		var configName = $editor.attr('data-configName');
	}
	if($parent.hasClass('ui-tabs-panel') && $parent.css('display') == 'none') {
		var parentID = $editor.parent().attr('id');
		var $a = $parent.closest('.ui-tabs, .langTabs').find('a[href=#' + parentID + ']');
		$a.attr('data-editorID', editorID).attr('data-configName', configName);
		$parent.closest('.ui-tabs, .langTabs').on('tabsactivate', ckeInitTab);
	} else {
		var editor;
		if(typeof ProcessWire.config[configName] != "undefined") {
			var editor = CKEDITOR.replace(editorID, ProcessWire.config[configName]);
		} else if(typeof $editor.attr('data-configdata') != "undefined") {
			var configData = JSON.parse($editor.attr('data-configdata'));
			ProcessWire.config[configName] = configData;
			var editor = CKEDITOR.replace(editorID, configData);
		}
		if(editor) {
			ckeInitEvents(editor);
			$editor.addClass('InputfieldCKEditorLoaded');
		}
	}
}
function ckeInitNormal ( editorID ) { var $editor = $ ( '#' + editorID ) ; var $parent = $editor . parent ( ) ; if ( typeof ProcessWire . config . InputfieldCKEditor . editors [ editorID ] != "undefined" ) { var configName = ProcessWire . config . InputfieldCKEditor . editors [ editorID ] ; } else { var configName = $editor . attr ( 'data-configName' ) ; } if ( $parent . hasClass ( 'ui-tabs-panel' ) && $parent . css ( 'display' ) == 'none' ) { var parentID = $editor . parent ( ) . attr ( 'id' ) ; var $a = $parent . closest ( '.ui-tabs, .langTabs' ) . find ( 'a[href=#' + parentID + ']' ) ; $a . attr ( 'data-editorID' , editorID ) . attr ( 'data-configName' , configName ) ; $parent . closest ( '.ui-tabs, .langTabs' ) . on ( 'tabsactivate' , ckeInitTab ) ; } else { var editor ; if ( typeof ProcessWire . config [ configName ] != "undefined" ) { var editor = CKEDITOR . replace ( editorID , ProcessWire . config [ configName ] ) ; } else if ( typeof $editor . attr ( 'data-configdata' ) != "undefined" ) { var configData = JSON . parse ( $editor . attr ( 'data-configdata' ) ) ; ProcessWire . config [ configName ] = configData ; var editor = CKEDITOR . replace ( editorID , configData ) ; } if ( editor ) { ckeInitEvents ( editor ) ; $editor . addClass ( 'InputfieldCKEditorLoaded' ) ; } } }
Initialize a normal CKEditor instance for the given textarea ID
Initialize a normal CKEditor instance for the given textarea ID
// CKEditor in a jQuery UI tab (like langTabs) // visible CKEditor // allow for alternate option of config data being passed through a data attribute // useful for some dynamic/ajax situations