Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
fixNoteContentForSend: function(content) {
if(!content) {
return content;
}
// console.log(Evt.localUrl + '/api/file/getImage');
// console.log(content);
var reg = new RegExp(Evt.getImageLocalUrlPrefix(), 'g');
content = content.replace(reg, Evt.leanoteUrl + '/api/file/getImage');
var reg2 = new RegExp(Evt.getAttachLocalUrlPrefix(), 'g');
content = content.replace(reg2, Evt.leanoteUrl + '/api/file/getAttach');
var reg3 = new RegExp(Evt.getAllAttachsLocalUrlPrefix(), 'g');
content = content.replace(reg3, Evt.leanoteUrl + '/api/file/getAllAttachs');
return content;
},
fixNoteContent: function(content) {
if(!content) {
return content;
}
// https, http都行
var url = Evt.leanoteUrl.replace('https', 'https*');
// http://leanote.com/file/outputImage?fileId=54f9079f38f4115c0200001b
var reg0 = new RegExp(url + '/file/outputImage', 'g');
content = content.replace(reg0, Evt.getImageLocalUrlPrefix());
var reg = new RegExp(url + '/api/file/getImage', 'g');
content = content.replace(reg, Evt.getImageLocalUrlPrefix());
var reg2 = new RegExp(url + '/api/file/getAttach', 'g');
content = content.replace(reg2, Evt.getAttachLocalUrlPrefix());
var reg3 = new RegExp(url + '/attach/download?attachId', 'g');
content = content.replace(reg3, Evt.getAttachLocalUrlPrefix() + '?fileId');
// 无用
// api/file/getAllAttachs?noteId=xxxxxxxxx, 这里的noteId是服务器上的noteId啊
var reg4 = new RegExp(url + '/api/file/getAllAttachs', 'g');
content = content.replace(reg4, Evt.getAllAttachsLocalUrlPrefix());
return content;
},
}
// https, http都行
var url = Evt.leanoteUrl.replace('https', 'https*');
// http://leanote.com/file/outputImage?fileId=54f9079f38f4115c0200001b
var reg0 = new RegExp(url + '/file/outputImage', 'g');
content = content.replace(reg0, Evt.getImageLocalUrlPrefix());
var reg = new RegExp(url + '/api/file/getImage', 'g');
content = content.replace(reg, Evt.getImageLocalUrlPrefix());
var reg2 = new RegExp(url + '/api/file/getAttach', 'g');
content = content.replace(reg2, Evt.getAttachLocalUrlPrefix());
var reg3 = new RegExp(url + '/attach/download?attachId', 'g');
content = content.replace(reg3, Evt.getAttachLocalUrlPrefix() + '?fileId');
// 无用
// api/file/getAllAttachs?noteId=xxxxxxxxx, 这里的noteId是服务器上的noteId啊
var reg4 = new RegExp(url + '/api/file/getAllAttachs', 'g');
content = content.replace(reg4, Evt.getAllAttachsLocalUrlPrefix());
return content;
},