diff --git a/Podfile.lock b/Podfile.lock index e29a4b6..467c1bc 100644 --- a/Podfile.lock +++ b/Podfile.lock @@ -1,11 +1,11 @@ PODS: - - Alamofire (5.0.2) - - CryptoSwift (1.3.0) - - Kingfisher (5.13.2): - - Kingfisher/Core (= 5.13.2) - - Kingfisher/Core (5.13.2) + - Alamofire (5.0.5) + - CryptoSwift (1.3.1) + - Kingfisher (5.14.1): + - Kingfisher/Core (= 5.14.1) + - Kingfisher/Core (5.14.1) - libminipng (0.5.6) - - LoginServiceKit (2.1.0) + - LoginServiceKit (2.2.0) - MASShortcut (2.4.0) - SnapKit (5.0.1) - Sparkle (1.23.0) @@ -55,21 +55,21 @@ EXTERNAL SOURCES: CHECKOUT OPTIONS: CryptoSwift: - :commit: a842251aee9047b2b335afe0ae0b5b44daf95219 + :commit: e793a595747c8f9b97b8de4ebde7b2a440f2d594 :git: https://github.com/krzyzanowskim/CryptoSwift LoginServiceKit: - :commit: be0b910d825f826d3c64d6ff1207209ec7dea0fa + :commit: 17a916dc09f1aab0f13e6edd1f77cdecee4d0ae8 :git: https://github.com/Clipy/LoginServiceKit.git SwiftyXMLParser: - :commit: bc85162ecee60d6eb94b778648bc4c51e1c4d34f + :commit: 9d82653e535a13a518b411934c0a5c0c84406c22 :git: https://github.com/yahoojapan/SwiftyXMLParser.git SPEC CHECKSUMS: - Alamofire: 3ba7a4db18b4f62c4a1c0e1cb39d7f3d52e10ada - CryptoSwift: 1283821600233bdbeb96d7b389c3288c3bf77211 - Kingfisher: d342c8354c10c3d85a27d6d4c42c41285924b898 + Alamofire: df2f8f826963b08b9a870791ad48e07a10090b2e + CryptoSwift: 27c1f79acf3410c697981c2443076ad0880a62b4 + Kingfisher: 8050bc6f7f68cbf3908bd04df7ccbac188f6d6d6 libminipng: a44c35d06b9d54d6640acdf97f4500c034748abb - LoginServiceKit: 9a8b258c3111fa0d9585615052f778b08be92302 + LoginServiceKit: 3c86ce2f2bcd1e373326839d6d863d8a6a5915b4 MASShortcut: d9e4909e878661cc42877cc9d6efbe638273ab57 SnapKit: 97b92857e3df3a0c71833cce143274bf6ef8e5eb Sparkle: 55b1a87ba69d56913375a281546b7c82dec95bb0 @@ -81,4 +81,4 @@ SPEC CHECKSUMS: PODFILE CHECKSUM: 4101e450e6b2d21bac70b5245d209294f573f3bb -COCOAPODS: 1.9.1 +COCOAPODS: 1.9.3 diff --git a/README-cn.md b/README-cn.md index 5ad8da3..56f2132 100644 --- a/README-cn.md +++ b/README-cn.md @@ -18,7 +18,7 @@ ----- -**👬联系: _[Telegram](https://t.me/upic_host), [Twitter](https://twitter.com/geee1k), [微博](https://weibo.com/6436660358), [微信群](https://raw.githubusercontent.com/gee1k/oss/master/personal/geee1k.JPG)_** +**👬联系: _[Telegram](https://t.me/upic_host), [Twitter](https://twitter.com/realSvend), [微博](https://weibo.com/6436660358), [微信群](https://raw.githubusercontent.com/gee1k/oss/master/personal/geee1k.JPG)_** **☕️赞助: _[Paypal](https://paypal.me/geeee1k), [支付宝](https://raw.githubusercontent.com/gee1k/oss/master/qrcode/alipay.JPG), [微信支付](https://raw.githubusercontent.com/gee1k/oss/master/qrcode/wechat_pay.JPG)_** diff --git a/README.md b/README.md index 92645ad..062a474 100644 --- a/README.md +++ b/README.md @@ -18,7 +18,7 @@ ----- -**👬Chat: _[Telegram](https://t.me/upic_host), [Twitter](https://twitter.com/geee1k), [Weibo](https://weibo.com/6436660358), [Wechat Group](https://raw.githubusercontent.com/gee1k/oss/master/personal/geee1k.JPG)_** +**👬Chat: _[Telegram](https://t.me/upic_host), [Twitter](https://twitter.com/realSvend), [Weibo](https://weibo.com/6436660358), [Wechat Group](https://raw.githubusercontent.com/gee1k/oss/master/personal/geee1k.JPG)_** **☕️Donate: _[Paypal](https://paypal.me/geeee1k), [Alipay](https://raw.githubusercontent.com/gee1k/oss/master/qrcode/alipay.JPG), [WechatPay](https://raw.githubusercontent.com/gee1k/oss/master/qrcode/wechat_pay.JPG)_** diff --git a/uPic.sketch b/uPic.sketch new file mode 100755 index 0000000..4e48e46 Binary files /dev/null and b/uPic.sketch differ diff --git a/uPic.xcodeproj/project.pbxproj b/uPic.xcodeproj/project.pbxproj index 11ef212..a2be7b3 100644 --- a/uPic.xcodeproj/project.pbxproj +++ b/uPic.xcodeproj/project.pbxproj @@ -323,7 +323,7 @@ 68BBB2F5FAEEFFF55935F022 /* AmazonS3Util.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = AmazonS3Util.swift; sourceTree = ""; }; 68BBB5C4550545707614BE4D /* AmazonS3Uploader.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = AmazonS3Uploader.swift; sourceTree = ""; }; 68BBB8CF2838A67CA1AD438F /* AmazonS3HostConfig.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = AmazonS3HostConfig.swift; sourceTree = ""; }; - 9667517C240D2BA6007C7012 /* en */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = en; path = en.lproj/Main.strings; sourceTree = ""; }; + 96319C6E24CE7CEB004A6E62 /* en */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = en; path = en.lproj/Main.strings; sourceTree = ""; }; 968ECC08240DFCF900B2D78C /* en */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = en; path = en.lproj/InfoPlist.strings; sourceTree = ""; }; 968ECC0A240DFCFA00B2D78C /* zh-Hans */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = "zh-Hans"; path = "zh-Hans.lproj/InfoPlist.strings"; sourceTree = ""; }; 969018A3240D998400B545B2 /* en */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = en; path = en.lproj/Preferences.strings; sourceTree = ""; }; @@ -1102,8 +1102,8 @@ children = ( 1648A215238E742600B99B9D /* Base */, 1648A218238E743200B99B9D /* zh-Hans */, - 9667517C240D2BA6007C7012 /* en */, 1605DDD8246D993C00262C89 /* zh-Hant */, + 96319C6E24CE7CEB004A6E62 /* en */, ); name = Main.storyboard; sourceTree = ""; @@ -1260,7 +1260,7 @@ CODE_SIGN_IDENTITY = "Apple Development"; CODE_SIGN_STYLE = Automatic; COMBINE_HIDPI_IMAGES = YES; - CURRENT_PROJECT_VERSION = 20200723; + CURRENT_PROJECT_VERSION = 20200728; DEVELOPMENT_TEAM = W863J6W8DZ; ENABLE_HARDENED_RUNTIME = YES; INFOPLIST_FILE = "$(SRCROOT)/uPic/Supporting Files/Info.plist"; @@ -1269,7 +1269,7 @@ "@executable_path/../Frameworks", ); MACOSX_DEPLOYMENT_TARGET = 10.12; - MARKETING_VERSION = 0.19.5; + MARKETING_VERSION = 0.19.6; PRODUCT_BUNDLE_IDENTIFIER = com.svend.uPic; PRODUCT_NAME = "$(TARGET_NAME)"; PROVISIONING_PROFILE_SPECIFIER = ""; @@ -1290,7 +1290,7 @@ CODE_SIGN_IDENTITY = "Apple Development"; CODE_SIGN_STYLE = Automatic; COMBINE_HIDPI_IMAGES = YES; - CURRENT_PROJECT_VERSION = 20200723; + CURRENT_PROJECT_VERSION = 20200728; DEVELOPMENT_TEAM = W863J6W8DZ; ENABLE_HARDENED_RUNTIME = YES; INFOPLIST_FILE = "$(SRCROOT)/uPic/Supporting Files/Info.plist"; @@ -1299,7 +1299,7 @@ "@executable_path/../Frameworks", ); MACOSX_DEPLOYMENT_TARGET = 10.12; - MARKETING_VERSION = 0.19.5; + MARKETING_VERSION = 0.19.6; PRODUCT_BUNDLE_IDENTIFIER = com.svend.uPic; PRODUCT_NAME = "$(TARGET_NAME)"; PROVISIONING_PROFILE_SPECIFIER = ""; @@ -1316,7 +1316,7 @@ CODE_SIGN_IDENTITY = "Apple Development"; CODE_SIGN_STYLE = Automatic; COMBINE_HIDPI_IMAGES = YES; - CURRENT_PROJECT_VERSION = 20200723; + CURRENT_PROJECT_VERSION = 20200728; DEVELOPMENT_TEAM = W863J6W8DZ; ENABLE_HARDENED_RUNTIME = YES; INFOPLIST_FILE = uPicFinderExtension/Info.plist; @@ -1326,7 +1326,7 @@ "@executable_path/../../../../Frameworks", ); MACOSX_DEPLOYMENT_TARGET = 10.12; - MARKETING_VERSION = 0.19.5; + MARKETING_VERSION = 0.19.6; PRODUCT_BUNDLE_IDENTIFIER = com.svend.uPic.uPicFinderExtension; PRODUCT_NAME = "$(TARGET_NAME)"; PROVISIONING_PROFILE_SPECIFIER = ""; @@ -1343,7 +1343,7 @@ CODE_SIGN_IDENTITY = "Apple Development"; CODE_SIGN_STYLE = Automatic; COMBINE_HIDPI_IMAGES = YES; - CURRENT_PROJECT_VERSION = 20200723; + CURRENT_PROJECT_VERSION = 20200728; DEVELOPMENT_TEAM = W863J6W8DZ; ENABLE_HARDENED_RUNTIME = YES; INFOPLIST_FILE = uPicFinderExtension/Info.plist; @@ -1353,7 +1353,7 @@ "@executable_path/../../../../Frameworks", ); MACOSX_DEPLOYMENT_TARGET = 10.12; - MARKETING_VERSION = 0.19.5; + MARKETING_VERSION = 0.19.6; PRODUCT_BUNDLE_IDENTIFIER = com.svend.uPic.uPicFinderExtension; PRODUCT_NAME = "$(TARGET_NAME)"; PROVISIONING_PROFILE_SPECIFIER = ""; diff --git a/uPic/Assets.xcassets/hosts/host_icon_lsky_pro.imageset/Contents.json b/uPic/Assets.xcassets/hosts/host_icon_lsky_pro.imageset/Contents.json index eef524e..c5019b3 100644 --- a/uPic/Assets.xcassets/hosts/host_icon_lsky_pro.imageset/Contents.json +++ b/uPic/Assets.xcassets/hosts/host_icon_lsky_pro.imageset/Contents.json @@ -1,23 +1,23 @@ { "images" : [ { - "idiom" : "universal", "filename" : "lsky.png", + "idiom" : "universal", "scale" : "1x" }, { - "idiom" : "universal", "filename" : "lsky@2x.png", + "idiom" : "universal", "scale" : "2x" }, { - "idiom" : "universal", "filename" : "lsky@3x.png", + "idiom" : "universal", "scale" : "3x" } ], "info" : { - "version" : 1, - "author" : "xcode" + "author" : "xcode", + "version" : 1 } -} \ No newline at end of file +} diff --git a/uPic/Assets.xcassets/hosts/host_icon_lsky_pro.imageset/lsky.png b/uPic/Assets.xcassets/hosts/host_icon_lsky_pro.imageset/lsky.png index 60b10bf..b0da80e 100644 Binary files a/uPic/Assets.xcassets/hosts/host_icon_lsky_pro.imageset/lsky.png and b/uPic/Assets.xcassets/hosts/host_icon_lsky_pro.imageset/lsky.png differ diff --git a/uPic/Assets.xcassets/hosts/host_icon_lsky_pro.imageset/lsky@2x.png b/uPic/Assets.xcassets/hosts/host_icon_lsky_pro.imageset/lsky@2x.png index a59ec5a..e7a2b20 100644 Binary files a/uPic/Assets.xcassets/hosts/host_icon_lsky_pro.imageset/lsky@2x.png and b/uPic/Assets.xcassets/hosts/host_icon_lsky_pro.imageset/lsky@2x.png differ diff --git a/uPic/Assets.xcassets/hosts/host_icon_lsky_pro.imageset/lsky@3x.png b/uPic/Assets.xcassets/hosts/host_icon_lsky_pro.imageset/lsky@3x.png index 93b920a..37d33c2 100644 Binary files a/uPic/Assets.xcassets/hosts/host_icon_lsky_pro.imageset/lsky@3x.png and b/uPic/Assets.xcassets/hosts/host_icon_lsky_pro.imageset/lsky@3x.png differ diff --git a/uPic/Assets.xcassets/hosts/host_icon_minio.imageset/Contents.json b/uPic/Assets.xcassets/hosts/host_icon_minio.imageset/Contents.json index 6524b36..2dbe6bb 100644 --- a/uPic/Assets.xcassets/hosts/host_icon_minio.imageset/Contents.json +++ b/uPic/Assets.xcassets/hosts/host_icon_minio.imageset/Contents.json @@ -1,17 +1,17 @@ { "images" : [ { - "filename" : "MINIO_Bird.png", + "filename" : "minio.png", "idiom" : "universal", "scale" : "1x" }, { - "filename" : "MINIO_Bird@2x.png", + "filename" : "minio@2x.png", "idiom" : "universal", "scale" : "2x" }, { - "filename" : "MINIO_Bird@3x.png", + "filename" : "minio@3x.png", "idiom" : "universal", "scale" : "3x" } diff --git a/uPic/Assets.xcassets/hosts/host_icon_minio.imageset/MINIO_Bird.png b/uPic/Assets.xcassets/hosts/host_icon_minio.imageset/MINIO_Bird.png deleted file mode 100644 index 2d6b5ba..0000000 Binary files a/uPic/Assets.xcassets/hosts/host_icon_minio.imageset/MINIO_Bird.png and /dev/null differ diff --git a/uPic/Assets.xcassets/hosts/host_icon_minio.imageset/MINIO_Bird@2x.png b/uPic/Assets.xcassets/hosts/host_icon_minio.imageset/MINIO_Bird@2x.png deleted file mode 100644 index 9c6d3c9..0000000 Binary files a/uPic/Assets.xcassets/hosts/host_icon_minio.imageset/MINIO_Bird@2x.png and /dev/null differ diff --git a/uPic/Assets.xcassets/hosts/host_icon_minio.imageset/MINIO_Bird@3x.png b/uPic/Assets.xcassets/hosts/host_icon_minio.imageset/MINIO_Bird@3x.png deleted file mode 100644 index affcce8..0000000 Binary files a/uPic/Assets.xcassets/hosts/host_icon_minio.imageset/MINIO_Bird@3x.png and /dev/null differ diff --git a/uPic/Assets.xcassets/hosts/host_icon_minio.imageset/minio.png b/uPic/Assets.xcassets/hosts/host_icon_minio.imageset/minio.png new file mode 100644 index 0000000..69bf2ac Binary files /dev/null and b/uPic/Assets.xcassets/hosts/host_icon_minio.imageset/minio.png differ diff --git a/uPic/Assets.xcassets/hosts/host_icon_minio.imageset/minio@2x.png b/uPic/Assets.xcassets/hosts/host_icon_minio.imageset/minio@2x.png new file mode 100644 index 0000000..f44fd69 Binary files /dev/null and b/uPic/Assets.xcassets/hosts/host_icon_minio.imageset/minio@2x.png differ diff --git a/uPic/Assets.xcassets/hosts/host_icon_minio.imageset/minio@3x.png b/uPic/Assets.xcassets/hosts/host_icon_minio.imageset/minio@3x.png new file mode 100644 index 0000000..807732b Binary files /dev/null and b/uPic/Assets.xcassets/hosts/host_icon_minio.imageset/minio@3x.png differ diff --git a/uPic/Base.lproj/Main.storyboard b/uPic/Base.lproj/Main.storyboard index 6bb7b57..f50824e 100644 --- a/uPic/Base.lproj/Main.storyboard +++ b/uPic/Base.lproj/Main.storyboard @@ -1,8 +1,8 @@ - + - + @@ -105,7 +105,8 @@ - + + @@ -151,25 +152,44 @@ - + - + - + - + + + + + + + + + + + + + + + + + + + + diff --git a/uPic/General/Managers/ConfigManager.swift b/uPic/General/Managers/ConfigManager.swift index 171b6cd..1327e08 100644 --- a/uPic/General/Managers/ConfigManager.swift +++ b/uPic/General/Managers/ConfigManager.swift @@ -88,15 +88,15 @@ extension ConfigManager { extension ConfigManager { func getOutputType() -> OutputType { - return OutputType(value: Defaults[.ouputFormat]) + OutputType(value: Defaults[.outputFormat]) } func setOutputType(_ outputType: OutputType) { - Defaults[.ouputFormat] = outputType.rawValue + Defaults[.outputFormat] = outputType.rawValue } func setOutputType(_ outputTypeRawValue: Int) { - Defaults[.ouputFormat] = outputTypeRawValue + Defaults[.outputFormat] = outputTypeRawValue } } diff --git a/uPic/General/Utils/PreferenceKey.swift b/uPic/General/Utils/PreferenceKey.swift index 5765f13..b1f80d4 100644 --- a/uPic/General/Utils/PreferenceKey.swift +++ b/uPic/General/Utils/PreferenceKey.swift @@ -12,7 +12,8 @@ struct Keys { static let firstUsage = "uPic_FirstUsage" static let hostItems = "uPic_hostItems" static let defaultHostId = "uPic_DefaultHostId" - static let ouputFormat = "uPic_OutputFormat" + static let outputFormat = "uPic_OutputFormat" + static let outputFormatEncoded = "uPic_OutputFormatEncoded" static let historyList = "uPic_HistoryList_New" static let historyLimit = "uPic_HistoryLimit_New" static let compressFactor = "uPic_CompressFactor" @@ -48,7 +49,8 @@ extension DefaultsKeys { static let firstUsage = DefaultsKey(Keys.firstUsage) static let hostItems = DefaultsKey<[Host]>(Keys.hostItems) static let defaultHostId = DefaultsKey(Keys.defaultHostId) - static let ouputFormat = DefaultsKey(Keys.ouputFormat) + static let outputFormat = DefaultsKey(Keys.outputFormat) + static let outputFormatEncoded = DefaultsKey(Keys.outputFormatEncoded) static let historyList = DefaultsKey<[[String: Any]]>(Keys.historyList) static let historyLimit = DefaultsKey(Keys.historyLimit) static let compressFactor = DefaultsKey(Keys.compressFactor) @@ -64,6 +66,15 @@ extension DefaultsKeys { let Defaults = UserDefaults.standard extension UserDefaults { + subscript(key: DefaultsKey) -> Bool? { + get { + bool(forKey: key._key) + } + set { + set(newValue, forKey: key._key) + } + } + subscript(key: DefaultsKey) -> String? { get { return string(forKey: key._key) diff --git a/uPic/Models/OutputType.swift b/uPic/Models/OutputType.swift index 6497579..3782cbc 100644 --- a/uPic/Models/OutputType.swift +++ b/uPic/Models/OutputType.swift @@ -47,28 +47,27 @@ enum OutputType: Int { } func formatUrl(_ url: String) -> String { - let url = url.urlDecoded() + var formatUrl = url + if Defaults[.outputFormatEncoded]! { + formatUrl = url.urlEncoded() + } var filename = url.lastPathComponent.deletingPathExtension.trim() let tempArr = filename.components(separatedBy: .whitespaces).map{ $0.trim() }.filter{ !$0.isEmpty } filename = tempArr.joined(separator: "") - - let encodedUrl = url.urlOutputEncoded() var outputUrl = "" switch self { case .html: - outputUrl = "\(filename)" + outputUrl = "\(filename)" break case .markdown: - outputUrl = "![\(filename)](\(encodedUrl))" + outputUrl = "![\(filename)](\(formatUrl))" break case .ubb: - outputUrl = "[img]\(encodedUrl)[/img]" + outputUrl = "[img]\(formatUrl)[/img]" break default: - outputUrl = encodedUrl - + outputUrl = formatUrl } - return outputUrl } } diff --git a/uPic/PreferencesWindow/Base.lproj/Preferences.storyboard b/uPic/PreferencesWindow/Base.lproj/Preferences.storyboard index 7266461..c0f12d8 100644 --- a/uPic/PreferencesWindow/Base.lproj/Preferences.storyboard +++ b/uPic/PreferencesWindow/Base.lproj/Preferences.storyboard @@ -1,8 +1,8 @@ - + - + @@ -69,17 +69,17 @@ - + @@ -87,13 +87,13 @@ - + - + - + @@ -101,7 +101,7 @@ - + @@ -115,7 +115,7 @@ - + @@ -185,10 +185,10 @@ - + - + @@ -196,7 +196,7 @@ - + @@ -223,7 +223,7 @@ - + @@ -250,7 +250,7 @@ - + @@ -277,7 +277,7 @@ - + @@ -285,7 +285,7 @@ - + @@ -364,7 +364,7 @@ - + @@ -443,7 +443,7 @@ - + @@ -476,7 +476,7 @@ - + @@ -509,23 +509,23 @@ - + - + Supports {year} {month} {day} {hour} {minute} {second} {since_second} {since_millisecond} {random} {filename} {.suffix} {suffix} {mimetype} {saveKey} and etc. @@ -1248,7 +1248,7 @@ Gw - + @@ -1263,7 +1263,7 @@ Gw - + @@ -1277,7 +1277,7 @@ Gw - +