This repository has been archived by the owner on Oct 8, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 0
/
overview.html
333 lines (315 loc) · 11.6 KB
/
overview.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
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
<!DOCTYPE html><html><head><meta charset="utf-8">
<meta name="viewport" content="width=device-width">
<meta name="format-detection" content="telephone=no,date=no">
<title>tycrek/ass iOS Media Uploader</title>
<style>
body {
font-family: system-ui;
font-size: 0.95em;
margin-top: 1rem;
margin-bottom: calc(1rem + env(safe-area-inset-bottom));
word-break: break-word;
}
button {
color: #000;
background-color: #e4e4ff;
width: 100%;
font-size: 1em;
font-weight: normal;
line-height: 1.8;
text-align: left;
margin: 3px 0;
padding: 1px 8px;
border: 1px #aaa;
border-style: solid;
border-radius: 8px;
cursor: initial;
touch-action: manipulation;
}
.button {
margin-bottom: 0;
border-bottom-style: none;
border-bottom-left-radius: 0;
border-bottom-right-radius: 0;
cursor: auto;
}
.button::after {
content: '\25A1';
float: right;
font-weight: bold;
margin-left: 10px;
}
.closed {
margin-bottom: 3px;
border-bottom-style: solid;
border-bottom-left-radius: 8px;
border-bottom-right-radius: 8px;
}
.closed::after { content: '\2212'; }
.nonbottom {
margin-bottom: 0;
border-bottom-left-radius: 0;
border-bottom-right-radius: 0;
border-bottom-style: none;
}
.nontop {
margin-top: 0;
border-top-left-radius: 0;
border-top-right-radius: 0;
}
.gGray { background-color: #e0e0e0; }
.gGreen { background-color: #ddffdd; }
.gYellow { background-color: #ffeebb; }
.gOrange { background-color: #ffddcc; }
.gRed { background-color: #ffccdd; }
.gBlue { background-color: #aaccff; }
.gUnknown { background-color: #bbffff; }
.gParams {
text-align: center;
background-color: #f8f8f8;
}
.content {
overflow: hidden;
margin-bottom: 3px;
padding: 3px 0 3px 8px;
border: 1px #aaa;
border-style: none solid solid solid;
border-bottom-left-radius: 8px;
border-bottom-right-radius: 8px;
}
.contentloop {
margin-bottom: 0;
padding-top: 3px;
border-bottom-style: none;
border-bottom-left-radius: 0;
border-bottom-right-radius: 0;
}
.dashed { border-left-style: dashed; }
.inside {
border-right-style: none;
border-top-right-radius: 0;
border-bottom-right-radius: 0;
}
.commentcontent { background-color: #ffeebb; }
.row {
display: flex;
padding: 0 2px;
}
.col1 {
margin-right: 3px;
padding-right: 4px;
border-right-style: double;
}
.col2 { white-space: pre-wrap; }
span.box {
display: inline;
margin: 0 2px;
padding: 2px 4px;
border-radius: 6px;
background-color: #fff;
}
span.var { font-style: italic; }
span.magic {
cursor: pointer;
font-style: italic;
text-decoration: underline;
}
@media (prefers-color-scheme: dark) {
body { background: #000; color: #eee; }
button { background: #514c72; color: #eee; }
.gGray { background-color: #555555; }
.gGreen { background-color: #3a6441; }
.gYellow { background-color: #716d33; }
.gOrange { background-color: #76523f; }
.gRed { background-color: #674044; }
.gBlue { background-color: #384c67; }
.gUnknown { background-color: #377172; }
.gParams { background-color: #181818; }
.commentcontent { background-color: #716d33; }
span.box { background-color: #000; }
}
</style></head><body>
<button class="button gParams"><b>tycrek/ass iOS Media Uploader</b> (28 actions, 20 KB)</button>
<div class="content"><div class="col2">"WFQuickActionSurfaces": [],
"WFWorkflowClientVersion": "1206.4.3",
"WFWorkflowHasOutputFallback": false,
"WFWorkflowHasShortcutInputVariables": true,
"WFWorkflowIcon": {
"WFWorkflowIconStartColor": 4271458815,
"WFWorkflowIconGlyphNumber": 59826
},
"WFWorkflowImportQuestions": [
{
"Category": "Parameter",
"ParameterKey": "WFURL",
"ActionIndex": <span class="magic" onclick="magictap(19)"><b>19</b></span>,
"Text": "Add the URL for your ass instance.",
"DefaultValue": "https://"
},
{
"Category": "Parameter",
"ParameterKey": "WFHTTPHeaders",
"ActionIndex": <span class="magic" onclick="magictap(19)"><b>19</b></span>,
"Text": "Add your Authorization token. You can pass any other headers you'd like here. For more info, check the comment in the shortcut.",
"DefaultValue": {
"Value": {
"WFDictionaryFieldValueItems": [
{
"WFItemType": 0,
"WFKey": {
"Value": {
"string": "Authorization"
},
"WFSerializationType": "WFTextTokenString"
},
"WFValue": {
"Value": {
"string": ""
},
"WFSerializationType": "WFTextTokenString"
}
}
]
},
"WFSerializationType": "WFDictionaryFieldValue"
}
}
],
"WFWorkflowInputContentItemClasses": [
"WFImageContentItem",
"WFAVAssetContentItem",
"WFGenericFileContentItem"
],
"WFWorkflowMinimumClientVersion": 1113,
"WFWorkflowMinimumClientVersionString": "1113",
"WFWorkflowNoInputBehavior": {
"Name": "WFWorkflowNoInputBehaviorAskForInput",
"Parameters": {
"ItemClass": "WFPhotoMediaContentItem"
}
},
"WFWorkflowOutputContentItemClasses": [],
"WFWorkflowTypes": [
"ActionExtension"
]
</div></div>
<button class="button gYellow" id="m0">
0 Comment</button>
<div class="content commentcontent">
<div class="col2">For info on headers and how to use them, look here: https://github.com/tycrek/ass#header-overrides
Credit to tycrek & contributors for the image server, this shortcut would not exist without them.
v1.0.1 by https://github.com/LeviSnoot</div></div>
<button class="button " id="m1">
1 Get Name of <span class="box"><span class="var"><b>[Shortcut Input</b> as GenericFile’s File Extension<b>]</b></span></span> » <i>2</i> <span class="magic" onclick="magictap(5)">5</span></button>
<div class="content">
<div class="row"><div class="col1">GetWebPageTitle</div>
<div class="col2">false</div></div></div>
<button class="button gGray nonbottom" id="m2">
2 If <span class="box"><span class="var"><b>[1 Name]</b></span></span> <span class="box">contains</span> <span class="box">gif</span></button>
<div class="content contentloop">
<button class="gBlue inside" id="m3">
3 Get Images from <span class="box"><span class="var"><b>[Shortcut Input]</b></span></span></button></div>
<button class="button gGray nonbottom nontop" id="m4">
4 Otherwise</button>
<div class="content contentloop">
<button class="button gGray nonbottom inside" id="m5">
5 If <span class="box"><span class="magic" onclick="magictap(1)"><b>[1 Name]</b></span></span> <span class="box">contains</span> <span class="box">png</span></button>
<div class="content contentloop dashed inside">
<button class="gBlue inside" id="m6">
6 Get Images from <span class="box"><span class="var"><b>[Shortcut Input]</b></span></span></button></div>
<button class="button gGray nonbottom nontop inside" id="m7">
7 Otherwise</button>
<div class="content contentloop dashed inside">
<button class="button gGray nonbottom inside" id="m8">
8 If <span class="box"><span class="var"><b>[Shortcut Input</b>’s Media Type<b>]</b></span></span> <span class="box">is</span> <span class="box">Image</span></button>
<div class="content contentloop inside">
<button class="button gBlue inside" id="m9">
9 Convert Image <span class="box"><span class="var"><b>[Shortcut Input]</b></span></span> to <span class="box">JPEG</span></button>
<div class="content inside">
<div class="row"><div class="col1">ImageCompressionQuality</div>
<div class="col2">1</div></div>
<div class="row"><div class="col1">ImagePreserveMetadata</div>
<div class="col2">false</div></div></div></div>
<button class="button gGray nonbottom nontop inside" id="m10">
10 Otherwise</button>
<div class="content contentloop inside">
<button class="button gGray nonbottom inside" id="m11">
11 If <span class="box"><span class="var"><b>[Shortcut Input</b>’s Media Type<b>]</b></span></span> <span class="box">is</span> <span class="box">Video</span></button>
<div class="content contentloop dashed inside">
<button class="gBlue inside" id="m12">
12 Encode Media <span class="box"><span class="var"><b>[Shortcut Input]</b></span></span></button></div>
<button class="gGray nontop inside" id="m13">
13 End If</button></div>
<button class="gGray nontop inside" id="m14">
14 End If</button></div>
<button class="gGray nontop inside" id="m15">
15 End If</button></div>
<button class="gGray nontop" id="m16">
16 End If ▵<span class="magic" onclick="magictap(4)">4</span> »</button>
<button class="button gGreen" id="m17">
17 Get Contents of URL <span class="box">https://</span> »</button>
<div class="content">
<div class="row"><div class="col1">HTTPHeaders</div>
<div class="col2">{}</div></div>
<div class="row"><div class="col1">ShowHeaders</div>
<div class="col2">true</div></div>
<div class="row"><div class="col1">HTTPMethod</div>
<div class="col2">POST</div></div>
<div class="row"><div class="col1">HTTPBodyType</div>
<div class="col2">Form</div></div>
<div class="row"><div class="col1">FormValues</div>
<div class="col2">{ "file": "<span class="var"><b>[16 If Result]</b></span>" }</div></div></div>
<button class="gOrange" id="m18">
18 Get Dictionary from <span class="box"><span class="var"><b>[17 Contents of URL</b> as Text<b>]</b></span></span> »</button>
<button class="gOrange" id="m19">
19 Get Dictionary Value for <span class="box">resource</span> in <span class="box"><span class="var"><b>[18 Dictionary]</b></span></span> »</button>
<button class="gBlue" id="m20">
20 Copy <span class="box"><span class="var"><b>[19 Dictionary Value]</b></span></span> to Clipboard</button>
<button class="button gGray nonbottom" id="m21">
21 If <span class="box"><span class="var"><b>[Clipboard]</b></span></span> <span class="box">begins with</span> <span class="box">http</span></button>
<div class="content contentloop">
<button class="button gYellow inside" id="m22">
22 Show Alert</button>
<div class="content inside">
<div class="row"><div class="col1">AlertActionCancelButtonShown</div>
<div class="col2">false</div></div>
<div class="row"><div class="col1">AlertActionMessage</div>
<div class="col2">Link has been placed in your clipboard.</div></div>
<div class="row"><div class="col1">AlertActionTitle</div>
<div class="col2">Upload success!</div></div></div></div>
<button class="button gGray nonbottom nontop" id="m23">
23 Otherwise</button>
<div class="content contentloop">
<button class="gYellow inside" id="m24">
24 Text »</button>
<button class="gBlue inside" id="m25">
25 Copy <span class="box"><span class="var"><b>[24 Text]</b></span></span> to Clipboard</button>
<button class="button gYellow inside" id="m26">
26 Show Alert</button>
<div class="content inside">
<div class="row"><div class="col1">AlertActionCancelButtonShown</div>
<div class="col2">false</div></div>
<div class="row"><div class="col1">AlertActionMessage</div>
<div class="col2">Something went wrong. Please check your URL and headers.</div></div>
<div class="row"><div class="col1">AlertActionTitle</div>
<div class="col2">Error</div></div></div></div>
<button class="gGray nontop" id="m27">
27 End If</button>
<script>
for (b of document.getElementsByClassName('button')) {
b.addEventListener('click', function() {
this.classList.toggle('closed');
let s = this.nextElementSibling;
s.style.display = getComputedStyle(s).display==='none' ? 'block' : 'none';
})}
function magictap(id) {
event.stopPropagation();
let e = document.getElementById('m'+id);
let p = e;
while ((p = p.parentNode).tagName.toLowerCase() === 'div') {
p.style.display = 'block';
p.previousElementSibling.classList.remove('closed');
}
setTimeout(function(){ e.scrollIntoView({block:'nearest',behavior:'smooth'}); }, 10);
}
</script></body></html>