This commit is contained in:
Jeena Paradies 2013-01-07 00:43:04 +01:00
parent fee541fd1d
commit e07fa926b8
7 changed files with 62 additions and 25 deletions

View file

@ -73,6 +73,7 @@
- (void)openURL:(NSString *)url;
- (IBAction)showProfile:(id)sender;
- (void)notificateViewsAboutDeletedPostWithId:(NSString *)postId byEntity:(NSString*)entity;
- (void)setString:(NSString *)string forKey:(NSString *)aKey;
- (void)setSecret:(NSString *)string;

View file

@ -90,9 +90,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];
//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];
@ -113,7 +113,7 @@
{
[self initOauth];
NSString *localStoragePath = @"~/Library/Application Support/Tentia";
//NSString *localStoragePath = @"~/Library/Application Support/Tentia";
NSString *path = [[[NSBundle mainBundle] resourcePath] stringByAppendingString:@"/Webkit/"];
NSURL *url = [NSURL fileURLWithPath:path];
@ -125,9 +125,9 @@
[timelineView setPolicyDelegate:viewDelegate];
[timelineView setUIDelegate:viewDelegate];
[[timelineView windowScriptObject] setValue:self forKey:@"controller"];
WebPreferences* prefs = [timelineView preferences];
[prefs _setLocalStorageDatabasePath:localStoragePath];
[prefs setLocalStorageEnabled:YES];
//WebPreferences* prefs = [timelineView preferences];
//[prefs _setLocalStorageDatabasePath:localStoragePath];
//[prefs setLocalStorageEnabled:YES];
viewDelegate.mentionsView = mentionsView;
[[mentionsView mainFrame] loadHTMLString:index_string baseURL:url];
@ -135,9 +135,9 @@
[mentionsView setPolicyDelegate:viewDelegate];
[mentionsView setUIDelegate:viewDelegate];
[[mentionsView windowScriptObject] setValue:self forKey:@"controller"];
prefs = [mentionsView preferences];
[prefs _setLocalStorageDatabasePath:localStoragePath];
[prefs setLocalStorageEnabled:YES];
//prefs = [mentionsView preferences];
//[prefs _setLocalStorageDatabasePath:localStoragePath];
//[prefs setLocalStorageEnabled:YES];
viewDelegate.conversationView = conversationView;
[[conversationView mainFrame] loadHTMLString:index_string baseURL:url];
@ -145,9 +145,9 @@
[conversationView setPolicyDelegate:viewDelegate];
[conversationView setUIDelegate:viewDelegate];
[[conversationView windowScriptObject] setValue:self forKey:@"controller"];
prefs = [conversationView preferences];
[prefs _setLocalStorageDatabasePath:localStoragePath];
[prefs setLocalStorageEnabled:YES];
//prefs = [conversationView preferences];
//[prefs _setLocalStorageDatabasePath:localStoragePath];
//[prefs setLocalStorageEnabled:YES];
viewDelegate.profileView = profileView;
[[profileView mainFrame] loadHTMLString:index_string baseURL:url];
@ -155,9 +155,9 @@
[profileView setPolicyDelegate:viewDelegate];
[profileView setUIDelegate:viewDelegate];
[[profileView windowScriptObject] setValue:self forKey:@"controller"];
prefs = [profileView preferences];
[prefs _setLocalStorageDatabasePath:localStoragePath];
[prefs setLocalStorageEnabled:YES];
//prefs = [profileView preferences];
//[prefs _setLocalStorageDatabasePath:localStoragePath];
//[prefs setLocalStorageEnabled:YES];
}
else
@ -421,6 +421,15 @@
}
}
- (void)notificateViewsAboutDeletedPostWithId:(NSString *)postId byEntity:(NSString*)entity
{
NSString *fun = [NSString stringWithFormat:@"tentia_instance.postDeleted('%@', '%@')", postId, entity];
[timelineView stringByEvaluatingJavaScriptFromString:fun];
[mentionsView stringByEvaluatingJavaScriptFromString:fun];
[conversationView stringByEvaluatingJavaScriptFromString:fun];
[profileView stringByEvaluatingJavaScriptFromString:fun];
}
/*
- (void)storeAccessToken:(NSString *)_accessToken secret:(NSString *)secret userId:(NSString *)userId andScreenName:(NSString *)screenName

View file

@ -99,13 +99,20 @@
}
}
- (NSArray *)webView:(WebView *)sender contextMenuItemsForElement:(NSDictionary *)element defaultMenuItems:(NSArray *)defaultMenuItems {
- (NSArray *)webView:(WebView *)sender contextMenuItemsForElement:(NSDictionary *)element defaultMenuItems:(NSArray *)defaultMenuItems
{
// FIXME
/*
NSMutableArray *menuItems = [NSMutableArray arrayWithArray:defaultMenuItems];
for (NSMenuItem*item in defaultMenuItems) {
if ([[item title] isEqualToString:@"Reload"]) {
[item setAction:@selector(reload:)];
[item setTarget:self];
//[item setAction:@selector(reload:)];
//[item setTarget:self];
} else {
[menuItems addObject:item];
}
}
}*/
return defaultMenuItems;
}