aboutsummaryrefslogtreecommitdiffstats
path: root/src/webview
diff options
context:
space:
mode:
authorLibravatar Aditya Mangalampalli <aditya.mangalampalli@gmail.com>2022-04-15 02:00:25 -0700
committerLibravatar Vijay A <vraravam@users.noreply.github.com>2022-04-16 21:57:57 +0530
commit210131ca184c3aa043371857c022aa1aa149efbf (patch)
tree6bc4e10a1540e55a66146c099bc468a12287425e /src/webview
parentUpdate submodule url to ferdium-recipes (#1) (diff)
downloadferdium-app-210131ca184c3aa043371857c022aa1aa149efbf.tar.gz
ferdium-app-210131ca184c3aa043371857c022aa1aa149efbf.tar.zst
ferdium-app-210131ca184c3aa043371857c022aa1aa149efbf.zip
Matched casing for almost all replacements
Diffstat (limited to 'src/webview')
-rw-r--r--src/webview/badge.ts2
-rw-r--r--src/webview/contextMenuBuilder.ts12
-rw-r--r--src/webview/darkmode.ts2
-rw-r--r--src/webview/dialogTitle.ts2
-rw-r--r--src/webview/lib/RecipeWebview.ts2
-rw-r--r--src/webview/lib/Userscript.ts12
-rw-r--r--src/webview/notifications.ts4
-rw-r--r--src/webview/recipe.js8
-rw-r--r--src/webview/screenshare.ts2
-rw-r--r--src/webview/sessionHandler.ts2
-rw-r--r--src/webview/spellchecker.ts2
11 files changed, 25 insertions, 25 deletions
diff --git a/src/webview/badge.ts b/src/webview/badge.ts
index 02bd3fb15..1b66effb6 100644
--- a/src/webview/badge.ts
+++ b/src/webview/badge.ts
@@ -1,6 +1,6 @@
1import { ipcRenderer } from 'electron'; 1import { ipcRenderer } from 'electron';
2 2
3const debug = require('debug')('Ferdi:Plugin:BadgeHandler'); 3const debug = require('debug')('Ferdium:Plugin:BadgeHandler');
4 4
5export class BadgeHandler { 5export class BadgeHandler {
6 // TODO: Need to extract this into a utility class and reuse outside of the recipes 6 // TODO: Need to extract this into a utility class and reuse outside of the recipes
diff --git a/src/webview/contextMenuBuilder.ts b/src/webview/contextMenuBuilder.ts
index 7b8c6cb2d..7bd86556e 100644
--- a/src/webview/contextMenuBuilder.ts
+++ b/src/webview/contextMenuBuilder.ts
@@ -1,7 +1,7 @@
1/** 1/**
2 * Context Menu builder. 2 * Context Menu builder.
3 * 3 *
4 * Based on "electron-spellchecker"'s ContextMenuBuilder but customized for Ferdi 4 * Based on "electron-spellchecker"'s ContextMenuBuilder but customized for Ferdium
5 * and for usage with Electron's build-in spellchecker 5 * and for usage with Electron's build-in spellchecker
6 * 6 *
7 * Source: https://github.com/electron-userland/electron-spellchecker/blob/master/src/context-menu-builder.js 7 * Source: https://github.com/electron-userland/electron-spellchecker/blob/master/src/context-menu-builder.js
@@ -29,7 +29,7 @@ interface ContextMenuStringTable {
29 pasteAndMatchStyle: () => string; 29 pasteAndMatchStyle: () => string;
30 searchWith: ({ searchEngine }: { searchEngine: string }) => string; 30 searchWith: ({ searchEngine }: { searchEngine: string }) => string;
31 openLinkUrl: () => string; 31 openLinkUrl: () => string;
32 openLinkInFerdiUrl: () => string; 32 openLinkInFerdiumUrl: () => string;
33 openInBrowser: () => string; 33 openInBrowser: () => string;
34 copyLinkUrl: () => string; 34 copyLinkUrl: () => string;
35 copyImageUrl: () => string; 35 copyImageUrl: () => string;
@@ -53,7 +53,7 @@ const contextMenuStringTable: ContextMenuStringTable = {
53 pasteAndMatchStyle: () => 'Paste and match style', 53 pasteAndMatchStyle: () => 'Paste and match style',
54 searchWith: ({ searchEngine }) => `Search with ${searchEngine}`, 54 searchWith: ({ searchEngine }) => `Search with ${searchEngine}`,
55 openLinkUrl: () => 'Open Link', 55 openLinkUrl: () => 'Open Link',
56 openLinkInFerdiUrl: () => 'Open Link in Ferdi', 56 openLinkInFerdiumUrl: () => 'Open Link in Ferdium',
57 openInBrowser: () => 'Open in Browser', 57 openInBrowser: () => 'Open in Browser',
58 copyLinkUrl: () => 'Copy Link', 58 copyLinkUrl: () => 'Copy Link',
59 copyImageUrl: () => 'Copy Image Address', 59 copyImageUrl: () => 'Copy Image Address',
@@ -222,8 +222,8 @@ export class ContextMenuBuilder {
222 }, 222 },
223 }); 223 });
224 224
225 const openInFerdiLink = new MenuItem({ 225 const openInFerdiumLink = new MenuItem({
226 label: this.stringTable.openLinkInFerdiUrl(), 226 label: this.stringTable.openLinkInFerdiumUrl(),
227 click: () => { 227 click: () => {
228 window.location.href = menuInfo.linkURL; 228 window.location.href = menuInfo.linkURL;
229 }, 229 },
@@ -231,7 +231,7 @@ export class ContextMenuBuilder {
231 231
232 menu.append(copyLink); 232 menu.append(copyLink);
233 menu.append(openLink); 233 menu.append(openLink);
234 menu.append(openInFerdiLink); 234 menu.append(openInFerdiumLink);
235 235
236 if (this.isSrcUrlValid(menuInfo)) { 236 if (this.isSrcUrlValid(menuInfo)) {
237 this.addSeparator(menu); 237 this.addSeparator(menu);
diff --git a/src/webview/darkmode.ts b/src/webview/darkmode.ts
index a0699bdb7..fbb0edf04 100644
--- a/src/webview/darkmode.ts
+++ b/src/webview/darkmode.ts
@@ -1,7 +1,7 @@
1import { join } from 'path'; 1import { join } from 'path';
2import { pathExistsSync, readFileSync } from 'fs-extra'; 2import { pathExistsSync, readFileSync } from 'fs-extra';
3 3
4const debug = require('debug')('Ferdi:DarkMode'); 4const debug = require('debug')('Ferdium:DarkMode');
5 5
6const chars = [...'abcdefghijklmnopqrstuvwxyz']; 6const chars = [...'abcdefghijklmnopqrstuvwxyz'];
7 7
diff --git a/src/webview/dialogTitle.ts b/src/webview/dialogTitle.ts
index f9a1aac6f..393c2499f 100644
--- a/src/webview/dialogTitle.ts
+++ b/src/webview/dialogTitle.ts
@@ -1,6 +1,6 @@
1import { ipcRenderer } from 'electron'; 1import { ipcRenderer } from 'electron';
2 2
3const debug = require('debug')('Ferdi:Plugin:DialogTitleHandler'); 3const debug = require('debug')('Ferdium:Plugin:DialogTitleHandler');
4 4
5export class DialogTitleHandler { 5export class DialogTitleHandler {
6 titleCache: { title: string }; 6 titleCache: { title: string };
diff --git a/src/webview/lib/RecipeWebview.ts b/src/webview/lib/RecipeWebview.ts
index 09dc462ed..568c31255 100644
--- a/src/webview/lib/RecipeWebview.ts
+++ b/src/webview/lib/RecipeWebview.ts
@@ -2,7 +2,7 @@ import { ipcRenderer } from 'electron';
2import { BrowserWindow } from '@electron/remote'; 2import { BrowserWindow } from '@electron/remote';
3import { pathExistsSync, readFileSync, existsSync } from 'fs-extra'; 3import { pathExistsSync, readFileSync, existsSync } from 'fs-extra';
4 4
5const debug = require('debug')('Ferdi:Plugin:RecipeWebview'); 5const debug = require('debug')('Ferdium:Plugin:RecipeWebview');
6 6
7class RecipeWebview { 7class RecipeWebview {
8 badgeHandler: any; 8 badgeHandler: any;
diff --git a/src/webview/lib/Userscript.ts b/src/webview/lib/Userscript.ts
index c50941dc7..f02a8f135 100644
--- a/src/webview/lib/Userscript.ts
+++ b/src/webview/lib/Userscript.ts
@@ -14,7 +14,7 @@ export default class Userscript {
14 // Service configuration 14 // Service configuration
15 config = {}; 15 config = {};
16 16
17 // Ferdi and service settings 17 // Ferdium and service settings
18 settings = {}; 18 settings = {};
19 19
20 constructor(recipe, controller, config) { 20 constructor(recipe, controller, config) {
@@ -25,7 +25,7 @@ export default class Userscript {
25 } 25 }
26 26
27 /** 27 /**
28 * Set internal copy of Ferdi's settings. 28 * Set internal copy of Ferdium's settings.
29 * This is only used internally and can not be used to change any settings 29 * This is only used internally and can not be used to change any settings
30 * 30 *
31 * @param {*} settings 31 * @param {*} settings
@@ -88,7 +88,7 @@ export default class Userscript {
88 * @param {any} value 88 * @param {any} value
89 */ 89 */
90 set(key: string, value: string) { 90 set(key: string, value: string) {
91 window.localStorage.setItem(`ferdi-user-${key}`, JSON.stringify(value)); 91 window.localStorage.setItem(`ferdium-user-${key}`, JSON.stringify(value));
92 } 92 }
93 93
94 /** 94 /**
@@ -98,10 +98,10 @@ export default class Userscript {
98 * @return Value of the key 98 * @return Value of the key
99 */ 99 */
100 get(key: string) { 100 get(key: string) {
101 const ferdiUserKey = window.localStorage.getItem(`ferdi-user-${key}`); 101 const ferdiumUserKey = window.localStorage.getItem(`ferdium-user-${key}`);
102 102
103 if (ferdiUserKey) { 103 if (ferdiumUserKey) {
104 return JSON.parse(ferdiUserKey); 104 return JSON.parse(ferdiumUserKey);
105 } 105 }
106 } 106 }
107} 107}
diff --git a/src/webview/notifications.ts b/src/webview/notifications.ts
index 73124b9a9..5ae99424c 100644
--- a/src/webview/notifications.ts
+++ b/src/webview/notifications.ts
@@ -2,7 +2,7 @@ import { ipcRenderer } from 'electron';
2 2
3import { v1 as uuidV1 } from 'uuid'; 3import { v1 as uuidV1 } from 'uuid';
4 4
5const debug = require('debug')('Ferdi:Notifications'); 5const debug = require('debug')('Ferdium:Notifications');
6 6
7export class NotificationsHandler { 7export class NotificationsHandler {
8 onNotify = (data: { title: string; options: any; notificationId: string }) => 8 onNotify = (data: { title: string; options: any; notificationId: string }) =>
@@ -37,7 +37,7 @@ export const notificationsClassDefinition = `(() => {
37 constructor(title = '', options = {}) { 37 constructor(title = '', options = {}) {
38 this.title = title; 38 this.title = title;
39 this.options = options; 39 this.options = options;
40 window.ferdi.displayNotification(title, options) 40 window.ferdium.displayNotification(title, options)
41 .then(() => { 41 .then(() => {
42 if (typeof (this.onClick) === 'function') { 42 if (typeof (this.onClick) === 'function') {
43 this.onClick(); 43 this.onClick();
diff --git a/src/webview/recipe.js b/src/webview/recipe.js
index 7c069562f..4fcf28363 100644
--- a/src/webview/recipe.js
+++ b/src/webview/recipe.js
@@ -50,7 +50,7 @@ import {
50 50
51import { DEFAULT_APP_SETTINGS } from '../config'; 51import { DEFAULT_APP_SETTINGS } from '../config';
52 52
53const debug = require('debug')('Ferdi:Plugin'); 53const debug = require('debug')('Ferdium:Plugin');
54 54
55const badgeHandler = new BadgeHandler(); 55const badgeHandler = new BadgeHandler();
56 56
@@ -105,9 +105,9 @@ window.open = (url, frameName, features) => {
105 } 105 }
106}; 106};
107 107
108// We can't override APIs here, so we first expose functions via 'window.ferdi', 108// We can't override APIs here, so we first expose functions via 'window.ferdium',
109// then overwrite the corresponding field of the window object by injected JS. 109// then overwrite the corresponding field of the window object by injected JS.
110contextBridge.exposeInMainWorld('ferdi', { 110contextBridge.exposeInMainWorld('ferdium', {
111 open: window.open, 111 open: window.open,
112 setBadge: (direct, indirect) => badgeHandler.setBadge(direct, indirect), 112 setBadge: (direct, indirect) => badgeHandler.setBadge(direct, indirect),
113 safeParseInt: text => badgeHandler.safeParseInt(text), 113 safeParseInt: text => badgeHandler.safeParseInt(text),
@@ -119,7 +119,7 @@ contextBridge.exposeInMainWorld('ferdi', {
119 119
120ipcRenderer.sendToHost( 120ipcRenderer.sendToHost(
121 'inject-js-unsafe', 121 'inject-js-unsafe',
122 'window.open = window.ferdi.open;', 122 'window.open = window.ferdium.open;',
123 notificationsClassDefinition, 123 notificationsClassDefinition,
124 screenShareJs, 124 screenShareJs,
125); 125);
diff --git a/src/webview/screenshare.ts b/src/webview/screenshare.ts
index 91a1623bb..dbc23d62c 100644
--- a/src/webview/screenshare.ts
+++ b/src/webview/screenshare.ts
@@ -106,7 +106,7 @@ window.navigator.mediaDevices.getDisplayMedia = () => new Promise(async (resolve
106 try { 106 try {
107 const selectionElem = document.createElement('div'); 107 const selectionElem = document.createElement('div');
108 selectionElem.classList = ['desktop-capturer-selection']; 108 selectionElem.classList = ['desktop-capturer-selection'];
109 selectionElem.innerHTML = await window.ferdi.getDisplayMediaSelector(); 109 selectionElem.innerHTML = await window.ferdium.getDisplayMediaSelector();
110 document.body.appendChild(selectionElem); 110 document.body.appendChild(selectionElem);
111 111
112 document 112 document
diff --git a/src/webview/sessionHandler.ts b/src/webview/sessionHandler.ts
index 0c6d23f23..e38368a18 100644
--- a/src/webview/sessionHandler.ts
+++ b/src/webview/sessionHandler.ts
@@ -1,4 +1,4 @@
1const debug = require('debug')('Ferdi:Plugin:SessionHandler'); 1const debug = require('debug')('Ferdium:Plugin:SessionHandler');
2 2
3export class SessionHandler { 3export class SessionHandler {
4 async releaseServiceWorkers() { 4 async releaseServiceWorkers() {
diff --git a/src/webview/spellchecker.ts b/src/webview/spellchecker.ts
index ee70589d5..bad2bb4ff 100644
--- a/src/webview/spellchecker.ts
+++ b/src/webview/spellchecker.ts
@@ -2,7 +2,7 @@ import { ipcRenderer } from 'electron';
2import { SPELLCHECKER_LOCALES } from '../i18n/languages'; 2import { SPELLCHECKER_LOCALES } from '../i18n/languages';
3import { isMac } from '../environment'; 3import { isMac } from '../environment';
4 4
5const debug = require('debug')('Ferdi:spellchecker'); 5const debug = require('debug')('Ferdium:spellchecker');
6 6
7export function getSpellcheckerLocaleByFuzzyIdentifier(identifier: string) { 7export function getSpellcheckerLocaleByFuzzyIdentifier(identifier: string) {
8 const locales = Object.keys(SPELLCHECKER_LOCALES).filter( 8 const locales = Object.keys(SPELLCHECKER_LOCALES).filter(