wire/modules/Inputfield/InputfieldCKEditor/InputfieldCKEditor.js
/**
 * Handler for fileUploadRequest event
 * 
 * @param event
 * 
 */
Handler for fileUploadRequest event

@param event
Handler for fileUploadRequest event @param event
function ckeUploadEvent(event) {
	var xhr = event.data.fileLoader.xhr;
	var fileLoader = event.data.fileLoader;
	var settings = ckeGetProcessWireConfig(event.editor);
	var uploadFieldName = settings ? settings.pwUploadField : '_unknown';
	var $imageInputfield = $('#Inputfield_' + uploadFieldName); 
	if(typeof settings.repeaterItem != "undefined" && settings.repeaterItem.length) {
		var $repeaterImageField = settings.repeaterItem.find('.InputfieldImage:not(.InputfieldFileSingle)');
		if($repeaterImageField.length) $imageInputfield = $repeaterImageField;
	}
	if($imageInputfield.length) {
		xhr.open("POST", fileLoader.uploadUrl, true);
		$imageInputfield.trigger('pwimageupload', {
			'name': fileLoader.fileName,
			'file': fileLoader.file,
			'xhr': xhr
		});
		event.stop();
	} else {
		if(typeof settings.error != "undefined" && settings.error.length) {
			ProcessWire.alert(settings.error);
		} else {
			ProcessWire.alert('Unable to find images field for upload');
		}
		event.stop();
		return false;
	}
}
function ckeUploadEvent ( event ) { var xhr = event . data . fileLoader . xhr ; var fileLoader = event . data . fileLoader ; var settings = ckeGetProcessWireConfig ( event . editor ) ; var uploadFieldName = settings ? settings . pwUploadField : '_unknown' ; var $imageInputfield = $ ( '#Inputfield_' + uploadFieldName ) ; if ( typeof settings . repeaterItem != "undefined" && settings . repeaterItem . length ) { var $repeaterImageField = settings . repeaterItem . find ( '.InputfieldImage:not(.InputfieldFileSingle)' ) ; if ( $repeaterImageField . length ) $imageInputfield = $repeaterImageField ; } if ( $imageInputfield . length ) { xhr . open ( "POST" , fileLoader . uploadUrl , true ) ; $imageInputfield . trigger ( 'pwimageupload' , { 'name' : fileLoader . fileName , 'file' : fileLoader . file , 'xhr' : xhr } ) ; event . stop ( ) ; } else { if ( typeof settings . error != "undefined" && settings . error . length ) { ProcessWire . alert ( settings . error ) ; } else { ProcessWire . alert ( 'Unable to find images field for upload' ) ; } event . stop ( ) ; return false ; } }
Handler for fileUploadRequest event
Handler for fileUploadRequest event
// Prevented the default behavior.