mirror of
https://github.com/kiwix/kiwix-apple.git
synced 2025-09-26 21:39:37 -04:00
commit
This commit is contained in:
parent
f51d285abc
commit
5a0f28bb86
@ -24,19 +24,21 @@ extension MainController: UIWebViewDelegate, SFSafariViewControllerDelegate {
|
|||||||
}
|
}
|
||||||
|
|
||||||
func webViewDidStartLoad(_ webView: UIWebView) {
|
func webViewDidStartLoad(_ webView: UIWebView) {
|
||||||
|
URLResponseCache.shared.start()
|
||||||
}
|
}
|
||||||
|
|
||||||
func webViewDidFinishLoad(_ webView: UIWebView) {
|
func webViewDidFinishLoad(_ webView: UIWebView) {
|
||||||
JS.preventDefaultLongTap(webView: webView)
|
JS.preventDefaultLongTap(webView: webView)
|
||||||
guard let title = JS.getTitle(from: webView) else {return}
|
URLResponseCache.shared.stop()
|
||||||
searchBar.title = title
|
|
||||||
|
|
||||||
buttons.back.tintColor = webView.canGoBack ? nil : UIColor.gray
|
buttons.back.tintColor = webView.canGoBack ? nil : UIColor.gray
|
||||||
buttons.forward.tintColor = webView.canGoForward ? nil : UIColor.gray
|
buttons.forward.tintColor = webView.canGoForward ? nil : UIColor.gray
|
||||||
|
|
||||||
|
guard let title = JS.getTitle(from: webView) else {return}
|
||||||
|
searchBar.title = title
|
||||||
}
|
}
|
||||||
|
|
||||||
func webView(_ webView: UIWebView, didFailLoadWithError error: Error) {
|
func webView(_ webView: UIWebView, didFailLoadWithError error: Error) {
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -49,7 +49,7 @@
|
|||||||
</dict>
|
</dict>
|
||||||
</array>
|
</array>
|
||||||
<key>CFBundleVersion</key>
|
<key>CFBundleVersion</key>
|
||||||
<string>1.8.3367</string>
|
<string>1.8.3378</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.3367</string>
|
<string>1.8.3378</string>
|
||||||
<key>NSExtension</key>
|
<key>NSExtension</key>
|
||||||
<dict>
|
<dict>
|
||||||
<key>NSExtensionMainStoryboard</key>
|
<key>NSExtensionMainStoryboard</key>
|
||||||
|
@ -85,9 +85,10 @@ class ArticleLoadOperation: Procedure {
|
|||||||
}
|
}
|
||||||
|
|
||||||
self.finish()
|
self.finish()
|
||||||
|
|
||||||
|
|
||||||
// //if main.traitCollection.horizontalSizeClass == .compact {main.hideTableOfContentsController()}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
class BookmarkAddOperation: Procedure {
|
||||||
|
|
||||||
|
}
|
||||||
|
@ -301,22 +301,14 @@ int levenshtein_distance(const std::string &s1, const std::string &s2)
|
|||||||
}
|
}
|
||||||
|
|
||||||
- (NSString *)getFavicon {
|
- (NSString *)getFavicon {
|
||||||
// NSData *data;
|
NSData *data;
|
||||||
// string content;
|
string content;
|
||||||
// string mimeType;
|
|
||||||
// if (_reader->getFavicon(content, mimeType)) {
|
|
||||||
// data = [NSData dataWithBytes:content.c_str() length:content.length()];
|
|
||||||
// }
|
|
||||||
// return data;
|
|
||||||
|
|
||||||
string contentC;
|
|
||||||
string mimeType;
|
string mimeType;
|
||||||
NSString *content;
|
if (_reader->getFavicon(content, mimeType)) {
|
||||||
|
data = [NSData dataWithBytes:content.c_str() length:content.length()];
|
||||||
if (_reader->getFavicon(contentC, mimeType)) {
|
|
||||||
content = [NSString stringWithCString:contentC.c_str() encoding:NSUTF8StringEncoding];
|
|
||||||
}
|
}
|
||||||
return content;
|
NSString * str = [data base64EncodedStringWithOptions:NSDataBase64EncodingEndLineWithLineFeed];
|
||||||
|
return str;
|
||||||
}
|
}
|
||||||
|
|
||||||
- (NSString *)parseURL:(NSString *)urlPath {
|
- (NSString *)parseURL:(NSString *)urlPath {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user