mirror of
https://github.com/kiwix/kiwix-apple.git
synced 2025-09-28 22:43:55 -04:00
commit
This commit is contained in:
parent
896d8dcdf9
commit
72a885d604
@ -59,7 +59,7 @@ class AppDelegate: UIResponder, UIApplicationDelegate {
|
|||||||
}
|
}
|
||||||
|
|
||||||
func application(app: UIApplication, openURL url: NSURL, options: [String : AnyObject]) -> Bool {
|
func application(app: UIApplication, openURL url: NSURL, options: [String : AnyObject]) -> Bool {
|
||||||
guard url.scheme!.caseInsensitiveCompare("kiwix") == .OrderedSame else {return false}
|
guard url.isKiwixURL else {return false}
|
||||||
let operation = ArticleLoadOperation(url: url)
|
let operation = ArticleLoadOperation(url: url)
|
||||||
GlobalQueue.shared.add(load: operation)
|
GlobalQueue.shared.add(load: operation)
|
||||||
return true
|
return true
|
||||||
|
@ -135,3 +135,12 @@ class ShowHelpPageOperation: Operation {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
class CannotFinishHandoffAlert: AlertOperation<UIViewController> {
|
||||||
|
init(context: UIViewController) {
|
||||||
|
super.init(presentAlertFrom: context)
|
||||||
|
title = NSLocalizedString("Cannot Finish Handoff", comment: "Cannot Finish Handoff Alert")
|
||||||
|
message = NSLocalizedString("The book required to complete the Handoff is not on the device. Please download the book and try again.", comment: "Cannot Finish Handoff Alert")
|
||||||
|
addActionWithTitle(LocalizedStrings.ok)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
@ -112,7 +112,8 @@ class MainController: UIViewController {
|
|||||||
let operation = ArticleLoadOperation(url: url)
|
let operation = ArticleLoadOperation(url: url)
|
||||||
GlobalQueue.shared.add(load: operation)
|
GlobalQueue.shared.add(load: operation)
|
||||||
} else {
|
} else {
|
||||||
// TODO: - Alert cannot complete hand off
|
let operation = CannotFinishHandoffAlert(context: self)
|
||||||
|
GlobalQueue.shared.addOperation(operation)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -49,7 +49,7 @@
|
|||||||
</dict>
|
</dict>
|
||||||
</array>
|
</array>
|
||||||
<key>CFBundleVersion</key>
|
<key>CFBundleVersion</key>
|
||||||
<string>1.8.998</string>
|
<string>1.8.1009</string>
|
||||||
<key>ITSAppUsesNonExemptEncryption</key>
|
<key>ITSAppUsesNonExemptEncryption</key>
|
||||||
<false/>
|
<false/>
|
||||||
<key>LSRequiresIPhoneOS</key>
|
<key>LSRequiresIPhoneOS</key>
|
||||||
|
@ -21,7 +21,7 @@
|
|||||||
<key>CFBundleSignature</key>
|
<key>CFBundleSignature</key>
|
||||||
<string>????</string>
|
<string>????</string>
|
||||||
<key>CFBundleVersion</key>
|
<key>CFBundleVersion</key>
|
||||||
<string>1.8.1002</string>
|
<string>1.8.1013</string>
|
||||||
<key>NSExtension</key>
|
<key>NSExtension</key>
|
||||||
<dict>
|
<dict>
|
||||||
<key>NSExtensionMainStoryboard</key>
|
<key>NSExtensionMainStoryboard</key>
|
||||||
|
@ -19,5 +19,21 @@
|
|||||||
landmarkType = "5">
|
landmarkType = "5">
|
||||||
</BreakpointContent>
|
</BreakpointContent>
|
||||||
</BreakpointProxy>
|
</BreakpointProxy>
|
||||||
|
<BreakpointProxy
|
||||||
|
BreakpointExtensionID = "Xcode.Breakpoint.FileBreakpoint">
|
||||||
|
<BreakpointContent
|
||||||
|
shouldBeEnabled = "Yes"
|
||||||
|
ignoreCount = "0"
|
||||||
|
continueAfterRunningActions = "No"
|
||||||
|
filePath = "Kiwix/Operations/GlobalQueue.swift"
|
||||||
|
timestampString = "496186011.525439"
|
||||||
|
startingColumnNumber = "9223372036854775807"
|
||||||
|
endingColumnNumber = "9223372036854775807"
|
||||||
|
startingLineNumber = "44"
|
||||||
|
endingLineNumber = "44"
|
||||||
|
landmarkName = "add(load:)"
|
||||||
|
landmarkType = "7">
|
||||||
|
</BreakpointContent>
|
||||||
|
</BreakpointProxy>
|
||||||
</Breakpoints>
|
</Breakpoints>
|
||||||
</Bucket>
|
</Bucket>
|
||||||
|
@ -77,10 +77,12 @@ class ArticleLoadOperation: Operation {
|
|||||||
NSOperationQueue.mainQueue().addOperationWithBlock {
|
NSOperationQueue.mainQueue().addOperationWithBlock {
|
||||||
controller.hideSearch(animated: self.animated)
|
controller.hideSearch(animated: self.animated)
|
||||||
controller.presentingViewController?.dismissViewControllerAnimated(self.animated, completion: nil)
|
controller.presentingViewController?.dismissViewControllerAnimated(self.animated, completion: nil)
|
||||||
// hide toc
|
if controller.traitCollection.horizontalSizeClass == .Compact {controller.hideTableOfContentsController()}
|
||||||
|
|
||||||
|
if controller.webView.request?.URL != url {
|
||||||
|
controller.webView.loadRequest(request)
|
||||||
|
}
|
||||||
|
|
||||||
guard controller.webView.request?.URL != url else {return}
|
|
||||||
controller.webView.loadRequest(request)
|
|
||||||
self.finish()
|
self.finish()
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -89,6 +89,7 @@ class ScanLocalBookOperation: Operation {
|
|||||||
book.isLocal = true
|
book.isLocal = true
|
||||||
book.hasIndex = reader.hasIndex()
|
book.hasIndex = reader.hasIndex()
|
||||||
book.hasPic = !reader.fileURL.absoluteString!.containsString("nopic")
|
book.hasPic = !reader.fileURL.absoluteString!.containsString("nopic")
|
||||||
|
if let downloadTask = book.downloadTask {context.deleteObject(downloadTask)}
|
||||||
}
|
}
|
||||||
|
|
||||||
for (id, book) in localBooks {
|
for (id, book) in localBooks {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user