feat: Added shortcut file and web overview

This commit is contained in:
Levi 2022-10-31 20:56:21 +01:00 committed by GitHub
parent efab3a437a
commit 3c45318f51
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 722 additions and 0 deletions

323
overview.html Normal file
View file

@ -0,0 +1,323 @@
<!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> (24 actions, 18 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(13)"><b>13</b></span>,
"Text": "URL for your ass instance:",
"DefaultValue": "https://"
},
{
"Category": "Parameter",
"ParameterKey": "WFHTTPHeaders",
"ActionIndex": <span class="magic" onclick="magictap(13)"><b>13</b></span>,
"Text": "Add your token in the \"Text\" field. You can add any other headers you'd like here. For information on headers and how to use them, 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 &amp; contributors for the image server, this shortcut would not exist without them.
v1.0.0 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 GenericFiles File Extension<b>]</b></span></span>&#12288;&#187;</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="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 dashed inside">
<button class="button gBlue inside" id="m6">
6 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="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">Video</span></button>
<div class="content contentloop inside">
<button class="gBlue inside" id="m9">
9 Encode Media <span class="box"><span class="var"><b>[Shortcut Input]</b></span></span></button></div>
<button class="gGray nontop inside" id="m10">
10 End If</button></div>
<button class="gGray nontop inside" id="m11">
11 End If</button></div>
<button class="gGray nontop" id="m12">
12 End If&#12288;&#187;</button>
<button class="button gGreen" id="m13">
13 Get Contents of URL <span class="box">https://</span>&#12288;&#187;</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>[12 If Result]</b></span>" }</div></div></div>
<button class="gOrange" id="m14">
14 Get Dictionary from <span class="box"><span class="var"><b>[13 Contents of URL</b> as Text<b>]</b></span></span>&#12288;&#187;</button>
<button class="gOrange" id="m15">
15 Get Dictionary Value for <span class="box">resource</span> in <span class="box"><span class="var"><b>[14 Dictionary]</b></span></span>&#12288;&#187;</button>
<button class="gBlue" id="m16">
16 Copy <span class="box"><span class="var"><b>[15 Dictionary Value]</b></span></span> to Clipboard</button>
<button class="button gGray nonbottom" id="m17">
17 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="m18">
18 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="m19">
19 Otherwise</button>
<div class="content contentloop">
<button class="gYellow inside" id="m20">
20 Text&#12288;&#187;</button>
<button class="gBlue inside" id="m21">
21 Copy <span class="box"><span class="var"><b>[20 Text]</b></span></span> to Clipboard</button>
<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">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="m23">
23 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>

399
shortcut.plist Normal file
View file

@ -0,0 +1,399 @@
{
"WFWorkflowMinimumClientVersionString": "1113",
"WFWorkflowMinimumClientVersion": 1113,
"WFWorkflowIcon": {
"WFWorkflowIconStartColor": 4271458815,
"WFWorkflowIconGlyphNumber": 59826
},
"WFWorkflowClientVersion": "1206.4.3",
"WFWorkflowOutputContentItemClasses": [],
"WFWorkflowHasOutputFallback": false,
"WFWorkflowNoInputBehavior": {
"Name": "WFWorkflowNoInputBehaviorAskForInput",
"Parameters": {
"ItemClass": "WFPhotoMediaContentItem"
}
},
"WFWorkflowActions": [
{
"WFWorkflowActionIdentifier": "is.workflow.actions.comment",
"WFWorkflowActionParameters": {
"WFCommentActionText": "For info on headers and how to use them, look here: https://github.com/tycrek/ass#header-overrides\n\nCredit to tycrek & contributors for the image server, this shortcut would not exist without them.\n\nv1.0.0 by https://github.com/LeviSnoot"
}
},
{
"WFWorkflowActionIdentifier": "is.workflow.actions.getitemname",
"WFWorkflowActionParameters": {
"GetWebPageTitle": false,
"WFInput": {
"Value": {
"Type": "ExtensionInput",
"Aggrandizements": [
{
"Type": "WFCoercionVariableAggrandizement",
"CoercionItemClass": "WFGenericFileContentItem"
},
{
"PropertyUserInfo": "WFFileExtensionProperty",
"Type": "WFPropertyVariableAggrandizement",
"PropertyName": "File Extension"
}
]
},
"WFSerializationType": "WFTextTokenAttachment"
},
"UUID": "C12B7BC7-4B5C-4403-B7CC-21C5CFD79694"
}
},
{
"WFWorkflowActionIdentifier": "is.workflow.actions.conditional",
"WFWorkflowActionParameters": {
"WFInput": {
"Type": "Variable",
"Variable": {
"Value": {
"OutputUUID": "C12B7BC7-4B5C-4403-B7CC-21C5CFD79694",
"Type": "ActionOutput",
"OutputName": "Name"
},
"WFSerializationType": "WFTextTokenAttachment"
}
},
"WFControlFlowMode": 0,
"WFConditionalActionString": "gif",
"GroupingIdentifier": "DF347143-C79F-4020-A715-CB373BCA94AD",
"WFCondition": 99
}
},
{
"WFWorkflowActionIdentifier": "is.workflow.actions.detect.images",
"WFWorkflowActionParameters": {
"WFInput": {
"Value": {
"Type": "ExtensionInput"
},
"WFSerializationType": "WFTextTokenAttachment"
}
}
},
{
"WFWorkflowActionIdentifier": "is.workflow.actions.conditional",
"WFWorkflowActionParameters": {
"GroupingIdentifier": "DF347143-C79F-4020-A715-CB373BCA94AD",
"WFControlFlowMode": 1
}
},
{
"WFWorkflowActionIdentifier": "is.workflow.actions.conditional",
"WFWorkflowActionParameters": {
"GroupingIdentifier": "4A5965D9-45BC-48C3-8F24-8D74B4E3008D",
"WFInput": {
"Type": "Variable",
"Variable": {
"Value": {
"Type": "ExtensionInput",
"Aggrandizements": [
{
"Type": "WFPropertyVariableAggrandizement",
"PropertyName": "Media Type"
}
]
},
"WFSerializationType": "WFTextTokenAttachment"
}
},
"WFControlFlowMode": 0,
"WFEnumeration": "Image",
"WFCondition": 4
}
},
{
"WFWorkflowActionIdentifier": "is.workflow.actions.image.convert",
"WFWorkflowActionParameters": {
"WFImageCompressionQuality": 1,
"WFInput": {
"Value": {
"Type": "ExtensionInput"
},
"WFSerializationType": "WFTextTokenAttachment"
},
"UUID": "ABFC2337-401B-4C55-A4D3-6FDF583A566B",
"WFImagePreserveMetadata": false,
"WFImageFormat": "JPEG"
}
},
{
"WFWorkflowActionIdentifier": "is.workflow.actions.conditional",
"WFWorkflowActionParameters": {
"GroupingIdentifier": "4A5965D9-45BC-48C3-8F24-8D74B4E3008D",
"WFControlFlowMode": 1
}
},
{
"WFWorkflowActionIdentifier": "is.workflow.actions.conditional",
"WFWorkflowActionParameters": {
"GroupingIdentifier": "78E9705B-1A4E-4627-9137-88FDAADBADB0",
"WFInput": {
"Type": "Variable",
"Variable": {
"Value": {
"Type": "ExtensionInput",
"Aggrandizements": [
{
"Type": "WFPropertyVariableAggrandizement",
"PropertyName": "Media Type"
}
]
},
"WFSerializationType": "WFTextTokenAttachment"
}
},
"WFControlFlowMode": 0,
"WFEnumeration": "Video",
"WFCondition": 4
}
},
{
"WFWorkflowActionIdentifier": "is.workflow.actions.encodemedia",
"WFWorkflowActionParameters": {
"WFMedia": {
"Value": {
"Type": "ExtensionInput"
},
"WFSerializationType": "WFTextTokenAttachment"
},
"UUID": "9D196FE3-C8AB-4F5B-B748-5FAB81712ED9"
}
},
{
"WFWorkflowActionIdentifier": "is.workflow.actions.conditional",
"WFWorkflowActionParameters": {
"GroupingIdentifier": "78E9705B-1A4E-4627-9137-88FDAADBADB0",
"WFControlFlowMode": 2
}
},
{
"WFWorkflowActionIdentifier": "is.workflow.actions.conditional",
"WFWorkflowActionParameters": {
"GroupingIdentifier": "4A5965D9-45BC-48C3-8F24-8D74B4E3008D",
"WFControlFlowMode": 2
}
},
{
"WFWorkflowActionIdentifier": "is.workflow.actions.conditional",
"WFWorkflowActionParameters": {
"WFControlFlowMode": 2,
"GroupingIdentifier": "DF347143-C79F-4020-A715-CB373BCA94AD",
"UUID": "4FC7832E-BDC2-49FA-9956-5338C1F979E9"
}
},
{
"WFWorkflowActionIdentifier": "is.workflow.actions.downloadurl",
"WFWorkflowActionParameters": {
"WFHTTPHeaders": {
"Value": {
"WFDictionaryFieldValueItems": []
},
"WFSerializationType": "WFDictionaryFieldValue"
},
"UUID": "29ACFEB7-7546-4E33-A251-9E5A63FB336C",
"ShowHeaders": true,
"WFURL": "https://",
"WFHTTPMethod": "POST",
"WFHTTPBodyType": "Form",
"WFFormValues": {
"Value": {
"WFDictionaryFieldValueItems": [
{
"WFItemType": 5,
"WFKey": {
"Value": {
"string": "file"
},
"WFSerializationType": "WFTextTokenString"
},
"WFValue": {
"Value": {
"Value": {
"OutputUUID": "4FC7832E-BDC2-49FA-9956-5338C1F979E9",
"Type": "ActionOutput",
"OutputName": "If Result"
},
"WFSerializationType": "WFTextTokenAttachment"
},
"WFSerializationType": "WFTokenAttachmentParameterState"
}
}
]
},
"WFSerializationType": "WFDictionaryFieldValue"
}
}
},
{
"WFWorkflowActionIdentifier": "is.workflow.actions.detect.dictionary",
"WFWorkflowActionParameters": {
"WFInput": {
"Value": {
"Type": "ActionOutput",
"OutputName": "Contents of URL",
"OutputUUID": "29ACFEB7-7546-4E33-A251-9E5A63FB336C",
"Aggrandizements": [
{
"Type": "WFCoercionVariableAggrandizement",
"CoercionItemClass": "WFStringContentItem"
}
]
},
"WFSerializationType": "WFTextTokenAttachment"
},
"UUID": "B659AB67-8D71-4E53-AFDE-B9C9B88A76AA"
}
},
{
"WFWorkflowActionIdentifier": "is.workflow.actions.getvalueforkey",
"WFWorkflowActionParameters": {
"WFInput": {
"Value": {
"OutputUUID": "B659AB67-8D71-4E53-AFDE-B9C9B88A76AA",
"Type": "ActionOutput",
"OutputName": "Dictionary"
},
"WFSerializationType": "WFTextTokenAttachment"
},
"WFDictionaryKey": "resource",
"UUID": "50CB17F3-F171-4DE5-AD95-62AAAFA531BB"
}
},
{
"WFWorkflowActionIdentifier": "is.workflow.actions.setclipboard",
"WFWorkflowActionParameters": {
"WFInput": {
"Value": {
"OutputUUID": "50CB17F3-F171-4DE5-AD95-62AAAFA531BB",
"Type": "ActionOutput",
"OutputName": "Dictionary Value"
},
"WFSerializationType": "WFTextTokenAttachment"
},
"UUID": "67C6AFE1-F7EE-4EBA-BDB8-C24CD2B20F9F"
}
},
{
"WFWorkflowActionIdentifier": "is.workflow.actions.conditional",
"WFWorkflowActionParameters": {
"WFInput": {
"Type": "Variable",
"Variable": {
"Value": {
"Type": "Clipboard"
},
"WFSerializationType": "WFTextTokenAttachment"
}
},
"WFControlFlowMode": 0,
"WFConditionalActionString": "http",
"GroupingIdentifier": "0FBE77F0-50D7-408B-8065-BCCCA86BA00C",
"WFCondition": 8
}
},
{
"WFWorkflowActionIdentifier": "is.workflow.actions.alert",
"WFWorkflowActionParameters": {
"WFAlertActionCancelButtonShown": false,
"WFAlertActionMessage": "Link has been placed in your clipboard.",
"WFAlertActionTitle": "Upload success!"
}
},
{
"WFWorkflowActionIdentifier": "is.workflow.actions.conditional",
"WFWorkflowActionParameters": {
"GroupingIdentifier": "0FBE77F0-50D7-408B-8065-BCCCA86BA00C",
"WFControlFlowMode": 1
}
},
{
"WFWorkflowActionIdentifier": "is.workflow.actions.gettext",
"WFWorkflowActionParameters": {
"UUID": "386EF43D-73AA-4FA1-8E9E-16E61DD4C650"
}
},
{
"WFWorkflowActionIdentifier": "is.workflow.actions.setclipboard",
"WFWorkflowActionParameters": {
"WFInput": {
"Value": {
"OutputUUID": "386EF43D-73AA-4FA1-8E9E-16E61DD4C650",
"Type": "ActionOutput",
"OutputName": "Text"
},
"WFSerializationType": "WFTextTokenAttachment"
},
"UUID": "2C552069-C58C-40F0-9565-D96D8A565F6B"
}
},
{
"WFWorkflowActionIdentifier": "is.workflow.actions.alert",
"WFWorkflowActionParameters": {
"WFAlertActionCancelButtonShown": false,
"WFAlertActionMessage": "Something went wrong. Please check your URL and headers.",
"WFAlertActionTitle": "Error"
}
},
{
"WFWorkflowActionIdentifier": "is.workflow.actions.conditional",
"WFWorkflowActionParameters": {
"WFControlFlowMode": 2,
"GroupingIdentifier": "0FBE77F0-50D7-408B-8065-BCCCA86BA00C",
"UUID": "7E7BCD56-53C0-4CFF-BDD2-1F949C1A8AD7"
}
}
],
"WFWorkflowInputContentItemClasses": [
"WFImageContentItem",
"WFAVAssetContentItem",
"WFGenericFileContentItem"
],
"WFWorkflowImportQuestions": [
{
"Category": "Parameter",
"ParameterKey": "WFURL",
"ActionIndex": 13,
"Text": "URL for your ass instance:",
"DefaultValue": "https://"
},
{
"Category": "Parameter",
"ParameterKey": "WFHTTPHeaders",
"ActionIndex": 13,
"Text": "Add your token in the \"Text\" field. You can add any other headers you'd like here. For information on headers and how to use them, check the comment in the shortcut.",
"DefaultValue": {
"Value": {
"WFDictionaryFieldValueItems": [
{
"WFItemType": 0,
"WFKey": {
"Value": {
"string": "Authorization"
},
"WFSerializationType": "WFTextTokenString"
},
"WFValue": {
"Value": {
"string": ""
},
"WFSerializationType": "WFTextTokenString"
}
}
]
},
"WFSerializationType": "WFDictionaryFieldValue"
}
}
],
"WFQuickActionSurfaces": [],
"WFWorkflowTypes": [
"ActionExtension"
],
"WFWorkflowHasShortcutInputVariables": true
}