!153 蓝区代码同步

Merge pull request !153 from 黎思泉/master
This commit is contained in:
openharmony_ci 2022-12-19 08:13:41 +00:00 committed by Gitee
commit 1a4d1416cc
No known key found for this signature in database
GPG Key ID: 173E9B9CA92EEF8F
3 changed files with 41 additions and 33 deletions

View File

@ -4,19 +4,20 @@
<title>
"editorJs"
</title>
<meta
http-equiv="Content-Type"
content="text/html; charset=UTF-8">
<link
rel="stylesheet"
type="text/css"
href="editor_style.css">
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<link rel="stylesheet" type="text/css" href="editor_style.css">
</head>
<body onload="load()">
<div class="edit-box">
<div
id="editorjs"
contenteditable="true">
<div id="editorjs" contenteditable="true">
</div>
<div class="button-box" id="buttonBox">
<div id="addToDo">
@ -34,8 +35,8 @@
</div>
</div>
<script
type="text/javascript"
src="rich_editor.js"></script>
<script type="text/javascript" src="rich_editor.js"></script>
</body>
</html>

View File

@ -37,7 +37,7 @@ body {
background-size: cover;
color: #182431;
opacity: 0.9;
font-size: 16vp;
font-size: 24px;
overflow: scroll;
user-select: none;
}

View File

@ -428,6 +428,13 @@ RICH_EDITOR.insertImageHtml = function (contents) {
selection.getRangeAt(0).insertNode(img);
};
document.getElementById('addToDo').addEventListener('click', (e) => {
console.info(`lsq: e is ${JSON.stringify(e)}`)
if (e.id !== 'editorjs') {
e.preventDefault()
}
})
document.getElementById('addToDo').addEventListener('click', () => {
callBackToApp.addToDo()
})
@ -443,12 +450,12 @@ document.getElementById('openAlbum').addEventListener('click', () => {
function changeSizeToRk() {
document.getElementById('editorjs').style.fontSize = '24px';
document.getElementById('img1').style.fontSize = '40px';
document.getElementById('img1').style.fontSize = '40px';
document.getElementById('img2').style.fontSize = '40px';
document.getElementById('img2').style.fontSize = '40px';
document.getElementById('img3').style.fontSize = '40px';
document.getElementById('img3').style.fontSize = '40px';
document.getElementById('img1').style.width = '40px';
document.getElementById('img1').style.height = '40px';
document.getElementById('img2').style.width = '40px';
document.getElementById('img2').style.height = '40px';
document.getElementById('img3').style.width = '40px';
document.getElementById('img3').style.height = '40px';
document.getElementById('lable1').style.fontSize = '20px';
document.getElementById('lable2').style.fontSize = '20px';
document.getElementById('lable3').style.fontSize = '20px';
@ -456,12 +463,12 @@ function changeSizeToRk() {
function changeSizeToPhone() {
document.getElementById('editorjs').style.fontSize = '16px';
document.getElementById('img1').style.fontSize = '24px';
document.getElementById('img1').style.fontSize = '24px';
document.getElementById('img2').style.fontSize = '24px';
document.getElementById('img2').style.fontSize = '24px';
document.getElementById('img3').style.fontSize = '24px';
document.getElementById('img3').style.fontSize = '24px';
document.getElementById('img1').style.width = '24px';
document.getElementById('img1').style.height = '24px';
document.getElementById('img2').style.width = '24px';
document.getElementById('img2').style.height = '24px';
document.getElementById('img3').style.width = '24px';
document.getElementById('img3').style.height = '24px';
document.getElementById('lable1').style.fontSize = '12px';
document.getElementById('lable2').style.fontSize = '12px';
document.getElementById('lable3').style.fontSize = '12px';
@ -469,12 +476,12 @@ function changeSizeToPhone() {
function changeSizeToTablet() {
document.getElementById('editorjs').style.fontSize = '16px';
document.getElementById('img1').style.fontSize = '28px';
document.getElementById('img1').style.fontSize = '28px';
document.getElementById('img2').style.fontSize = '28px';
document.getElementById('img2').style.fontSize = '28px';
document.getElementById('img3').style.fontSize = '28px';
document.getElementById('img3').style.fontSize = '28px';
document.getElementById('img1').style.width = '28px';
document.getElementById('img1').style.height = '28px';
document.getElementById('img2').style.width = '28px';
document.getElementById('img2').style.height = '28px';
document.getElementById('img3').style.width = '28px';
document.getElementById('img3').style.height = '28px';
document.getElementById('lable1').style.fontSize = '12px';
document.getElementById('lable2').style.fontSize = '12px';
document.getElementById('lable3').style.fontSize = '12px';
@ -485,7 +492,7 @@ function hiddenButton() {
}
RICH_EDITOR.getFocus = function() {
return document.GetElementById('editorjs').focus();
return document.getElementById('editorjs').focus();
}
document.getElementById('editorjs').addEventListener('click', () => {