delete spaces and tabs on line ends
This commit is contained in:
parent
f7240ea2e5
commit
8d89461be7
28 changed files with 222 additions and 222 deletions
|
@ -19,7 +19,7 @@
|
|||
d = [NSUserDefaults standardUserDefaults];
|
||||
//[d removeObjectForKey:@"user_access_token"];
|
||||
}
|
||||
|
||||
|
||||
return self;
|
||||
}
|
||||
|
||||
|
@ -50,7 +50,7 @@
|
|||
char *_password = nil;
|
||||
SecKeychainItemRef item = nil;
|
||||
SecKeychainFindGenericPassword(NULL, 6, "Bungloo", 17, "BunglooUserAccount", &_passwordLength, (void **)&_password, &item);
|
||||
|
||||
|
||||
OSStatus status;
|
||||
void * passwordData = (void*)[_secret cStringUsingEncoding:NSUTF8StringEncoding];
|
||||
UInt32 passwordLength = strlen((char*)passwordData);
|
||||
|
@ -85,11 +85,11 @@
|
|||
char *password = nil;
|
||||
SecKeychainItemRef item = nil;
|
||||
SecKeychainFindGenericPassword(NULL, 6, "Bungloo", 17, "BunglooUserAccount", &passwordLength, (void **)&password, &item);
|
||||
|
||||
|
||||
if (!item) {
|
||||
return nil;
|
||||
}
|
||||
|
||||
|
||||
//Get password
|
||||
NSString *passwordString = [[[NSString alloc] initWithData:[NSData dataWithBytes:password length:passwordLength] encoding:NSUTF8StringEncoding] autorelease];
|
||||
SecKeychainItemFreeContent(NULL, password);
|
||||
|
|
|
@ -213,7 +213,7 @@
|
|||
string = nil;
|
||||
break;
|
||||
}
|
||||
|
||||
|
||||
return string;
|
||||
}
|
||||
|
||||
|
|
102
Mac/Controller.m
102
Mac/Controller.m
|
@ -26,48 +26,48 @@
|
|||
{
|
||||
[timelineViewWindow setExcludedFromWindowsMenu:YES];
|
||||
[mentionsViewWindow setExcludedFromWindowsMenu:YES];
|
||||
|
||||
|
||||
[self initHotKeys];
|
||||
|
||||
|
||||
[GrowlApplicationBridge setGrowlDelegate:self];
|
||||
|
||||
|
||||
NSNotificationCenter *nc = [NSNotificationCenter defaultCenter];
|
||||
[nc addObserver:self
|
||||
selector:@selector(openNewMessageWindow:)
|
||||
[nc addObserver:self
|
||||
selector:@selector(openNewMessageWindow:)
|
||||
name:@"openNewMessageWindow"
|
||||
object:nil];
|
||||
[nc addObserver:self
|
||||
selector:@selector(sendTweet:)
|
||||
[nc addObserver:self
|
||||
selector:@selector(sendTweet:)
|
||||
name:@"sendTweet"
|
||||
object:nil];
|
||||
[nc addObserver:self
|
||||
selector:@selector(authentificationSucceded:)
|
||||
[nc addObserver:self
|
||||
selector:@selector(authentificationSucceded:)
|
||||
name:@"authentificationSucceded"
|
||||
object:nil];
|
||||
[nc addObserver:self
|
||||
selector:@selector(getTweetUpdates:)
|
||||
[nc addObserver:self
|
||||
selector:@selector(getTweetUpdates:)
|
||||
name:@"getTweetUpdates"
|
||||
object:nil];
|
||||
|
||||
|
||||
NSAppleEventManager *appleEventManager = [NSAppleEventManager sharedAppleEventManager];
|
||||
[appleEventManager setEventHandler:self
|
||||
andSelector:@selector(handleGetURLEvent:withReplyEvent:)
|
||||
forEventClass:kInternetEventClass
|
||||
andEventID:kAEGetURL];
|
||||
|
||||
|
||||
|
||||
viewDelegate = [[ViewDelegate alloc] init];
|
||||
accessToken = [[AccessToken alloc] init];
|
||||
|
||||
|
||||
BOOL forceLogin = NO;
|
||||
/*
|
||||
if (![accessToken stringForKey:@"version-0.6.0-new-login"]) {
|
||||
[self logout:self];
|
||||
forceLogin = YES;
|
||||
[accessToken setString:nil forKey:@"entity"];
|
||||
[accessToken setString:nil forKey:@"entity"];
|
||||
[accessToken setString:@"yes" forKey:@"version-0.6.0-new-login"];
|
||||
}*/
|
||||
|
||||
|
||||
if (forceLogin || ![accessToken stringForKey:@"user_access_token"] || ![accessToken secret]) {
|
||||
[timelineViewWindow performClose:self];
|
||||
[mentionsViewWindow performClose:self];
|
||||
|
@ -89,7 +89,7 @@
|
|||
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];
|
||||
|
||||
|
||||
oauthView = [[WebView alloc] init];
|
||||
viewDelegate.oauthView = oauthView;
|
||||
[[oauthView mainFrame] loadHTMLString:index_string baseURL:url];
|
||||
|
@ -107,11 +107,11 @@
|
|||
if (viewDelegate.timelineView != timelineView)
|
||||
{
|
||||
[self initOauth];
|
||||
|
||||
|
||||
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];
|
||||
|
||||
|
||||
viewDelegate.timelineView = timelineView;
|
||||
[[timelineView mainFrame] loadHTMLString:index_string baseURL:url];
|
||||
[timelineView setFrameLoadDelegate:viewDelegate];
|
||||
|
@ -121,7 +121,7 @@
|
|||
//WebPreferences* prefs = [timelineView preferences];
|
||||
//[prefs _setLocalStorageDatabasePath:localStoragePath];
|
||||
//[prefs setLocalStorageEnabled:YES];
|
||||
|
||||
|
||||
viewDelegate.mentionsView = mentionsView;
|
||||
[[mentionsView mainFrame] loadHTMLString:index_string baseURL:url];
|
||||
[mentionsView setFrameLoadDelegate:viewDelegate];
|
||||
|
@ -131,7 +131,7 @@
|
|||
//prefs = [mentionsView preferences];
|
||||
//[prefs _setLocalStorageDatabasePath:localStoragePath];
|
||||
//[prefs setLocalStorageEnabled:YES];
|
||||
|
||||
|
||||
viewDelegate.conversationView = conversationView;
|
||||
[[conversationView mainFrame] loadHTMLString:index_string baseURL:url];
|
||||
[conversationView setFrameLoadDelegate:viewDelegate];
|
||||
|
@ -141,7 +141,7 @@
|
|||
//prefs = [conversationView preferences];
|
||||
//[prefs _setLocalStorageDatabasePath:localStoragePath];
|
||||
//[prefs setLocalStorageEnabled:YES];
|
||||
|
||||
|
||||
viewDelegate.profileView = profileView;
|
||||
[[profileView mainFrame] loadHTMLString:index_string baseURL:url];
|
||||
[profileView setFrameLoadDelegate:viewDelegate];
|
||||
|
@ -166,8 +166,8 @@
|
|||
{
|
||||
|
||||
NSInteger newTweetKey = kVK_ANSI_M; // http://boredzo.org/blog/archives/2007-05-22/virtual-key-codes
|
||||
NSInteger newTweetModifierKey = controlKey + cmdKey + optionKey; // cmdKey 256, shitfKey 512, optionKey 2048, controlKey 4096
|
||||
|
||||
NSInteger newTweetModifierKey = controlKey + cmdKey + optionKey; // cmdKey 256, shitfKey 512, optionKey 2048, controlKey 4096
|
||||
|
||||
NSUserDefaults *defaults = [NSUserDefaults standardUserDefaults];
|
||||
NSInteger defaultsNewTweetKey = (NSInteger)[defaults integerForKey:@"newTweetKey"];
|
||||
|
||||
|
@ -179,7 +179,7 @@
|
|||
{
|
||||
[defaults setInteger:newTweetKey forKey:@"newTweetKey"];
|
||||
}
|
||||
|
||||
|
||||
NSInteger defaultsNewTweetModifierKey = (NSInteger)[defaults integerForKey:@"newTweetModifierKey"];
|
||||
if ([defaults objectForKey:@"newTweetModifierKey"] != nil)
|
||||
{
|
||||
|
@ -189,9 +189,9 @@
|
|||
{
|
||||
[defaults setInteger:newTweetModifierKey forKey:@"newTweetModifierKey"];
|
||||
}
|
||||
|
||||
|
||||
[defaults synchronize];
|
||||
|
||||
|
||||
NSUInteger cocoaModifiers = 0;
|
||||
if (newTweetModifierKey & shiftKey) cocoaModifiers = cocoaModifiers | NSShiftKeyMask;
|
||||
if (newTweetModifierKey & optionKey) cocoaModifiers = cocoaModifiers | NSAlternateKeyMask;
|
||||
|
@ -200,22 +200,22 @@
|
|||
|
||||
[globalHotkeyMenuItem setKeyEquivalent:[Constants stringFromVirtualKeyCode:newTweetKey]];
|
||||
[globalHotkeyMenuItem setKeyEquivalentModifierMask:cocoaModifiers];
|
||||
|
||||
|
||||
/* CARBON from http://github.com/Xjs/drama-button/blob/carbon/Drama_ButtonAppDelegate.m */
|
||||
|
||||
|
||||
EventTypeSpec eventType;
|
||||
eventType.eventClass = kEventClassKeyboard;
|
||||
eventType.eventKind = kEventHotKeyPressed;
|
||||
|
||||
|
||||
InstallApplicationEventHandler(&handler, 1, &eventType, NULL, NULL);
|
||||
|
||||
|
||||
EventHotKeyID g_HotKeyID;
|
||||
g_HotKeyID.id = 1;
|
||||
|
||||
|
||||
EventHotKeyRef g_HotKeyRef;
|
||||
|
||||
|
||||
RegisterEventHotKey(newTweetKey, newTweetModifierKey, g_HotKeyID, GetApplicationEventTarget(), 0, &g_HotKeyRef);
|
||||
|
||||
|
||||
/* end CARBON */
|
||||
}
|
||||
|
||||
|
@ -285,13 +285,13 @@
|
|||
|
||||
- (IBAction)openNewMessageWindow:(id)sender
|
||||
{
|
||||
[NSApp activateIgnoringOtherApps:YES];
|
||||
[[NSDocumentController sharedDocumentController] openUntitledDocumentAndDisplay:YES error:nil];
|
||||
[NSApp activateIgnoringOtherApps:YES];
|
||||
[[NSDocumentController sharedDocumentController] openUntitledDocumentAndDisplay:YES error:nil];
|
||||
}
|
||||
|
||||
- (void)openNewMessageWindowInReplyTo:(NSString *)userName statusId:(NSString *)statusId withString:(NSString *)string isPrivate:(BOOL)isPrivate
|
||||
{
|
||||
[NSApp activateIgnoringOtherApps:YES];
|
||||
[NSApp activateIgnoringOtherApps:YES];
|
||||
NewMessageWindow *newMessage = (NewMessageWindow *)[[NSDocumentController sharedDocumentController] openUntitledDocumentAndDisplay:YES error:nil];
|
||||
[newMessage inReplyTo:userName statusId:statusId withString:string];
|
||||
[newMessage setIsPrivate:isPrivate];
|
||||
|
@ -300,9 +300,9 @@
|
|||
- (void)openNewMessageWindowWithString:(NSString *)aString
|
||||
{
|
||||
[NSApp activateIgnoringOtherApps:YES];
|
||||
|
||||
|
||||
NSRange range = [aString rangeOfString:@"oauthtoken"];
|
||||
|
||||
|
||||
if (range.length > 0)
|
||||
{
|
||||
[oauthView stringByEvaluatingJavaScriptFromString:[NSString stringWithFormat:@"bungloo_instance.requestAccessToken('%@')", aString]];
|
||||
|
@ -310,7 +310,7 @@
|
|||
else
|
||||
{
|
||||
NewMessageWindow *newTweet = (NewMessageWindow *)[[NSDocumentController sharedDocumentController] openUntitledDocumentAndDisplay:YES error:nil];
|
||||
[newTweet withString:aString];
|
||||
[newTweet withString:aString];
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -325,12 +325,12 @@
|
|||
PostModel *post = (PostModel *)[sender object];
|
||||
NSString *text = [[post.text stringByReplacingOccurrencesOfString:@"\\" withString:@"\\\\"] stringByReplacingOccurrencesOfString:@"\"" withString:@"\\\""];
|
||||
text = [text stringByReplacingOccurrencesOfString:@"\n" withString:@"\\n"];
|
||||
|
||||
|
||||
NSString *locationObject = @"null";
|
||||
if (post.location) {
|
||||
locationObject = [NSString stringWithFormat:@"[%f, %f]", post.location.coordinate.latitude, post.location.coordinate.longitude];
|
||||
}
|
||||
|
||||
|
||||
NSString *imageFilePath = @"null";
|
||||
if (post.imageFilePath) {
|
||||
NSError *error;
|
||||
|
@ -340,12 +340,12 @@
|
|||
[data release];
|
||||
imageFilePath = [NSString stringWithFormat:@"\"data:%@;base64,%@\"", mimeType, base64];
|
||||
}
|
||||
|
||||
|
||||
NSString *isPrivate = @"false";
|
||||
if (post.isPrivate) {
|
||||
isPrivate = @"true";
|
||||
}
|
||||
|
||||
|
||||
NSString *func = [NSString stringWithFormat:@"bungloo_instance.sendNewMessage(\"%@\", \"%@\", \"%@\", %@, %@, %@)",
|
||||
text,
|
||||
post.inReplyTostatusId,
|
||||
|
@ -361,7 +361,7 @@
|
|||
{
|
||||
NSFileManager *fileManager = [NSFileManager defaultManager];
|
||||
NSString *pathToPlugin = [@"~/Library/Application Support/Bungloo/Plugin.js" stringByExpandingTildeInPath];
|
||||
|
||||
|
||||
if([fileManager fileExistsAtPath:pathToPlugin])
|
||||
{
|
||||
return [NSString stringWithFormat:@"%@", [NSURL fileURLWithPath:pathToPlugin]];
|
||||
|
@ -432,7 +432,7 @@
|
|||
self.accessToken.userId = userId;
|
||||
self.accessToken.screenName = screenName;
|
||||
[timelineViewWindow makeKeyAndOrderFront:self];
|
||||
|
||||
|
||||
[[NSNotificationCenter defaultCenter] postNotificationName:@"authentificationSucceded" object:nil];
|
||||
}*/
|
||||
|
||||
|
@ -456,13 +456,13 @@
|
|||
- (IBAction)logout:(id)sender
|
||||
{
|
||||
[oauthView stringByEvaluatingJavaScriptFromString:@"bungloo_instance.logout();"];
|
||||
|
||||
|
||||
[timelineViewWindow performClose:self];
|
||||
[mentionsViewWindow performClose:self];
|
||||
[conversationViewWindow performClose:self];
|
||||
[profileViewWindow performClose:self];
|
||||
[self.loginViewWindow makeKeyAndOrderFront:self];
|
||||
|
||||
|
||||
[timelineView stringByEvaluatingJavaScriptFromString:@"bungloo_instance.logout();"];
|
||||
[mentionsView stringByEvaluatingJavaScriptFromString:@"bungloo_instance.logout();"];
|
||||
}
|
||||
|
@ -474,7 +474,7 @@
|
|||
{
|
||||
//[self unreadMentions:0];
|
||||
[mentionsView stringByEvaluatingJavaScriptFromString:@"bungloo_instance.setAllMentionsRead();"];
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
- (void)getTweetUpdates:(id)sender
|
||||
|
@ -508,9 +508,9 @@
|
|||
NSDictionary *userInfo = (NSDictionary *)clickContext;
|
||||
NSString *postId = [userInfo objectForKey:@"postId"];
|
||||
NSString *entity = [userInfo objectForKey:@"entity"];
|
||||
|
||||
|
||||
[self showConversationForPostId:postId andEntity:entity];
|
||||
|
||||
|
||||
NSString *js = [NSString stringWithFormat:@"bungloo_instance.mentionRead('%@', '%@');", postId, entity];
|
||||
[mentionsView stringByEvaluatingJavaScriptFromString:js];
|
||||
}
|
||||
|
|
|
@ -390,8 +390,8 @@
|
|||
/*! @brief Tries to fill in missing keys in a notification dictionary.
|
||||
* @param notifDict The dictionary to fill in.
|
||||
* @return The dictionary with the keys filled in. This will be a separate instance from \a notifDict.
|
||||
* @discussion This function examines the \a notifDict for missing keys, and
|
||||
* tries to get them from the last known registration dictionary. As of 1.1,
|
||||
* @discussion This function examines the \a notifDict for missing keys, and
|
||||
* tries to get them from the last known registration dictionary. As of 1.1,
|
||||
* the keys that it will look for are:
|
||||
*
|
||||
* \li <code>GROWL_APP_NAME</code>
|
||||
|
@ -410,8 +410,8 @@
|
|||
*@abstract Lets the app know whether growl:// is registered on the system, used for certain methods below this
|
||||
*@return Returns whether growl:// is registered on the system
|
||||
*@discussion Methods such as openGrowlPreferences rely on the growl:// URL scheme to function
|
||||
* Further, this method can provide a check on whether Growl is installed,
|
||||
* however, the framework will not be relying on this method for choosing when/how to notify,
|
||||
* Further, this method can provide a check on whether Growl is installed,
|
||||
* however, the framework will not be relying on this method for choosing when/how to notify,
|
||||
* and it is not recommended that the app rely on it for other than whether to use growl:// methods
|
||||
*@since Growl.framework 1.4
|
||||
*/
|
||||
|
@ -421,7 +421,7 @@
|
|||
* @method openGrowlPreferences:
|
||||
* @abstract Open Growl preferences, optionally to this app's settings, growl:// method
|
||||
* @param showApp Whether to show the application's settings, otherwise just opens to the last position
|
||||
* @return Return's whether opening the URL was succesfull or not.
|
||||
* @return Return's whether opening the URL was succesfull or not.
|
||||
* @discussion Will launch if Growl is installed, but not running, and open the preferences window
|
||||
* Uses growl:// URL scheme
|
||||
* @since Growl.framework 1.4
|
||||
|
|
|
@ -12,15 +12,15 @@
|
|||
|
||||
+(NSString *)mimeTypeForFileAtPath:(NSString *)path error:(NSError **)err {
|
||||
NSString *uti, *mimeType = nil;
|
||||
|
||||
|
||||
if (!(uti = [[NSWorkspace sharedWorkspace] typeOfFile:path error:err]))
|
||||
return nil;
|
||||
if (err)
|
||||
*err = nil;
|
||||
|
||||
|
||||
if ((mimeType = (NSString *)UTTypeCopyPreferredTagWithClass((CFStringRef)uti, kUTTagClassMIMEType)))
|
||||
mimeType = NSMakeCollectable(mimeType);
|
||||
|
||||
|
||||
return mimeType;
|
||||
}
|
||||
|
||||
|
|
|
@ -15,7 +15,7 @@
|
|||
{
|
||||
if ([base64Encoding length] % 4 != 0)
|
||||
return nil;
|
||||
|
||||
|
||||
NSString *plist = [NSString stringWithFormat:@"<?xml version=\"1.0\" encoding=\"UTF-8\"?><plist version=\"1.0\"><data>%@</data></plist>", base64Encoding];
|
||||
return [NSPropertyListSerialization propertyListWithData:[plist dataUsingEncoding:NSASCIIStringEncoding] options:0 format:NULL error:NULL];
|
||||
}
|
||||
|
@ -28,14 +28,14 @@
|
|||
NSRange endRange = [plist rangeOfData:[@"</data>" dataUsingEncoding:NSASCIIStringEncoding] options:NSDataSearchBackwards range:fullRange];
|
||||
if (startRange.location == NSNotFound || endRange.location == NSNotFound)
|
||||
return nil;
|
||||
|
||||
|
||||
NSUInteger base64Location = startRange.location + startRange.length;
|
||||
NSUInteger base64length = endRange.location - base64Location;
|
||||
NSData *base64Data = [NSData dataWithBytesNoCopy:(void *)((uintptr_t)base64Location + (uintptr_t)[plist bytes]) length:base64length freeWhenDone:NO];
|
||||
NSString *base64Encoding = [[NSString alloc] initWithData:base64Data encoding:NSASCIIStringEncoding];
|
||||
base64Encoding = [base64Encoding stringByTrimmingCharactersInSet:[NSCharacterSet whitespaceAndNewlineCharacterSet]];
|
||||
base64Encoding = [base64Encoding stringByReplacingOccurrencesOfString:@"\n" withString:@""];
|
||||
|
||||
|
||||
#if __has_feature(objc_arc)
|
||||
return base64Encoding;
|
||||
#else
|
||||
|
|
|
@ -88,10 +88,10 @@
|
|||
{
|
||||
// Insert code here to read your document from the given data of the specified type. If the given outError != NULL, ensure that you set *outError when returning NO.
|
||||
|
||||
// You can also choose to override -readFromFileWrapper:ofType:error: or -readFromURL:ofType:error: instead.
|
||||
|
||||
// You can also choose to override -readFromFileWrapper:ofType:error: or -readFromURL:ofType:error: instead.
|
||||
|
||||
// For applications targeted for Panther or earlier systems, you should use the deprecated API -loadDataRepresentation:ofType. In this case you can also choose to override -readFromFile:ofType: or -loadFileWrapperRepresentation:ofType: instead.
|
||||
|
||||
|
||||
if ( outError != NULL )
|
||||
{
|
||||
*outError = [NSError errorWithDomain:NSOSStatusErrorDomain code:unimpErr userInfo:NULL];
|
||||
|
@ -102,25 +102,25 @@
|
|||
- (void)inReplyTo:(NSString *)entity statusId:(NSString *)statusId withString:(NSString *)string
|
||||
{
|
||||
[textField setStringValue:string];
|
||||
|
||||
|
||||
NSInteger location = [string rangeOfString:@" "].location;
|
||||
NSInteger length = 0;
|
||||
if (location != NSNotFound) {
|
||||
length = [[textField stringValue] length] - location - 1;
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
NSRange range = {location + 1, length};
|
||||
[[textField currentEditor] setSelectedRange:range];
|
||||
|
||||
|
||||
[inReplyTostatusId release];
|
||||
inReplyTostatusId = statusId;
|
||||
[inReplyTostatusId retain];
|
||||
|
||||
|
||||
[inReplyToEntity release];
|
||||
inReplyToEntity = entity;
|
||||
[inReplyToEntity retain];
|
||||
|
||||
|
||||
[self controlTextDidChange:nil];
|
||||
}
|
||||
|
||||
|
@ -130,7 +130,7 @@
|
|||
NSRange range = {[[textField stringValue] length] , 0};
|
||||
[[textField currentEditor] setSelectedRange:range];
|
||||
NSLog(@"BB");
|
||||
|
||||
|
||||
[self controlTextDidChange:nil];
|
||||
}
|
||||
|
||||
|
@ -155,7 +155,7 @@
|
|||
{
|
||||
NSRect frame = [(NSButton *)sender frame];
|
||||
NSPoint menuOrigin = [[(NSButton *)sender superview] convertPoint:NSMakePoint(frame.origin.x, frame.origin.y+frame.size.height) toView:nil];
|
||||
|
||||
|
||||
NSEvent *event = [NSEvent mouseEventWithType:NSLeftMouseDown
|
||||
location:menuOrigin
|
||||
modifierFlags:NSLeftMouseDownMask // 0x100
|
||||
|
@ -165,7 +165,7 @@
|
|||
eventNumber:0
|
||||
clickCount:1
|
||||
pressure:1];
|
||||
|
||||
|
||||
[NSMenu popUpContextMenu:self.addMenu withEvent:event forView:self.addMenuButton];
|
||||
}
|
||||
|
||||
|
@ -190,7 +190,7 @@
|
|||
if(c < 0) {
|
||||
[counter setTextColor:[NSColor redColor]];
|
||||
} else {
|
||||
[counter setTextColor:[NSColor controlTextColor]];
|
||||
[counter setTextColor:[NSColor controlTextColor]];
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -212,7 +212,7 @@
|
|||
|
||||
- (void)locationManager:(CLLocationManager *)manager didFailWithError:(NSError *)error{
|
||||
NSLog(@"CLLocationManager Error: %@", error);
|
||||
|
||||
|
||||
NSMenuItem *menuItem = [self.addMenu itemAtIndex:0];
|
||||
[menuItem setTitle:@"Current location not available"];
|
||||
}
|
||||
|
@ -252,17 +252,17 @@
|
|||
- (BOOL)control:(NSControl *)control textView:(NSTextView *)fieldEditor doCommandBySelector:(SEL)commandSelector
|
||||
{
|
||||
BOOL retval = NO;
|
||||
|
||||
|
||||
BOOL isEnter = [[NSApp currentEvent] keyCode] == 76;
|
||||
|
||||
|
||||
if (commandSelector == @selector(insertNewline:) && !isEnter) {
|
||||
|
||||
|
||||
NSText *text = [[textField window] fieldEditor:YES forObject:nil];
|
||||
|
||||
|
||||
NSRange range = [text selectedRange];
|
||||
NSString *stringBefore = [textField.stringValue substringToIndex:range.location];
|
||||
NSString *stringAfter = [textField.stringValue substringFromIndex:range.location + range.length];
|
||||
|
||||
|
||||
textField.stringValue = [NSString stringWithFormat:@"%@\n%@", stringBefore, stringAfter];
|
||||
|
||||
NSRange r = NSMakeRange(range.location + 1, 0);
|
||||
|
@ -275,7 +275,7 @@
|
|||
retval = YES;
|
||||
[self sendPost:control];
|
||||
}
|
||||
|
||||
|
||||
return retval;
|
||||
}
|
||||
|
||||
|
@ -288,17 +288,17 @@
|
|||
if (!self.imageFilePath)
|
||||
{
|
||||
[menuItem setTitle:@"Remove photo"];
|
||||
|
||||
|
||||
NSOpenPanel* openDlg = [NSOpenPanel openPanel];
|
||||
[openDlg setPrompt:@"Select"];
|
||||
[openDlg setDelegate:self];
|
||||
|
||||
|
||||
// Enable the selection of files in the dialog.
|
||||
[openDlg setCanChooseFiles:YES];
|
||||
|
||||
|
||||
// Enable the selection of directories in the dialog.
|
||||
[openDlg setCanChooseDirectories:NO];
|
||||
|
||||
|
||||
// Display the dialog. If the OK button was pressed,
|
||||
// process the files.
|
||||
if ( [openDlg runModalForDirectory:nil file:nil] == NSOKButton )
|
||||
|
@ -306,7 +306,7 @@
|
|||
// Get an array containing the full filenames of all
|
||||
// files and directories selected.
|
||||
NSArray* files = [openDlg filenames];
|
||||
|
||||
|
||||
// Loop through all the files and process them.
|
||||
for( int i = 0; i < [files count]; i++ )
|
||||
{
|
||||
|
@ -327,7 +327,7 @@
|
|||
if ([ext isEqualToString:@""] || [ext isEqualToString:@"/"] || ext == nil || ext == NULL || [ext length] < 1) {
|
||||
return YES;
|
||||
}
|
||||
|
||||
|
||||
NSEnumerator* tagEnumerator = [[NSArray arrayWithObjects:@"png", @"jpg", @"gif", @"jpeg", nil] objectEnumerator];
|
||||
NSString* allowedExt;
|
||||
while ((allowedExt = [tagEnumerator nextObject]))
|
||||
|
@ -337,7 +337,7 @@
|
|||
return YES;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
return NO;
|
||||
}
|
||||
|
||||
|
|
|
@ -13,16 +13,16 @@
|
|||
NSString *title;
|
||||
NSDate *date;
|
||||
NSString *itemDescription;
|
||||
|
||||
|
||||
NSURL *releaseNotesURL;
|
||||
|
||||
NSString *DSASignature;
|
||||
|
||||
NSString *DSASignature;
|
||||
NSString *minimumSystemVersion;
|
||||
|
||||
|
||||
NSURL *fileURL;
|
||||
NSString *versionString;
|
||||
NSString *displayVersionString;
|
||||
|
||||
|
||||
NSDictionary *propertiesDictionary;
|
||||
}
|
||||
|
||||
|
|
|
@ -15,7 +15,7 @@
|
|||
@interface SUUpdater : NSObject {
|
||||
NSTimer *checkTimer;
|
||||
SUUpdateDriver *driver;
|
||||
|
||||
|
||||
SUHost *host;
|
||||
IBOutlet id delegate;
|
||||
}
|
||||
|
|
|
@ -16,7 +16,7 @@
|
|||
@protocol SUVersionComparison
|
||||
|
||||
/*!
|
||||
@method
|
||||
@method
|
||||
@abstract An abstract method to compare two version strings.
|
||||
@discussion Should return NSOrderedAscending if b > a, NSOrderedDescending if b < a, and NSOrderedSame if they are equivalent.
|
||||
*/
|
||||
|
|
|
@ -16,13 +16,13 @@
|
|||
- (void)webView:(WebView *)sender addMessageToConsole:(NSDictionary *)message;{
|
||||
|
||||
if (![message isKindOfClass:[NSDictionary class]]) return;
|
||||
|
||||
|
||||
NSString *viewName = @"TimelineView";
|
||||
if (sender == mentionsView) viewName = @"MentionsView";
|
||||
if (sender == conversationView) viewName = @"ConversationView";
|
||||
if (sender == oauthView) viewName = @"OauthView";
|
||||
if (sender == profileView) viewName = @"ProfileView";
|
||||
|
||||
|
||||
NSLog(@"js<%@>: %@:%@: %@",
|
||||
viewName,
|
||||
[[message objectForKey:@"sourceURL"] lastPathComponent],
|
||||
|
@ -46,7 +46,7 @@
|
|||
NSLocalizedString(@"OK", @""), // default button
|
||||
NSLocalizedString(@"Cancel", @""), // alt button
|
||||
nil);
|
||||
return NSAlertDefaultReturn == result;
|
||||
return NSAlertDefaultReturn == result;
|
||||
return NO;
|
||||
}
|
||||
|
||||
|
@ -56,45 +56,45 @@
|
|||
}
|
||||
|
||||
- (void)webView:(WebView *)sender didFinishLoadForFrame:(WebFrame *)frame {
|
||||
|
||||
|
||||
NSFileManager *fileManager = [NSFileManager defaultManager];
|
||||
NSString *pathToJsPlugin = [@"~/Library/Application Support/bungloo/Plugin.js" stringByExpandingTildeInPath];
|
||||
NSString *pathToCssPlugin = [@"~/Library/Application Support/bungloo/Plugin.css" stringByExpandingTildeInPath];
|
||||
|
||||
|
||||
if([fileManager fileExistsAtPath:pathToCssPlugin])
|
||||
{
|
||||
[sender stringByEvaluatingJavaScriptFromString:[NSString stringWithFormat:@"setTimeout(function() { loadCssPlugin('file://localhost%@') }, 1000);", pathToCssPlugin]];
|
||||
}
|
||||
|
||||
|
||||
if([fileManager fileExistsAtPath:pathToJsPlugin])
|
||||
{
|
||||
[sender stringByEvaluatingJavaScriptFromString:[NSString stringWithFormat:@"setTimeout(function() { loadJsPlugin('file://localhost%@') }, 1000);", pathToJsPlugin]];
|
||||
}
|
||||
|
||||
|
||||
[sender stringByEvaluatingJavaScriptFromString:@"var OS_TYPE = 'mac';"];
|
||||
|
||||
if (sender == oauthView) {
|
||||
|
||||
|
||||
[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 {
|
||||
|
||||
|
||||
NSString *action = @"timeline";
|
||||
NSString *delay = @"1";
|
||||
|
||||
|
||||
if (sender == mentionsView) {
|
||||
action = @"mentions";
|
||||
delay = @"1000";
|
||||
}
|
||||
|
||||
|
||||
[sender stringByEvaluatingJavaScriptFromString:[NSString stringWithFormat:@"function HostAppGo() { start('%@') }", action]];
|
||||
}
|
||||
}
|
||||
|
@ -104,7 +104,7 @@
|
|||
// FIXME
|
||||
/*
|
||||
NSMutableArray *menuItems = [NSMutableArray arrayWithArray:defaultMenuItems];
|
||||
|
||||
|
||||
for (NSMenuItem*item in defaultMenuItems) {
|
||||
if ([[item title] isEqualToString:@"Reload"]) {
|
||||
//[item setAction:@selector(reload:)];
|
||||
|
@ -113,7 +113,7 @@
|
|||
[menuItems addObject:item];
|
||||
}
|
||||
}*/
|
||||
|
||||
|
||||
return defaultMenuItems;
|
||||
}
|
||||
|
||||
|
@ -126,7 +126,7 @@
|
|||
{
|
||||
NSFileManager *fileManager = [NSFileManager defaultManager];
|
||||
NSString *pathToPlugin = [@"~/Library/Application Support/Bungloo/Plugin.js" stringByExpandingTildeInPath];
|
||||
|
||||
|
||||
if([fileManager fileExistsAtPath:pathToPlugin])
|
||||
{
|
||||
return [NSString stringWithFormat:@"%@", [NSURL fileURLWithPath:pathToPlugin]];
|
||||
|
|
|
@ -174,7 +174,7 @@
|
|||
<p>Moved reply icon to left so it is easier to use when the scrollbar is shown</p>
|
||||
<p>Login with the [Login] button now works</p>
|
||||
<p>Fixed automatic updates so it will work next time again.</p>
|
||||
|
||||
|
||||
<hr />
|
||||
|
||||
<h1>Tentia 0.2.0</h2>
|
||||
|
@ -191,15 +191,15 @@
|
|||
<p>Mentions now appear as realnames</p>
|
||||
|
||||
<hr />
|
||||
|
||||
|
||||
<h1>Tentia 0.1.1</h1>
|
||||
<p>Bugfixes</p>
|
||||
<p>Changed to send on Cmd+Enter.</p>
|
||||
|
||||
|
||||
<hr />
|
||||
|
||||
|
||||
<h1>Tentia 0.1.0</h1>
|
||||
<p>First attempt to rewrite the old Twitter client Twittia to a new and shiny Tent client Tentia.</p>
|
||||
|
||||
|
||||
</body>
|
||||
</html>
|
Reference in a new issue