This commit is contained in:
Jesse-Ma
2022-06-06 10:56:12 +08:00
parent 0d10a1802a
commit 9a7d98316c
11 changed files with 392 additions and 50 deletions

View File

@@ -52,7 +52,7 @@
<style>
#noteText {
color: black;
padding: 10px;
padding: 15px;
vertical-align: top;
width: 100%;
height: auto;
@@ -93,18 +93,67 @@
<div style="background: white;width:100%;height:40px;">
<img style="height:40px;float:left;" src="favicon.png">
<div style="float:left;width:auto;">
<div style="height: 40px;float: left;padding-top: 15px;padding-left: 20px;">
<Icon type="md-create" style="font-size: 22px;color:red" /><a class="noteKey">{{ noteForm.key }}</a>
<Button-group size="large">
</Button-group>
</div>
<img style="height:40px;float:left;" src="favicon.png">
<div style="float:left;width:auto;">
<Button-group size="large">
</Button-group>
</div>
<div style="float:right;width:auto;">
<Button-group size="large">
<Button v-show="!showPassword" type="error"
style="margin-right:5px; border-radius: 0px;font-size: 24px;" @click="showInput()"
icon="md-unlock"></Button>
<Input v-show="!showPassword">
<Button slot="append" type="error" style="margin-right:5px; border-radius: 0px;font-size: 24px;"
icon="md-checkmark-circle"></Button>
</Input>
<Button type="error" :loading="loading"
style="margin-right:5px; border-radius: 0px;font-size: 24px;" @click="submitNote()"
icon="md-cloud-upload"></Button>
<Button type="error" style="margin-left:0px; border-radius: 0px;font-size: 24px;"
@click="createNote()" icon="md-add"></Button>
<Button type="error" style="margin-left:0px; border-radius: 0px;font-size: 24px;"
@click="dropNote()" icon="md-trash"></Button>
</Button-group>
</div>
<div style="float:right;width:auto;">
<Button-group size="large">
<Button type="error" :loading="loading" style="margin-left:5px; border-radius: 0px;font-size: 24px;"
@click="submitNote()" icon="md-cloud-upload"></Button>
<Button type="error" style="margin-left:5px; border-radius: 0px;font-size: 24px;"
@click="createNote()" icon="md-add"></Button>
<!--
<Button v-show="!show" type="error" style="margin-left:5px; border-radius: 0px;font-size: 24px;"
@click="showNote()" icon="md-eye"></Button>
<Button v-show="show" type="error" style="margin-left:5px; border-radius: 0px;font-size: 24px;"
@click="hideNote()" icon="md-eye-off"></Button>
-->
</Button-group>
</div>
@@ -116,7 +165,8 @@
<Button-group size="default">
<Button type="error" @click="unLockNote()" icon="md-eye"></Button>
<Button type="error" @click="lockNote()" icon="md-eye-off"></Button>
</Button-group>
<Button type="error" style="margin-left:5px; border-radius: 0px;font-size: 24px;"
@click="dropNote()" icon="md-trash"></Button> </Button-group>
</div>
-->
@@ -153,7 +203,7 @@
:lg="{ span: 18, offset: 3 }" :xl="{ span: 16, offset: 4 }" :xxl="{ span: 16, offset: 4 }">
<Card :padding="0">
<Form :model="noteForm" :label-width="80">
<div id="wrapper" style="border-left: 3px solid #FF3366;">
<div id="wrapper" style="border-left: 0px solid #FF3366;">
<Input element-id="noteText" type="textarea" :border="false" v-model="noteForm.text"
:autosize="{ minRows: 30, maxRows: 1024 }" placeholder="Enter something..." v-on:input="log"
@@ -172,7 +222,7 @@
</Content>
<Footer class="layout-footer-center">2022 &copy; openif.com</Footer>
<Footer class="layout-footer-center">2022 &copy; flagnote.com</Footer>
</Layout>
<Modal v-model="modal1" title="Common Modal dialog box title" @on-ok="ok" @on-cancel="cancel">
@@ -204,6 +254,7 @@ export default {
components: {},
data() {
return {
show: true,
loading: false,
modal1: false,
showExt: false,
@@ -244,6 +295,7 @@ export default {
}
if (this.state.lock == "1") {
this.show = false;
this.noteForm.text = "*****lock*****";
return;
} else {
@@ -264,6 +316,12 @@ export default {
computed: {},
watch: {},
methods: {
showInput() {
this.showPassword = true;
},
hideInput() {
//this.showPassword = false;
},
change(status) {
this.showPassword = status;
},
@@ -324,7 +382,7 @@ export default {
// //document.body.appendChild(canvas);
// });
} else if (event.ctrlKey && event.which == 13) {
} else if (event.ctrlKey && (event.which == 13)) {
this.save().then(res => {
if (res) {
location.reload();
@@ -352,7 +410,7 @@ export default {
}
});
},
lockNote() {
hideNote() {
if (this.state.locking == "1") {
return;
}
@@ -363,6 +421,8 @@ export default {
return;
}
let password = '123456';
setStoreText(this.noteForm.text, this.secret, password);
@@ -378,11 +438,13 @@ export default {
noteText.selectionStart = 0;
noteText.selectionEnd = 1;
this.show = false;
this.state.locking = "0";
},
unLockNote() {
showNote() {
if (this.state.locking == "1") {
return;
}
@@ -426,7 +488,7 @@ export default {
this.noteForm.text = plainText.substring(9);
this.state.lock = "0";
setStoreText(this.noteForm.text, this.secret);
this.show = true;
this.state.locking = "0";
} else {
alert("password is wrong!")
@@ -438,10 +500,21 @@ export default {
this.state.locking = "0";
}
},
refresh() {
location.reload();
},
createNote() {
window.open("/");
},
dropNote() {
storage.local.delete(this.secret.storeKey + '.text');
storage.session.delete(this.secret.storeKey + '.keyMeta');
location.reload();
},
bindEvent() {
if (document.body.createTextRange) {
Jquery(document).keydown(function (e) {