!250 规避接口javaScriptProxy异常导致的js调用失败

Merge pull request !250 from nobbo/master
This commit is contained in:
openharmony_ci
2024-02-20 01:55:22 +00:00
committed by Gitee
@@ -400,13 +400,15 @@ function getImagePathFromContent(contentInfo) {
}
function scheduledSaveContent() {
console.info('scheduledSaveContent');
var htmlString = RICH_EDITOR.getHtml();
let imgName = getImagePathFromContent(htmlString);
htmlString = window.btoa(unescape(encodeURIComponent(htmlString)));
callBackToApp.callbackImagePath(imgName);
var str = callBackToApp.callbackScheduledSave(htmlString);
console.info('scheduledSaveContent end');
if (callBackToApp !== undefined) {
console.info('scheduledSaveContent');
var htmlString = RICH_EDITOR.getHtml();
let imgName = getImagePathFromContent(htmlString);
htmlString = window.btoa(unescape(encodeURIComponent(htmlString)));
callBackToApp.callbackImagePath(imgName);
var str = callBackToApp.callbackScheduledSave(htmlString);
console.info('scheduledSaveContent end');
}
}
document.body.addEventListener('paste', (event) => {
@@ -504,7 +506,5 @@ RICH_EDITOR.getFocus = function () {
}
document.getElementById('editorjs_box').addEventListener('click', () => {
if (callBackToApp.getBreakPoint() === 'sm') {
document.getElementById('buttonBox').style.display = 'flex';
}
document.getElementById('buttonBox').style.display = 'flex';
})