forked from phonegap/phonegap
-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
0 parents
commit 45e6d72
Showing
20 changed files
with
4,389 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
.DS_Store | ||
build/* |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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. |
Oops, something went wrong.