Skip to content

Commit

Permalink
first commit
Browse files Browse the repository at this point in the history
  • Loading branch information
moeseth committed Jun 28, 2013
1 parent 4bb892a commit 69bd4c9
Show file tree
Hide file tree
Showing 31 changed files with 2,259 additions and 0 deletions.
401 changes: 401 additions & 0 deletions GhostBin.xcodeproj/project.pbxproj

Large diffs are not rendered by default.

Binary file added GhostBin/BarBtn@2x.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added GhostBin/Default-568h@2x.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added GhostBin/Default.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added GhostBin/Default@2x.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
55 changes: 55 additions & 0 deletions GhostBin/GhostBin-Info.plist
Original file line number Diff line number Diff line change
@@ -0,0 +1,55 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>CFBundleDevelopmentRegion</key>
<string>en</string>
<key>CFBundleDisplayName</key>
<string>${PRODUCT_NAME}</string>
<key>CFBundleExecutable</key>
<string>${EXECUTABLE_NAME}</string>
<key>CFBundleIconFiles</key>
<array>
<string>Icon.png</string>
<string>Icon@2x.png</string>
<string>Icon-72.png</string>
<string>Icon-72@2x.png</string>
<string>Icon-Small-50.png</string>
<string>Icon-Small-50@2x.png</string>
<string>Icon-Small.png</string>
<string>Icon-Small@2x.png</string>
</array>
<key>CFBundleIdentifier</key>
<string>com.w00tylab.ghostbin</string>
<key>CFBundleInfoDictionaryVersion</key>
<string>6.0</string>
<key>CFBundleName</key>
<string>${PRODUCT_NAME}</string>
<key>CFBundlePackageType</key>
<string>APPL</string>
<key>CFBundleShortVersionString</key>
<string>1.0</string>
<key>CFBundleSignature</key>
<string>????</string>
<key>CFBundleVersion</key>
<string>1.0</string>
<key>LSRequiresIPhoneOS</key>
<true/>
<key>UIPrerenderedIcon</key>
<true/>
<key>UIRequiredDeviceCapabilities</key>
<array>
<string>armv7</string>
</array>
<key>UISupportedInterfaceOrientations</key>
<array>
<string>UIInterfaceOrientationPortrait</string>
</array>
<key>UISupportedInterfaceOrientations~ipad</key>
<array>
<string>UIInterfaceOrientationPortrait</string>
<string>UIInterfaceOrientationLandscapeLeft</string>
<string>UIInterfaceOrientationLandscapeRight</string>
</array>
</dict>
</plist>
14 changes: 14 additions & 0 deletions GhostBin/GhostBin-Prefix.pch
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
//
// Prefix header for all source files of the 'GhostBin' target in the 'GhostBin' project
//

#import <Availability.h>

#ifndef __IPHONE_4_0
#warning "This project uses features only available in iOS SDK 4.0 and later."
#endif

#ifdef __OBJC__
#import <UIKit/UIKit.h>
#import <Foundation/Foundation.h>
#endif
Binary file added GhostBin/Icon-72.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added GhostBin/Icon-72@2x.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added GhostBin/Icon-Small-50.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added GhostBin/Icon-Small-50@2x.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added GhostBin/Icon-Small.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added GhostBin/Icon-Small@2x.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added GhostBin/Icon.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added GhostBin/Icon@2x.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
19 changes: 19 additions & 0 deletions GhostBin/MSAppDelegate.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
//
// MSAppDelegate.h
// GhostBin
//
// Created by moeseth on 6/27/13.
// Copyright (c) 2013 w00ty Lab. All rights reserved.
//

#import <UIKit/UIKit.h>

@class MSViewController;

@interface MSAppDelegate : UIResponder <UIApplicationDelegate>

@property (strong, nonatomic) UIWindow *window;

@property (strong, nonatomic) MSViewController *viewController;

@end
56 changes: 56 additions & 0 deletions GhostBin/MSAppDelegate.m
Original file line number Diff line number Diff line change
@@ -0,0 +1,56 @@
//
// MSAppDelegate.m
// GhostBin
//
// Created by moeseth on 6/27/13.
// Copyright (c) 2013 w00ty Lab. All rights reserved.
//

#import "MSAppDelegate.h"

#import "MSViewController.h"

@implementation MSAppDelegate

- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions
{
self.window = [[UIWindow alloc] initWithFrame:[[UIScreen mainScreen] bounds]];
// Override point for customization after application launch.
if ([[UIDevice currentDevice] userInterfaceIdiom] == UIUserInterfaceIdiomPhone) {
self.viewController = [[MSViewController alloc] initWithNibName:@"MSViewController_iPhone" bundle:nil];
} else {
self.viewController = [[MSViewController alloc] initWithNibName:@"MSViewController_iPad" bundle:nil];
}
self.window.rootViewController = self.viewController;
[self.window makeKeyAndVisible];
return YES;
}

- (void)applicationWillResignActive:(UIApplication *)application
{
// Sent when the application is about to move from active to inactive state. This can occur for certain types of temporary interruptions (such as an incoming phone call or SMS message) or when the user quits the application and it begins the transition to the background state.
// Use this method to pause ongoing tasks, disable timers, and throttle down OpenGL ES frame rates. Games should use this method to pause the game.
}

- (void)applicationDidEnterBackground:(UIApplication *)application
{
// Use this method to release shared resources, save user data, invalidate timers, and store enough application state information to restore your application to its current state in case it is terminated later.
// If your application supports background execution, this method is called instead of applicationWillTerminate: when the user quits.
}

- (void)applicationWillEnterForeground:(UIApplication *)application
{
// Called as part of the transition from the background to the inactive state; here you can undo many of the changes made on entering the background.
}

- (void)applicationDidBecomeActive:(UIApplication *)application
{
// Restart any tasks that were paused (or not yet started) while the application was inactive. If the application was previously in the background, optionally refresh the user interface.
}

- (void)applicationWillTerminate:(UIApplication *)application
{
// Called when the application is about to terminate. Save data if appropriate. See also applicationDidEnterBackground:.
}

@end
20 changes: 20 additions & 0 deletions GhostBin/MSLanguageChooser.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
//
// MSLanguageChooser.h
// GhostBin
//
// Created by moeseth on 6/28/13.
// Copyright (c) 2013 w00ty Lab. All rights reserved.
//

#import <UIKit/UIKit.h>

@interface MSLanguageChooser : UIView <UITableViewDataSource, UITableViewDelegate> {
NSDictionary *languages;
NSArray *keys;
}

@property(strong) void(^ChooserBlock)(NSString *chosen);

- (void) waitForAction:(void(^) (NSString *chosen)) block;

@end
71 changes: 71 additions & 0 deletions GhostBin/MSLanguageChooser.m
Original file line number Diff line number Diff line change
@@ -0,0 +1,71 @@
//
// MSLanguageChooser.m
// GhostBin
//
// Created by moeseth on 6/28/13.
// Copyright (c) 2013 w00ty Lab. All rights reserved.
//

#import "MSLanguageChooser.h"

@implementation MSLanguageChooser
@synthesize ChooserBlock;

- (id)initWithFrame:(CGRect)frame {
self = [super initWithFrame:frame];
if (self) {
UIImageView *imageView = [[UIImageView alloc] initWithFrame:CGRectMake(frame.size.width/2 - 140, 30, 280, 300)];
imageView.image = [UIImage imageNamed:@"Popup"];
imageView.userInteractionEnabled = YES;
[self addSubview:imageView];

UITableView *tableView = [[UITableView alloc] initWithFrame:CGRectMake(30, 40, imageView.frame.size.width - 60, imageView.frame.size.height - 53)];
tableView.delegate = self;
tableView.rowHeight = 50.0f;
tableView.dataSource = self;
tableView.showsVerticalScrollIndicator = FALSE;
tableView.backgroundColor = [UIColor clearColor];
[imageView addSubview:tableView];

keys = [NSArray arrayWithObjects:@"Logos + Objective-C", @"Objective-C", @"Plain Text", @"C", @"C++", @"IRC log", @"Perl", @"Go", @"HTML", @"ANSI", nil];
languages = [NSDictionary dictionaryWithObjects:[NSArray arrayWithObjects:@"logos", @"objective-c", @"text", @"c", @"c++", @"irc", @"perl", @"go", @"html", @"ansi", nil] forKeys:keys];
}
return self;
}

- (void) waitForAction:(void(^) (NSString *chosen)) block {
ChooserBlock = block;
}

- (void) touchesBegan:(NSSet *)touches withEvent:(UIEvent *)event {
ChooserBlock(NULL);
}

#pragma UITableView methods

- (NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section {
return [keys count];
}

- (UITableViewCell *)tableView:(UITableView *)table cellForRowAtIndexPath:(NSIndexPath *)indexPath {
UITableViewCell *cell = [table dequeueReusableCellWithIdentifier:@"Cell"];

if (cell == nil) {
cell = [[UITableViewCell alloc] initWithStyle:UITableViewCellStyleDefault reuseIdentifier:@"Cell"];
cell.backgroundColor = [UIColor clearColor];
}

cell.textLabel.text = [keys objectAtIndex:indexPath.row];
cell.textLabel.textAlignment = NSTextAlignmentCenter;
cell.textLabel.textColor = [UIColor whiteColor];
cell.selectionStyle = UITableViewCellSelectionStyleNone;
cell.textLabel.font = [UIFont fontWithName:@"Helvetica Neue" size:18];
return cell;
}

- (void)tableView:(UITableView *)table didSelectRowAtIndexPath:(NSIndexPath *)indexPath {
[table deselectRowAtIndexPath:indexPath animated:YES];
ChooserBlock([languages objectForKey:[keys objectAtIndex:indexPath.row]]);
}

@end
13 changes: 13 additions & 0 deletions GhostBin/MSNavigationBar.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
//
// MSNavigationBar.h
// GhostBin
//
// Created by moeseth on 6/28/13.
// Copyright (c) 2013 w00ty Lab. All rights reserved.
//

#import <UIKit/UIKit.h>

@interface MSNavigationBar : UINavigationBar

@end
27 changes: 27 additions & 0 deletions GhostBin/MSNavigationBar.m
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
//
// MSNavigationBar.m
// GhostBin
//
// Created by moeseth on 6/28/13.
// Copyright (c) 2013 w00ty Lab. All rights reserved.
//

#import "MSNavigationBar.h"

@implementation MSNavigationBar

- (id)initWithFrame:(CGRect)frame
{
self = [super initWithFrame:frame];
if (self) {
// Initialization code
}
return self;
}

- (void)drawRect:(CGRect)rect {
UIImage *image = [[UIImage imageNamed:@"NavBar"] stretchableImageWithLeftCapWidth:0 topCapHeight:0];
[image drawInRect:CGRectMake(0, 0, self.frame.size.width, self.frame.size.height)];
}

@end
26 changes: 26 additions & 0 deletions GhostBin/MSViewController.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
//
// MSViewController.h
// GhostBin
//
// Created by moeseth on 6/27/13.
// Copyright (c) 2013 w00ty Lab. All rights reserved.
//

#import <UIKit/UIKit.h>
#import <MessageUI/MessageUI.h>
#import <Twitter/Twitter.h>

@class MSLanguageChooser;

@interface MSViewController : UIViewController <UITextViewDelegate, MFMailComposeViewControllerDelegate, UIActionSheetDelegate> {
IBOutlet UITextView *textView;
IBOutlet UIButton *button;
IBOutlet UINavigationBar *navBar;
IBOutlet UILabel *urlLabel;
MSLanguageChooser *chooser;
}

- (void)post:(id)sender;
- (IBAction)languageChooser:(id)sender;

@end
Loading

0 comments on commit 69bd4c9

Please sign in to comment.