Skip to content

Commit

Permalink
Merge branch 'release/v0.19.6'
Browse files Browse the repository at this point in the history
  • Loading branch information
gee1k committed Jul 28, 2020
2 parents f75a0b8 + 311795a commit 8443e92
Show file tree
Hide file tree
Showing 32 changed files with 268 additions and 129 deletions.
28 changes: 14 additions & 14 deletions Podfile.lock
Original file line number Diff line number Diff line change
@@ -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)
Expand Down Expand Up @@ -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
Expand All @@ -81,4 +81,4 @@ SPEC CHECKSUMS:

PODFILE CHECKSUM: 4101e450e6b2d21bac70b5245d209294f573f3bb

COCOAPODS: 1.9.1
COCOAPODS: 1.9.3
2 changes: 1 addition & 1 deletion README-cn.md
Original file line number Diff line number Diff line change
Expand Up @@ -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)_**

Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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)_**

Expand Down
Binary file added uPic.sketch
Binary file not shown.
20 changes: 10 additions & 10 deletions uPic.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -323,7 +323,7 @@
68BBB2F5FAEEFFF55935F022 /* AmazonS3Util.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = AmazonS3Util.swift; sourceTree = "<group>"; };
68BBB5C4550545707614BE4D /* AmazonS3Uploader.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = AmazonS3Uploader.swift; sourceTree = "<group>"; };
68BBB8CF2838A67CA1AD438F /* AmazonS3HostConfig.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = AmazonS3HostConfig.swift; sourceTree = "<group>"; };
9667517C240D2BA6007C7012 /* en */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = en; path = en.lproj/Main.strings; sourceTree = "<group>"; };
96319C6E24CE7CEB004A6E62 /* en */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = en; path = en.lproj/Main.strings; sourceTree = "<group>"; };
968ECC08240DFCF900B2D78C /* en */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = en; path = en.lproj/InfoPlist.strings; sourceTree = "<group>"; };
968ECC0A240DFCFA00B2D78C /* zh-Hans */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = "zh-Hans"; path = "zh-Hans.lproj/InfoPlist.strings"; sourceTree = "<group>"; };
969018A3240D998400B545B2 /* en */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = en; path = en.lproj/Preferences.strings; sourceTree = "<group>"; };
Expand Down Expand Up @@ -1102,8 +1102,8 @@
children = (
1648A215238E742600B99B9D /* Base */,
1648A218238E743200B99B9D /* zh-Hans */,
9667517C240D2BA6007C7012 /* en */,
1605DDD8246D993C00262C89 /* zh-Hant */,
96319C6E24CE7CEB004A6E62 /* en */,
);
name = Main.storyboard;
sourceTree = "<group>";
Expand Down Expand Up @@ -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";
Expand All @@ -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 = "";
Expand All @@ -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";
Expand All @@ -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 = "";
Expand All @@ -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;
Expand All @@ -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 = "";
Expand All @@ -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;
Expand All @@ -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 = "";
Expand Down
Original file line number Diff line number Diff line change
@@ -1,23 +1,23 @@
{
"images" : [
{
"idiom" : "universal",
"filename" : "lsky.png",
"idiom" : "universal",
"scale" : "1x"
},
{
"idiom" : "universal",
"filename" : "[email protected]",
"idiom" : "universal",
"scale" : "2x"
},
{
"idiom" : "universal",
"filename" : "[email protected]",
"idiom" : "universal",
"scale" : "3x"
}
],
"info" : {
"version" : 1,
"author" : "xcode"
"author" : "xcode",
"version" : 1
}
}
}
Binary file modified uPic/Assets.xcassets/hosts/host_icon_lsky_pro.imageset/lsky.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Original file line number Diff line number Diff line change
@@ -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"
}
Expand Down
Binary file not shown.
Binary file not shown.
Binary file not shown.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
34 changes: 27 additions & 7 deletions uPic/Base.lproj/Main.storyboard
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
<?xml version="1.0" encoding="UTF-8"?>
<document type="com.apple.InterfaceBuilder3.Cocoa.Storyboard.XIB" version="3.0" toolsVersion="15705" targetRuntime="MacOSX.Cocoa" propertyAccessControl="none" useAutolayout="YES">
<document type="com.apple.InterfaceBuilder3.Cocoa.Storyboard.XIB" version="3.0" toolsVersion="16097.2" targetRuntime="MacOSX.Cocoa" propertyAccessControl="none" useAutolayout="YES">
<dependencies>
<deployment identifier="macosx"/>
<plugIn identifier="com.apple.InterfaceBuilder.CocoaPlugin" version="15705"/>
<plugIn identifier="com.apple.InterfaceBuilder.CocoaPlugin" version="16097.2"/>
</dependencies>
<scenes>
<!--Application-->
Expand Down Expand Up @@ -105,7 +105,8 @@
<outlet property="compressFactorMenuItem" destination="eIU-EA-uQZ" id="uMq-Nm-vXy"/>
<outlet property="historyMenu" destination="MjM-mX-Ci5" id="b7E-HG-zZU"/>
<outlet property="hostMenuItem" destination="d02-bT-1Lv" id="Ah0-J0-Z4M"/>
<outlet property="ouputFormatMenuItem" destination="1BX-LF-q51" id="H54-M9-CBq"/>
<outlet property="outputFormatEncodedMenuItem" destination="NcU-Ek-lED" id="yc4-kN-ufV"/>
<outlet property="outputFormatMenuItem" destination="1BX-LF-q51" id="H54-M9-CBq"/>
<outlet property="statusMenu" destination="fqV-BN-CNE" id="XoS-be-xDF"/>
<outlet property="uploadFromPasteboardMenuItem" destination="orX-KL-q11" id="v7z-nL-hxW"/>
<outlet property="uploadFromScreenshotMenuItem" destination="ueU-fm-1nn" id="Fnc-s1-TnL"/>
Expand Down Expand Up @@ -151,25 +152,44 @@
<menuItem title="URL" id="U1c-9i-q5b">
<modifierMask key="keyEquivalentModifierMask"/>
<connections>
<action selector="ouputFormatMenuItemClicked:" target="veO-oa-UPB" id="rRb-CM-Htv"/>
<action selector="outputFormatMenuItemClicked:" target="veO-oa-UPB" id="rRb-CM-Htv"/>
</connections>
</menuItem>
<menuItem title="HTML" tag="1" id="wCN-Y7-fdU">
<modifierMask key="keyEquivalentModifierMask"/>
<connections>
<action selector="ouputFormatMenuItemClicked:" target="veO-oa-UPB" id="v5l-L7-7KA"/>
<action selector="outputFormatMenuItemClicked:" target="veO-oa-UPB" id="v5l-L7-7KA"/>
</connections>
</menuItem>
<menuItem title="Markdown" tag="2" id="Opc-aA-hUg">
<modifierMask key="keyEquivalentModifierMask"/>
<connections>
<action selector="ouputFormatMenuItemClicked:" target="veO-oa-UPB" id="Xxd-x1-2BP"/>
<action selector="outputFormatMenuItemClicked:" target="veO-oa-UPB" id="Xxd-x1-2BP"/>
</connections>
</menuItem>
<menuItem title="UBB" tag="3" id="Hz2-gj-luo">
<modifierMask key="keyEquivalentModifierMask"/>
<connections>
<action selector="ouputFormatMenuItemClicked:" target="veO-oa-UPB" id="BYo-1k-amH"/>
<action selector="outputFormatMenuItemClicked:" target="veO-oa-UPB" id="BYo-1k-amH"/>
</connections>
</menuItem>
</items>
</menu>
</menuItem>
<menuItem title="Output format encode" id="NcU-Ek-lED">
<modifierMask key="keyEquivalentModifierMask"/>
<menu key="submenu" title="Output format encode" id="jbA-xM-vl3">
<items>
<menuItem title="On" id="ynd-0y-yEv">
<modifierMask key="keyEquivalentModifierMask"/>
<connections>
<action selector="outputFormatEncodeMenuItemClicked:" target="veO-oa-UPB" id="Ihl-ST-fGa"/>
</connections>
</menuItem>
<menuItem title="Off" tag="1" id="yW4-Cl-nF5">
<modifierMask key="keyEquivalentModifierMask"/>
<connections>
<action selector="outputFormatEncodeMenuItemClicked:" target="veO-oa-UPB" id="lQv-LX-iqu"/>
</connections>
</menuItem>
</items>
Expand Down
6 changes: 3 additions & 3 deletions uPic/General/Managers/ConfigManager.swift
Original file line number Diff line number Diff line change
Expand Up @@ -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
}
}

Expand Down
15 changes: 13 additions & 2 deletions uPic/General/Utils/PreferenceKey.swift
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down Expand Up @@ -48,7 +49,8 @@ extension DefaultsKeys {
static let firstUsage = DefaultsKey<String>(Keys.firstUsage)
static let hostItems = DefaultsKey<[Host]>(Keys.hostItems)
static let defaultHostId = DefaultsKey<String>(Keys.defaultHostId)
static let ouputFormat = DefaultsKey<Int>(Keys.ouputFormat)
static let outputFormat = DefaultsKey<Int>(Keys.outputFormat)
static let outputFormatEncoded = DefaultsKey<Bool>(Keys.outputFormatEncoded)
static let historyList = DefaultsKey<[[String: Any]]>(Keys.historyList)
static let historyLimit = DefaultsKey<Int>(Keys.historyLimit)
static let compressFactor = DefaultsKey<Int>(Keys.compressFactor)
Expand All @@ -64,6 +66,15 @@ extension DefaultsKeys {
let Defaults = UserDefaults.standard

extension UserDefaults {
subscript(key: DefaultsKey<Bool>) -> Bool? {
get {
bool(forKey: key._key)
}
set {
set(newValue, forKey: key._key)
}
}

subscript(key: DefaultsKey<String>) -> String? {
get {
return string(forKey: key._key)
Expand Down
17 changes: 8 additions & 9 deletions uPic/Models/OutputType.swift
Original file line number Diff line number Diff line change
Expand Up @@ -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 = "<img src='\(encodedUrl)' alt='\(filename)'/>"
outputUrl = "<img src='\(formatUrl)' alt='\(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
}
}
Loading

0 comments on commit 8443e92

Please sign in to comment.