Skip to content

Commit

Permalink
Merge pull request #12 from ety001/3.0.3
Browse files Browse the repository at this point in the history
add privacy policy
  • Loading branch information
ety001 authored Feb 7, 2020
2 parents 437cebf + 0a11c27 commit 59676dd
Show file tree
Hide file tree
Showing 6 changed files with 50 additions and 32 deletions.
2 changes: 1 addition & 1 deletion package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "review-bookmark",
"version": "3.0.2",
"version": "3.0.3",
"description": "A bookmark manager for Chrome.",
"author": "ETY001 <[email protected]>",
"license": "MIT",
Expand Down
10 changes: 8 additions & 2 deletions src/_locales/en/messages.json
Original file line number Diff line number Diff line change
Expand Up @@ -132,9 +132,15 @@
"message": "Clear List"
},
"ga": {
"message": "Whether to enable Data Analyzes? This will help author improve the extension's experience."
"message": "Whether to enable Data Analyzes?"
},
"enable": {
"enable_btn": {
"message": "Enable"
},
"disable_btn": {
"message": "Disable"
},
"privacy_policy": {
"message": "Review Bookmarks will collect anonymously how freqency to display/block/manage bookmarks, if you have agreed. These data will help author to improve the extension's experience."
}
}
12 changes: 9 additions & 3 deletions src/_locales/zh_CN/messages.json
Original file line number Diff line number Diff line change
Expand Up @@ -132,9 +132,15 @@
"message": "清空列表"
},
"ga": {
"message": "是否允许作者统计数据以此提升使用体验"
"message": "是否允许统计数据"
},
"enable": {
"message": "激活"
"enable_btn": {
"message": "允许"
},
"disable_btn": {
"message": "拒绝"
},
"privacy_policy": {
"message": "如果同意,温故知新将会匿名地收集用户的展示/屏蔽/整理书签的频率,这将帮助作者提升扩展的使用体验。"
}
}
34 changes: 17 additions & 17 deletions src/background.js
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@ const GetUid = {
const uid = GetUid.get();

//google analytics
let currentVersion = '3_0_2';
let currentVersion = '3_0_3';
if (isChrome) {
currentVersion = `chrome_${currentVersion}`;
}
Expand Down Expand Up @@ -104,7 +104,7 @@ chrome.runtime.onConnect.addListener(function(port) {
}
const bmForFull = BookmarkLib.getBookmark();
sendPageview('/full_mode_page');
sendEvent(currentVersion, 'getbookmark_from_full', 'get_bookmark_' + uid, JSON.stringify({ uid, bmForFull }));
sendEvent(currentVersion, 'getbookmark_from_full', uid);
port.postMessage({ ctype: ctype, cdata: bmForFull });
break;
case 'getbookmark_from_mini':
Expand All @@ -114,7 +114,7 @@ chrome.runtime.onConnect.addListener(function(port) {
}
const bmForMini = BookmarkLib.getBookmark();
sendPageview('/mini_mode_notification');
sendEvent(currentVersion, 'getbookmark_from_mini', 'get_bookmark_' + uid, JSON.stringify({ uid, bmForMini }));
sendEvent(currentVersion, 'getbookmark_from_mini', uid);
port.postMessage({
ctype,
cdata: {
Expand All @@ -128,7 +128,7 @@ chrome.runtime.onConnect.addListener(function(port) {
if (bm) {
BookmarkLib.getBookmarkById(bm.parentId, parentBm => {
bm.parent = parentBm;
sendEvent(currentVersion, 'getbookmark_byid', 'get_bookmark_' + uid, JSON.stringify({ uid, bm }));
sendEvent(currentVersion, 'getbookmark_byid', uid);
return port.postMessage({
ctype,
cdata: {
Expand All @@ -138,7 +138,7 @@ chrome.runtime.onConnect.addListener(function(port) {
});
});
} else {
sendEvent(currentVersion, 'getbookmark_byid', 'get_bookmark_' + uid, JSON.stringify({ uid, bm }));
sendEvent(currentVersion, 'getbookmark_byid', uid);
return port.postMessage({
ctype,
cdata: {
Expand All @@ -152,46 +152,46 @@ chrome.runtime.onConnect.addListener(function(port) {
case 'getbookmark_menu':
BookmarkLib.getBookmarkMenu(menu => {
sendPageview('/bookmark_manager_page');
sendEvent(currentVersion, 'getbookmark_menu', 'getbookmark_menu_' + uid, JSON.stringify({ uid }));
sendEvent(currentVersion, 'getbookmark_menu', uid);
port.postMessage({ ctype, cdata: menu });
});
break;
case 'getbookmark_children':
sendEvent(currentVersion, 'getbookmark_children', 'getbookmark_children_' + uid, JSON.stringify({ uid }));
sendEvent(currentVersion, 'getbookmark_children', uid);
BookmarkLib.getBookmarkChildren(cdata, bookmarks => {
port.postMessage({ ctype, cdata: bookmarks });
});
break;
case 'block':
sendEvent(currentVersion, 'block', 'block_' + uid, JSON.stringify({ uid }));
sendEvent(currentVersion, 'block', uid);
BookmarkLib.addBlockedBookmark(cdata);
port.postMessage({ ctype, cdata: true });
break;
case 'cancel_block':
sendEvent(currentVersion, 'cancel_block', 'cancel_block_' + uid, JSON.stringify({ uid }));
sendEvent(currentVersion, 'cancel_block', uid);
BookmarkLib.removeBlockedBookmark(cdata);
port.postMessage({ ctype, cdata: true });
break;
case 'remove_bookmark':
sendEvent(currentVersion, 'remove_bookmark', 'remove_bookmark_' + uid, JSON.stringify({ uid }));
sendEvent(currentVersion, 'remove_bookmark', uid);
// 从 chrome 删除
BookmarkLib.removeBookmark(cdata, () => {
port.postMessage({ ctype, cdata: true });
});
break;
case 'update_bookmark':
sendEvent(currentVersion, 'update_bookmark', 'update_bookmark_' + uid, JSON.stringify({ uid }));
sendEvent(currentVersion, 'update_bookmark', uid);
BookmarkLib.updateBookmark(cdata, () => {
port.postMessage({ ctype, cdata: true });
});
break;
case 'get_config':
sendPageview('/popup');
sendEvent(currentVersion, 'get_config', 'get_config_' + uid, JSON.stringify({ uid, config: store.getters.config }));
sendEvent(currentVersion, 'get_config', uid);
port.postMessage({ ctype, cdata: store.getters.config });
break;
case 'save_config':
sendEvent(currentVersion, 'save_config', 'save_config_' + uid, JSON.stringify({ uid }));
sendEvent(currentVersion, 'save_config', uid);
store.commit(types.UPDATE_CONFIG, {
status: cdata.status,
mini: cdata.mini,
Expand All @@ -212,24 +212,24 @@ chrome.runtime.onConnect.addListener(function(port) {
break;
case 'get_block_list':
sendPageview('/block_list_page');
sendEvent(currentVersion, 'get_block_list', 'get_block_list_' + uid, JSON.stringify({ uid }));
sendEvent(currentVersion, 'get_block_list', uid);
BookmarkLib.getBlockList(blockedBookmarks => {
port.postMessage({ ctype, cdata: blockedBookmarks });
});
break;
case 'create_bookmark_folder':
sendEvent(currentVersion, 'create_bookmark_folder', 'create_bookmark_folder_' + uid, JSON.stringify({ uid }));
sendEvent(currentVersion, 'create_bookmark_folder', uid);
BookmarkLib.createBookmark(cdata, () => {
port.postMessage({ ctype, cdata: true });
});
break;
case 'remove_block_bookmark':
sendEvent(currentVersion, 'remove_block_bookmark', 'remove_block_bookmark_' + uid, JSON.stringify({ uid }));
sendEvent(currentVersion, 'remove_block_bookmark', uid);
BookmarkLib.removeBlockedBookmark(cdata);
port.postMessage({ ctype, cdata: true });
break;
case 'clear_block_list':
sendEvent(currentVersion, 'clear_block_list', 'clear_block_list_' + uid, JSON.stringify({ uid }));
sendEvent(currentVersion, 'clear_block_list', uid);
BookmarkLib.clearBlockList();
port.postMessage({ ctype, cdata: true });
break;
Expand Down
22 changes: 14 additions & 8 deletions src/popup/App.vue
Original file line number Diff line number Diff line change
@@ -1,16 +1,19 @@
<template>
<div>
<el-row class="config-box" v-if="formData !== null">
<el-col :span="24" v-if="ga === false">
<el-col :span="24" v-if="displayGaReminder === 'display'">
<h4>{{ 'ga' | lang }}</h4>
<div style="margin-bottom: 20px;">
<el-alert :title="'privacy_policy' | lang" type="warning" :closable="false"></el-alert>
</div>
<el-form>
<el-form-item>
<el-button type="primary" @click="enableGa()">{{ 'confirm_btn' | lang }}</el-button>
<el-button type="warning" @click="cancelGa()">{{ 'cancel_btn' | lang }}</el-button>
<el-button type="primary" @click="enableGa()">{{ 'enable_btn' | lang }}</el-button>
<el-button type="warning" @click="cancelGa()">{{ 'disable_btn' | lang }}</el-button>
</el-form-item>
</el-form>
</el-col>
<el-col :span="24" v-if="ga === true">
<el-col :span="24" v-if="displayGaReminder === 'hidden'">
<el-form ref="form1" :rules="rules" :model="formData" label-position="left" label-width="140px" @submit.native.prevent>
<el-form-item :label="'switch' | lang" prop="status">
<el-switch v-model="formData.status"></el-switch>
Expand All @@ -33,6 +36,9 @@
<el-checkbox-group v-model="formData.ga">
<el-checkbox :label="'ga' | lang" name="ga"></el-checkbox>
</el-checkbox-group>
<div style="margin-bottom: 20px;">
<el-alert :title="'privacy_policy' | lang" type="warning" :closable="false"></el-alert>
</div>
</el-form-item>

<el-form-item>
Expand All @@ -58,7 +64,7 @@ export default {
};
return {
formData: null,
ga: false,
displayGaReminder: 'display',
notifyLocation: [
{
name: this.getLang('top_right'),
Expand Down Expand Up @@ -98,7 +104,7 @@ export default {
this.port.postMessage({ ctype: 'save_config', cdata: this.formData });
},
cancelGa() {
this.ga = true;
this.displayGaReminder = 'hidden';
},
save(formName) {
this.$refs[formName].validate(valid => {
Expand Down Expand Up @@ -133,7 +139,7 @@ export default {
type: 'success',
message: this.getLang('save_success'),
});
this.ga = true;
this.displayGaReminder = 'hidden';
break;
case 'get_config':
this.formData = {
Expand All @@ -144,7 +150,7 @@ export default {
currentNotifyLocation: msg.cdata.currentNotifyLocation,
ga: msg.cdata.ga,
};
this.ga = msg.cdata.ga;
this.displayGaReminder = msg.cdata.ga === true ? 'hidden' : 'display';
break;
}
});
Expand Down

0 comments on commit 59676dd

Please sign in to comment.