Skip to content

Commit 12e5f35

Browse files
authored
Merge pull request #117 from Stigmatoz/welcome-page
Welcome page
2 parents b0192bc + 7f228c8 commit 12e5f35

File tree

16 files changed

+301
-15
lines changed

16 files changed

+301
-15
lines changed

src/_locales/de/messages.json

Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -258,5 +258,41 @@
258258
},
259259
"restore": {
260260
"message": "Wiederherstellen"
261+
},
262+
"welcome": {
263+
"message": "Willkommen bei Web Activity Time Tracker",
264+
"description": "Web Activity Time Tracker ist eine <b>open-source</b>, <b>kostenlose</b> und <b>werbefreie</b> Erweiterung, mit der Sie die Zeit, die Sie für das Durchsuchen von Websites aufgewendet haben, und die Anzahl der Besuche nachverfolgen können."
265+
},
266+
"getStarted": {
267+
"message": "Anleitung"
268+
},
269+
"welcomeStart": {
270+
"message": "Sie können die Erweiterung in nur 3 einfachen Schritten schnell verwenden"
271+
},
272+
"pinIcon": {
273+
"message": "Pin das Symbol"
274+
},
275+
"pinIconPart1": {
276+
"message": "Um diese Erweiterung bequemer zu verwenden, können Sie das Symbol an die Symbolleiste anheften. Klicken Sie auf das Symbol"
277+
},
278+
"pinIconPart2": {
279+
"message": "und klicken Sie dann auf das Pin-Symbol"
280+
},
281+
"browse": {
282+
"message": "Durchsuchen Sie alle Websites",
283+
"description": "Wenn Sie eine Website besuchen, werden Sie sehen, dass die Uhrzeit auf dem Symbol angezeigt wird, genau wie hier"
284+
},
285+
"seeData": {
286+
"message": "Zeigen Sie Ihre Daten auf der Popup-Seite und im Dashboard an",
287+
"description": "Klicken Sie auf das Erweiterungssymbol, um eine Popup-Seite zu öffnen, und Sie können die mit einem Kreisdiagramm gerenderten Daten für heute, für alle Zeiten oder für Tage lesen. In einem Popup-Fenster können Sie das Dashboard öffnen, und es zeigt Ihnen die heutige Zeit nach Stunden an. Und Sie können ein tägliches Zeitlimit für alle Websites festlegen, Benachrichtigungen für Websites festlegen oder Daten in CSV exportieren."
288+
},
289+
"close": {
290+
"message": "Schließen"
291+
},
292+
"useExtension": {
293+
"message": "Verwenden Sie die Erweiterung"
294+
},
295+
"next": {
296+
"message": "Weiter"
261297
}
262298
}

src/_locales/en/messages.json

Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -258,5 +258,41 @@
258258
},
259259
"restore": {
260260
"message": "Restore"
261+
},
262+
"welcome": {
263+
"message": "Welcome to Web Activity Time Tracker",
264+
"description": "Web Activity Time Tracker is <b>open-source</b>, <b>free</b> and <b>no ads</b> extension, which can help you track the time you spent on browsing websites and the count of visit."
265+
},
266+
"getStarted": {
267+
"message": "Get started"
268+
},
269+
"welcomeStart": {
270+
"message": "You can quicly start using the extension in just 3 easy steps"
271+
},
272+
"pinIcon": {
273+
"message": "Pin the icon"
274+
},
275+
"pinIconPart1": {
276+
"message": "To use this extension more conveniently, you can pin the icon to toolbar. Click the icon"
277+
},
278+
"pinIconPart2": {
279+
"message": "and then click the pin icon"
280+
},
281+
"browse": {
282+
"message": "Browse any websites",
283+
"description": "When you visit any website, you will see that the time is displayed on the icon, just like here"
284+
},
285+
"seeData": {
286+
"message": "View your data on the popup page and on the dashboard",
287+
"description": "Click on the extension icon to open a popup page and you will be able to read the data visualized using a pie chart, for today, for all time or by day. In the popup window, you can open the dashboard and it will show you today's time by the clock. And you can set a daily time limit for any websites, notifications for websites, or export data to CSV."
288+
},
289+
"close": {
290+
"message": "Close"
291+
},
292+
"useExtension": {
293+
"message": "Use the extension"
294+
},
295+
"next": {
296+
"message": "Next"
261297
}
262298
}

src/_locales/ru/messages.json

Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -258,5 +258,41 @@
258258
},
259259
"restore": {
260260
"message": "Восстановить из резервной копиии"
261+
},
262+
"welcome": {
263+
"message": "Добро пожаловать в Web Activity Time Tracker",
264+
"description": "Web Activity Time Tracker это <b>бесплатное</b>, <b>без рекламы</b> и <b>\u0441 открытым исходным кодом</b> расширение, которое поможем вам отслеживать время, потраченное вами на просмотр веб-сайтов, и покажет количество посещений."
265+
},
266+
"getStarted": {
267+
"message": "Руководство"
268+
},
269+
"welcomeStart": {
270+
"message": "Вы можете быстро начать использовать расширение всего за 3 простых шага"
271+
},
272+
"pinIcon": {
273+
"message": "Закрепите значок"
274+
},
275+
"pinIconPart1": {
276+
"message": "Чтобы более удобно использовать это расширение, вы можете прикрепить значок к панели инструментов. Нажмите на значок"
277+
},
278+
"pinIconPart2": {
279+
"message": "и затем нажмите на значок закрепления"
280+
},
281+
"browse": {
282+
"message": "Просматривайте любые веб-сайты",
283+
"description": "При посещении любого веб-сайта вы увидите, что время отображается на значке, точно так же, как здесь"
284+
},
285+
"seeData": {
286+
"message": "Просматривайте ваши данные на всплывающей странице и на панели мониторинга",
287+
"description": "Нажмите на значок расширения, чтобы открыть всплывающую страницу, и вы сможете увидеть данные посещения сайтов за сегодня, за все время и по дням. Во всплывающем окне вы можете открыть панель мониторинга, и вы увидите сегодняшнее время по часам. Там же вы можете установить ежедневное ограничение по времени для любых веб-сайтов, уведомления для веб-сайтов или экспортировать данные в CSV."
288+
},
289+
"close": {
290+
"message": "Закрыть"
291+
},
292+
"useExtension": {
293+
"message": "Начать пользоваться"
294+
},
295+
"next": {
296+
"message": "Продолжить"
261297
}
262298
}

src/assets/icons/extension.svg

Lines changed: 1 addition & 0 deletions
Loading

src/assets/icons/icon.png

871 Bytes
Loading

src/assets/icons/pin.svg

Lines changed: 1 addition & 0 deletions
Loading

src/assets/initial.jpg

75.9 KB
Loading

src/assets/pin-tutorial.png

15.3 KB
Loading

src/background.ts

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,16 @@ Browser.storage.onChanged.addListener((changes, namespace) => {
2828

2929
Browser.runtime.setUninstallURL('https://webtracker.online/goodbye.html');
3030

31+
Browser.runtime.onInstalled.addListener(async details => {
32+
if (details.reason == 'install') {
33+
const initialPageUrl = Browser.runtime.getURL('src/welcome.html');
34+
await Browser.tabs.create({
35+
url: initialPageUrl,
36+
active: true,
37+
});
38+
}
39+
});
40+
3141
Browser.runtime.onStartup.addListener(() => {
3242
logger.log(`onStartup event`);
3343
});

src/compositions/set-badge.ts

Lines changed: 9 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ import Browser from 'webextension-polyfill';
22

33
export interface BadgeState {
44
color: BadgeColor;
5-
tabId: number;
5+
tabId: number | undefined;
66
text: string;
77
}
88

@@ -13,10 +13,12 @@ export enum BadgeColor {
1313
none = '#000',
1414
}
1515

16-
export function useBadge(badge: BadgeState): void {
17-
Browser.action.setBadgeBackgroundColor({ color: badge.color });
18-
Browser.action.setBadgeText({
19-
tabId: badge.tabId,
20-
text: badge.text,
21-
});
16+
export async function useBadge(badge: BadgeState): Promise<void> {
17+
if (badge.tabId != undefined) {
18+
await Browser.action.setBadgeBackgroundColor({ color: badge.color });
19+
await Browser.action.setBadgeText({
20+
tabId: badge.tabId,
21+
text: badge.text,
22+
});
23+
}
2224
}

0 commit comments

Comments
 (0)