mirror of
https://github.com/leanote/desktop-app.git
synced 2025-10-16 08:01:53 +00:00
本地添加图片成功, add resource 待完善
This commit is contained in:
19
test.js
19
test.js
@@ -16,23 +16,34 @@ Api.addNotebook({
|
||||
Title: "哈哈"
|
||||
}, function() {});
|
||||
*/
|
||||
Api.test();
|
||||
Api.uploadImage();
|
||||
/*
|
||||
User.userId = '54bdc65599c37b0da9000002';
|
||||
console.log(User.getCurActiveUserId());
|
||||
// console.log(User.getCurActiveUserId());
|
||||
Note.getDirtyNotes(function(ret) {
|
||||
console.log(ret);
|
||||
});
|
||||
*/
|
||||
/*
|
||||
Note.getNoteByServerNoteId("54c6313799c37bdeec000008", function(ret){
|
||||
console.log(ret);
|
||||
});
|
||||
*/
|
||||
|
||||
|
||||
// Api.auth('c@a.com', 'abc123');
|
||||
// var content = '<img src="http://localhost:9000/api/file/getImage?fileId=54c2083f99c37bea5f000001"> <img src="http://localhost:9000/api/file/getImage?fileId=54c2083f99c37bea5f000001">' + "\n" + '<img src="http://localhost:9000/api/file/getImage?fileId=54c2083f99c37bea5f000001">';
|
||||
// var reg = new RegExp('<img *src="' + Api.leanoteUrl + '/api/file/getImage', 'g');
|
||||
// content = content.replace(reg, '<img src="' + Server.localUrl + '/api/file/getImage');
|
||||
// console.log(content);
|
||||
|
||||
/*
|
||||
var content = '<p>lifedddddd</p><p><img src="app://leanote/data/54bdc65599c37b0da9000002/images/1422368307147_2.png" alt="" data-mce-src="app://leanote/data/54bdc65599c37b0da9000002/images/1422368307147_2.png" style="display: block; margin-left: auto; margin-right: auto;"></p><p><img src="http://127.0.0.1:8008/api/file/getImage?fileId=54c7ae27d98d0329dd000000" alt="" data-mce-src="http://127.0.0.1:8008/api/file/getImg?fileId=54c7ae27d98d0329dd000000"></p><p><br></p><p><img src="http://127.0.0.1:8008/api/file/getImage?fileId=54c7ae855e94ea2dba000000" alt="" data-mce-src="http://127.0.0.1:8008/api/file/getImage?fileId=54c7ae855e94ea2dba000000" style="display: block; margin-left: auto; margin-right: auto;"></p><p><br></p><p><br></p>';
|
||||
// http://127.0.0.1:8008/api/file/getImage?fileId=54c7ae27d98d0329dd000000
|
||||
// var reg = new RegExp('http://127.0.0.1:8008/api/file/getImage?fileId=([0-9a-zA-Z]{24})', 'g');
|
||||
var reg = new RegExp("http://127.0.0.1:8008/api/file/getImage\\?fileId=([0-9a-zA-Z]{24})", 'g');
|
||||
var fileIds = [];
|
||||
while((result = reg.exec(content)) != null) {
|
||||
// result = [所有, 子表达式1, 子表达式2]
|
||||
console.log(result);
|
||||
}
|
||||
console.log("??");
|
||||
*/
|
Reference in New Issue
Block a user