Merge branch 'master' of git://github.com/280north/cappuccino

This commit is contained in:
Randall Luecke
2010-03-22 19:27:13 -04:00
11 changed files with 42 additions and 17 deletions
+1 -1
View File
@@ -873,7 +873,7 @@ CPRunContinuesResponse = -1002;
Checks for a target in the following order:
<ol>
<li>a responder from the key window</li>
<li>a responder frmo the main window</li>
<li>a responder from the main window</li>
<li>the CPApplication instance</li>
<li>the application delegate</li>
<li>the document controller</li>
+1 -1
View File
@@ -758,7 +758,7 @@
[self _scrollToSelection];
}
- (void)deleteBackwards:(id)sender
- (void)deleteBackward:(id)sender
{
if ([[self delegate] respondsToSelector:@selector(collectionView:shouldDeleteItemsAtIndexes:)])
{
+1 -1
View File
@@ -51,7 +51,7 @@ var CPSharedFontManager = nil,
// Changing the Default Font Conversion Classes
/*!
Sets the class that will be used to create the applcation's
Sets the class that will be used to create the application's
font manager.
*/
+ (void)setFontManagerFactory:(Class)aClass
+3
View File
@@ -370,7 +370,10 @@ var LEFT_SHADOW_INSET = 3.0,
var images = [CPKeyedUnarchiver unarchiveObjectWithData:[[aSender draggingPasteboard] dataForType:CPImagesPboardType]];
if ([images count])
{
[self setImage:images[0]];
[self sendAction:[self action] to:[self target]];
}
}
@end
+3 -3
View File
@@ -813,7 +813,7 @@ CPTextFieldStatePlaceholder = CPThemeState("placeholder");
if (![CPPlatform isBrowser])
{
[self copy:sender];
[self deleteBackwards:sender];
[self deleteBackward:sender];
}
}
@@ -826,7 +826,7 @@ CPTextFieldStatePlaceholder = CPThemeState("placeholder");
if (![[pasteboard types] containsObject:CPStringPboardType])
return;
[self deleteBackwards:sender];
[self deleteBackward:sender];
var selectedRange = [self selectedRange],
stringValue = [self stringValue],
@@ -912,7 +912,7 @@ CPTextFieldStatePlaceholder = CPThemeState("placeholder");
[self selectText:sender];
}
- (void)deleteBackwards:(id)sender
- (void)deleteBackward:(id)sender
{
var selectedRange = [self selectedRange],
stringValue = [self stringValue],
+6
View File
@@ -153,6 +153,12 @@
continue;
var value = object[key];
if (value === null)
{
[dictionary setObject:[CPNull null] forKey:key];
continue;
}
if (recursively)
{
+1 -1
View File
@@ -281,7 +281,7 @@ function pushPackage(path, remote, branch)
{
branch = branch || "master";
var pushPackagesPath = FILE.path(".push-package")
var pushPackagesPath = FILE.path(".push-package");
pushPackagesPath.mkdirs();
+8 -6
View File
@@ -63,12 +63,14 @@
- (void)testDescription
{
// Unfortunately the result will be different depending on the testing machine's timezone.
var expectedHour = 23
var expectedMinute = 31;
var offsetHours = Math.floor(new Date().getTimezoneOffset() / 60);
var offsetMinutes = new Date().getTimezoneOffset() - offsetHours * 60;
var expectedString = [CPString stringWithFormat:"2009-02-13 %02d:%02d:30 +%02d%02d", expectedHour-offsetHours, expectedMinute-offsetMinutes, offsetHours, offsetMinutes];
[self assert:expectedString equals: [[CPDate dateWithTimeIntervalSince1970: 1234567890] description]];
var date = [CPDate dateWithTimeIntervalSince1970: 1234567890],
expectedHour = 23,
expectedMinute = 31,
offsetHours = Math.floor(date.getTimezoneOffset() / 60),
offsetMinutes = date.getTimezoneOffset() - offsetHours * 60,
expectedString = [CPString stringWithFormat:"2009-02-13 %02d:%02d:30 +%02d%02d", expectedHour-offsetHours, expectedMinute-offsetMinutes, offsetHours, offsetMinutes];
[self assert:expectedString equals:[date description]];
}
- (void)testCopy
+14
View File
@@ -16,6 +16,12 @@
string_dict = [[CPDictionary alloc] initWithObjects:[@"1", @"2"] forKeys:[@"key1", @"key2"]];
json_dict = [CPDictionary dictionaryWithJSObject:json recursively:YES];
json_with_nulls = {
"key1": ['1', '2', '3'],
"key2": "This is a string",
"key3": null
}
}
- (void)testInitWithDictionary
@@ -58,6 +64,14 @@
[self assert:[[dict objectForKey:@"key3"] count] equals:1];
}
- (void)testDictionaryWithJSObjectRecursiveWithNull
{
var dict = [CPDictionary dictionaryWithJSObject:json_with_nulls recursively:YES];
[self assert:3 equals:[dict count]];
[self assert:[@"key1", @"key2", @"key3"] equals:[dict allKeys]];
[self assert:[CPNull null] equals:[dict objectForKey:@"key3"]];
}
- (void)testDictionaryWithJSObjectNonRecursive
{
var non_recursive_dict = [CPDictionary dictionaryWithJSObject:json recursively:NO];
@@ -39,9 +39,9 @@ app ("__project.nameasidentifier__", function(task)
function printResults(configuration)
{
print("----------------------------")
print("----------------------------");
print(configuration+" app built at path: "+FILE.join("Build", configuration, "__project.nameasidentifier__"));
print("----------------------------")
print("----------------------------");
}
task ("default", ["__project.nameasidentifier__"], function()
@@ -40,9 +40,9 @@ app ("__project.nameasidentifier__", function(task)
function printResults(configuration)
{
print("----------------------------")
print("----------------------------");
print(configuration+" app built at path: "+FILE.join("Build", configuration, "__project.nameasidentifier__"));
print("----------------------------")
print("----------------------------");
}
task ("default", ["__project.nameasidentifier__"], function()