Skip to content

Commit

Permalink
更新HTTP Shortcuts以支持多文件
Browse files Browse the repository at this point in the history
  • Loading branch information
Jeric-X committed May 10, 2024
1 parent d6e1277 commit 9be8d50
Show file tree
Hide file tree
Showing 8 changed files with 12 additions and 10 deletions.
2 changes: 1 addition & 1 deletion Changes.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
v2.7.5.1
- 功能:支持同步多个文件、文件夹,移动端体现为zip压缩文件,安卓端`HTTP Shortcuts`配置也需要更新以支持此功能
- 修复:最大上传文件大小设置项在混合模式无法设置(#68)
- 功能:支持复制多个文件、文件夹,移动端体现为zip压缩文件
- 修复:Windows端无法下载`.lnk``.url``.wsh`类型的文件

v2.7.5
Expand Down
4 changes: 2 additions & 2 deletions build/macos/Info.plist
Original file line number Diff line number Diff line change
Expand Up @@ -19,8 +19,8 @@
<key>NSHighResolutionCapable</key>
<true/>
<key>CFBundleVersion</key>
<string>0.6.4</string>
<string>0.6.4.1</string>
<key>CFBundleShortVersionString</key>
<string>0.6.4</string>
<string>0.6.4.1</string>
</dict>
</plist>
6 changes: 2 additions & 4 deletions script/en/shortcuts.json
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@
"bodyContent": "{\"File\":\"\",\"Clipboard\":\"{{76b1e948-84b3-497e-8ec5-b911d00f8f0f}}\",\"Type\":\"Text\"}",
"codeOnSuccess": "showToast(\u0027uploaded\u0027);",
"contentType": "application/json",
"description": "",
"iconName": "freepik_upload",
"id": "d6a958cb-3fa6-4c79-b342-229008bfac8a",
"method": "PUT",
Expand All @@ -25,7 +24,7 @@
},
{
"authentication": "basic",
"codeOnSuccess": "const profile \u003d JSON.parse(response.body)\nconst type \u003d profile.Type\n\nif (type \u003d\u003d \u0027Text\u0027) {\n const ClibboardText \u003d profile.Clipboard;\n copyToClipboard(ClibboardText);\n showToast(\u0027Copied\\n\u0027 + ClibboardText);\n\n const httpstr \u003d httpString(ClibboardText);\n\n if (httpstr) {\n if (confirm(\u0027Open Url in Browser?\u0027)) {\n openUrl(httpstr[0]);\n }\n }\n}\n\nif (type \u003d\u003d \u0027File\u0027 || type \u003d\u003d \u0027Image\u0027) {\n const downloadUrl \u003d getVariable(/*[variable]*/\"136751b5-5f38-49fc-81dc-80a825804203\"/*[/variable]*/) + \u0027/file/\u0027 + encodeURIComponent(profile.File)\n copyToClipboard(profile.File);\n showToast(\u0027File name copied, downloading\\n\u0027 + profile.File);\n const inputPara \u003d { \u0027downloadUrl\u0027: downloadUrl }\n enqueueShortcut(/*[shortcut]*/\"1e693964-ab59-4e9c-902b-6b94b90ff2f0\"/*[/shortcut]*/, inputPara)\n}\n\nfunction httpString(s) {\n var reg \u003d /(https?|http|ftp|file):\\/\\/[-A-Za-z0-9+\u0026@#/%?\u003d~_|!:,.;]+[-A-Za-z0-9+\u0026@#/%\u003d~_|]/g;\n s \u003d s.match(reg);\n return (s)\n}",
"codeOnSuccess": "const profile \u003d JSON.parse(response.body)\r\nconst type \u003d profile.Type\r\n\r\nif (type \u003d\u003d \u0027Text\u0027) {\r\n const ClibboardText \u003d profile.Clipboard;\r\n copyToClipboard(ClibboardText);\r\n showToast(\u0027Copied\\n\u0027 + ClibboardText);\r\n\r\n const httpstr \u003d httpString(ClibboardText);\r\n\r\n if (httpstr) {\r\n if (confirm(\u0027Open Url in Browser?\u0027)) {\r\n openUrl(httpstr[0]);\r\n }\r\n }\r\n}\r\nelse if (profile.File \u0026\u0026 profile.File.length \u003e 0) {\r\n const downloadUrl \u003d getVariable(/*[variable]*/\"136751b5-5f38-49fc-81dc-80a825804203\"/*[/variable]*/) + \u0027/file/\u0027 + encodeURIComponent(profile.File)\r\n copyToClipboard(profile.File);\r\n showToast(\u0027File name copied, downloading\\n\u0027 + profile.File);\r\n const inputPara \u003d { \u0027downloadUrl\u0027: downloadUrl }\r\n enqueueShortcut(/*[shortcut]*/\"1e693964-ab59-4e9c-902b-6b94b90ff2f0\"/*[/shortcut]*/, inputPara)\r\n}\r\n\r\nfunction httpString(s) {\r\n var reg \u003d /(https?|http|ftp|file):\\/\\/[-A-Za-z0-9+\u0026@#/%?\u003d~_|!:,.;]+[-A-Za-z0-9+\u0026@#/%\u003d~_|]/g;\r\n s \u003d s.match(reg);\r\n return (s)\r\n}",
"iconName": "freepik_download",
"id": "91cf41c5-da0c-45b5-988c-9f636e135abd",
"name": "Download",
Expand Down Expand Up @@ -86,7 +85,6 @@
"authentication": "basic",
"bodyContent": "{\"File\":\"\",\"Clipboard\":\"{{76b1e948-84b3-497e-8ec5-b911d00f8f0f}}\",\"Type\":\"Text\"}",
"contentType": "application/json",
"description": "",
"iconName": "flat_color_folder",
"id": "1e693964-ab59-4e9c-902b-6b94b90ff2f0",
"name": "Showcase",
Expand Down Expand Up @@ -142,5 +140,5 @@
"value": ""
}
],
"version": 71
"version": 75
}
Binary file modified script/en/shortcuts.zip
Binary file not shown.
4 changes: 2 additions & 2 deletions script/shortcuts.json
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@
},
{
"authentication": "basic",
"codeOnSuccess": "const profile \u003d JSON.parse(response.body)\nconst type \u003d profile.Type\n\nif (type \u003d\u003d \u0027Text\u0027) {\n const ClibboardText \u003d profile.Clipboard;\n copyToClipboard(ClibboardText);\n showToast(\u0027已拷贝\\n\u0027 + ClibboardText);\n\n const httpstr \u003d httpString(ClibboardText);\n\n if (httpstr) {\n if (confirm(\u0027包含网址,是否打开\u0027)) {\n openUrl(httpstr[0]);\n }\n }\n}\n\nif (type \u003d\u003d \u0027File\u0027 || type \u003d\u003d \u0027Image\u0027) {\n const downloadUrl \u003d getVariable(/*[variable]*/\"136751b5-5f38-49fc-81dc-80a825804203\"/*[/variable]*/) + \u0027/file/\u0027 + encodeURIComponent(profile.File)\n copyToClipboard(profile.File);\n showToast(\u0027文件名已拷贝,正在下载\\n\u0027 + profile.File);\n const inputPara \u003d { \u0027downloadUrl\u0027: downloadUrl }\n enqueueShortcut(/*[shortcut]*/\"1e693964-ab59-4e9c-902b-6b94b90ff2f0\"/*[/shortcut]*/, inputPara)\n}\n\nfunction httpString(s) {\n var reg \u003d /(https?|http|ftp|file):\\/\\/[-A-Za-z0-9+\u0026@#/%?\u003d~_|!:,.;]+[-A-Za-z0-9+\u0026@#/%\u003d~_|]/g;\n s \u003d s.match(reg);\n return (s)\n}",
"codeOnSuccess": "const profile \u003d JSON.parse(response.body)\r\nconst type \u003d profile.Type\r\n\r\nif (type \u003d\u003d \u0027Text\u0027) {\r\n const ClibboardText \u003d profile.Clipboard;\r\n copyToClipboard(ClibboardText);\r\n showToast(\u0027已拷贝\\n\u0027 + ClibboardText);\r\n\r\n const httpstr \u003d httpString(ClibboardText);\r\n\r\n if (httpstr) {\r\n if (confirm(\u0027包含网址,是否打开\u0027)) {\r\n openUrl(httpstr[0]);\r\n }\r\n }\r\n}\r\nelse if (profile.File \u0026\u0026 profile.File.length \u003e 0) {\r\n const downloadUrl \u003d getVariable(/*[variable]*/\"136751b5-5f38-49fc-81dc-80a825804203\"/*[/variable]*/) + \u0027/file/\u0027 + encodeURIComponent(profile.File)\r\n const inputPara \u003d { \u0027downloadUrl\u0027: downloadUrl }\r\n showToast(\u0027文件名已拷贝,正在下载\\n\u0027 + profile.File)\r\n copyToClipboard(profile.File)\r\n if (type \u003d\u003d \u0027Image\u0027 || isImageFile(profile.File)) {\r\n enqueueShortcut(/*[shortcut]*/\"1e693964-ab59-4e9c-902b-6b94b90ff2f0\"/*[/shortcut]*/, inputPara)\r\n } else {\r\n enqueueShortcut(/*[shortcut]*/\"1e693964-ab59-4e9c-902b-6b94b90ff2f0\"/*[/shortcut]*/, inputPara)\r\n }\r\n}\r\n\r\nfunction isImageFile(file) {\r\n const filename \u003d file.toLowerCase();\r\n const list \u003d [\r\n \u0027.png\u0027,\r\n \u0027.jpg\u0027,\r\n \u0027.jpeg\u0027,\r\n \u0027.gif\u0027,\r\n \u0027.bmp\u0027,\r\n \u0027.webp\u0027,\r\n ]\r\n let result \u003d false\r\n list.forEach(element \u003d\u003e {\r\n if (filename.endsWith(element)) {\r\n result \u003d true\r\n }\r\n })\r\n return result\r\n}\r\n\r\nfunction httpString(s) {\r\n var reg \u003d /(https?|http|ftp|file):\\/\\/[-A-Za-z0-9+\u0026@#/%?\u003d~_|!:,.;]+[-A-Za-z0-9+\u0026@#/%\u003d~_|]/g;\r\n s \u003d s.match(reg);\r\n return (s)\r\n}",
"iconName": "freepik_download",
"id": "91cf41c5-da0c-45b5-988c-9f636e135abd",
"name": "下载剪贴板",
Expand Down Expand Up @@ -142,5 +142,5 @@
"value": ""
}
],
"version": 71
"version": 75
}
Binary file modified script/shortcuts.zip
Binary file not shown.
2 changes: 1 addition & 1 deletion src/SyncClipboard.Desktop/AppConfig.cs
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ internal class AppConfig : IAppConfig
{
public string AppId => Env.AppId;
public string AppStringId => "SyncClipboard.Desktop";
public string AppVersion => "0.6.4";
public string AppVersion => "0.6.4.1";
public string UpdateApiUrl => "https://api.github.com/repos/Jeric-X/SyncClipboard.Desktop/releases/latest";
public string UpdateUrl => "https://github.com/Jeric-X/SyncClipboard.Desktop/releases/latest";
}
4 changes: 4 additions & 0 deletions src/SyncClipboard.Desktop/Changes.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
0.6.4.1
- 功能:支持同步多个文件、文件夹,移动端体现为zip压缩文件,安卓端`HTTP Shortcuts`配置也需要更新以支持此功能
- 修复:最大上传文件大小设置项在混合模式无法设置(https://github.com/Jeric-X/SyncClipboard/issues/68)

0.6.4
- 功能:增加复制并上传/下载并粘贴快捷键

Expand Down

0 comments on commit 9be8d50

Please sign in to comment.