Skip to content
This repository was archived by the owner on Jun 26, 2025. It is now read-only.

Commit bb38e97

Browse files
committed
Improve Remove Method / Add Warning Message
1 parent 85a8ab6 commit bb38e97

File tree

3 files changed

+11
-24
lines changed

3 files changed

+11
-24
lines changed

src/popup/router/pages/Add.vue

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@
1818
<el-button @click="clearText()" type="warning">지우기</el-button>
1919
<el-button @click="Back()" type="primary">돌아가기</el-button>
2020
</el-row>
21+
<h4>중요한 정보를 입력하지 마세요! 단어는 암호화되어서 저장되지 않습니다.<br />개발자는 중요 정보를 입력해서 생기는 문제를 책임지지 않습니다.</h4>
2122
</el-col>
2223
</el-container>
2324
</template>
@@ -74,15 +75,15 @@ export default {
7475
for(var i in wordArray) {
7576
console.log(wordArray[i]);
7677
if(wordArray[i]['abbr'] == _this.abbrWord || wordArray[i]['origin'] == _this.abbrWord ||
77-
wordArray[i]['abbr'] == _this.originWord || wordArray[i]['origin'] == _this.originWord) {
78+
wordArray[i]['abbr'] == _this.originWord) {
7879
isAlreadyRegistered = true;
7980
break;
8081
}
8182
}
8283
if(!isAlreadyRegistered) {
8384
_this.$message({
8485
showClose: true,
85-
message: '등록되었습니다! 새로고침을 하셔야 정상적으로 적용됩니다.',
86+
message: '등록되었습니다!',
8687
type: 'success'
8788
});
8889
wordArray.push({'abbr': _this.abbrWord, 'origin': _this.originWord});

src/popup/router/pages/List.vue

Lines changed: 6 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -43,9 +43,10 @@ export default {
4343
if(items.firstInit == undefined) {
4444
console.log("Setting First Data...");
4545
var firstList = JSON.stringify([{"abbr": "ㅎㅇ", "origin": "안녕하세요"}, {"abbr": "ㅅㄱ", "origin": "수고하셨습니다"}]);
46+
chrome.storage.local.set({'WordList': firstList}, function() {});
4647
chrome.storage.local.set({'enable': true}, function() {});
4748
chrome.storage.local.set({'firstInit': false}, function() {});
48-
chrome.storage.local.set({'WordList': firstList}, function() {});
49+
chrome.tabs.create({url: "https://github.com/Aftermoon-dev/AbbrtoOriginal/wiki/Help-(%EB%8F%84%EC%9B%80%EB%A7%90)", active: true});
4950
}
5051
_this.writeList();
5152
});
@@ -62,22 +63,10 @@ export default {
6263
}).catch(() => {});
6364
},
6465
deleteItem(targetAbbr) {
65-
var _this = this;
66-
getLocalWordList().then(function (data) {
67-
_this.$message({
68-
showClose: true,
69-
message: '삭제되었습니다!',
70-
type: 'success'
71-
});
72-
var wordArray = Object.values(JSON.parse(data.WordList));
73-
console.log('original : ' + JSON.stringify(wordArray));
74-
wordArray = wordArray.filter(wordArray => wordArray.abbr !== targetAbbr)
75-
chrome.storage.local.set({'WordList': JSON.stringify(wordArray)}, function() {});
76-
console.log('change : ' + JSON.stringify(wordArray));
77-
_this.resetTable();
78-
}).catch(function (err) {
79-
console.error(err);
80-
});
66+
var wordArray = this.tableData;
67+
wordArray = wordArray.filter(wordArray => wordArray.abbr !== targetAbbr)
68+
this.tableData = wordArray;
69+
chrome.storage.local.set({'WordList': JSON.stringify(wordArray)}, function() {});
8170
},
8271
writeList() {
8372
var _this = this;
@@ -93,10 +82,6 @@ export default {
9382
}).catch(function (err) {
9483
console.error(err);
9584
});
96-
},
97-
resetTable() {
98-
this.tableData = [];
99-
this.writeList();
10085
}
10186
}
10287
}

src/popup/router/pages/Setting.vue

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@
88
<el-button @click="questionDelete()" type="danger">모든 데이터 초기화</el-button>
99
</el-row>
1010
<el-row>
11+
<el-button size="mini" @click="gotoLink('https://github.com/Aftermoon-dev/AbbrtoOriginal/wiki/Help-(%EB%8F%84%EC%9B%80%EB%A7%90)')" type="primary">도움말</el-button>
1112
<el-button size="mini" @click="gotoLink('https://github.com/Aftermoon-dev/AbbrtoOriginal')" type="primary">GitHub 저장소</el-button>
1213
<el-button size="mini" @click="gotoLink('https://github.com/Aftermoon-dev/')" type="primary">개발자 GitHub</el-button>
1314
</el-row>
@@ -31,7 +32,7 @@ export default {
3132
},
3233
methods: {
3334
questionDelete() {
34-
this.$confirm('등록된 모든 데이터가 삭제되고 초기 상태로 돌아갑니다. 진행하시겠습니까?', '경고', {
35+
this.$confirm('등록된 모든 데이터가 삭제되고 초기 상태로 돌아갑니다. 진행하시겠습니까? (초기화시 도움말 페이지가 열립니다)', '경고', {
3536
confirmButtonText: '',
3637
cancelButtonText: '아니오',
3738
type: 'warning'

0 commit comments

Comments
 (0)