Compare commits
2 commits
Author | SHA1 | Date | |
---|---|---|---|
![]() |
2046a74ba2 | ||
![]() |
b9563e1ebb |
8 changed files with 39 additions and 145 deletions
|
@ -42,7 +42,7 @@
|
||||||
<key>CFBundlePackageType</key>
|
<key>CFBundlePackageType</key>
|
||||||
<string>APPL</string>
|
<string>APPL</string>
|
||||||
<key>CFBundleShortVersionString</key>
|
<key>CFBundleShortVersionString</key>
|
||||||
<string>1.2.0</string>
|
<string>2.0.0</string>
|
||||||
<key>CFBundleSignature</key>
|
<key>CFBundleSignature</key>
|
||||||
<string>????</string>
|
<string>????</string>
|
||||||
<key>CFBundleURLTypes</key>
|
<key>CFBundleURLTypes</key>
|
||||||
|
@ -57,7 +57,7 @@
|
||||||
</dict>
|
</dict>
|
||||||
</array>
|
</array>
|
||||||
<key>CFBundleVersion</key>
|
<key>CFBundleVersion</key>
|
||||||
<string>1.2.0</string>
|
<string>2.0.0</string>
|
||||||
<key>LSApplicationCategoryType</key>
|
<key>LSApplicationCategoryType</key>
|
||||||
<string>public.app-category.social-networking</string>
|
<string>public.app-category.social-networking</string>
|
||||||
<key>LSMinimumSystemVersion</key>
|
<key>LSMinimumSystemVersion</key>
|
||||||
|
|
|
@ -19,12 +19,6 @@
|
||||||
@interface Controller : NSObject <GrowlApplicationBridgeDelegate> {
|
@interface Controller : NSObject <GrowlApplicationBridgeDelegate> {
|
||||||
IBOutlet WebView *timelineView;
|
IBOutlet WebView *timelineView;
|
||||||
IBOutlet NSWindow *timelineViewWindow;
|
IBOutlet NSWindow *timelineViewWindow;
|
||||||
IBOutlet WebView *mentionsView;
|
|
||||||
IBOutlet NSWindow *mentionsViewWindow;
|
|
||||||
IBOutlet WebView *conversationView;
|
|
||||||
IBOutlet NSWindow *conversationViewWindow;
|
|
||||||
WebView *profileView;
|
|
||||||
NSWindow *profileViewWindow;
|
|
||||||
NSPanel *openProfileWindow;
|
NSPanel *openProfileWindow;
|
||||||
NSWindow *loginViewWindow;
|
NSWindow *loginViewWindow;
|
||||||
NSTextField *loginEntityTextField;
|
NSTextField *loginEntityTextField;
|
||||||
|
@ -40,12 +34,6 @@
|
||||||
|
|
||||||
@property (assign) IBOutlet WebView *timelineView;
|
@property (assign) IBOutlet WebView *timelineView;
|
||||||
@property (assign) IBOutlet NSWindow *timelineViewWindow;
|
@property (assign) IBOutlet NSWindow *timelineViewWindow;
|
||||||
@property (assign) IBOutlet WebView *mentionsView;
|
|
||||||
@property (assign) IBOutlet NSWindow *mentionsViewWindow;
|
|
||||||
@property (assign) IBOutlet WebView *conversationView;
|
|
||||||
@property (assign) IBOutlet NSWindow *conversationViewWindow;
|
|
||||||
@property (assign) IBOutlet WebView *profileView;
|
|
||||||
@property (assign) IBOutlet NSWindow *profileViewWindow;
|
|
||||||
@property (assign) IBOutlet NSPanel *openProfileWindow;
|
@property (assign) IBOutlet NSPanel *openProfileWindow;
|
||||||
|
|
||||||
@property (assign) IBOutlet NSWindow *loginViewWindow;
|
@property (assign) IBOutlet NSWindow *loginViewWindow;
|
||||||
|
|
117
Mac/Controller.m
117
Mac/Controller.m
|
@ -17,7 +17,7 @@
|
||||||
@synthesize loginViewWindow;
|
@synthesize loginViewWindow;
|
||||||
@synthesize loginEntityTextField;
|
@synthesize loginEntityTextField;
|
||||||
@synthesize loginActivityIndicator;
|
@synthesize loginActivityIndicator;
|
||||||
@synthesize timelineView, timelineViewWindow, mentionsView, mentionsViewWindow, conversationView, conversationViewWindow, profileView, profileViewWindow;
|
@synthesize timelineView, timelineViewWindow;
|
||||||
@synthesize globalHotkeyMenuItem, viewDelegate;
|
@synthesize globalHotkeyMenuItem, viewDelegate;
|
||||||
@synthesize logoLayer;
|
@synthesize logoLayer;
|
||||||
@synthesize oauthView, accessToken;
|
@synthesize oauthView, accessToken;
|
||||||
|
@ -25,7 +25,6 @@
|
||||||
- (void)awakeFromNib
|
- (void)awakeFromNib
|
||||||
{
|
{
|
||||||
[timelineViewWindow setExcludedFromWindowsMenu:YES];
|
[timelineViewWindow setExcludedFromWindowsMenu:YES];
|
||||||
[mentionsViewWindow setExcludedFromWindowsMenu:YES];
|
|
||||||
|
|
||||||
[self initHotKeys];
|
[self initHotKeys];
|
||||||
|
|
||||||
|
@ -70,7 +69,6 @@
|
||||||
|
|
||||||
if (forceLogin || ![accessToken stringForKey:@"user_access_token"] || ![accessToken secret]) {
|
if (forceLogin || ![accessToken stringForKey:@"user_access_token"] || ![accessToken secret]) {
|
||||||
[timelineViewWindow performClose:self];
|
[timelineViewWindow performClose:self];
|
||||||
[mentionsViewWindow performClose:self];
|
|
||||||
[self.loginViewWindow makeKeyAndOrderFront:self];
|
[self.loginViewWindow makeKeyAndOrderFront:self];
|
||||||
[self initOauth];
|
[self initOauth];
|
||||||
} else {
|
} else {
|
||||||
|
@ -125,47 +123,11 @@
|
||||||
[timelineView setPolicyDelegate:viewDelegate];
|
[timelineView setPolicyDelegate:viewDelegate];
|
||||||
[timelineView setUIDelegate:viewDelegate];
|
[timelineView setUIDelegate:viewDelegate];
|
||||||
[[timelineView windowScriptObject] setValue:self forKey:@"controller"];
|
[[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];
|
|
||||||
[mentionsView setFrameLoadDelegate:viewDelegate];
|
|
||||||
[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];
|
|
||||||
[conversationView setFrameLoadDelegate:viewDelegate];
|
|
||||||
[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];
|
|
||||||
[profileView setFrameLoadDelegate:viewDelegate];
|
|
||||||
[profileView setPolicyDelegate:viewDelegate];
|
|
||||||
[profileView setUIDelegate:viewDelegate];
|
|
||||||
[[profileView windowScriptObject] setValue:self forKey:@"controller"];
|
|
||||||
//prefs = [profileView preferences];
|
|
||||||
//[prefs _setLocalStorageDatabasePath:localStoragePath];
|
|
||||||
//[prefs setLocalStorageEnabled:YES];
|
|
||||||
|
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
[timelineView stringByEvaluatingJavaScriptFromString:@"start('timeline')"];
|
[timelineView stringByEvaluatingJavaScriptFromString:@"start('timeline')"];
|
||||||
[mentionsView stringByEvaluatingJavaScriptFromString:@"start('mentions')"];
|
|
||||||
[conversationView stringByEvaluatingJavaScriptFromString:@"start('conversation')"];
|
|
||||||
[profileView stringByEvaluatingJavaScriptFromString:@"start('profile')"];
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -312,7 +274,7 @@
|
||||||
|
|
||||||
if (range.length > 0)
|
if (range.length > 0)
|
||||||
{
|
{
|
||||||
[oauthView stringByEvaluatingJavaScriptFromString:[NSString stringWithFormat:@"bungloo_instance.requestAccessToken('%@')", aString]];
|
[oauthView stringByEvaluatingJavaScriptFromString:[NSString stringWithFormat:@"bungloo.oauth.requestAccessToken('%@')", aString]];
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
|
@ -353,7 +315,7 @@
|
||||||
isPrivate = @"true";
|
isPrivate = @"true";
|
||||||
}
|
}
|
||||||
|
|
||||||
NSString *func = [NSString stringWithFormat:@"bungloo_instance.sendNewMessage(\"%@\", \"%@\", \"%@\", %@, %@, %@)",
|
NSString *func = [NSString stringWithFormat:@"bungloo.timeline.sendNewMessage(\"%@\", \"%@\", \"%@\", %@, %@, %@)",
|
||||||
text,
|
text,
|
||||||
post.inReplyTostatusId,
|
post.inReplyTostatusId,
|
||||||
post.inReplyToEntity,
|
post.inReplyToEntity,
|
||||||
|
@ -378,17 +340,17 @@
|
||||||
|
|
||||||
- (void)unreadMentions:(int)count
|
- (void)unreadMentions:(int)count
|
||||||
{
|
{
|
||||||
if (![mentionsViewWindow isVisible] && count > 0)
|
if (count > 0)
|
||||||
{
|
{
|
||||||
[timelineViewWindow setTitle:[NSString stringWithFormat:@"Bungloo (^%i)", count]];
|
|
||||||
[[[NSApplication sharedApplication] dockTile] setBadgeLabel:[NSString stringWithFormat:@"%i", count]];
|
[[[NSApplication sharedApplication] dockTile] setBadgeLabel:[NSString stringWithFormat:@"%i", count]];
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
[timelineViewWindow setTitle:[NSString stringWithFormat:@"Bungloo"]];
|
|
||||||
[[[NSApplication sharedApplication] dockTile] setBadgeLabel:nil];
|
[[[NSApplication sharedApplication] dockTile] setBadgeLabel:nil];
|
||||||
[mentionsView stringByEvaluatingJavaScriptFromString:@"bungloo_instance.unread_mentions = 0;"];
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
NSString *script = [NSString stringWithFormat:@"bungloo.sidebar.setUnreadMentions(%i);", count];
|
||||||
|
[timelineView stringByEvaluatingJavaScriptFromString:script];
|
||||||
}
|
}
|
||||||
|
|
||||||
- (void)notificateUserAboutMention:(NSString *)text fromName:(NSString *)name withPostId:(NSString *)postId andEntity:(NSString *)entity
|
- (void)notificateUserAboutMention:(NSString *)text fromName:(NSString *)name withPostId:(NSString *)postId andEntity:(NSString *)entity
|
||||||
|
@ -414,35 +376,21 @@
|
||||||
{
|
{
|
||||||
NSString *entity = [self.showProfileTextField stringValue];
|
NSString *entity = [self.showProfileTextField stringValue];
|
||||||
if ([entity rangeOfString:@"."].location != NSNotFound && ([entity hasPrefix:@"http://"] || [entity hasPrefix:@"https://"])) {
|
if ([entity rangeOfString:@"."].location != NSNotFound && ([entity hasPrefix:@"http://"] || [entity hasPrefix:@"https://"])) {
|
||||||
NSString *func = [NSString stringWithFormat:@"bungloo_instance.showProfileForEntity('%@')", entity];
|
NSString *func = [NSString stringWithFormat:@"bungloo.sidebar.onEntityProfile(); bungloo.entityProfile.showProfileForEntity('%@')", entity];
|
||||||
[profileView stringByEvaluatingJavaScriptFromString:func];
|
[timelineView stringByEvaluatingJavaScriptFromString:func];
|
||||||
[profileViewWindow makeKeyAndOrderFront:self];
|
|
||||||
[openProfileWindow performClose:self];
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
- (void)notificateViewsAboutDeletedPostWithId:(NSString *)postId byEntity:(NSString*)entity
|
- (void)notificateViewsAboutDeletedPostWithId:(NSString *)postId byEntity:(NSString*)entity
|
||||||
{
|
{
|
||||||
NSString *fun = [NSString stringWithFormat:@"bungloo_instance.postDeleted('%@', '%@')", postId, entity];
|
NSString *f = [NSString stringWithFormat:@".postDeleted('%@', '%@');", postId, entity];
|
||||||
|
NSMutableString *fun = [NSMutableString stringWithFormat:@"bungloo.timeline%@", f];
|
||||||
|
[fun appendFormat:@"bungloo.mentions%@", f];
|
||||||
|
[fun appendFormat:@"bungloo.conversation%@", f];
|
||||||
|
[fun appendFormat:@"bungloo.entityProfile%@", f];
|
||||||
[timelineView stringByEvaluatingJavaScriptFromString:fun];
|
[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
|
|
||||||
{
|
|
||||||
self.accessToken.accessToken = _accessToken;
|
|
||||||
self.accessToken.secret = secret;
|
|
||||||
self.accessToken.userId = userId;
|
|
||||||
self.accessToken.screenName = screenName;
|
|
||||||
[timelineViewWindow makeKeyAndOrderFront:self];
|
|
||||||
|
|
||||||
[[NSNotificationCenter defaultCenter] postNotificationName:@"authentificationSucceded" object:nil];
|
|
||||||
}*/
|
|
||||||
|
|
||||||
- (void)loggedIn
|
- (void)loggedIn
|
||||||
{
|
{
|
||||||
[loginActivityIndicator stopAnimation:self];
|
[loginActivityIndicator stopAnimation:self];
|
||||||
|
@ -456,58 +404,47 @@
|
||||||
if ([[loginEntityTextField stringValue] length] > 0) {
|
if ([[loginEntityTextField stringValue] length] > 0) {
|
||||||
[[loginEntityTextField window] makeFirstResponder:nil];
|
[[loginEntityTextField window] makeFirstResponder:nil];
|
||||||
[loginActivityIndicator startAnimation:self];
|
[loginActivityIndicator startAnimation:self];
|
||||||
[oauthView stringByEvaluatingJavaScriptFromString:@"bungloo_instance.authenticate();"];
|
[oauthView stringByEvaluatingJavaScriptFromString:@"bungloo.oauth.authenticate();"];
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
- (IBAction)logout:(id)sender
|
- (IBAction)logout:(id)sender
|
||||||
{
|
{
|
||||||
[oauthView stringByEvaluatingJavaScriptFromString:@"bungloo_instance.logout();"];
|
[oauthView stringByEvaluatingJavaScriptFromString:@"bungloo.oauth.logout();"];
|
||||||
|
|
||||||
[timelineViewWindow performClose:self];
|
[timelineViewWindow performClose:self];
|
||||||
[mentionsViewWindow performClose:self];
|
|
||||||
[conversationViewWindow performClose:self];
|
|
||||||
[profileViewWindow performClose:self];
|
|
||||||
[self.loginViewWindow makeKeyAndOrderFront:self];
|
[self.loginViewWindow makeKeyAndOrderFront:self];
|
||||||
|
|
||||||
[timelineView stringByEvaluatingJavaScriptFromString:@"bungloo_instance.logout();"];
|
[timelineView stringByEvaluatingJavaScriptFromString:@"bungloo.sidebar.logout();"];
|
||||||
[mentionsView stringByEvaluatingJavaScriptFromString:@"bungloo_instance.logout();"];
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// Mentions window has been visible
|
// Mentions window has been visible
|
||||||
- (void)windowDidBecomeKey:(NSNotification *)notification
|
- (void)windowDidBecomeKey:(NSNotification *)notification
|
||||||
{
|
{
|
||||||
if ([notification object] == mentionsViewWindow)
|
|
||||||
{
|
|
||||||
//[self unreadMentions:0];
|
|
||||||
[mentionsView stringByEvaluatingJavaScriptFromString:@"bungloo_instance.setAllMentionsRead();"];
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
- (void)getPostUpdates:(id)sender
|
- (void)getPostUpdates:(id)sender
|
||||||
{
|
{
|
||||||
[timelineView stringByEvaluatingJavaScriptFromString:@"bungloo_instance.getNewData(true)"];
|
[timelineView stringByEvaluatingJavaScriptFromString:@"bungloo.timeline.getNewData(true)"];
|
||||||
[mentionsView stringByEvaluatingJavaScriptFromString:@"bungloo_instance.getNewData(true)"];
|
[timelineView stringByEvaluatingJavaScriptFromString:@"bungloo.mentions.getNewData(true)"];
|
||||||
}
|
}
|
||||||
|
|
||||||
- (IBAction)showConversationForPostId:(NSString *)postId andEntity:(NSString *)entity
|
- (IBAction)showConversationForPostId:(NSString *)postId andEntity:(NSString *)entity
|
||||||
{
|
{
|
||||||
NSString *js = [NSString stringWithFormat:@"bungloo_instance.showStatus('%@', '%@');", postId, entity];
|
NSString *js = [NSString stringWithFormat:@"bungloo.sidebar.onConversation(); bungloo.conversation.showStatus('%@', '%@');", postId, entity];
|
||||||
[conversationView stringByEvaluatingJavaScriptFromString:js];
|
[timelineView stringByEvaluatingJavaScriptFromString:js];
|
||||||
[conversationViewWindow makeKeyAndOrderFront:self];
|
|
||||||
[[NSApplication sharedApplication] activateIgnoringOtherApps:YES];
|
|
||||||
}
|
}
|
||||||
|
|
||||||
- (IBAction)clearCache:(id)sender
|
- (IBAction)clearCache:(id)sender
|
||||||
{
|
{
|
||||||
[timelineView stringByEvaluatingJavaScriptFromString:@"bungloo_instance.cache.clear()"];
|
[timelineView stringByEvaluatingJavaScriptFromString:@"bungloo.timeline.cache.clear()"];
|
||||||
}
|
}
|
||||||
|
|
||||||
- (IBAction)showProfileForEntity:(NSString *)entity
|
- (IBAction)showProfileForEntity:(NSString *)entity
|
||||||
{
|
{
|
||||||
NSString *js = [NSString stringWithFormat:@"bungloo_instance.showProfileForEntity('%@');", entity];
|
NSString *js = [NSString stringWithFormat:@"bungloo.sidebar.onEntityProfile(); bungloo.entityProfile.showProfileForEntity('%@');", entity];
|
||||||
[profileView stringByEvaluatingJavaScriptFromString:js];
|
[timelineView stringByEvaluatingJavaScriptFromString:js];
|
||||||
[profileViewWindow makeKeyAndOrderFront:self];
|
|
||||||
}
|
}
|
||||||
|
|
||||||
- (void)growlNotificationWasClicked:(id)clickContext
|
- (void)growlNotificationWasClicked:(id)clickContext
|
||||||
|
@ -518,8 +455,8 @@
|
||||||
|
|
||||||
[self showConversationForPostId:postId andEntity:entity];
|
[self showConversationForPostId:postId andEntity:entity];
|
||||||
|
|
||||||
NSString *js = [NSString stringWithFormat:@"bungloo_instance.mentionRead('%@', '%@');", postId, entity];
|
NSString *js = [NSString stringWithFormat:@"bungloo.sidebar.onMentions(); bungloo.mentions.mentionRead('%@', '%@');", postId, entity];
|
||||||
[mentionsView stringByEvaluatingJavaScriptFromString:js];
|
[timelineView stringByEvaluatingJavaScriptFromString:js];
|
||||||
}
|
}
|
||||||
|
|
||||||
- (NSString *) applicationNameForGrowl
|
- (NSString *) applicationNameForGrowl
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
{\rtf1\ansi\ansicpg1252\cocoartf1187\cocoasubrtf340
|
{\rtf1\ansi\ansicpg1252\cocoartf1187\cocoasubrtf370
|
||||||
{\fonttbl\f0\fswiss\fcharset0 Helvetica;}
|
{\fonttbl\f0\fswiss\fcharset0 Helvetica;}
|
||||||
{\colortbl;\red255\green255\blue255;}
|
{\colortbl;\red255\green255\blue255;}
|
||||||
\viewkind0
|
\viewkind0
|
||||||
|
@ -16,7 +16,7 @@
|
||||||
|
|
||||||
\b Documentation:
|
\b Documentation:
|
||||||
\b0 \
|
\b0 \
|
||||||
http://github.com/jeena/bungloo/wiki\
|
http://jabs.nu/bungloo\
|
||||||
\
|
\
|
||||||
|
|
||||||
\b With special thanks to:
|
\b With special thanks to:
|
||||||
|
|
|
@ -11,17 +11,9 @@
|
||||||
#import "Constants.h"
|
#import "Constants.h"
|
||||||
|
|
||||||
@interface ViewDelegate : NSObject {
|
@interface ViewDelegate : NSObject {
|
||||||
WebView *timelineView;
|
WebView *timelineView; WebView *oauthView;
|
||||||
WebView *mentionsView;
|
|
||||||
WebView *conversationView;
|
|
||||||
WebView *profileView;
|
|
||||||
WebView *oauthView;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@property (nonatomic, assign) WebView *timelineView;
|
@property (nonatomic, assign) WebView *timelineView;@property (nonatomic, assign) WebView *oauthView;
|
||||||
@property (nonatomic, assign) WebView *mentionsView;
|
|
||||||
@property (nonatomic, assign) WebView *conversationView;
|
|
||||||
@property (nonatomic, assign) WebView *profileView;
|
|
||||||
@property (nonatomic, assign) WebView *oauthView;
|
|
||||||
|
|
||||||
@end
|
@end
|
||||||
|
|
|
@ -11,18 +11,15 @@
|
||||||
|
|
||||||
@implementation ViewDelegate
|
@implementation ViewDelegate
|
||||||
|
|
||||||
@synthesize timelineView, mentionsView, conversationView, profileView, oauthView;
|
@synthesize timelineView, oauthView;
|
||||||
|
|
||||||
- (void)webView:(WebView *)sender addMessageToConsole:(NSDictionary *)message {
|
- (void)webView:(WebView *)sender addMessageToConsole:(NSDictionary *)message {
|
||||||
|
|
||||||
if (![message isKindOfClass:[NSDictionary class]]) return;
|
if (![message isKindOfClass:[NSDictionary class]]) return;
|
||||||
|
|
||||||
NSString *viewName = @"TimelineView";
|
NSString *viewName = @"TimelineView";
|
||||||
if (sender == mentionsView) viewName = @"MentionsView";
|
|
||||||
if (sender == conversationView) viewName = @"ConversationView";
|
|
||||||
if (sender == oauthView) viewName = @"OauthView";
|
if (sender == oauthView) viewName = @"OauthView";
|
||||||
if (sender == profileView) viewName = @"ProfileView";
|
|
||||||
|
|
||||||
NSLog(@"js<%@>: %@:%@: %@",
|
NSLog(@"js<%@>: %@:%@: %@",
|
||||||
viewName,
|
viewName,
|
||||||
[[message objectForKey:@"sourceURL"] lastPathComponent],
|
[[message objectForKey:@"sourceURL"] lastPathComponent],
|
||||||
|
@ -33,8 +30,6 @@
|
||||||
|
|
||||||
- (void)webView:(WebView *)sender runJavaScriptAlertPanelWithMessage:(NSString *)message initiatedByFrame:(WebFrame *)frame {
|
- (void)webView:(WebView *)sender runJavaScriptAlertPanelWithMessage:(NSString *)message initiatedByFrame:(WebFrame *)frame {
|
||||||
NSString *viewName = @"TimelineView";
|
NSString *viewName = @"TimelineView";
|
||||||
if (sender == mentionsView) viewName = @"MentionsView";
|
|
||||||
if (sender == conversationView) viewName = @"ConversationView";
|
|
||||||
if (sender == oauthView) viewName = @"OauthView";
|
if (sender == oauthView) viewName = @"OauthView";
|
||||||
|
|
||||||
NSLog(@"jsa<%@>: %@", viewName, message);
|
NSLog(@"jsa<%@>: %@", viewName, message);
|
||||||
|
@ -52,7 +47,7 @@
|
||||||
|
|
||||||
- (void)webView:(WebView *)sender decidePolicyForNavigationAction:(NSDictionary *)actionInformation request:(NSURLRequest *)request frame:(WebFrame *)frame decisionListener:(id <WebPolicyDecisionListener>)listener {
|
- (void)webView:(WebView *)sender decidePolicyForNavigationAction:(NSDictionary *)actionInformation request:(NSURLRequest *)request frame:(WebFrame *)frame decisionListener:(id <WebPolicyDecisionListener>)listener {
|
||||||
|
|
||||||
NSArray *frames = [NSArray arrayWithObjects:timelineView.mainFrame, mentionsView.mainFrame, conversationView.mainFrame, oauthView.mainFrame, profileView.mainFrame, nil];
|
NSArray *frames = [NSArray arrayWithObjects:timelineView.mainFrame, oauthView.mainFrame, nil];
|
||||||
|
|
||||||
// If it is clicked from one of the views the open default browser
|
// If it is clicked from one of the views the open default browser
|
||||||
if ([frames indexOfObject:frame] != NSNotFound) {
|
if ([frames indexOfObject:frame] != NSNotFound) {
|
||||||
|
@ -85,25 +80,9 @@
|
||||||
|
|
||||||
[oauthView stringByEvaluatingJavaScriptFromString:@"function HostAppGo() { start('oauth') }"];
|
[oauthView stringByEvaluatingJavaScriptFromString:@"function HostAppGo() { start('oauth') }"];
|
||||||
|
|
||||||
} else if(sender == conversationView) {
|
|
||||||
|
|
||||||
[conversationView stringByEvaluatingJavaScriptFromString:@"function HostAppGo() { start('conversation') }"];
|
|
||||||
|
|
||||||
} else if(sender == profileView) {
|
|
||||||
|
|
||||||
[profileView stringByEvaluatingJavaScriptFromString:@"function HostAppGo() { start('profile') }"];
|
|
||||||
|
|
||||||
} else {
|
} else {
|
||||||
|
|
||||||
NSString *action = @"timeline";
|
[sender stringByEvaluatingJavaScriptFromString:@"function HostAppGo() { start('timeline') }"];
|
||||||
NSString *delay = @"1";
|
|
||||||
|
|
||||||
if (sender == mentionsView) {
|
|
||||||
action = @"mentions";
|
|
||||||
delay = @"1000";
|
|
||||||
}
|
|
||||||
|
|
||||||
[sender stringByEvaluatingJavaScriptFromString:[NSString stringWithFormat:@"function HostAppGo() { start('%@') }", action]];
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -126,8 +105,7 @@
|
||||||
}
|
}
|
||||||
|
|
||||||
- (void)reload:(id)sender {
|
- (void)reload:(id)sender {
|
||||||
[timelineView stringByEvaluatingJavaScriptFromString:@"bungloo_instance.getNewData();"];
|
[timelineView stringByEvaluatingJavaScriptFromString:@"bungloo.timeline.getNewData();"];
|
||||||
[mentionsView stringByEvaluatingJavaScriptFromString:@"bungloo_instance.getNewData();"];
|
|
||||||
}
|
}
|
||||||
|
|
||||||
- (NSString *)pluginURL
|
- (NSString *)pluginURL
|
||||||
|
|
|
@ -236,7 +236,7 @@ li:hover .from {
|
||||||
|
|
||||||
li:first-child:hover .from {
|
li:first-child:hover .from {
|
||||||
top: auto;
|
top: auto;
|
||||||
bottom: -1.9em;
|
bottom: -1.8em;
|
||||||
z-index: 2;
|
z-index: 2;
|
||||||
-webkit-border-top-left-radius: 0;
|
-webkit-border-top-left-radius: 0;
|
||||||
-webkit-border-top-right-radius: 0;
|
-webkit-border-top-right-radius: 0;
|
||||||
|
|
|
@ -122,7 +122,6 @@ function(jQuery, Paths, URI, HostApp, Cache) {
|
||||||
|
|
||||||
head.appendChild(reposted_by)
|
head.appendChild(reposted_by)
|
||||||
|
|
||||||
|
|
||||||
var message = document.createElement("p");
|
var message = document.createElement("p");
|
||||||
message.className = "message";
|
message.className = "message";
|
||||||
data.appendChild(message);
|
data.appendChild(message);
|
||||||
|
|
Reference in a new issue