This commit is contained in:
shaoyongjun 2024-11-01 09:59:05 +08:00
parent c497e02416
commit 41f121d18a
2 changed files with 27 additions and 25 deletions

View File

@ -273,12 +273,12 @@ export class MyUtils {
"\nwindow.webkit: ", window.webkit, "\nwindow.webkit: ", window.webkit,
"\nwindow.gecko: ", window.gecko, "\nwindow.gecko: ", window.gecko,
"\nwindow.opera: ", window.opera) "\nwindow.opera: ", window.opera)
let testDiv = document.getElementById("testDevice") // let testDiv = document.getElementById("testDevice")
testDiv.innerText = testDiv.innerText + // testDiv.innerText = testDiv.innerText +
"\n ie: " + window.ie + // "\n ie: " + window.ie +
"\n window.webkit: " + window.webkit + // "\n window.webkit: " + window.webkit +
"\n window.gecko: " + window.gecko + // "\n window.gecko: " + window.gecko +
"\n window.opera: " + window.opera // "\n window.opera: " + window.opera
} }
/** /**
@ -297,15 +297,15 @@ export class MyUtils {
let nowFrontSize = ((curClientW / designWidth) / 10) + 'px'; let nowFrontSize = ((curClientW / designWidth) / 10) + 'px';
curDoc.style.fontSize = nowFrontSize; curDoc.style.fontSize = nowFrontSize;
console.log("curClientW :", curClientW, "designWidth: ", designWidth, "-> ", nowFrontSize); console.log("curClientW :", curClientW, "designWidth: ", designWidth, "-> ", nowFrontSize);
let testDiv = document.getElementById("testDevice") // let testDiv = document.getElementById("testDevice")
testDiv.innerText = testDiv.innerText + // testDiv.innerText = testDiv.innerText +
// "\n navigator_userAgent :" + navigator.userAgent.toLocaleLowerCase() + // // "\n navigator_userAgent :" + navigator.userAgent.toLocaleLowerCase() +
"\n isMobile :" + /mobi|android|iphone|ipad|ipod/i.test(navigator.userAgent.toLocaleLowerCase()) + // "\n isMobile :" + /mobi|android|iphone|ipad|ipod/i.test(navigator.userAgent.toLocaleLowerCase()) +
"\n isIOS :" + /iphone|ipad|ipod/.test(window.navigator.userAgent.toLocaleLowerCase()) + // "\n isIOS :" + /iphone|ipad|ipod/.test(window.navigator.userAgent.toLocaleLowerCase()) +
"\n isAndroid :" + /android/.test(window.navigator.userAgent.toLocaleLowerCase()) + // "\n isAndroid :" + /android/.test(window.navigator.userAgent.toLocaleLowerCase()) +
"\n curClientW :" + curClientW + // "\n curClientW :" + curClientW +
" \n designWidth: " + designWidth + // " \n designWidth: " + designWidth +
"\n 1rem = " + nowFrontSize // "\n 1rem = " + nowFrontSize
} }
@ -341,7 +341,7 @@ export class MyUtils {
console.log("myEditFrontSize: ", myEditFrontSize.style.fontSize); console.log("myEditFrontSize: ", myEditFrontSize.style.fontSize);
let testDiv = document.getElementById("testDevice"); let testDiv = document.getElementById("testDevice");
testDiv.innerText += "\nmyEditFrontSize:" + myEditFrontSize.style.fontSize; testDiv.innerText = "\nmyEditFrontSize:" + myEditFrontSize.style.fontSize;
} }
/** /**

View File

@ -170,15 +170,17 @@ window.onload = function () {
/** /**
* 监听手机键盘 * 使用说明
*/ */
if (window.myEdit.ctx.isMobile) { let testDiv = document.getElementById("testDevice");
if (window.myEdit.ctx.isIOS) { testDiv.innerText += "\n\n ### info ###"+
// window.addEventListener("") "\n'# ': h1" +
} else if (window.myEdit.ctx.isAndroid) { "\n'## ': h2" +
"\n'### ': h3" +
} "\n'#### ': h4" +
"\n'##### ': h5" +
} "\n'###### ': h6" +
"\n'- ': 无序列表" +
"\n'num ': 有序序列表"
} }