added Cache
This commit is contained in:
parent
dacd2ee019
commit
c3d1ce7d24
8 changed files with 280 additions and 105 deletions
|
@ -92,6 +92,9 @@
|
|||
NSString *index_string = [NSString stringWithContentsOfFile:[NSString stringWithFormat:@"%@index.html", path] encoding:NSUTF8StringEncoding error:nil];
|
||||
|
||||
oauthView = [[WebView alloc] init];
|
||||
WebPreferences* prefs = [oauthView preferences];
|
||||
[prefs _setLocalStorageDatabasePath:@"~/Library/Application Support/Tentia"];
|
||||
[prefs setLocalStorageEnabled:YES];
|
||||
viewDelegate.oauthView = oauthView;
|
||||
[[oauthView mainFrame] loadHTMLString:index_string baseURL:url];
|
||||
[oauthView setFrameLoadDelegate:viewDelegate];
|
||||
|
@ -110,6 +113,8 @@
|
|||
|
||||
if (YES) //viewDelegate.timelineView != timelineView)
|
||||
{
|
||||
NSString *localStoragePath = @"~/Library/Application Support/Tentia";
|
||||
|
||||
NSString *path = [[[NSBundle mainBundle] resourcePath] stringByAppendingString:@"/Webkit/"];
|
||||
NSURL *url = [NSURL fileURLWithPath:path];
|
||||
NSString *index_string = [NSString stringWithContentsOfFile:[NSString stringWithFormat:@"%@index.html", path] encoding:NSUTF8StringEncoding error:nil];
|
||||
|
@ -120,6 +125,9 @@
|
|||
[timelineView setPolicyDelegate:viewDelegate];
|
||||
[timelineView setUIDelegate:viewDelegate];
|
||||
[[timelineView windowScriptObject] setValue:self forKey:@"controller"];
|
||||
WebPreferences* prefs = [timelineView preferences];
|
||||
[prefs _setLocalStorageDatabasePath:localStoragePath];
|
||||
[prefs setLocalStorageEnabled:YES];
|
||||
|
||||
viewDelegate.mentionsView = mentionsView;
|
||||
[[mentionsView mainFrame] loadHTMLString:index_string baseURL:url];
|
||||
|
@ -127,7 +135,9 @@
|
|||
[mentionsView setPolicyDelegate:viewDelegate];
|
||||
[mentionsView setUIDelegate:viewDelegate];
|
||||
[[mentionsView windowScriptObject] setValue:self forKey:@"controller"];
|
||||
|
||||
prefs = [mentionsView preferences];
|
||||
[prefs _setLocalStorageDatabasePath:localStoragePath];
|
||||
[prefs setLocalStorageEnabled:YES];
|
||||
|
||||
viewDelegate.conversationView = conversationView;
|
||||
[[conversationView mainFrame] loadHTMLString:index_string baseURL:url];
|
||||
|
@ -135,6 +145,9 @@
|
|||
[conversationView setPolicyDelegate:viewDelegate];
|
||||
[conversationView setUIDelegate:viewDelegate];
|
||||
[[conversationView windowScriptObject] setValue:self forKey:@"controller"];
|
||||
prefs = [conversationView preferences];
|
||||
[prefs _setLocalStorageDatabasePath:localStoragePath];
|
||||
[prefs setLocalStorageEnabled:YES];
|
||||
|
||||
viewDelegate.profileView = profileView;
|
||||
[[profileView mainFrame] loadHTMLString:index_string baseURL:url];
|
||||
|
@ -142,6 +155,10 @@
|
|||
[profileView setPolicyDelegate:viewDelegate];
|
||||
[profileView setUIDelegate:viewDelegate];
|
||||
[[profileView windowScriptObject] setValue:self forKey:@"controller"];
|
||||
prefs = [profileView preferences];
|
||||
[prefs _setLocalStorageDatabasePath:localStoragePath];
|
||||
[prefs setLocalStorageEnabled:YES];
|
||||
|
||||
}
|
||||
else
|
||||
{
|
||||
|
|
Reference in a new issue