Skip to content

Commit a94c59c

Browse files
authored
Merge branch 'dev' into backup
2 parents f07da3c + d6d1533 commit a94c59c

File tree

3 files changed

+41
-16
lines changed

3 files changed

+41
-16
lines changed

src/content.ts

Lines changed: 34 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -27,8 +27,8 @@ if (!document.getElementById('__ga_grayLayout__')) {
2727
});
2828
}
2929

30-
sessionStorage.captureBoxPositionLeft = 0;
31-
sessionStorage.captureBoxPositionTop = 0;
30+
sessionStorage.setItem('captureBoxPositionLeft', '0');
31+
sessionStorage.setItem('captureBoxPositionTop', '0');
3232

3333
function showGrayLayout(passphrase: string) {
3434
let grayLayout = document.getElementById('__ga_grayLayout__');
@@ -67,8 +67,8 @@ function grayLayoutDown(event: MouseEvent) {
6767
return;
6868
}
6969

70-
sessionStorage.captureBoxPositionLeft = event.clientX;
71-
sessionStorage.captureBoxPositionTop = event.clientY;
70+
sessionStorage.setItem('captureBoxPositionLeft', event.clientX.toString());
71+
sessionStorage.setItem('captureBoxPositionTop', event.clientY.toString());
7272
captureBox.style.left = event.clientX + 'px';
7373
captureBox.style.top = event.clientY + 'px';
7474
captureBox.style.width = '1px';
@@ -87,14 +87,20 @@ function grayLayoutMove(event: MouseEvent) {
8787
return;
8888
}
8989

90-
const captureBoxLeft =
91-
Math.min(sessionStorage.captureBoxPositionLeft, event.clientX);
92-
const captureBoxTop =
93-
Math.min(sessionStorage.captureBoxPositionTop, event.clientY);
90+
const captureBoxLeft = Math.min(
91+
Number(sessionStorage.getItem('captureBoxPositionLeft')), event.clientX);
92+
const captureBoxTop = Math.min(
93+
Number(sessionStorage.getItem('captureBoxPositionTop')), event.clientY);
9494
const captureBoxWidth =
95-
Math.abs(sessionStorage.captureBoxPositionLeft - event.clientX) - 1;
95+
Math.abs(
96+
Number(sessionStorage.getItem('captureBoxPositionLeft')) -
97+
event.clientX) -
98+
1;
9699
const captureBoxHeight =
97-
Math.abs(sessionStorage.captureBoxPositionTop - event.clientY) - 1;
100+
Math.abs(
101+
Number(sessionStorage.getItem('captureBoxPositionTop')) -
102+
event.clientY) -
103+
1;
98104
captureBox.style.left = captureBoxLeft + 'px';
99105
captureBox.style.top = captureBoxTop + 'px';
100106
captureBox.style.width = captureBoxWidth + 'px';
@@ -120,13 +126,25 @@ function grayLayoutUp(event: MouseEvent, passphrase: string) {
120126
}
121127

122128
const captureBoxLeft =
123-
Math.min(sessionStorage.captureBoxPositionLeft, event.clientX) + 1;
129+
Math.min(
130+
Number(sessionStorage.getItem('captureBoxPositionLeft')),
131+
event.clientX) +
132+
1;
124133
const captureBoxTop =
125-
Math.min(sessionStorage.captureBoxPositionTop, event.clientY) + 1;
134+
Math.min(
135+
Number(sessionStorage.getItem('captureBoxPositionTop')),
136+
event.clientY) +
137+
1;
126138
const captureBoxWidth =
127-
Math.abs(sessionStorage.captureBoxPositionLeft - event.clientX) - 1;
139+
Math.abs(
140+
Number(sessionStorage.getItem('captureBoxPositionLeft')) -
141+
event.clientX) -
142+
1;
128143
const captureBoxHeight =
129-
Math.abs(sessionStorage.captureBoxPositionTop - event.clientY) - 1;
144+
Math.abs(
145+
Number(sessionStorage.getItem('captureBoxPositionTop')) -
146+
event.clientY) -
147+
1;
130148

131149
// make sure captureBox and grayLayout is hidden
132150
setTimeout(() => {
@@ -168,7 +186,8 @@ function pasteCode(code: string) {
168186
const _inputBoxes = document.getElementsByTagName('input');
169187
const inputBoxes: HTMLInputElement[] = [];
170188
for (let i = 0; i < _inputBoxes.length; i++) {
171-
if (_inputBoxes[i].type === 'text' || _inputBoxes[i].type === 'number') {
189+
if (_inputBoxes[i].type === 'text' || _inputBoxes[i].type === 'number' ||
190+
_inputBoxes[i].type === 'tel') {
172191
inputBoxes.push(_inputBoxes[i]);
173192
}
174193
}

src/ui/info.ts

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,12 @@ async function info(_ui: UI) {
2020
}
2121
}
2222
} else if (tab === 'dropbox') {
23+
if (localStorage.dropboxEncrypted !== 'true' &&
24+
localStorage.dropboxEncrypted !== 'false') {
25+
localStorage.dropboxEncrypted = 'true';
26+
_ui.instance.dropboxEncrypted = localStorage.dropboxEncrypted;
27+
}
28+
2329
chrome.permissions.request(
2430
{origins: ['https://*.dropboxapi.com/*']}, async (granted) => {
2531
if (granted) {

view/popup.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -168,7 +168,7 @@
168168
<!-- DROPBOX -->
169169
<div v-show="info === 'dropbox'">
170170
<div id="dropbox_box">
171-
<div id="dropbox_risk" v-if="dropboxEncrypted !== 'true' && dropboxToken">{{ i18n.dropbox_risk }}</div>
171+
<div id="dropbox_risk" v-if="dropboxEncrypted !== 'true' || !encryption.getEncryptionStatus()">{{ i18n.dropbox_risk }}</div>
172172
<div v-if="encryption.getEncryptionStatus() && dropboxToken">
173173
<label for="dropbox_encryption" id="dropbox_encryption_label">{{ i18n.encrypted }}</label>
174174
<select id="dropbox_encryption" v-model="dropboxEncrypted" v-on:change="backupUpdateEncryption('dropbox')">

0 commit comments

Comments
 (0)