-
Notifications
You must be signed in to change notification settings - Fork 1
/
popup.html
178 lines (152 loc) · 3.74 KB
/
popup.html
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
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8" />
<title>JSnippets</title>
<style>
button {
background-color: #21917b;
border: none;
color: white;
padding: 5px 10px;
text-align: center;
text-decoration: none;
display: inline-block;
border-radius: 5px;
font-size: 14px;
}
body {
width: 800px;
margin: 0;
font-size: 14px;
}
.execute {
border-top: 1px solid lightgray;
}
.wrapper {
margin: 0 10px;
padding: 10px 0;
width: calc(100% - 20px);
display: flex;
flex-direction: row;
}
.snippets {
width: calc(40% - 1px);
border-right: 1px solid lightgray;
}
.options {
width: calc(100% - 150px);
}
.snippet {
cursor: pointer;
}
.snippet.selected {
background-color: #e7e7ff;
}
*[contenteditable="true"] {
padding: 5px 0;
max-width: 100%;
overflow-x: auto;
}
code {
white-space: pre;
font-family: monospace;
display: block;
}
.snippet:hover {
background-color: #d3d3d3;
}
.options {
padding: 0 10px;
display: grid;
grid-auto-flow: row;
grid-row-gap: 10px;
}
#add {
width: calc(100% - 20px);
}
.commands {
margin: 0 auto;
margin-top: 10px;
display: grid;
grid-auto-flow: column;
grid-template-columns: repeat(3, min-content);
grid-column-gap: 50px;
}
label {
color: #666;
font-weight: bold;
font-size: 16px;
}
.field {
max-width: 100%;
overflow-x: auto;
}
.field [contenteditable="true"] {
border-bottom: 1px dashed #666;
}
.field:hover [contenteditable="true"] {
border-bottom: 1px dashed #21917b;
}
#snippets {
width: 150px;
display: grid;
grid-auto-flow: row;
grid-row-gap: 5px;
grid-auto-rows: min-content;
}
#outlet {
display: grid;
grid-auto-flow: row;
grid-row-gap: 5px;
}
#outlet > div {
padding: 5px;
}
#output {
margin: 0 50px;
width: calc(100% - 200px);
border-radius: 5px;
padding: 5px 50px;
}
</style>
</head>
<body>
<div class="wrapper">
<div id="snippets" class="snippets">
<div id="outlet"></div>
<input type="text" id="add" placeholder="add new.." />
</div>
<div class="options">
<div class="field">
<label for="options-name">Name</label>
<div id="options-name" class="name" contenteditable="true"></div>
</div>
<div class="field">
<label for="options-cmd">Script</label>
<code id="options-cmd" class="cmd" contenteditable="true"></code>
</div>
<div class="field">
<label for="options-regex">URL-Regex, one regex per line.</label>
<div id="options-regex" contenteditable="true"></div>
</div>
<div class="field">
<label for="options-autoexecute"
><input type="checkbox" id="options-autoexecute" /> Auto
execute</label
>
</div>
<div class="commands">
<button id="save">Save</button>
<button id="abort">Abort</button>
<button id="remove">Delete</button>
</div>
</div>
</div>
<div class="wrapper execute">
<button id="execute">Execute</button>
<div id="output"></div>
</div>
<script src="popup.js"></script>
</body>
</html>