functionckeGetProcessWireConfig(editor){vareditorName=typeofeditor=="string"?editor:editor.name;varconfigName=editorName.replace("Inputfield_","InputfieldCKEditor_");var$repeaterItem="";varsettings={};configName=configName.replace("Inputfield_","InputfieldCKEditor_");if(typeofProcessWire.config[configName]=="undefined"&&configName.indexOf("_repeater")>0){configName=configName.replace(/_repeater[0-9]+/,"");$repeaterItem=$("#"+editorName).closest(".InputfieldRepeaterItem")}if(typeofProcessWire.config[configName]=="undefined"&&configName.indexOf("_ckeditor")>0){configName=configName.replace(/_ckeditor$/,"")}if(typeofProcessWire.config[configName]=="undefined"&&configName.indexOf("__")>0){configName=configName.replace(/__\d+$/,"")}if(typeofProcessWire.config[configName]=="undefined"){settings.error="Cannot find CKEditor settings for "+configName}else{settings=ProcessWire.config[configName]}if($repeaterItem.length){settings["repeaterItem"]=$repeaterItem}else{settings["repeaterItem"]=""}returnsettings}functionckeLoadPlugins(){for(varnameinProcessWire.config.InputfieldCKEditor.plugins){varfile=ProcessWire.config.InputfieldCKEditor.plugins[name];CKEDITOR.plugins.addExternal(name,file,"")}}ckeLoadPlugins();functionckeBlurEvent(event){vareditor=event.editor;var$textarea=$(editor.element.$);if(editor.checkDirty()){if($textarea.length){if($textarea.is("textarea"))$textarea.trigger("change");$textarea.closest(".Inputfield").addClass("InputfieldStateChanged")}}}functionckeFocusEvent(event){vareditor=event.editor;var$textarea=$(editor.element.$);$textarea.trigger("pw-focus")}functionckeResizeEvent(event){vareditor=event.editor;var$textarea=$(editor.element.$);if($textarea.length){$textarea.closest(".Inputfield").trigger("heightChanged")}}functionckeUploadEvent(event){varxhr=event.data.fileLoader.xhr;varfileLoader=event.data.fileLoader;varsettings=ckeGetProcessWireConfig(event.editor);varuploadFieldName=settings?settings.pwUploadField:"_unknown";var$imageInputfield=$("#Inputfield_"+uploadFieldName);if(typeofsettings.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(typeofsettings.error!="undefined"&&settings.error.length){ProcessWire.alert(settings.error)}else{ProcessWire.alert("Unable to find images field for upload")}event.stop();returnfalse}}functionckeInitEvents(editor){editor.on("blur",ckeBlurEvent);editor.on("focus",ckeFocusEvent);editor.on("change",ckeBlurEvent);editor.on("resize",ckeResizeEvent);editor.on("fileUploadRequest",ckeUploadEvent,null,null,4);var$textarea=$(editor.element.$);var$inputfield=$textarea.closest(".Inputfield.InputfieldColumnWidth");if($inputfield.length)setTimeout(function(){$inputfield.trigger("heightChanged")},1e3)}functionckeSaveReadyInline($inputfield){if(!$inputfield.length)return;var$inlines=$inputfield.hasClass(".InputfieldCKEditorInline")?$inputfield:$inputfield.find(".InputfieldCKEditorInline");if($inlines.length)$inlines.each(function(){var$t=$(this);varvalue;if($t.hasClass("InputfieldCKEditorLoaded")){vareditor=CKEDITOR.instances[$t.attr("id")];if(typeofeditor!="undefined"){if(editor.focusManager.hasFocus){editor.focusManager.focus(true);editor.focus()}value=editor.getData()}}else{value=$t.html()}var$input=$t.next("input");$input.attr("value",value)})}functionckeSaveReadyNormal($inputfield){var$normals=$inputfield.hasClass("InputfieldCKEditorNormal")?$inputfield:$inputfield.find(".InputfieldCKEditorNormal");$normals.each(function(){var$t=$(this);if(!$t.hasClass("InputfieldCKEditorLoaded"))return;vareditor=CKEDITOR.instances[$t.attr("id")];editor.updateElement()})}functionckeGetConfigData($editor){varconfigName=$editor.attr("data-configName");if(typeofProcessWire.config[configName]==="undefi