Skip to content

Commit

Permalink
Merge branch 'release/v0.18.0'
Browse files Browse the repository at this point in the history
  • Loading branch information
gee1k committed Mar 9, 2020
2 parents 622591f + 3f54658 commit aeb6b28
Show file tree
Hide file tree
Showing 98 changed files with 745 additions and 417 deletions.
3 changes: 2 additions & 1 deletion Podfile
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ target 'uPic' do
use_frameworks!

pod 'SwiftyJSON'
pod 'Alamofire', '~> 5.0.0-rc.3'
pod 'Alamofire', '~> 5.0.2'
pod 'MASShortcut'
pod 'CryptoSwift', :git => "https://github.com/krzyzanowskim/CryptoSwift", :branch => "master"
pod "SwiftyXMLParser", :git => 'https://github.com/yahoojapan/SwiftyXMLParser.git'
Expand All @@ -20,3 +20,4 @@ use_frameworks!
pod 'WCDB.swift'

end

24 changes: 12 additions & 12 deletions Podfile.lock
Original file line number Diff line number Diff line change
@@ -1,14 +1,14 @@
PODS:
- Alamofire (5.0.0-rc.3)
- Alamofire (5.0.2)
- CryptoSwift (1.3.0)
- Kingfisher (5.12.0):
- Kingfisher/Core (= 5.12.0)
- Kingfisher/Core (5.12.0)
- Kingfisher (5.13.2):
- Kingfisher/Core (= 5.13.2)
- Kingfisher/Core (5.13.2)
- libminipng (0.5.6)
- LoginServiceKit (2.1.0)
- MASShortcut (2.4.0)
- SnapKit (5.0.1)
- Sparkle (1.22.0)
- Sparkle (1.23.0)
- SQLiteRepairKit (1.2.2):
- WCDBOptimizedSQLCipher (~> 1.2.0)
- SwiftyJSON (5.0.0)
Expand All @@ -19,7 +19,7 @@ PODS:
- WCDBOptimizedSQLCipher (1.2.1)

DEPENDENCIES:
- Alamofire (~> 5.0.0-rc.3)
- Alamofire (~> 5.0.2)
- CryptoSwift (from `https://github.com/krzyzanowskim/CryptoSwift`, branch `master`)
- Kingfisher
- libminipng
Expand Down Expand Up @@ -55,30 +55,30 @@ EXTERNAL SOURCES:

CHECKOUT OPTIONS:
CryptoSwift:
:commit: a44caef0550c346e0ab9172f7c9a3852c1833599
:commit: a842251aee9047b2b335afe0ae0b5b44daf95219
:git: https://github.com/krzyzanowskim/CryptoSwift
LoginServiceKit:
:commit: 0b25f256e07ca110c2883f4f5072a7fe525b5805
:commit: be0b910d825f826d3c64d6ff1207209ec7dea0fa
:git: https://github.com/Clipy/LoginServiceKit.git
SwiftyXMLParser:
:commit: bc85162ecee60d6eb94b778648bc4c51e1c4d34f
:git: https://github.com/yahoojapan/SwiftyXMLParser.git

SPEC CHECKSUMS:
Alamofire: ca8c0de6906873be89d6deec5c8de279e00bf872
Alamofire: 3ba7a4db18b4f62c4a1c0e1cb39d7f3d52e10ada
CryptoSwift: 1283821600233bdbeb96d7b389c3288c3bf77211
Kingfisher: dc6e0f53bb5b12c3e75bedb0e01bbd7a640eea69
Kingfisher: d342c8354c10c3d85a27d6d4c42c41285924b898
libminipng: a44c35d06b9d54d6640acdf97f4500c034748abb
LoginServiceKit: 9a8b258c3111fa0d9585615052f778b08be92302
MASShortcut: d9e4909e878661cc42877cc9d6efbe638273ab57
SnapKit: 97b92857e3df3a0c71833cce143274bf6ef8e5eb
Sparkle: 593ac2e677c07bcb6c3b22d621240e7cbedaab57
Sparkle: 55b1a87ba69d56913375a281546b7c82dec95bb0
SQLiteRepairKit: 35aaae5a8838adb85f5b1eb4d796055be6060a4b
SwiftyJSON: 36413e04c44ee145039d332b4f4e2d3e8d6c4db7
SwiftyXMLParser: 8271497e0a37b5c04b0b167c77b4896e36175a21
WCDB.swift: 05d509d7a0e60fb6e11c34eb7e4027c0fab5849f
WCDBOptimizedSQLCipher: baf44493b0c7a3d49e97bc5b64a3856f6428ddd1

PODFILE CHECKSUM: 5d4929949fea5a9aff12eeae4ddf2cd5adcff85d
PODFILE CHECKSUM: edb09d911eed83ee53778d9ac21bb5347040f534

COCOAPODS: 1.8.4
56 changes: 32 additions & 24 deletions uPic.xcodeproj/project.pbxproj

Large diffs are not rendered by default.

36 changes: 34 additions & 2 deletions uPic/AppDelegate.swift
Original file line number Diff line number Diff line change
Expand Up @@ -222,7 +222,7 @@ extension AppDelegate {

let openPanel = NSOpenPanel()
openPanel.allowsMultipleSelection = true
openPanel.canChooseDirectories = false
openPanel.canChooseDirectories = true
openPanel.canCreateDirectories = false
openPanel.canChooseFiles = true

Expand Down Expand Up @@ -323,9 +323,41 @@ extension AppDelegate {
// 上传多个文件
// MARK: - Cli Support
func uploadFiles(_ files: [Any], _ uploadSourceType: UploadSourceType? = .normal) {

var uploadFiles = files

if let urls = files as? [URL] {
// 如果是文件路径,处理文件夹
var uploadUrls: [URL] = []
for url in urls {
let path = url.path
if FileManager.directoryIsExists(path: path) {
let directoryName = path.lastPathComponent
let enumerator = FileManager.default.enumerator(atPath: path)
while let filename = enumerator?.nextObject() as? String {
let subPath = path.appendingPathComponent(path: filename)
if FileManager.directoryIsExists(path: subPath) {
continue
}
if !BaseUploader.checkFileExtensions(fileExtensions: BaseUploader.getFileExtensions(), fileExtension: filename.pathExtension) {
continue
}
let subDirectoryPath = filename.deletingLastPathComponent
let directoryPath = directoryName.appendingPathComponent(path: subDirectoryPath)
var subUrl = URL(fileURLWithPath: subPath)
subUrl._uploadFolderPath = directoryPath
uploadUrls.append(subUrl)
}
} else {
uploadUrls.append(url)
}
}
uploadFiles = uploadUrls
}

self.uploadSourceType = uploadSourceType

self.needUploadFiles = files
self.needUploadFiles = uploadFiles
self.resultUrls.removeAll()

if self.needUploadFiles.count == 0 {
Expand Down
Binary file removed uPic/Assets.xcassets/AppIcon.appiconset/128.png
Binary file not shown.
Binary file not shown.
Binary file removed uPic/Assets.xcassets/AppIcon.appiconset/16.png
Binary file not shown.
Binary file not shown.
Binary file removed uPic/Assets.xcassets/AppIcon.appiconset/256.png
Binary file not shown.
Binary file not shown.
Binary file removed uPic/Assets.xcassets/AppIcon.appiconset/32.png
Binary file not shown.
Binary file not shown.
Binary file removed uPic/Assets.xcassets/AppIcon.appiconset/512.png
Binary file not shown.
Binary file not shown.
20 changes: 10 additions & 10 deletions uPic/Assets.xcassets/AppIcon.appiconset/Contents.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,61 +3,61 @@
{
"size" : "16x16",
"idiom" : "mac",
"filename" : "16.png",
"filename" : "mac-16x16.png",
"scale" : "1x"
},
{
"size" : "16x16",
"idiom" : "mac",
"filename" : "16@2x.png",
"filename" : "mac-16x16@2x.png",
"scale" : "2x"
},
{
"size" : "32x32",
"idiom" : "mac",
"filename" : "32.png",
"filename" : "mac-32x32.png",
"scale" : "1x"
},
{
"size" : "32x32",
"idiom" : "mac",
"filename" : "32@2x.png",
"filename" : "mac-32x32@2x.png",
"scale" : "2x"
},
{
"size" : "128x128",
"idiom" : "mac",
"filename" : "128.png",
"filename" : "mac-128x128.png",
"scale" : "1x"
},
{
"size" : "128x128",
"idiom" : "mac",
"filename" : "128@2x.png",
"filename" : "mac-128x128@2x.png",
"scale" : "2x"
},
{
"size" : "256x256",
"idiom" : "mac",
"filename" : "256.png",
"filename" : "mac-256x256.png",
"scale" : "1x"
},
{
"size" : "256x256",
"idiom" : "mac",
"filename" : "256@2x.png",
"filename" : "mac-256x256@2x.png",
"scale" : "2x"
},
{
"size" : "512x512",
"idiom" : "mac",
"filename" : "512.png",
"filename" : "mac-512x512.png",
"scale" : "1x"
},
{
"size" : "512x512",
"idiom" : "mac",
"filename" : "512@2x.png",
"filename" : "mac-512x512@2x.png",
"scale" : "2x"
}
],
Expand Down
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.
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.
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.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
2 changes: 2 additions & 0 deletions uPic/Assets.xcassets/about.imageset/Contents.json
Original file line number Diff line number Diff line change
Expand Up @@ -7,10 +7,12 @@
},
{
"idiom" : "universal",
"filename" : "[email protected]",
"scale" : "2x"
},
{
"idiom" : "universal",
"filename" : "[email protected]",
"scale" : "3x"
}
],
Expand Down
Binary file modified uPic/Assets.xcassets/about.imageset/about.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.
23 changes: 23 additions & 0 deletions uPic/Assets.xcassets/color.imageset/Contents.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
{
"images" : [
{
"idiom" : "universal",
"filename" : "color.png",
"scale" : "1x"
},
{
"idiom" : "universal",
"filename" : "[email protected]",
"scale" : "2x"
},
{
"idiom" : "universal",
"filename" : "[email protected]",
"scale" : "3x"
}
],
"info" : {
"version" : 1,
"author" : "xcode"
}
}
Binary file added uPic/Assets.xcassets/color.imageset/color.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.
26 changes: 26 additions & 0 deletions uPic/Assets.xcassets/single.imageset/Contents.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
{
"images" : [
{
"idiom" : "universal",
"filename" : "single.png",
"scale" : "1x"
},
{
"idiom" : "universal",
"filename" : "[email protected]",
"scale" : "2x"
},
{
"idiom" : "universal",
"filename" : "[email protected]",
"scale" : "3x"
}
],
"info" : {
"version" : 1,
"author" : "xcode"
},
"properties" : {
"template-rendering-intent" : "template"
}
}
Binary file added uPic/Assets.xcassets/single.imageset/single.png
5 changes: 3 additions & 2 deletions uPic/Assets.xcassets/statusIcon.imageset/Contents.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,16 +2,17 @@
"images" : [
{
"idiom" : "universal",
"filename" : "statusIcon.png",
"scale" : "1x"
},
{
"idiom" : "universal",
"filename" : "menubar@2x.png.png",
"filename" : "statusIcon@2x.png",
"scale" : "2x"
},
{
"idiom" : "universal",
"filename" : "menubar@3x.png",
"filename" : "statusIcon@3x.png",
"scale" : "3x"
}
],
Expand Down
Diff not rendered.
Diff not rendered.
5 changes: 3 additions & 2 deletions uPic/Assets.xcassets/uploadIcon.imageset/Contents.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,16 +2,17 @@
"images" : [
{
"idiom" : "universal",
"filename" : "uploadIcon.png",
"scale" : "1x"
},
{
"idiom" : "universal",
"filename" : "wait@2x.png",
"filename" : "uploadIcon@2x.png",
"scale" : "2x"
},
{
"idiom" : "universal",
"filename" : "wait@3x.png",
"filename" : "uploadIcon@3x.png",
"scale" : "3x"
}
],
Expand Down
Diff not rendered.
Diff not rendered.
8 changes: 4 additions & 4 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="15702" targetRuntime="MacOSX.Cocoa" propertyAccessControl="none" useAutolayout="YES">
<document type="com.apple.InterfaceBuilder3.Cocoa.Storyboard.XIB" version="3.0" toolsVersion="15705" targetRuntime="MacOSX.Cocoa" propertyAccessControl="none" useAutolayout="YES">
<dependencies>
<deployment identifier="macosx"/>
<plugIn identifier="com.apple.InterfaceBuilder.CocoaPlugin" version="15702"/>
<plugIn identifier="com.apple.InterfaceBuilder.CocoaPlugin" version="15705"/>
</dependencies>
<scenes>
<!--Application-->
Expand Down Expand Up @@ -190,9 +190,9 @@
<action selector="preferenceMenuItemClicked:" target="veO-oa-UPB" id="dVz-M2-Nxa"/>
</connections>
</menuItem>
<menuItem title="Help" id="2Jw-ET-3eH">
<menuItem title="More" id="2Jw-ET-3eH">
<modifierMask key="keyEquivalentModifierMask"/>
<menu key="submenu" title="Help" id="Z6H-TN-83r">
<menu key="submenu" title="More" id="Z6H-TN-83r">
<items>
<menuItem title="Check for updates..." id="yai-4F-Btp">
<modifierMask key="keyEquivalentModifierMask"/>
Expand Down
35 changes: 35 additions & 0 deletions uPic/Extensions/FinderUtil.swift
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
//
// FinderUtil.swift
// uPic
//
// Created by Svend Jin on 2020/3/7.
// Copyright © 2020 Svend Jin. All rights reserved.
//

import Foundation

class FinderUtil {
private static var groupName: String {
let infoDic = Bundle.main.infoDictionary!
return "\(infoDic["TeamIdentifierPrefix"]!)com.svend.uPic"
}
static func removeIcon() {
let defaults = UserDefaults.init(suiteName: groupName)
defaults?.removeObject(forKey: "uPic_FinderExtensionIcon")
defaults?.synchronize()
}

static func getIcon() -> Int {
let defaults = UserDefaults.init(suiteName: groupName)
guard let icon = defaults?.value(forKey: "uPic_FinderExtensionIcon") else {
return 1
}
return icon as! Int
}

static func setIcon(_ value: Int) {
let defaults = UserDefaults.init(suiteName: groupName)
defaults?.set(value, forKey: "uPic_FinderExtensionIcon")
defaults?.synchronize()
}
}
3 changes: 3 additions & 0 deletions uPic/Extensions/NSDragingInfoExt.swift
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,9 @@ extension NSDraggingInfo {

// 过滤不支持的文件
urls = urls.filter({url -> Bool in
if FileManager.directoryIsExists(path: url.path) {
return true
}
let fileExtension = url.pathExtension.lowercased()
return fileExtensions.contains(fileExtension)
})
Expand Down
Loading

0 comments on commit aeb6b28

Please sign in to comment.