implement insider preview feature

This commit is contained in:
Xen 2020-05-31 21:50:28 +08:00
parent e1d6d2a4de
commit e4349a5a73
4 changed files with 31 additions and 7 deletions

View File

@ -1,7 +1,7 @@
{
"name": "comng",
"productName": "comNG",
"version": "1.0.5",
"version": "1.0.6",
"mode": "dev",
"description": "A powerful serialport tool with modernx UI",
"repository": "https://github.com/xenkuo/comNG",

View File

@ -60,6 +60,7 @@ const store = new Store({
},
"1.0.6": (store) => {
store.set("transmit.hexmode", false);
store.set("about.insiderPreview", false);
},
},
});
@ -205,6 +206,9 @@ window.onload = () => {
document.getElementById("sign-switch").checked = config.advance.sign.switch;
document.getElementById("sign-name").value = config.advance.sign.name;
document.getElementById("insider-preview").checked =
config.about.insiderPreview;
document.getElementById("bar-color-head").value =
config.advance.barColor.head;
document.getElementById("bar-color-middle").value =
@ -250,6 +254,9 @@ window.onload = () => {
return data.json();
})
.then((res) => {
if (res.prerelease === true && config.about.insiderPreview === false)
return;
let latest = res.tag_name.split("v")[1];
if (latest !== appVersion && true === platformUpdateCheck(res.assets)) {
const dialogOpts = {
@ -541,6 +548,10 @@ document.getElementById("trans-log-btn").onclick = () => {
mcss.textareaAutoResize(logObj);
};
document.getElementById("insider-preview").onclick = (e) => {
configUpdate("about.insiderPreview", e.target.checked);
};
document.getElementById("bar-color-head").oninput = (e) => {
let color = e.target.value;

View File

@ -474,7 +474,7 @@ amdRequire(["vs/editor/editor.main"], function () {
theme: "comNGTheme",
language: "comNGLang",
automaticLayout: true,
readOnly: false,
readOnly: true,
folding: false,
fontFamily: config.general.fontFamily,
fontSize: config.general.fontSize,

View File

@ -344,13 +344,26 @@
<div class="col s3 label-key">
<p>Issue</p>
</div>
<div class="col s9">
<div class="col s3">
<p>
<a href="https://gitee.com/xenkuo/comNG/issues" id="issue"
>https://gitee.com/xenkuo/comNG/issues</a
>comNG Issues</a
>
</p>
</div>
<div class="col s3 config-key">
<p>Insider Preview</p>
</div>
<div class="col s3 config-item">
<div class="switch">
<label>
Off
<input type="checkbox" id="insider-preview" />
<span class="lever"></span>
On
</label>
</div>
</div>
</div>
<div class="row label-row">
<div class="col s3 label-key">
@ -366,14 +379,14 @@
</div>
<div class="row label-row">
<div class="col s3 label-key">
<p>Highlight Syntax</p>
<p>Documents</p>
</div>
<div class="col s9">
<p>
<a
href="https://xenkuo.github.io/2019-08-03-comNGLang"
href="https://gitee.com/xenkuo/comNG/blob/master/doc/Introduction.md"
id="comnglang"
>https://xenkuo.github.io/2019-08-03-comNGLang</a
>Usage Docs</a
>
</p>
</div>