Skip to content

Commit

Permalink
initial commit
Browse files Browse the repository at this point in the history
  • Loading branch information
sintaxi committed Aug 3, 2008
0 parents commit 45e6d72
Show file tree
Hide file tree
Showing 20 changed files with 4,389 additions and 0 deletions.
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
.DS_Store
build/*
23 changes: 23 additions & 0 deletions Classes/GlassAppDelegate.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
//
// GlassAppDelegate.h
// Glass
//
// Created by Eric Oesterle on 8/2/08.
// Copyright InPlace 2008. All rights reserved.
//

#import <UIKit/UIKit.h>

@class GlassViewController;

@interface GlassAppDelegate : NSObject <UIApplicationDelegate, UIWebViewDelegate> {
IBOutlet UIWindow *window;
IBOutlet GlassViewController *viewController;
IBOutlet UIWebView *webView;
}

@property (nonatomic, retain) UIWindow *window;
@property (nonatomic, retain) GlassViewController *viewController;

@end

78 changes: 78 additions & 0 deletions Classes/GlassAppDelegate.m
Original file line number Diff line number Diff line change
@@ -0,0 +1,78 @@
//
// GlassAppDelegate.m
// Glass
//
// Created by Eric Oesterle on 8/2/08.
// Copyright InPlace 2008. All rights reserved.
//

#import "GlassAppDelegate.h"
#import "GlassViewController.h"

@implementation GlassAppDelegate

@synthesize window;
@synthesize viewController;


- (void)applicationDidFinishLaunching:(UIApplication *)application {

// Override point for customization after app launch
[window addSubview:viewController.view];
webView.delegate = self;
// [webView loadRequest:[NSURLRequest requestWithURL:[NSURL URLWithString:@"http://google.com"]]];


NSString * htmlFileName;
NSString * urlFileName;

htmlFileName = @"index";
urlFileName = @"url";

// NSString * htmlPathString = [[NSBundle mainBundle] resourcePath];
NSString * urlPathString; //= [[NSBundle mainBundle] resourcePath];

NSBundle * thisBundle = [NSBundle bundleForClass:[self class]];

/*
if (htmlPathString = [thisBundle pathForResource:htmlFileName ofType:@"html"]) {
NSURL * anURL = [NSURL fileURLWithPath:htmlPathString];
NSURLRequest * aRequest = [NSURLRequest requestWithURL:anURL];
}
*/

if (urlPathString = [thisBundle pathForResource:urlFileName ofType:@"txt"]){
NSString * theURLString = [NSString stringWithContentsOfFile:urlPathString];


NSURL * anURL = [NSURL URLWithString:theURLString];



NSURLRequest * aRequest = [NSURLRequest requestWithURL:anURL];

[webView loadRequest:aRequest];
}


[window makeKeyAndVisible];
}

- (BOOL)webView:(UIWebView *)webView shouldStartLoadWithRequest:(NSURLRequest *)request navigationType:(UIWebViewNavigationType)navigationType {
NSString * myURL = [[request URL] absoluteString];
NSLog(myURL);

return YES;
}



- (void)dealloc {
[viewController release];
[window release];
[super dealloc];
}


@end
9 changes: 9 additions & 0 deletions Classes/GlassViewController.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
#import <UIKit/UIKit.h>
#import <Foundation/Foundation.h>

@interface GlassViewController : UIViewController {
}
- (IBAction)loadView;
- (IBAction)pushBack;
- (IBAction)pushHome;
@end
17 changes: 17 additions & 0 deletions Classes/GlassViewController.m
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
#import "GlassViewController.h"

@implementation GlassViewController


- (IBAction)loadView {

}

- (IBAction)pushBack {

}

- (IBAction)pushHome {

}
@end
62 changes: 62 additions & 0 deletions Classes/README.markdown
Original file line number Diff line number Diff line change
@@ -0,0 +1,62 @@
# GAP

### bridging the gap between the web and the iphone SDK

Written in Objective-C, GAP is an open source developer tool
for the iphone that allows calls to the native iPhone SKD
with javascript. values are returned as a json object.

[get the GAP source](http://github.com/ "source code via github") or [generate your GAP app](http://github.com/ "generates iphone app")

## API

#### Geo Location
function getLocData(){
var location = gap:getloc();
return location;
}
#### Camera (pending)

function takePhoto(){
var photo = gap:takePhoto();
return photo;
}

#### Vibration (pending)

function vibrate(){
gap:vibrate();
return false;
}

#### Accelerometer (pending)

function getAccelData(){
gap:accelerometer();
return false;
}

### The MIT License

#### Copyright (c) 2008 Nitobi

Permission is hereby granted, free of charge, to any person obtaining
a copy of this software and associated documentation files (the
"Software"), to deal in the Software without restriction, including
without limitation the rights to use, copy, modify, merge, publish,
distribute, sublicense, and/or sell copies of the Software, and to
permit persons to whom the Software is furnished to do so, subject to
the following conditions:

The above copyright notice and this permission notice shall be
included in all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
Loading

0 comments on commit 45e6d72

Please sign in to comment.