This commit is contained in:
Chris Li 2016-11-26 20:54:32 -05:00
parent f51d285abc
commit 5a0f28bb86
5 changed files with 17 additions and 22 deletions

View File

@ -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) {
}
}

View File

@ -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>

View File

@ -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>

View File

@ -85,9 +85,10 @@ class ArticleLoadOperation: Procedure {
}
self.finish()
// //if main.traitCollection.horizontalSizeClass == .compact {main.hideTableOfContentsController()}
}
}
}
class BookmarkAddOperation: Procedure {
}

View File

@ -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 {