File "ckeditor5-utils.min.js"
Path: /ThinkIB/assets/js/ckeditor5-utilsminjs
File size: 2.26 KB
MIME-type: text/plain
Charset: utf-8
function cancelDropEvents(editor){editor.editing.view.document.on("drop",(evt,data)=>{evt.stop(),data.preventDefault()},{priority:"high"}),editor.editing.view.document.on("dragover",(evt,data)=>{evt.stop(),data.preventDefault()},{priority:"high"})}function checkTypeUpload(editor){const imageUpload=editor.commands.get("imageUpload"),fileUpload=editor.commands.get("fileUpload");window.upload="imageUpload",imageUpload.on("execute",()=>{window.upload="imageUpload"}),fileUpload.on("execute",()=>{window.upload="fileUpload"})}function checkS3Files(editor){var files;getSavedFiles(editor.getData()).forEach(file=>{uploadedFiles.push(file)})}function getSavedFiles(draftData){const $linkFile=$(draftData).find(".ck-link-file"),$srcImg=$(draftData).find("img");let savedFiles=[];return $linkFile.length>0&&$linkFile.each((function(){let $href=$(this).attr("href");getAttributeFileNameOnly(savedFiles,$href)})),$srcImg.length>0&&$srcImg.each((function(){let $src=$(this).attr("src");getAttributeFileNameOnly(savedFiles,$src)})),savedFiles}function getAttributeFileNameOnly(savedFiles,source){void 0!==source&&(source=source.substr(source.indexOf(".net/")+5),savedFiles.push(source))}function deleteS3Files(content){let savedFiles=getSavedFiles(content),toDeleteFiles=[];if($.map(uploadedFiles,(function(val){$.inArray(val,savedFiles)<0&&toDeleteFiles.push(val)})),toDeleteFiles.length>0){let url="/pages/std/std-file-delete.php",data={ticket:$("#ticket").val(),delete:toDeleteFiles};$.post(url,data,"json")}}function enableCKLinkFiles(editor,type){var container=document.getElementById(editor.sourceElement.id);container="custom-essay"==type?$(container).closest("#student-editor"):editor.sourceElement,$(container).on("click","a.ck-link-file",(function(e){e.preventDefault();var href=$(this).attr("href"),win=window.open(href,"_blank");win?win.focus():alert("Please allow popups for this site")}))}function displaySaveStatus(editor){const pendingActions=editor.plugins.get("PendingActions"),statusIndicator=$("#save-draft-status");pendingActions.on("change:hasAny",(function(evt,propertyName,newValue){newValue&&(statusIndicator.css("color","#933"),statusIndicator.find("span.last-saved").text(""),statusIndicator.find("span.current-status").html('Saving draft... <i class="fa fa-spin fa-circle-o-notch"></i>'))}))}