mirror of
https://github.com/kiwix/kiwix-apple.git
synced 2025-09-26 05:18:31 -04:00
commit
This commit is contained in:
parent
f51d285abc
commit
5a0f28bb86
@ -24,19 +24,21 @@ extension MainController: UIWebViewDelegate, SFSafariViewControllerDelegate {
|
||||
}
|
||||
|
||||
func webViewDidStartLoad(_ webView: UIWebView) {
|
||||
URLResponseCache.shared.start()
|
||||
}
|
||||
|
||||
func webViewDidFinishLoad(_ webView: UIWebView) {
|
||||
JS.preventDefaultLongTap(webView: webView)
|
||||
guard let title = JS.getTitle(from: webView) else {return}
|
||||
searchBar.title = title
|
||||
URLResponseCache.shared.stop()
|
||||
|
||||
buttons.back.tintColor = webView.canGoBack ? 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) {
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -49,7 +49,7 @@
|
||||
</dict>
|
||||
</array>
|
||||
<key>CFBundleVersion</key>
|
||||
<string>1.8.3367</string>
|
||||
<string>1.8.3378</string>
|
||||
<key>ITSAppUsesNonExemptEncryption</key>
|
||||
<false/>
|
||||
<key>LSRequiresIPhoneOS</key>
|
||||
|
@ -21,7 +21,7 @@
|
||||
<key>CFBundleSignature</key>
|
||||
<string>????</string>
|
||||
<key>CFBundleVersion</key>
|
||||
<string>1.8.3367</string>
|
||||
<string>1.8.3378</string>
|
||||
<key>NSExtension</key>
|
||||
<dict>
|
||||
<key>NSExtensionMainStoryboard</key>
|
||||
|
@ -85,9 +85,10 @@ class ArticleLoadOperation: Procedure {
|
||||
}
|
||||
|
||||
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 {
|
||||
// NSData *data;
|
||||
// string content;
|
||||
// string mimeType;
|
||||
// if (_reader->getFavicon(content, mimeType)) {
|
||||
// data = [NSData dataWithBytes:content.c_str() length:content.length()];
|
||||
// }
|
||||
// return data;
|
||||
|
||||
string contentC;
|
||||
NSData *data;
|
||||
string content;
|
||||
string mimeType;
|
||||
NSString *content;
|
||||
|
||||
if (_reader->getFavicon(contentC, mimeType)) {
|
||||
content = [NSString stringWithCString:contentC.c_str() encoding:NSUTF8StringEncoding];
|
||||
if (_reader->getFavicon(content, mimeType)) {
|
||||
data = [NSData dataWithBytes:content.c_str() length:content.length()];
|
||||
}
|
||||
return content;
|
||||
NSString * str = [data base64EncodedStringWithOptions:NSDataBase64EncodingEndLineWithLineFeed];
|
||||
return str;
|
||||
}
|
||||
|
||||
- (NSString *)parseURL:(NSString *)urlPath {
|
||||
|
Loading…
x
Reference in New Issue
Block a user