diff --git a/AppKit/CPApplication.j b/AppKit/CPApplication.j
index 2f67b076d..fd7bcfc47 100644
--- a/AppKit/CPApplication.j
+++ b/AppKit/CPApplication.j
@@ -873,7 +873,7 @@ CPRunContinuesResponse = -1002;
Checks for a target in the following order:
- a responder from the key window
- - a responder frmo the main window
+ - a responder from the main window
- the CPApplication instance
- the application delegate
- the document controller
diff --git a/AppKit/CPCollectionView.j b/AppKit/CPCollectionView.j
index e6976c3ba..cf91c32cd 100644
--- a/AppKit/CPCollectionView.j
+++ b/AppKit/CPCollectionView.j
@@ -758,7 +758,7 @@
[self _scrollToSelection];
}
-- (void)deleteBackwards:(id)sender
+- (void)deleteBackward:(id)sender
{
if ([[self delegate] respondsToSelector:@selector(collectionView:shouldDeleteItemsAtIndexes:)])
{
diff --git a/AppKit/CPFontManager.j b/AppKit/CPFontManager.j
index e95057b99..e4f9c8c68 100644
--- a/AppKit/CPFontManager.j
+++ b/AppKit/CPFontManager.j
@@ -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
diff --git a/AppKit/CPImageView.j b/AppKit/CPImageView.j
index 817ffbd0b..234f74ceb 100644
--- a/AppKit/CPImageView.j
+++ b/AppKit/CPImageView.j
@@ -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
diff --git a/AppKit/CPTextField.j b/AppKit/CPTextField.j
index e70984296..7459fa772 100644
--- a/AppKit/CPTextField.j
+++ b/AppKit/CPTextField.j
@@ -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],
diff --git a/Foundation/CPDictionary.j b/Foundation/CPDictionary.j
index e6f83f56a..28e7a1310 100755
--- a/Foundation/CPDictionary.j
+++ b/Foundation/CPDictionary.j
@@ -153,6 +153,12 @@
continue;
var value = object[key];
+
+ if (value === null)
+ {
+ [dictionary setObject:[CPNull null] forKey:key];
+ continue;
+ }
if (recursively)
{
diff --git a/Jakefile b/Jakefile
index 94112040d..77a4ccc0a 100644
--- a/Jakefile
+++ b/Jakefile
@@ -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();
diff --git a/Tests/Foundation/CPDateTest.j b/Tests/Foundation/CPDateTest.j
index ccaf42666..4668d37af 100644
--- a/Tests/Foundation/CPDateTest.j
+++ b/Tests/Foundation/CPDateTest.j
@@ -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
diff --git a/Tests/Foundation/CPDictionaryTest.j b/Tests/Foundation/CPDictionaryTest.j
index f3936b26b..3cdfd51df 100644
--- a/Tests/Foundation/CPDictionaryTest.j
+++ b/Tests/Foundation/CPDictionaryTest.j
@@ -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];
diff --git a/Tools/capp/Resources/Templates/Application/Jakefile b/Tools/capp/Resources/Templates/Application/Jakefile
index 752b63495..2fa0c14f9 100644
--- a/Tools/capp/Resources/Templates/Application/Jakefile
+++ b/Tools/capp/Resources/Templates/Application/Jakefile
@@ -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()
diff --git a/Tools/capp/Resources/Templates/NibApplication/Jakefile b/Tools/capp/Resources/Templates/NibApplication/Jakefile
index bbda96c09..41505c40a 100644
--- a/Tools/capp/Resources/Templates/NibApplication/Jakefile
+++ b/Tools/capp/Resources/Templates/NibApplication/Jakefile
@@ -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()