Consolidate with browser branch.

Reviewed by me.
This commit is contained in:
Francisco Ryan Tolmasky I committed 2009-10-19 16:52:19 -07:00
1 parent a27f104a63
commit efaff96168
4 files changed
+41 -19

No files matched your search

+6 -1
View File
@@ -460,7 +460,12 @@ var CPDocumentUntitledCount = 0;
_writeRequest = [CPURLRequest requestWithURL:anAbsoluteURL];
[_writeRequest setHTTPMethod:@"PUT"];
// FIXME: THIS IS WRONG! We need a way to decide
if ([CPPlatform isBrowser])
[_writeRequest setHTTPMethod:@"POST"];
else
[_writeRequest setHTTPMethod:@"PUT"];
[_writeRequest setHTTPBody:[data string]];
[_writeRequest setValue:@"close" forHTTPHeaderField:@"Connection"];
+3 -4
View File
@@ -1492,7 +1492,8 @@ var _CPMenuBarWindowBackgroundColor = nil,
- (id)init
{
var contentRect = [CPPlatform isBrowser] ? [[CPPlatformWindow primaryPlatformWindow] contentBounds] : [[self screen] visibleFrame];
// This only shows up in browser land, so don't bother calculating metrics in desktop.
var contentRect = [[CPPlatformWindow primaryPlatformWindow] contentBounds];
contentRect.size.height = MENUBAR_HEIGHT;
@@ -1501,9 +1502,7 @@ var _CPMenuBarWindowBackgroundColor = nil,
if (self)
{
// FIXME: http://280north.lighthouseapp.com/projects/13294-cappuccino/tickets/39-dont-allow-windows-to-go-above-menubar
if ([CPPlatform isBrowser])
[self setLevel:-1];//CPTornOffMenuWindowLevel];
[self setLevel:-1];//CPTornOffMenuWindowLevel];
[self setAutoresizingMask:CPWindowWidthSizable];
var contentView = [self contentView];
+14 -10
View File
@@ -1,6 +1,5 @@
@import <AppKit/CPPanel.j>
#include "Platform/Platform.h"
@implementation CPOpenPanel : CPPanel
@@ -19,19 +18,24 @@
- (CPInteger)runModal
{
// FIXME: Is this correct???
[[CPRunLoop currentRunLoop] limitDateForMode:CPDefaultRunLoopMode];
if (typeof window["cpOpenPanel"] === "function")
{
// FIXME: Is this correct???
[[CPRunLoop currentRunLoop] limitDateForMode:CPDefaultRunLoopMode];
var options = { directoryURL: [self directoryURL],
canChooseFiles: [self canChooseFiles],
canChooseDirectories: [self canChooseDirectories],
allowsMultipleSelection: [self allowsMultipleSelection] };
var options = { directoryURL: [self directoryURL],
canChooseFiles: [self canChooseFiles],
canChooseDirectories: [self canChooseDirectories],
allowsMultipleSelection: [self allowsMultipleSelection] };
var result = window.cpOpenPanel(options);
var result = window.cpOpenPanel(options);
_URLs = result.URLs;
_URLs = result.URLs;
return result.button;
return result.button;
}
throw "-runModal is unimplemented.";
}
- (CPArray)URLs
+18 -4
View File
@@ -4,7 +4,7 @@
@implementation CPSavePanel : CPPanel
{
Object result;
CPURL _URL;
}
+ (id)savePanel
@@ -17,14 +17,28 @@
// FIXME: Is this correct???
[[CPRunLoop currentRunLoop] limitDateForMode:CPDefaultRunLoopMode];
result = window.cpSavePanel();
if (typeof window["cpSavePanel"] === "function")
{
var resultObject = window.cpSavePanel(),
result = resultObject.button;
return result.button;
_URL = result ? [CPURL URLWithString:resultObject.URL] : nil;
}
else
{
// FIXME: This is not the best way to do this.
var documentName = window.prompt("Document Name:"),
result = documentName !== null;
_URL = result ? [[self class] proposedFileURLWithDocumentName:documentName] : nil;
}
return result;
}
- (CPURL)URL
{
return [CPURL URLWithString:result.URL];
return _URL;
}
@end