Skip to content
This repository has been archived by the owner on Jan 2, 2025. It is now read-only.

Added File Access #25

Open
wants to merge 3 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions MacGap.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@
88C0646014BDE10A00E4BCE2 /* Window.m in Sources */ = {isa = PBXBuildFile; fileRef = 88C0645F14BDE10A00E4BCE2 /* Window.m */; };
88C0646614BDEC5800E4BCE2 /* Window.xib in Resources */ = {isa = PBXBuildFile; fileRef = 88C0646414BDEC5800E4BCE2 /* Window.xib */; };
88C0646D14BDF6A600E4BCE2 /* WindowController.m in Sources */ = {isa = PBXBuildFile; fileRef = 88C0646C14BDF6A600E4BCE2 /* WindowController.m */; };
88CAD87714D3C6A800B45DB2 /* File.m in Sources */ = {isa = PBXBuildFile; fileRef = 88CAD87614D3C6A800B45DB2 /* File.m */; };
FA32509D14BA813600BF0781 /* WebKit.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = FA32509C14BA813600BF0781 /* WebKit.framework */; };
FA3250C314BA85E700BF0781 /* ContentView.m in Sources */ = {isa = PBXBuildFile; fileRef = FA3250BC14BA85E700BF0781 /* ContentView.m */; };
FA3250C514BA85E700BF0781 /* Utils.m in Sources */ = {isa = PBXBuildFile; fileRef = FA3250BE14BA85E700BF0781 /* Utils.m */; };
Expand Down Expand Up @@ -53,6 +54,8 @@
88C0646514BDEC5800E4BCE2 /* en */ = {isa = PBXFileReference; lastKnownFileType = file.xib; name = en; path = en.lproj/Window.xib; sourceTree = "<group>"; };
88C0646B14BDF6A600E4BCE2 /* WindowController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = WindowController.h; sourceTree = "<group>"; };
88C0646C14BDF6A600E4BCE2 /* WindowController.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = WindowController.m; sourceTree = "<group>"; };
88CAD87514D3C6A800B45DB2 /* File.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = File.h; path = Classes/Commands/File.h; sourceTree = "<group>"; };
88CAD87614D3C6A800B45DB2 /* File.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = File.m; path = Classes/Commands/File.m; sourceTree = "<group>"; };
FA32509C14BA813600BF0781 /* WebKit.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = WebKit.framework; path = System/Library/Frameworks/WebKit.framework; sourceTree = SDKROOT; };
FA32509E14BA816E00BF0781 /* Growl.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = Growl.framework; path = MacGap/Growl.framework; sourceTree = "<group>"; };
FA3250BA14BA85E700BF0781 /* Constants.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; name = Constants.h; path = Classes/Constants.h; sourceTree = "<group>"; };
Expand Down Expand Up @@ -138,6 +141,8 @@
88C0645F14BDE10A00E4BCE2 /* Window.m */,
88746BEC14CCA435001E160E /* JSEventHelper.h */,
88746BED14CCA435001E160E /* JSEventHelper.m */,
88CAD87514D3C6A800B45DB2 /* File.h */,
88CAD87614D3C6A800B45DB2 /* File.m */,
);
name = Commands;
sourceTree = "<group>";
Expand Down Expand Up @@ -289,6 +294,7 @@
88C0646014BDE10A00E4BCE2 /* Window.m in Sources */,
88C0646D14BDF6A600E4BCE2 /* WindowController.m in Sources */,
88746BEE14CCA435001E160E /* JSEventHelper.m in Sources */,
88CAD87714D3C6A800B45DB2 /* File.m in Sources */,
);
runOnlyForDeploymentPostprocessing = 0;
};
Expand Down
Binary file not shown.
Original file line number Diff line number Diff line change
Expand Up @@ -9,11 +9,11 @@
continueAfterRunningActions = "No"
isPathRelative = "1"
filePath = "MacGap/Classes/WebViewDelegate.m"
timestampString = "349029710.277675"
timestampString = "349561774.548839"
startingColumnNumber = "9223372036854775807"
endingColumnNumber = "9223372036854775807"
startingLineNumber = "107"
endingLineNumber = "107"
startingLineNumber = "150"
endingLineNumber = "150"
landmarkName = "-webView:contextMenuItemsForElement:defaultMenuItems:"
landmarkType = "5">
</FileBreakpoint>
Expand All @@ -23,11 +23,11 @@
continueAfterRunningActions = "No"
isPathRelative = "1"
filePath = "MacGap/Classes/WebViewDelegate.m"
timestampString = "349029710.277675"
timestampString = "349561774.548839"
startingColumnNumber = "9223372036854775807"
endingColumnNumber = "9223372036854775807"
startingLineNumber = "95"
endingLineNumber = "95"
startingLineNumber = "138"
endingLineNumber = "138"
landmarkName = "-webView:contextMenuItemsForElement:defaultMenuItems:"
landmarkType = "5">
</FileBreakpoint>
Expand Down Expand Up @@ -79,11 +79,11 @@
continueAfterRunningActions = "No"
isPathRelative = "1"
filePath = "MacGap/Classes/WebViewDelegate.m"
timestampString = "348021074.943219"
timestampString = "349561774.548839"
startingColumnNumber = "9223372036854775807"
endingColumnNumber = "9223372036854775807"
startingLineNumber = "21"
endingLineNumber = "21"
startingLineNumber = "26"
endingLineNumber = "26"
landmarkName = "-webView:didClearWindowObject:forFrame:"
landmarkType = "5">
</FileBreakpoint>
Expand All @@ -93,11 +93,11 @@
continueAfterRunningActions = "No"
isPathRelative = "1"
filePath = "MacGap/Classes/WebViewDelegate.m"
timestampString = "349029710.277675"
timestampString = "349561774.548839"
startingColumnNumber = "9223372036854775807"
endingColumnNumber = "9223372036854775807"
startingLineNumber = "128"
endingLineNumber = "128"
startingLineNumber = "171"
endingLineNumber = "171"
landmarkName = "-webView:createWebViewWithRequest:"
landmarkType = "5">
</FileBreakpoint>
Expand All @@ -107,11 +107,11 @@
continueAfterRunningActions = "No"
isPathRelative = "1"
filePath = "MacGap/Classes/WebViewDelegate.m"
timestampString = "349029710.277675"
timestampString = "349561774.548839"
startingColumnNumber = "9223372036854775807"
endingColumnNumber = "9223372036854775807"
startingLineNumber = "133"
endingLineNumber = "133"
startingLineNumber = "176"
endingLineNumber = "176"
landmarkName = "-webViewShow:"
landmarkType = "5">
</FileBreakpoint>
Expand Down Expand Up @@ -149,13 +149,139 @@
continueAfterRunningActions = "No"
isPathRelative = "1"
filePath = "MacGap/Classes/WebViewDelegate.m"
timestampString = "348947710.747279"
timestampString = "349561774.548839"
startingColumnNumber = "9223372036854775807"
endingColumnNumber = "9223372036854775807"
startingLineNumber = "84"
endingLineNumber = "84"
landmarkName = "-webView:runOpenPanelForFileButtonWithResultListener:allowMultipleFiles:"
landmarkType = "5">
</FileBreakpoint>
<FileBreakpoint
shouldBeEnabled = "No"
ignoreCount = "0"
continueAfterRunningActions = "No"
isPathRelative = "1"
filePath = "MacGap/Classes/WebViewDelegate.m"
timestampString = "349561774.548839"
startingColumnNumber = "9223372036854775807"
endingColumnNumber = "9223372036854775807"
startingLineNumber = "90"
endingLineNumber = "90"
landmarkName = "-webView:runOpenPanelForFileButtonWithResultListener:allowMultipleFiles:"
landmarkType = "5">
</FileBreakpoint>
<FileBreakpoint
shouldBeEnabled = "No"
ignoreCount = "0"
continueAfterRunningActions = "No"
isPathRelative = "1"
filePath = "MacGap/Classes/Commands/File.mm"
timestampString = "349479202.010813"
startingColumnNumber = "9223372036854775807"
endingColumnNumber = "9223372036854775807"
startingLineNumber = "43"
endingLineNumber = "43"
landmarkName = "-readAsBinaryString:"
landmarkType = "5">
</FileBreakpoint>
<FileBreakpoint
shouldBeEnabled = "No"
ignoreCount = "0"
continueAfterRunningActions = "No"
isPathRelative = "1"
filePath = "MacGap/Classes/WebViewDelegate.m"
timestampString = "349561774.548839"
startingColumnNumber = "9223372036854775807"
endingColumnNumber = "9223372036854775807"
startingLineNumber = "89"
endingLineNumber = "89"
landmarkName = "-webView:runOpenPanelForFileButtonWithResultListener:allowMultipleFiles:"
landmarkType = "5">
</FileBreakpoint>
<FileBreakpoint
shouldBeEnabled = "No"
ignoreCount = "0"
continueAfterRunningActions = "No"
isPathRelative = "1"
filePath = "MacGap/Classes/JSEventHelper.m"
timestampString = "349555697.275184"
startingColumnNumber = "9223372036854775807"
endingColumnNumber = "9223372036854775807"
startingLineNumber = "16"
endingLineNumber = "16"
landmarkName = "+triggerEvent:withExtraJS:forWebView:"
landmarkType = "5">
</FileBreakpoint>
<FileBreakpoint
shouldBeEnabled = "No"
ignoreCount = "0"
continueAfterRunningActions = "No"
isPathRelative = "1"
filePath = "MacGap/Classes/WebViewDelegate.m"
timestampString = "349561774.548839"
startingColumnNumber = "9223372036854775807"
endingColumnNumber = "9223372036854775807"
startingLineNumber = "49"
endingLineNumber = "49"
landmarkName = "-webView:willPerformDragDestinationAction:forDraggingInfo:"
landmarkType = "5">
</FileBreakpoint>
<FileBreakpoint
shouldBeEnabled = "No"
ignoreCount = "0"
continueAfterRunningActions = "No"
isPathRelative = "1"
filePath = "MacGap/Classes/WebViewDelegate.m"
timestampString = "349561774.548839"
startingColumnNumber = "9223372036854775807"
endingColumnNumber = "9223372036854775807"
startingLineNumber = "74"
endingLineNumber = "74"
landmarkName = "-webView:willPerformDragDestinationAction:forDraggingInfo:"
landmarkType = "5">
</FileBreakpoint>
<FileBreakpoint
shouldBeEnabled = "No"
ignoreCount = "0"
continueAfterRunningActions = "No"
isPathRelative = "1"
filePath = "MacGap/Classes/WebViewDelegate.m"
timestampString = "349561774.548839"
startingColumnNumber = "9223372036854775807"
endingColumnNumber = "9223372036854775807"
startingLineNumber = "71"
endingLineNumber = "71"
landmarkName = "-webView:willPerformDragDestinationAction:forDraggingInfo:"
landmarkType = "5">
</FileBreakpoint>
<FileBreakpoint
shouldBeEnabled = "No"
ignoreCount = "0"
continueAfterRunningActions = "No"
isPathRelative = "1"
filePath = "MacGap/Classes/Utils.m"
timestampString = "349568933.925701"
startingColumnNumber = "9223372036854775807"
endingColumnNumber = "9223372036854775807"
startingLineNumber = "74"
endingLineNumber = "74"
landmarkName = "+getMIMETypesFromFile:"
landmarkType = "5">
</FileBreakpoint>
<FileBreakpoint
shouldBeEnabled = "No"
ignoreCount = "0"
continueAfterRunningActions = "No"
isPathRelative = "1"
filePath = "MacGap/Classes/Commands/File.m"
timestampString = "349653100.32652"
startingColumnNumber = "9223372036854775807"
endingColumnNumber = "9223372036854775807"
startingLineNumber = "108"
endingLineNumber = "108"
landmarkName = "-readAsText:"
landmarkType = "5">
</FileBreakpoint>
</FileBreakpoints>
</Bucket>
23 changes: 23 additions & 0 deletions MacGap/Classes/Commands/File.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
//
// File.h
// MacGap
//
// Created by Liam Kaufman Simpkins on 12-01-28.
// Copyright (c) 2012 Twitter. All rights reserved.
//

#import <Foundation/Foundation.h>
#import "WindowController.h"

@interface File : NSObject{

}

@property (nonatomic, retain) WebView *webView;
- (id) initWithWebView:(WebView *)view;
-(NSArray *) files;
-(void) readAsText:(NSString *) path;
-(void) readAsDataURL:(NSString *) path;

@property (retain) NSArray* selectedFiles;
@end
Loading