Skip to content

Commit 17ee82b

Browse files
author
hoang.tran12
committed
refactor
1 parent 957bbe6 commit 17ee82b

File tree

10 files changed

+29
-25
lines changed

10 files changed

+29
-25
lines changed

pages/viewScriptSource/main.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
import { disableSmoothScrollSaver } from "../../popup/helpers/storage.js";
2-
import { run as enableSmoothScroll } from "../../scripts/smoothScroll.js";
2+
import { enableSmoothScroll } from "../../scripts/smoothScroll.js";
33

44
window.onload = async () => {
55
if (!disableSmoothScrollSaver.get()) enableSmoothScroll();

popup/index.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ import { BADGES_CONFIG } from "../scripts/helpers/badge.js";
44
import { checkForUpdate } from "./helpers/checkForUpdate.js";
55
import { UfsGlobal } from "../scripts/content-scripts/ufs_global.js";
66
import { THEME, THEME_KEY, getTheme, setTheme } from "./helpers/theme.js";
7-
import { run as enableSmoothScroll } from "../scripts/smoothScroll.js";
7+
import { enableSmoothScroll } from "../scripts/smoothScroll.js";
88
import {
99
isActiveScript,
1010
getCurrentTab,

popup/tabs.js

Lines changed: 15 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -301,7 +301,6 @@ const tabs = [
301301
s.fb_downloadAlbumMedia,
302302
s.fb_downloadWallMediaFromPosts,
303303
s.fb_getAllAlbumInformation,
304-
s.fb_openSaved,
305304
s.fb_exportSaved,
306305
createTitle("--- Hot ---", "--- Nổi bật ---"),
307306
s.fb_revealDeletedMessages,
@@ -335,6 +334,21 @@ const tabs = [
335334
s.fb_getAllUidFromFbSearch,
336335
s.fb_getAllUidOfGroupMembers,
337336
createTitle("--- Shortcut ---", "--- Phím tắt ---"),
337+
{
338+
icon: '<i class="fa-solid fa-bookmark fa-lg"></i>',
339+
name: {
340+
en: "View your facebook saved",
341+
vi: "Xem mục đã lưu trên facebook",
342+
},
343+
description: {
344+
en: "View saved contents on Facebook",
345+
vi: "Xem nội dung bạn đã lưu trên Facebook",
346+
},
347+
348+
popupScript: {
349+
onClick: () => window.open("https://www.facebook.com/saved"),
350+
},
351+
},
338352
{
339353
id: "fb_openMemories",
340354
icon: '<i class="fa-solid fa-clock-rotate-left fa-lg"></i>',

popup/themes/default.less

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -288,6 +288,7 @@ option {
288288
z-index: 2;
289289
margin-top: 15px;
290290
margin-bottom: 10px;
291+
font-weight: bolder;
291292
}
292293

293294
.content {

scripts/_index.js

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -101,7 +101,6 @@ export { default as ggdrive_generateDirectLink } from "./ggdrive_generateDirectL
101101
export { default as soundcloud_downloadMusic } from "./soundcloud_downloadMusic.js";
102102
export { default as dino_hack } from "./dino_hack.js";
103103
export { default as google_mirror } from "./google_mirror.js";
104-
export { default as fb_openSaved } from "./fb_openSaved.js";
105104
export { default as fb_exportSaved } from "./fb_exportSaved.js";
106105
export { default as studyphim_unlimited } from "./studyphim_unlimited.js";
107106
export { default as shopee_totalSpendMoney } from "./shopee_totalSpendMoney.js";

scripts/fb_bulkDownload.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
import { BADGES } from "./helpers/badge.js";
22

33
export default {
4-
icon: '<i class="fa-solid fa-cloud-arrow-down"></i>',
4+
icon: '<i class="fa-solid fa-cloud-arrow-down fa-lg"></i>',
55
name: {
66
en: "Facebook - Bulk download",
77
vi: "Facebook - Tải hàng loạt",

scripts/fb_downloadWallMediaFromPosts.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ import { UfsGlobal } from "./content-scripts/ufs_global.js";
22
import { showLoading } from "./helpers/utils.js";
33

44
export default {
5-
icon: '<i class="fa-regular fa-images fa-lg"></i>',
5+
icon: '<i class="fa-regular fa-newspaper fa-lg"></i>',
66
name: {
77
en: "Download all photos from posts",
88
vi: "Tải tất cả hình trên bài viết",

scripts/fb_openSaved.js

Lines changed: 0 additions & 15 deletions
This file was deleted.

scripts/smoothScroll.js

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@ export default {
4444
tabId: tab.id,
4545
allFrames: true,
4646
},
47-
func: run,
47+
func: enableSmoothScroll,
4848
world: "ISOLATED",
4949
});
5050
count++;
@@ -114,7 +114,7 @@ export default {
114114

115115
contentScript: {
116116
onDocumentStart_: (details) => {
117-
run();
117+
enableSmoothScroll();
118118
},
119119
},
120120
};
@@ -126,7 +126,7 @@ export default {
126126
// + check excluded
127127

128128
// https://chromewebstore.google.com/detail/smoothscroll/nbokbjkabcmbfdlbddjidfmibcpneigj
129-
export function run() {
129+
export function enableSmoothScroll() {
130130
// =======================================================================
131131
// ============================ sscr.js ==================================
132132
// =======================================================================

scripts/web_timer_main.js

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,8 @@
11
import { t } from "../popup/helpers/lang.js";
2+
import { enableSmoothScroll } from "./smoothScroll.js";
3+
import { disableSmoothScrollSaver } from "../popup/helpers/storage.js";
4+
5+
if (!disableSmoothScrollSaver.get()) enableSmoothScroll();
26

37
const backBtn = document.querySelector("#back");
48
const chartContainer = document.querySelector("#chart");
@@ -342,7 +346,8 @@ function getData({
342346
if (dateType === DATE_TYPE.RANGE || dateType === DATE_TYPE.ALL) {
343347
totalDays = 0;
344348
let web = {},
345-
_fromDate = formatDate(fromDate),
349+
_fromDate =
350+
dateType === DATE_TYPE.ALL ? getOldestDate() : formatDate(fromDate),
346351
_endDate = formatDate(endDate);
347352

348353
for (let date in web_timer) {

0 commit comments

Comments
 (0)