working android example. File access still not working
This commit is contained in:
parent
a04fd0293f
commit
340833ea7b
6 changed files with 50 additions and 17 deletions
30
src/main.js
30
src/main.js
|
|
@ -1,4 +1,5 @@
|
|||
const { convertFileSrc, invoke } = window.__TAURI__.core;
|
||||
// const { invoke } = window.__TAURI__.core;
|
||||
const { homeDir, join } = window.__TAURI__.path;
|
||||
const { readFile } = window.__TAURI__.fs;
|
||||
|
||||
|
|
@ -7,20 +8,25 @@ const filePath = await join(appDataDirPath, 'Pictures/wallpaper.png');
|
|||
|
||||
const assetUrl = convertFileSrc(filePath);
|
||||
|
||||
|
||||
let text = "";
|
||||
window.addEventListener("DOMCharacterDataModified", () => {
|
||||
// window.addEventListener("DOMCharacterDataModified", () => {
|
||||
// var tag_id = document.getElementById('rendered_markdown');
|
||||
// tag_id.innerHTML = "<p>HI</p>"
|
||||
// window.addEventListener("DOMContentLoaded", () => {
|
||||
let textarea = document.getElementById('markdown_input');
|
||||
textarea.addEventListener('input', ()=> {
|
||||
let textarea = document.getElementById('markdown_input');
|
||||
textarea.addEventListener('input', ()=> {
|
||||
text = textarea.innerText;
|
||||
invoke("parse_markdown", { document: text }).then(
|
||||
(ret)=>{
|
||||
var tag_id = document.getElementById('rendered_markdown');
|
||||
// tag_id.innerHTML = "<pre>".concat("", ret).concat("", "</pre>");
|
||||
tag_id.innerHTML = assetUrl.concat(" ", ' \n <img src="'.concat("", assetUrl).concat("", '" alt="Girl in a jacket" width="500" height="600">'))
|
||||
}
|
||||
);
|
||||
var tag_id = document.getElementById('rendered_markdown');
|
||||
tag_id.innerHTML = "<p>HI</p>"
|
||||
// invoke("parse_markdown", { document: text }).then(
|
||||
// (ret)=>{
|
||||
// var tag_id = document.getElementById('rendered_markdown');
|
||||
// // tag_id.innerHTML = assetUrl.concat(" ", ' \n <img src="'.concat("", assetUrl).concat("", '" alt="Girl in a jacket" width="500" height="600">'))
|
||||
// tag_id.innerHTML = "<p>HI</p>"
|
||||
// // tag_id.innerHTML = "<pre>".concat("", ret).concat("", "</pre>");
|
||||
tag_id.innerHTML = assetUrl.concat(" ", ' \n <img src="'.concat("", assetUrl).concat("", '" alt="Girl in a jacket" width="500" height="600">'))
|
||||
// }
|
||||
// );
|
||||
|
||||
});
|
||||
// });
|
||||
});
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue