-
-
Notifications
You must be signed in to change notification settings - Fork 8
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Converted popup to React in newpopup.tsx, still no functionality impl…
…emented yet but the UI is identical
- Loading branch information
Showing
16 changed files
with
1,515 additions
and
290 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
<html lang="en"> | ||
<head> | ||
<title>وضوح</title> | ||
<meta content="text/html;charset=UTF-8" http-equiv="Content-Type"> | ||
<link href="popup.css" rel="stylesheet"> | ||
<style id="wudoohCustomFontsStyle"></style> | ||
</head> | ||
|
||
<body> | ||
<div id="root"></div> | ||
<script src="js/newpopup.js"></script> | ||
</body> | ||
|
||
</html> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,63 @@ | ||
import {wait} from "./common" | ||
|
||
declare global { | ||
interface Array<T> { | ||
contains(element: T): boolean; | ||
clear(): void; | ||
filterAsync(predicate: (value: T, index: number, array: T[]) => Promise<boolean>): Promise<Array<T>> | ||
forEachAsync(callback: (value: T, index: number, array: T[]) => Promise<void>): Promise<void> | ||
} | ||
|
||
interface String { | ||
contains(string: string): boolean | ||
} | ||
|
||
// TODO: Better way of having delayed task that changes if updated before ran | ||
interface Element { | ||
currentTask: number; | ||
|
||
postDelayed(millis: number, func: Function): void; | ||
} | ||
} | ||
|
||
export function extensions(): void { | ||
if (!Array.prototype.contains) { | ||
Array.prototype.contains = function <T>(element: T): boolean { | ||
return this.indexOf(element) !== -1 | ||
} | ||
} | ||
|
||
if (!Array.prototype.clear) { | ||
Array.prototype.clear = function <T>(): void { | ||
this.splice(0, this.length) | ||
} | ||
} | ||
|
||
if (!Array.prototype.filterAsync) { | ||
Array.prototype.filterAsync = async function <T>(predicate: (value: T, index: number, array: T[]) => Promise<boolean>): Promise<Array<T>> { | ||
const booleans: Array<boolean> = await Promise.all(this.map((value, index, array) => predicate(value, index, array))) | ||
return this.filter((_value, index) => booleans[index]) | ||
} | ||
} | ||
|
||
if (!Array.prototype.forEachAsync) { | ||
Array.prototype.forEachAsync = async function <T>(callback: (value: T, index: number, array: T[]) => Promise<void>): Promise<void> { | ||
await Promise.all(this.map((value, index, array) => callback(value, index, array))) | ||
} | ||
} | ||
|
||
if (!String.prototype.contains) { | ||
String.prototype.contains = function (string: string) { | ||
return this.indexOf(string) !== -1 | ||
} | ||
} | ||
|
||
if (typeof Element !== "undefined" && !Element.prototype.postDelayed) { | ||
Element.prototype.postDelayed = function (millis: number, func: Function) { | ||
let localTask = wait(millis, () => { | ||
if (localTask === this.currentTask) func.call(this) | ||
}) | ||
this.currentTask = localTask | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.