added opening conversation view in new window to OS X

This commit is contained in:
Jeena Paradies 2013-04-16 23:20:08 +02:00
parent 11e6da5592
commit 142b4d4dd3
13 changed files with 481 additions and 37 deletions

View file

@ -22,6 +22,8 @@
1F880B6B165EE0F60022A84D /* NSData+Base64.m in Sources */ = {isa = PBXBuildFile; fileRef = 1F880B6A165EE0F60022A84D /* NSData+Base64.m */; };
1F880B6E165FE8890022A84D /* MimeType.m in Sources */ = {isa = PBXBuildFile; fileRef = 1F880B6D165FE8890022A84D /* MimeType.m */; };
1FA09847144602530079E258 /* libicucore.dylib in Frameworks */ = {isa = PBXBuildFile; fileRef = 1FA09846144602530079E258 /* libicucore.dylib */; };
1FADDCED171DCBF400502891 /* NewConversationWindowController.m in Sources */ = {isa = PBXBuildFile; fileRef = 1FADDCEB171DCBF400502891 /* NewConversationWindowController.m */; };
1FADDCEE171DCBF400502891 /* NewConversationWindowController.xib in Resources */ = {isa = PBXBuildFile; fileRef = 1FADDCEC171DCBF400502891 /* NewConversationWindowController.xib */; };
1FC254A01427DFAD0035D84B /* AccessToken.m in Sources */ = {isa = PBXBuildFile; fileRef = 1FC2549B1427D9930035D84B /* AccessToken.m */; };
1FDEF722164EFE9100F927F3 /* Growl.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 1FDEF721164EFE9100F927F3 /* Growl.framework */; };
1FDEF723164EFF3100F927F3 /* Growl.framework in CopyFiles */ = {isa = PBXBuildFile; fileRef = 1FDEF721164EFE9100F927F3 /* Growl.framework */; };
@ -77,6 +79,9 @@
1F880B6C165FE8890022A84D /* MimeType.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = MimeType.h; sourceTree = "<group>"; };
1F880B6D165FE8890022A84D /* MimeType.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = MimeType.m; sourceTree = "<group>"; };
1FA09846144602530079E258 /* libicucore.dylib */ = {isa = PBXFileReference; lastKnownFileType = "compiled.mach-o.dylib"; name = libicucore.dylib; path = usr/lib/libicucore.dylib; sourceTree = SDKROOT; };
1FADDCEA171DCBF400502891 /* NewConversationWindowController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = NewConversationWindowController.h; sourceTree = "<group>"; };
1FADDCEB171DCBF400502891 /* NewConversationWindowController.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = NewConversationWindowController.m; sourceTree = "<group>"; };
1FADDCEC171DCBF400502891 /* NewConversationWindowController.xib */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = file.xib; path = NewConversationWindowController.xib; sourceTree = "<group>"; };
1FC2549A1427D9930035D84B /* AccessToken.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; lineEnding = 0; path = AccessToken.h; sourceTree = "<group>"; xcLanguageSpecificationIdentifier = xcode.lang.objcpp; };
1FC2549B1427D9930035D84B /* AccessToken.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; lineEnding = 0; path = AccessToken.m; sourceTree = "<group>"; xcLanguageSpecificationIdentifier = xcode.lang.objc; };
1FDEF721164EFE9100F927F3 /* Growl.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; path = Growl.framework; sourceTree = "<group>"; };
@ -185,6 +190,8 @@
1F880B6A165EE0F60022A84D /* NSData+Base64.m */,
1F880B6C165FE8890022A84D /* MimeType.h */,
1F880B6D165FE8890022A84D /* MimeType.m */,
1FADDCEA171DCBF400502891 /* NewConversationWindowController.h */,
1FADDCEB171DCBF400502891 /* NewConversationWindowController.m */,
);
name = Classes;
sourceTree = "<group>";
@ -210,6 +217,7 @@
089C165FFE840EACC02AAC07 /* InfoPlist.strings */,
1DDD58280DA1D0D100B32029 /* NewMessageWindow.xib */,
1DDD582A0DA1D0D100B32029 /* MainMenu.xib */,
1FADDCEC171DCBF400502891 /* NewConversationWindowController.xib */,
1FDEF724164F079800F927F3 /* Growl Registration Ticket.growlRegDict */,
);
name = Resources;
@ -287,6 +295,7 @@
1F122D49118E1DE100E83B77 /* Icon.icns in Resources */,
1F1C80F916482A250010B409 /* WebKit in Resources */,
1F132C791666CD9700E4E661 /* TB_SendTemplate.png in Resources */,
1FADDCEE171DCBF400502891 /* NewConversationWindowController.xib in Resources */,
);
runOnlyForDeploymentPostprocessing = 0;
};
@ -306,6 +315,7 @@
1F618ECA12DB5E6100E500D9 /* PostModel.m in Sources */,
1F880B6B165EE0F60022A84D /* NSData+Base64.m in Sources */,
1F880B6E165FE8890022A84D /* MimeType.m in Sources */,
1FADDCED171DCBF400502891 /* NewConversationWindowController.m in Sources */,
);
runOnlyForDeploymentPostprocessing = 0;
};

View file

@ -68,6 +68,7 @@
- (IBAction)showSearch:(id)sender;
- (IBAction)showAbout:(id)sender;
- (IBAction)showNext:(id)sender;
- (IBAction)showConversationViewForPostId:(NSString *)postId andEntity:(NSString *)entity;
- (void)notificateViewsAboutDeletedPostWithId:(NSString *)postId byEntity:(NSString*)entity;

View file

@ -10,6 +10,7 @@
#import "NewMessageWindow.h"
#import "PostModel.h"
#import "NSData+Base64.h"
#import "NewConversationWindowController.h"
@implementation Controller
@synthesize showProfileTextField;
@ -387,6 +388,12 @@
[timelineView stringByEvaluatingJavaScriptFromString:@"bungloo.sidebar.onConversation();"];
}
- (IBAction)showConversationViewForPostId:(NSString *)postId andEntity:(NSString *)entity
{
NewConversationWindowController *conversationView = [[NewConversationWindowController alloc] initWithPostId:postId entity:entity andViewDelegate:viewDelegate];
[conversationView showWindow:conversationView.window];
}
- (IBAction)showProfile:(id)sender
{
if ([sender isKindOfClass:[NSMenuItem class]]) {

View file

@ -887,6 +887,7 @@
<bool key="EncodedWithXMLCoder">YES</bool>
<object class="NSArray" key="dict.sortedKeys">
<bool key="EncodedWithXMLCoder">YES</bool>
<string>13WebKitAllowAnimatedImageLoopingPreferenceKey</string>
<string>13WebKitJavaEnabled</string>
<string>13WebKitJavaScriptCanOpenWindowsAutomatically</string>
<string>13WebKitPluginsEnabled</string>
@ -896,6 +897,7 @@
<boolean value="NO"/>
<boolean value="NO"/>
<boolean value="NO"/>
<boolean value="NO"/>
</object>
</object>
</object>
@ -1052,6 +1054,7 @@
<string key="NSFrame">{{391, 46}, {75, 32}}</string>
<reference key="NSSuperview" ref="503676418"/>
<reference key="NSWindow"/>
<reference key="NSNextKeyView"/>
<string key="NSReuseIdentifierKey">_NS:9</string>
<bool key="NSEnabled">YES</bool>
<object class="NSButtonCell" key="NSCell" id="54847478">
@ -1160,6 +1163,7 @@
<string key="NSFrame">{{285, 13}, {74, 32}}</string>
<reference key="NSSuperview" ref="997375509"/>
<reference key="NSWindow"/>
<reference key="NSNextKeyView"/>
<string key="NSReuseIdentifierKey">_NS:9</string>
<bool key="NSEnabled">YES</bool>
<object class="NSButtonCell" key="NSCell" id="302504138">
@ -2812,15 +2816,11 @@
<string>clearCache:</string>
<string>login:</string>
<string>logout:</string>
<string>openNewMessageWindow:</string>
<string>sendPost:</string>
<string>showAbout:</string>
<string>showConversation:</string>
<string>showConversationForPostId:andEntity:</string>
<string>showMentions:</string>
<string>showNext:</string>
<string>showProfile:</string>
<string>showProfileForEntity:</string>
<string>showSearch:</string>
<string>showTimeline:</string>
</object>
@ -2833,13 +2833,9 @@
<string>id</string>
<string>id</string>
<string>id</string>
<string>NSString</string>
<string>id</string>
<string>id</string>
<string>id</string>
<string>NSString</string>
<string>id</string>
<string>id</string>
</object>
</object>
<object class="NSMutableDictionary" key="actionInfosByName">
@ -2849,15 +2845,11 @@
<string>clearCache:</string>
<string>login:</string>
<string>logout:</string>
<string>openNewMessageWindow:</string>
<string>sendPost:</string>
<string>showAbout:</string>
<string>showConversation:</string>
<string>showConversationForPostId:andEntity:</string>
<string>showMentions:</string>
<string>showNext:</string>
<string>showProfile:</string>
<string>showProfileForEntity:</string>
<string>showSearch:</string>
<string>showTimeline:</string>
</object>
@ -2875,14 +2867,6 @@
<string key="name">logout:</string>
<string key="candidateClassName">id</string>
</object>
<object class="IBActionInfo">
<string key="name">openNewMessageWindow:</string>
<string key="candidateClassName">id</string>
</object>
<object class="IBActionInfo">
<string key="name">sendPost:</string>
<string key="candidateClassName">id</string>
</object>
<object class="IBActionInfo">
<string key="name">showAbout:</string>
<string key="candidateClassName">id</string>
@ -2891,10 +2875,6 @@
<string key="name">showConversation:</string>
<string key="candidateClassName">id</string>
</object>
<object class="IBActionInfo">
<string key="name">showConversationForPostId:andEntity:</string>
<string key="candidateClassName">NSString</string>
</object>
<object class="IBActionInfo">
<string key="name">showMentions:</string>
<string key="candidateClassName">id</string>
@ -2907,10 +2887,6 @@
<string key="name">showProfile:</string>
<string key="candidateClassName">id</string>
</object>
<object class="IBActionInfo">
<string key="name">showProfileForEntity:</string>
<string key="candidateClassName">NSString</string>
</object>
<object class="IBActionInfo">
<string key="name">showSearch:</string>
<string key="candidateClassName">id</string>

View file

@ -42,7 +42,7 @@
<int key="NSWindowStyleMask">15</int>
<int key="NSWindowBacking">2</int>
<string key="NSWindowRect">{{133, 535}, {299, 113}}</string>
<int key="NSWTFlags">1886913536</int>
<int key="NSWTFlags">813171712</int>
<string key="NSWindowTitle">New Post</string>
<string key="NSWindowClass">NSWindow</string>
<string key="NSViewClass">View</string>

View file

@ -0,0 +1,27 @@
//
// NewConversationWindowController.h
// Bungloo
//
// Created by Jeena on 16/04/2013.
//
//
#import <Cocoa/Cocoa.h>
#import <WebKit/WebKit.h>
#import "ViewDelegate.h"
@interface NewConversationWindowController : NSWindowController {
NSString *postId;
NSString *entity;
IBOutlet WebView *timelineView;
ViewDelegate *viewDelegate;
}
@property (nonatomic, retain) NSString *postId;
@property (nonatomic, retain) NSString *entity;
@property (nonatomic, retain) IBOutlet WebView *timelineView;
@property (nonatomic, retain) ViewDelegate *viewDelegate;
- (id)initWithPostId:(NSString *)postId entity:(NSString *)entity andViewDelegate:(ViewDelegate *)viewDelegate;
@end

View file

@ -0,0 +1,70 @@
//
// NewConversationWindowController.m
// Bungloo
//
// Created by Jeena on 16/04/2013.
//
//
#import "NewConversationWindowController.h"
#import "Controller.h"
@implementation NewConversationWindowController
@synthesize postId, entity, timelineView, viewDelegate;
- (id)initWithWindow:(NSWindow *)window
{
self = [super initWithWindow:window];
if (self) {
// Initialization code here.
}
return self;
}
- (id)initWithPostId:(NSString *)_postId entity:(NSString *)_entity andViewDelegate:(ViewDelegate *)_viewDelegate;
{
self = [super initWithWindowNibName:@"NewConversationWindowController"];
if (self) {
self.postId = _postId;
self.entity = _entity;
self.viewDelegate = _viewDelegate;
}
return self;
}
- (void)windowDidLoad
{
[super windowDidLoad];
// Implement this method to handle any initialization after your window controller's window has been loaded from its nib file.
NSString *index_string;
NSURL *url;
Controller *controller = (Controller *)[[NSApplication sharedApplication] delegate];
[controller stringFromFile: @"index.html" url: &url content: &index_string];
[self.viewDelegate.conversationViews addObject:timelineView];
[[timelineView mainFrame] loadHTMLString:index_string baseURL:url];
[timelineView setFrameLoadDelegate:viewDelegate];
[timelineView setPolicyDelegate:viewDelegate];
[timelineView setUIDelegate:viewDelegate];
[[timelineView windowScriptObject] setValue:controller forKey:@"controller"];
[[timelineView windowScriptObject] setValue:self forKey:@"conversationViewController"];
}
+ (BOOL)isSelectorExcludedFromWebScript:(SEL)aSelector
{
return NO;
}
+ (BOOL)isKeyExcludedFromWebScript:(const char *)name
{
return NO;
}
@end

View file

@ -0,0 +1,327 @@
<?xml version="1.0" encoding="UTF-8"?>
<archive type="com.apple.InterfaceBuilder3.Cocoa.XIB" version="8.00">
<data>
<int key="IBDocument.SystemTarget">1080</int>
<string key="IBDocument.SystemVersion">12D78</string>
<string key="IBDocument.InterfaceBuilderVersion">3084</string>
<string key="IBDocument.AppKitVersion">1187.37</string>
<string key="IBDocument.HIToolboxVersion">626.00</string>
<dictionary class="NSMutableDictionary" key="IBDocument.PluginVersions">
<string key="com.apple.InterfaceBuilder.CocoaPlugin">3084</string>
<string key="com.apple.WebKitIBPlugin">2053</string>
</dictionary>
<array key="IBDocument.IntegratedClassDependencies">
<string>IBNSLayoutConstraint</string>
<string>NSCustomObject</string>
<string>NSView</string>
<string>NSWindowTemplate</string>
<string>WebView</string>
</array>
<array key="IBDocument.PluginDependencies">
<string>com.apple.InterfaceBuilder.CocoaPlugin</string>
<string>com.apple.WebKitIBPlugin</string>
</array>
<object class="NSMutableDictionary" key="IBDocument.Metadata">
<string key="NS.key.0">PluginDependencyRecalculationVersion</string>
<integer value="1" key="NS.object.0"/>
</object>
<array class="NSMutableArray" key="IBDocument.RootObjects" id="1000">
<object class="NSCustomObject" id="1001">
<string key="NSClassName">NewConversationWindowController</string>
</object>
<object class="NSCustomObject" id="1003">
<string key="NSClassName">FirstResponder</string>
</object>
<object class="NSCustomObject" id="1004">
<string key="NSClassName">NSApplication</string>
</object>
<object class="NSWindowTemplate" id="278727222">
<int key="NSWindowStyleMask">15</int>
<int key="NSWindowBacking">2</int>
<string key="NSWindowRect">{{712, 280}, {397, 581}}</string>
<int key="NSWTFlags">880280576</int>
<string key="NSWindowTitle">Conversation</string>
<string key="NSWindowClass">NSWindow</string>
<nil key="NSViewClass"/>
<nil key="NSUserInterfaceItemIdentifier"/>
<object class="NSView" key="NSWindowView" id="819837490">
<reference key="NSNextResponder"/>
<int key="NSvFlags">256</int>
<array class="NSMutableArray" key="NSSubviews">
<object class="WebView" id="1009273855">
<reference key="NSNextResponder" ref="819837490"/>
<int key="NSvFlags">274</int>
<set class="NSMutableSet" key="NSDragTypes">
<string>Apple HTML pasteboard type</string>
<string>Apple PDF pasteboard type</string>
<string>Apple PICT pasteboard type</string>
<string>Apple URL pasteboard type</string>
<string>Apple Web Archive pasteboard type</string>
<string>NSColor pasteboard type</string>
<string>NSFilenamesPboardType</string>
<string>NSStringPboardType</string>
<string>NeXT RTFD pasteboard type</string>
<string>NeXT Rich Text Format v1.0 pasteboard type</string>
<string>NeXT TIFF v4.0 pasteboard type</string>
<string>WebURLsWithTitlesPboardType</string>
<string>public.png</string>
<string>public.url</string>
<string>public.url-name</string>
</set>
<string key="NSFrameSize">{397, 581}</string>
<reference key="NSSuperview" ref="819837490"/>
<reference key="NSWindow"/>
<reference key="NSNextKeyView"/>
<string key="FrameName"/>
<string key="GroupName"/>
<object class="WebPreferences" key="Preferences">
<string key="Identifier">13</string>
<dictionary class="NSMutableDictionary" key="Values">
<boolean value="NO" key="13WebKitAllowAnimatedImageLoopingPreferenceKey"/>
<boolean value="NO" key="13WebKitJavaEnabled"/>
<boolean value="NO" key="13WebKitJavaScriptCanOpenWindowsAutomatically"/>
<boolean value="NO" key="13WebKitPluginsEnabled"/>
</dictionary>
</object>
<bool key="UseBackForwardList">NO</bool>
<bool key="AllowsUndo">YES</bool>
</object>
</array>
<string key="NSFrameSize">{397, 581}</string>
<reference key="NSSuperview"/>
<reference key="NSWindow"/>
<reference key="NSNextKeyView" ref="1009273855"/>
</object>
<string key="NSScreenRect">{{0, 0}, {2560, 1418}}</string>
<string key="NSMaxSize">{10000000000000, 10000000000000}</string>
<string key="NSFrameAutosaveName">conversationWindow</string>
<bool key="NSWindowIsRestorable">YES</bool>
</object>
</array>
<object class="IBObjectContainer" key="IBDocument.Objects">
<array class="NSMutableArray" key="connectionRecords">
<object class="IBConnectionRecord">
<object class="IBOutletConnection" key="connection">
<string key="label">window</string>
<reference key="source" ref="1001"/>
<reference key="destination" ref="278727222"/>
</object>
<int key="connectionID">12</int>
</object>
<object class="IBConnectionRecord">
<object class="IBOutletConnection" key="connection">
<string key="label">timelineView</string>
<reference key="source" ref="1001"/>
<reference key="destination" ref="1009273855"/>
</object>
<int key="connectionID">15</int>
</object>
<object class="IBConnectionRecord">
<object class="IBOutletConnection" key="connection">
<string key="label">delegate</string>
<reference key="source" ref="278727222"/>
<reference key="destination" ref="1001"/>
</object>
<int key="connectionID">13</int>
</object>
</array>
<object class="IBMutableOrderedSet" key="objectRecords">
<array key="orderedObjects">
<object class="IBObjectRecord">
<int key="objectID">0</int>
<array key="object" id="0"/>
<reference key="children" ref="1000"/>
<nil key="parent"/>
</object>
<object class="IBObjectRecord">
<int key="objectID">-2</int>
<reference key="object" ref="1001"/>
<reference key="parent" ref="0"/>
<string key="objectName">File's Owner</string>
</object>
<object class="IBObjectRecord">
<int key="objectID">-1</int>
<reference key="object" ref="1003"/>
<reference key="parent" ref="0"/>
<string key="objectName">First Responder</string>
</object>
<object class="IBObjectRecord">
<int key="objectID">-3</int>
<reference key="object" ref="1004"/>
<reference key="parent" ref="0"/>
<string key="objectName">Application</string>
</object>
<object class="IBObjectRecord">
<int key="objectID">5</int>
<reference key="object" ref="278727222"/>
<array class="NSMutableArray" key="children">
<reference ref="819837490"/>
</array>
<reference key="parent" ref="0"/>
<string key="objectName">Timeline</string>
</object>
<object class="IBObjectRecord">
<int key="objectID">6</int>
<reference key="object" ref="819837490"/>
<array class="NSMutableArray" key="children">
<reference ref="1009273855"/>
<object class="IBNSLayoutConstraint" id="254325848">
<reference key="firstItem" ref="1009273855"/>
<int key="firstAttribute">4</int>
<int key="relation">0</int>
<reference key="secondItem" ref="819837490"/>
<int key="secondAttribute">4</int>
<float key="multiplier">1</float>
<object class="IBLayoutConstant" key="constant">
<double key="value">0.0</double>
</object>
<float key="priority">1000</float>
<reference key="containingView" ref="819837490"/>
<int key="scoringType">8</int>
<float key="scoringTypeFloat">29</float>
<int key="contentType">3</int>
</object>
<object class="IBNSLayoutConstraint" id="1072031682">
<reference key="firstItem" ref="1009273855"/>
<int key="firstAttribute">5</int>
<int key="relation">0</int>
<reference key="secondItem" ref="819837490"/>
<int key="secondAttribute">5</int>
<float key="multiplier">1</float>
<object class="IBLayoutConstant" key="constant">
<double key="value">0.0</double>
</object>
<float key="priority">1000</float>
<reference key="containingView" ref="819837490"/>
<int key="scoringType">8</int>
<float key="scoringTypeFloat">29</float>
<int key="contentType">3</int>
</object>
<object class="IBNSLayoutConstraint" id="198962998">
<reference key="firstItem" ref="1009273855"/>
<int key="firstAttribute">6</int>
<int key="relation">0</int>
<reference key="secondItem" ref="819837490"/>
<int key="secondAttribute">6</int>
<float key="multiplier">1</float>
<object class="IBLayoutConstant" key="constant">
<double key="value">0.0</double>
</object>
<float key="priority">1000</float>
<reference key="containingView" ref="819837490"/>
<int key="scoringType">8</int>
<float key="scoringTypeFloat">29</float>
<int key="contentType">3</int>
</object>
<object class="IBNSLayoutConstraint" id="978633656">
<reference key="firstItem" ref="1009273855"/>
<int key="firstAttribute">3</int>
<int key="relation">0</int>
<reference key="secondItem" ref="819837490"/>
<int key="secondAttribute">3</int>
<float key="multiplier">1</float>
<object class="IBLayoutConstant" key="constant">
<double key="value">0.0</double>
</object>
<float key="priority">1000</float>
<reference key="containingView" ref="819837490"/>
<int key="scoringType">8</int>
<float key="scoringTypeFloat">29</float>
<int key="contentType">3</int>
</object>
</array>
<reference key="parent" ref="278727222"/>
</object>
<object class="IBObjectRecord">
<int key="objectID">7</int>
<reference key="object" ref="1009273855"/>
<reference key="parent" ref="819837490"/>
<string key="objectName">timeline</string>
</object>
<object class="IBObjectRecord">
<int key="objectID">8</int>
<reference key="object" ref="978633656"/>
<reference key="parent" ref="819837490"/>
</object>
<object class="IBObjectRecord">
<int key="objectID">9</int>
<reference key="object" ref="198962998"/>
<reference key="parent" ref="819837490"/>
</object>
<object class="IBObjectRecord">
<int key="objectID">10</int>
<reference key="object" ref="1072031682"/>
<reference key="parent" ref="819837490"/>
</object>
<object class="IBObjectRecord">
<int key="objectID">11</int>
<reference key="object" ref="254325848"/>
<reference key="parent" ref="819837490"/>
</object>
</array>
</object>
<dictionary class="NSMutableDictionary" key="flattenedProperties">
<string key="-1.IBPluginDependency">com.apple.InterfaceBuilder.CocoaPlugin</string>
<string key="-2.IBPluginDependency">com.apple.InterfaceBuilder.CocoaPlugin</string>
<string key="-3.IBPluginDependency">com.apple.InterfaceBuilder.CocoaPlugin</string>
<string key="10.IBPluginDependency">com.apple.InterfaceBuilder.CocoaPlugin</string>
<string key="11.IBPluginDependency">com.apple.InterfaceBuilder.CocoaPlugin</string>
<string key="5.IBPluginDependency">com.apple.InterfaceBuilder.CocoaPlugin</string>
<string key="5.IBWindowTemplateEditedContentRect">{{202, 175}, {397, 581}}</string>
<boolean value="NO" key="5.NSWindowTemplate.visibleAtLaunch"/>
<array key="6.IBNSViewMetadataConstraints">
<reference ref="978633656"/>
<reference ref="198962998"/>
<reference ref="1072031682"/>
<reference ref="254325848"/>
</array>
<string key="6.IBPluginDependency">com.apple.InterfaceBuilder.CocoaPlugin</string>
<boolean value="NO" key="7.IBNSViewMetadataTranslatesAutoresizingMaskIntoConstraints"/>
<string key="7.IBPluginDependency">com.apple.WebKitIBPlugin</string>
<string key="8.IBPluginDependency">com.apple.InterfaceBuilder.CocoaPlugin</string>
<string key="9.IBPluginDependency">com.apple.InterfaceBuilder.CocoaPlugin</string>
</dictionary>
<dictionary class="NSMutableDictionary" key="unlocalizedProperties"/>
<nil key="activeLocalization"/>
<dictionary class="NSMutableDictionary" key="localizations"/>
<nil key="sourceID"/>
<int key="maxID">15</int>
</object>
<object class="IBClassDescriber" key="IBDocument.Classes">
<array class="NSMutableArray" key="referencedPartialClassDescriptions">
<object class="IBPartialClassDescription">
<string key="className">NSLayoutConstraint</string>
<string key="superclassName">NSObject</string>
<object class="IBClassDescriptionSource" key="sourceIdentifier">
<string key="majorKey">IBProjectSource</string>
<string key="minorKey">./Classes/NSLayoutConstraint.h</string>
</object>
</object>
<object class="IBPartialClassDescription">
<string key="className">NewConversationWindowController</string>
<string key="superclassName">NSWindowController</string>
<object class="NSMutableDictionary" key="outlets">
<string key="NS.key.0">timelineView</string>
<string key="NS.object.0">WebView</string>
</object>
<object class="NSMutableDictionary" key="toOneOutletInfosByName">
<string key="NS.key.0">timelineView</string>
<object class="IBToOneOutletInfo" key="NS.object.0">
<string key="name">timelineView</string>
<string key="candidateClassName">WebView</string>
</object>
</object>
<object class="IBClassDescriptionSource" key="sourceIdentifier">
<string key="majorKey">IBProjectSource</string>
<string key="minorKey">./Classes/NewConversationWindowController.h</string>
</object>
</object>
</array>
</object>
<int key="IBDocument.localizationMode">0</int>
<string key="IBDocument.TargetRuntimeIdentifier">IBCocoaFramework</string>
<bool key="IBDocument.PluginDeclaredDependenciesTrackSystemTargetVersion">YES</bool>
<int key="IBDocument.defaultPropertyAccessControl">3</int>
<bool key="IBDocument.UseAutolayout">YES</bool>
</data>
</archive>

View file

@ -11,9 +11,12 @@
#import "Constants.h"
@interface ViewDelegate : NSObject {
WebView *timelineView; WebView *oauthView;
WebView *timelineView;
WebView *oauthView;
NSMutableArray *conversationViews;
}
@property (nonatomic, assign) WebView *timelineView;@property (nonatomic, assign) WebView *oauthView;
@property (nonatomic, assign) WebView *timelineView;
@property (nonatomic, assign) WebView *oauthView;
@property (nonatomic, assign) NSMutableArray *conversationViews;
@end

View file

@ -11,7 +11,16 @@
@implementation ViewDelegate
@synthesize timelineView, oauthView;
@synthesize timelineView, oauthView, conversationViews;
- (id)init
{
self = [super init];
if (self) {
self.conversationViews = [[NSMutableArray alloc] init];
}
return self;
}
- (void)webView:(WebView *)sender addMessageToConsole:(NSDictionary *)message {
@ -19,6 +28,7 @@
NSString *viewName = @"TimelineView";
if (sender == oauthView) viewName = @"OauthView";
else if(sender != timelineView) viewName = @"ConversationView";
NSLog(@"js<%@>: %@:%@: %@",
viewName,
@ -31,6 +41,7 @@
- (void)webView:(WebView *)sender runJavaScriptAlertPanelWithMessage:(NSString *)message initiatedByFrame:(WebFrame *)frame {
NSString *viewName = @"TimelineView";
if (sender == oauthView) viewName = @"OauthView";
else if (sender != timelineView) viewName = @"ConversationView";
NSLog(@"jsa<%@>: %@", viewName, message);
}
@ -75,11 +86,15 @@
}
[sender stringByEvaluatingJavaScriptFromString:@"var OS_TYPE = 'mac';"];
if (sender == oauthView) {
[oauthView stringByEvaluatingJavaScriptFromString:@"function HostAppGo() { start('oauth') }"];
} else if([conversationViews containsObject:sender]) {
[sender stringByEvaluatingJavaScriptFromString:@"function HostAppGo() { start('conversation-standalone', function() { bungloo.conversation.showStatusFromController(); }) }"];
} else {
[sender stringByEvaluatingJavaScriptFromString:@"function HostAppGo() { start('timeline') }"];

View file

@ -50,6 +50,11 @@ function(HostApp, Core, Paths, URI) {
this.append(id, entity);
}
// Hack for OS X
Conversation.prototype.showStatusFromController = function() {
this.showStatus(conversationViewController.postId, conversationViewController.entity);
}
Conversation.prototype.append = function(id, entity, node, add_after) {
var _this = this;

View file

@ -14,6 +14,8 @@ function(HostApp, Core, Paths, URI) {
this.action = "profile";
this.posts_limit = 25;
this.container = document.createElement("div");
this.container.className = this.action;
document.getElementById("content").appendChild(this.container);
@ -390,7 +392,7 @@ function(HostApp, Core, Paths, URI) {
add_search = add_search || {};
var url = URI(root_url + "/posts");
url.addSearch("limit", 20);
url.addSearch("limit", this.posts_limit);
var post_types = [
"https://tent.io/types/post/repost/v0.1.0",

View file

@ -14,7 +14,8 @@ function(Core, Paths, HostApp, URI) {
this.action = "timeline";
this.reload_blocked = false;
this.max_length = 25;
this.posts_limit = 25;
this.max_length = 200;
this.timeout = 10 * 1000; // every 10 seconds
this.since_id = null;
this.since_id_entity = null;
@ -109,7 +110,7 @@ function(Core, Paths, HostApp, URI) {
];
url.addSearch("post_types", post_types.join(","));
//url.addSearch("sort_by", "published_at");
url.addSearch("limit", this.max_length);
url.addSearch("limit", this.posts_limit);
if(this.since_id && !append) {
url.addSearch("since_id", this.since_id);