Skip to content

Commit 0cf3018

Browse files
committed
infoLink
1 parent 9851353 commit 0cf3018

File tree

8 files changed

+45
-29
lines changed

8 files changed

+45
-29
lines changed

empty_script.js

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,8 @@ export default {
88
en: "",
99
vi: "",
1010
},
11+
infoLink: "",
12+
1113
blackList: [],
1214
whiteList: [],
1315

popup/index.js

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -229,6 +229,22 @@ function createScriptButton(script, isFavorite = false) {
229229
title.innerHTML = t(script.name);
230230
button.appendChild(title);
231231

232+
// what this? button
233+
if (typeof script.infoLink === "string") {
234+
const infoBtn = document.createElement("i");
235+
infoBtn.className = "fa-regular fa-circle-question";
236+
infoBtn.title = t({
237+
en: "View info/demo",
238+
vi: "Xem giới thiệu/demo",
239+
});
240+
infoBtn.onclick = (e) => {
241+
e.stopPropagation();
242+
e.preventDefault();
243+
window.open(script.infoLink);
244+
};
245+
button.appendChild(infoBtn);
246+
}
247+
232248
// add to favorite button
233249
const addFavoriteBtn = document.createElement("i");
234250
addFavoriteBtn.className = isFavorite

popup/styles/style.css

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -198,7 +198,8 @@ a:hover {
198198
}
199199

200200
.content button i.star,
201-
.content button i.view-source {
201+
.content button i.view-source,
202+
.content button i.fa-circle-question {
202203
opacity: 0;
203204
width: 0;
204205
transition: all .2s;
@@ -209,13 +210,15 @@ a:hover {
209210
}
210211

211212
.content button i.star:hover,
212-
.content button i.view-source:hover {
213+
.content button i.view-source:hover,
214+
.content button i.fa-circle-question:hover {
213215
transform: scale(1.8);
214216
}
215217

216218
.content button:hover i.star,
217219
.content button i.star.active,
218-
.content button:hover i.view-source {
220+
.content button:hover i.view-source,
221+
.content button:hover i.fa-circle-question {
219222
width: auto;
220223
margin-left: 5px;
221224
opacity: 1;
@@ -413,6 +416,8 @@ a:hover {
413416
justify-content: center;
414417
align-items: center;
415418
z-index: 5;
419+
-webkit-backdrop-filter: blur(.1rem);
420+
backdrop-filter: blur(.1rem);
416421
}
417422

418423
.loading-container .text {

scripts/detect_zeroWidthCharacters.js

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -8,14 +8,11 @@ export default {
88
en: "Detects zero-width characters, highlights the characters and containing DOM element.\n\nClick for more detail.",
99
vi: "Phát hiện ký tự ẩn (zero-width) trong văn bản cho trình duyệt, e-mail client, trình soạn thảo văn bản,...\n\nBấm để xem thêm chi tiết.",
1010
},
11+
infoLink:
12+
"https://viblo.asia/p/ky-tu-zero-width-sat-thu-vo-hinh-nam-giua-doan-van-ban-thuan-vo-hai-L4x5xM7qKBM",
1113

1214
onDocumentIdle: detectZeroWidthCharacters,
1315
onClick: detectZeroWidthCharacters,
14-
15-
// onClickExtension: () =>
16-
// window.open(
17-
// "https://viblo.asia/p/ky-tu-zero-width-sat-thu-vo-hinh-nam-giua-doan-van-ban-thuan-vo-hai-L4x5xM7qKBM"
18-
// ),
1916
};
2017

2118
// Code extracted from https://chrome.google.com/webstore/detail/detect-zero-width-charact/icibkhaehdofmcbfjfpppogioidkilib

scripts/fb_invisible_message.js

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,8 @@ export default {
88
en: "Add the > character before writing a message to send hidden messages.\n\nYour friends needs to install this extension and enable it to view hidden messages.",
99
vi: "Thêm ký tự > trước tin nhắn để tạo tin nhắn tàng hình.\n\nChỉ xem được tin nhắn tàng hình khi cài extension và bật chức năng này.",
1010
},
11+
infoLink: "https://www.facebook.com/groups/j2team.community/posts/1607769529555161/",
12+
1113
whiteList: ["https://*.facebook.com/*", "https://*.messenger.com/*"],
1214

1315
onDocumentIdle: () => {
@@ -179,9 +181,4 @@ export default {
179181
);
180182
})();
181183
},
182-
183-
onClickExtension: () =>
184-
window.open(
185-
"https://www.facebook.com/groups/j2team.community/posts/1607769529555161/"
186-
),
187184
};

scripts/fb_moreReactionStory.css

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -7,8 +7,9 @@
77
}
88

99
.btn-react {
10-
height: 40px;
11-
width: 40px;
10+
height: 35px;
11+
width: 35px;
12+
padding: 4px;
1213
background-color: #fff;
1314
display: flex;
1415
justify-content: center;
@@ -54,7 +55,6 @@
5455
cursor: pointer;
5556
display: inline-block;
5657
transition: all 0.1s;
57-
padding: 5px;
5858
}
5959

6060
.emoji-tab:hover {
@@ -89,7 +89,6 @@
8989
align-items: center;
9090
cursor: pointer;
9191
transition: all 0.15s;
92-
padding: 3px;
9392
}
9493

9594
.emoji.loading {

scripts/fb_moreReactionStory.js

Lines changed: 9 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,9 @@ export default {
88
en: "React story Facebook with more emojis",
99
vi: "React story Facebook với nhiều loại emoji khác nhau",
1010
},
11+
infoLink:
12+
"https://www.facebook.com/groups/j2team.community/posts/1769666783365434",
13+
1114
whiteList: ["https://www.facebook.com/*"],
1215

1316
// FB POST: https://www.facebook.com/groups/j2team.community/posts/1769666783365434
@@ -84,16 +87,20 @@ export default {
8487
emojiLi.className = "emoji always-enable-animations";
8588
emojiLi.textContent = emoji;
8689
emojiLi.setAttribute("value", emoji);
90+
91+
let loading = 0;
8792
emojiLi.onclick = async function () {
8893
const storyId = getStoryId();
8994
try {
90-
emojiLi.classList.add("loading");
95+
if (!loading) emojiLi.classList.add("loading");
96+
loading++;
9197
await reactStory(user_id, fb_dtsg, storyId, emoji);
98+
loading--;
9299
addFloatingEmoji(emoji, emojiLi);
93100
} catch (e) {
94101
console.error(e);
95102
} finally {
96-
emojiLi.classList.remove("loading");
103+
if (!loading) emojiLi.classList.remove("loading");
97104
}
98105
};
99106

@@ -215,9 +222,4 @@ export default {
215222
);
216223
UsefulScriptGlobalPageContext.DOM.injectCssFile(cssFile);
217224
},
218-
219-
onClickExtension: () =>
220-
window.open(
221-
"https://www.facebook.com/groups/j2team.community/posts/1769666783365434"
222-
),
223225
};

scripts/studyphim_unlimited.js

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,9 @@ export default {
88
en: "Watch movies on Studyphim for free without login",
99
vi: "Xem phim miễn phí trên Studyphim không cần đăng nhập",
1010
},
11+
infoLink:
12+
"https://www.facebook.com/groups/j2team.community/posts/565933393738785/",
13+
1114
whiteList: ["https://www.studyphim.vn/*"],
1215

1316
onDocumentStart: () => {
@@ -17,9 +20,4 @@ export default {
1720
true
1821
);
1922
},
20-
21-
onClickExtension: () =>
22-
window.open(
23-
"https://www.facebook.com/groups/j2team.community/posts/565933393738785/"
24-
),
2523
};

0 commit comments

Comments
 (0)