-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathbackground.js
78 lines (68 loc) · 2.36 KB
/
background.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
function replaceAll() {
var str = document.getElementById("text").value
var selector = document.getElementById("option");
var value = selector[selector.selectedIndex].value;
if(value == "HTML"){
str = str.replace(/&/g, "&");
str = str.replace(/"/g, """);
str = str.replace(/'/g, "'");
str = str.replace(/</g, "<");
str = str.replace(/>/g, ">");
str = str.replace(/\//g, "/");
}
if(value=="letters"){
str = str.replace(/A/g, "A");
str = str.replace(/B/g, "B");
str = str.replace(/C/g, "C");
str = str.replace(/D/g, "D");
str = str.replace(/E/g, "E");
str = str.replace(/F/g, "F");
str = str.replace(/G/g, "G");
str = str.replace(/H/g, "H");
str = str.replace(/I/g, "I");
str = str.replace(/J/g, "J");
str = str.replace(/K/g, "K");
str = str.replace(/L/g, "L");
str = str.replace(/M/g, "M");
str = str.replace(/N/g, "N");
str = str.replace(/O/g, "O");
str = str.replace(/P/g, "P");
str = str.replace(/Q/g, "Q");
str = str.replace(/R/g, "R");
str = str.replace(/S/g, "S");
str = str.replace(/T/g, "T");
str = str.replace(/U/g, "U");
str = str.replace(/V/g, "V");
str = str.replace(/W/g, "W");
str = str.replace(/X/g, "X");
str = str.replace(/Y/g, "Y");
str = str.replace(/Z/g, "Z");
str = str.replace(/a/g, "a");
str = str.replace(/b/g, "b");
str = str.replace(/c/g, "c");
str = str.replace(/d/g, "d");
str = str.replace(/e/g, "e");
str = str.replace(/f/g, "f");
str = str.replace(/g/g, "g");
str = str.replace(/h/g, "h");
str = str.replace(/i/g, "i");
str = str.replace(/j/g, "j");
str = str.replace(/k/g, "k");
str = str.replace(/l/g, "l");
str = str.replace(/m/g, "m");
str = str.replace(/n/g, "n");
str = str.replace(/o/g, "o");
str = str.replace(/p/g, "p");
str = str.replace(/q/g, "q");
str = str.replace(/r/g, "r");
str = str.replace(/s/g, "s");
str = str.replace(/t/g, "t");
str = str.replace(/u/g, "u");
str = str.replace(/v/g, "v");
str = str.replace(/w/g, "w");
str = str.replace(/x/g, "x");
str = str.replace(/y/g, "y");
str = str.replace(/z/g, "z");
}
document.getElementById("text").value = str
}