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/CPColor.j b/AppKit/CPColor.j
index cdc3af3a7..ee14fb397 100644
--- a/AppKit/CPColor.j
+++ b/AppKit/CPColor.j
@@ -437,51 +437,16 @@ var cachedBlackColor,
if (self)
{
_components = components;
-
- if (!CPFeatureIsCompatible(CPCSSRGBAFeature) && _components[3] != 1.0 && window.Base64 && window.CRC32)
- {
- var bytes = [0x89,0x50,0x4e,0x47,0xd,0xa,0x1a,0xa,0x0,0x0,0x0,0xd,0x49,0x48,0x44,0x52,0x0,0x0,0x0,0x1,0x0,0x0,0x0,0x1,0x8,0x3,0x0,0x0,0x0,0x28,0xcb,0x34,0xbb,0x0,0x0,0x3,0x0,0x50,0x4c,0x54,0x45,0xff,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0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- var b_off = 43;
- var a_off = 821;
- var plte_crc_off = 809;
- var trns_crc_off = 822;
- var plte_type_off = 37;
- var trns_type_off = 817;
-
- bytes[r_off] = Math.round(_components[0]*255);
- bytes[g_off] = Math.round(_components[1]*255);
- bytes[b_off] = Math.round(_components[2]*255);
- bytes[a_off] = Math.round(_components[3]*255);
-
- // calculate new CRCs
- var new_plte_crc = integerToBytes(CRC32.getCRC(bytes, plte_type_off, 4+768), 4);
- var new_trns_crc = integerToBytes(CRC32.getCRC(bytes, trns_type_off, 4+1), 4);
-
- // overwrite old CRCs with new ones
- for (var i = 0; i < 4; i++)
- {
- bytes[plte_crc_off+i] = new_plte_crc[i];
- bytes[trns_crc_off+i] = new_trns_crc[i];
- }
-
- // Base64 encode, strip whitespace and build data URL
- var base64image = Base64.encode(bytes); //.replace(/[\s]/g, "");
-
- _cssString = "url(\"data:image/png;base64," + base64image + "\")";
- }
- else
- {
- var hasAlpha = CPFeatureIsCompatible(CPCSSRGBAFeature) && _components[3] != 1.0;
-
- _cssString = (hasAlpha ? "rgba(" : "rgb(") +
- parseInt(_components[0] * 255.0) + ", " +
- parseInt(_components[1] * 255.0) + ", " +
- parseInt(_components[2] * 255.0) +
- (hasAlpha ? (", " + _components[3]) : "") + ")";
- }
+
+ var hasAlpha = CPFeatureIsCompatible(CPCSSRGBAFeature) && _components[3] != 1.0;
+
+ _cssString = (hasAlpha ? "rgba(" : "rgb(") +
+ parseInt(_components[0] * 255.0) + ", " +
+ parseInt(_components[1] * 255.0) + ", " +
+ parseInt(_components[2] * 255.0) +
+ (hasAlpha ? (", " + _components[3]) : "") + ")";
}
+
return self;
}
@@ -494,6 +459,7 @@ var cachedBlackColor,
{
_patternImage = anImage;
_cssString = "url(\"" + [_patternImage filename] + "\")";
+ _components = [];
}
return self;
@@ -512,7 +478,7 @@ var cachedBlackColor,
*/
- (float)alphaComponent
{
- return _components[3];
+ return _components[3] || 0.0;
}
/*!
@@ -520,7 +486,7 @@ var cachedBlackColor,
*/
- (float)blueComponent
{
- return _components[2];
+ return _components[2] || 0.0;
}
/*!
@@ -528,7 +494,7 @@ var cachedBlackColor,
*/
- (float)greenComponent
{
- return _components[1];
+ return _components[1] || 0.0;
}
/*!
@@ -536,7 +502,7 @@ var cachedBlackColor,
*/
- (float)redComponent
{
- return _components[0];
+ return _components[0] || 0.0;
}
/*!
@@ -736,7 +702,7 @@ var CPColorComponentsKey = @"CPColorComponentsKey",
var hexCharacters = "0123456789ABCDEF";
// HACK: prevent these from becoming globals. workaround for obj-j "function foo(){}" behavior
-var hexToRGB, integerToBytes, rgbToHex, byteToHex;
+var hexToRGB, rgbToHex, byteToHex;
/*!
Used for the CPColor \c +colorWithHexString: implementation
@@ -764,18 +730,6 @@ function hexToRGB(hex)
return [red, green, blue, 1.0];
}
-function integerToBytes(integer, length) {
- if (!length)
- length = (integer == 0) ? 1 : Math.round((Math.log(integer)/Math.log(2))/8+0.5);
-
- var bytes = new Array(length);
- for (var i = length-1; i >= 0; i--) {
- bytes[i] = integer & 255;
- integer = integer >> 8
- }
- return bytes;
-}
-
function rgbToHex(r,g,b) {
return byteToHex(r) + byteToHex(g) + byteToHex(b);
}
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/CPTableView.j b/AppKit/CPTableView.j
index af31a0a82..9a34956d4 100644
--- a/AppKit/CPTableView.j
+++ b/AppKit/CPTableView.j
@@ -1763,25 +1763,18 @@ CPTableViewFirstColumnOnlyAutoresizingStyle = 5;
return YES;
}
-- (CPImage)dragImageForRowsWithIndexes:(CPIndexSet)dragRows
- tableColumns:(CPArray)theTableColumns
- event:(CPEvent)dragEvent
- offset:(CPPointPointer)dragImageOffset
+- (CPImage)dragImageForRowsWithIndexes:(CPIndexSet)dragRows tableColumns:(CPArray)theTableColumns event:(CPEvent)dragEvent offset:(CPPointPointer)dragImageOffset
{
return [[CPImage alloc] initWithContentsOfFile:@"Frameworks/AppKit/Resources/GenericFile.png" size:CGSizeMake(32,32)];
}
-- (CPView)dragViewForRowsWithIndexes:(CPIndexSet)theDraggedRows
- tableColumns:(CPArray)theTableColumns
- event:(CPEvent)theDragEvent
- offset:(CPPoint)dragViewOffset
+- (CPView)dragViewForRowsWithIndexes:(CPIndexSet)theDraggedRows tableColumns:(CPArray)theTableColumns event:(CPEvent)theDragEvent offset:(CPPoint)dragViewOffset
{
var bounds = [self bounds],
view = [[CPView alloc] initWithFrame:bounds];
-
- [view setBackgroundColor:[CPColor clearColor]];
+
[view setAlphaValue:0.7];
-
+
// We have to fetch all the data views for the selected rows and columns
// After that we can copy these add them to a transparent drag view and use that drag view
// to make it appear we are dragging images of those rows (as you would do in regular Cocoa)
@@ -1791,35 +1784,34 @@ CPTableViewFirstColumnOnlyAutoresizingStyle = 5;
exposedRowsLength = [_exposedRows lastIndex] - firstExposedRow + 1,
columns = [],
rows = [];
-
+
[_exposedColumns getIndexes:columns maxCount:-1 inIndexRange:CPMakeRange(firstExposedColumn, exposedColumnsLength)];
[theDraggedRows getIndexes:rows maxCount:-1 inIndexRange:CPMakeRange(firstExposedRow, exposedRowsLength)];
var columnIndex = [columns count];
-
+
while (columnIndex--)
{
var column = columns[columnIndex],
tableColumn = [_tableColumns objectAtIndex:column],
rowIndex = [rows count];
-
+
while (rowIndex--)
{
var row = rows[rowIndex];
var dataView = [self _newDataViewForRow:row tableColumn:tableColumn];
-
- [dataView setBackgroundColor:[CPColor clearColor]];
+
[dataView setFrame:[self frameOfDataViewAtColumn:column row:row]];
[dataView setObjectValue:[self _objectValueForTableColumn:tableColumn row:row]];
-
+
[view addSubview:dataView];
}
}
-
+
var dragPoint = [self convertPoint:[theDragEvent locationInWindow] fromView:nil];
dragViewOffset.x = CGRectGetWidth(bounds)/2 - dragPoint.x;
dragViewOffset.y = CGRectGetHeight(bounds)/2 - dragPoint.y;
-
+
return view;
}
@@ -1841,7 +1833,7 @@ CPTableViewFirstColumnOnlyAutoresizingStyle = 5;
var numberOfRows = [self numberOfRows] + 1;
var reason = @"Attempt to set dropRow=" + row +
" dropOperation=CPTableViewDropOn when [0 - " + numberOfRows + "] is valid range of rows."
-
+
[[CPException exceptionWithName:@"Error" reason:reason userInfo:nil] raise];
}
@@ -1897,7 +1889,7 @@ CPTableViewFirstColumnOnlyAutoresizingStyle = 5;
return;
_sortDescriptors = newSortDescriptors;
-
+
[self _sendDataSourceSortDescriptorsDidChange:oldSortDescriptors];
}
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/AppKit/CPView.j b/AppKit/CPView.j
index 90685cb6c..3b3fa55ca 100644
--- a/AppKit/CPView.j
+++ b/AppKit/CPView.j
@@ -1199,7 +1199,7 @@ var CPViewFlags = { },
if (CPFeatureIsCompatible(CPOpacityRequiresFilterFeature))
{
- if (anAlphaValue == 1.0)
+ if (anAlphaValue === 1.0)
try { _DOMElement.style.removeAttribute("filter") } catch (anException) { }
else
_DOMElement.style.filter = "alpha(opacity=" + anAlphaValue * 100 + ")";
@@ -1317,56 +1317,72 @@ var CPViewFlags = { },
{
if (_backgroundColor == aColor)
return;
-
+
_backgroundColor = aColor;
-
+
#if PLATFORM(DOM)
var patternImage = [_backgroundColor patternImage],
+ colorExists = _backgroundColor && [_backgroundColor alphaComponent] > 0.0,
+ colorHasAlpha = colorExists && [_backgroundColor alphaComponent] < 1.0,
+ supportsRGBA = CPFeatureIsCompatible(CPCSSRGBAFeature),
+ colorNeedsDOMElement = colorHasAlpha && !supportsRGBA,
amount = 0;
-
+
if ([patternImage isThreePartImage])
{
_backgroundType = [patternImage isVertical] ? BackgroundVerticalThreePartImage : BackgroundHorizontalThreePartImage;
-
amount = 3 - _DOMImageParts.length;
}
else if ([patternImage isNinePartImage])
{
_backgroundType = BackgroundNinePartImage;
-
- amount = 9 - _DOMImageParts.length;
+ amount = 9 - _DOMImageParts.length;
}
else
{
_backgroundType = BackgroundTrivialColor;
-
- amount = 0 - _DOMImageParts.length;
+ amount = (colorNeedsDOMElement ? 1 : 0) - _DOMImageParts.length;
}
if (amount > 0)
+ {
while (amount--)
{
var DOMElement = DOMElementPrototype.cloneNode(false);
-
+
DOMElement.style.zIndex = -1000;
-
+
_DOMImageParts.push(DOMElement);
_DOMElement.appendChild(DOMElement);
}
+ }
else
{
amount = -amount;
-
while (amount--)
_DOMElement.removeChild(_DOMImageParts.pop());
}
-
- if (_backgroundType == BackgroundTrivialColor)
-
- // Opera doesn't like DOM properties set to nil.
- // https://trac.280north.com/ticket/7
- _DOMElement.style.background = _backgroundColor ? [_backgroundColor cssString] : "";
-
+
+ if (_backgroundType === BackgroundTrivialColor)
+ {
+ var colorCSS = colorExists ? [_backgroundColor cssString] : "";
+
+ if (colorNeedsDOMElement)
+ {
+ _DOMElement.style.background = "";
+ _DOMImageParts[0].style.background = [_backgroundColor cssString];
+
+ if (CPFeatureIsCompatible(CPOpacityRequiresFilterFeature))
+ _DOMImageParts[0].style.filter = "alpha(opacity=" + [_backgroundColor alphaComponent] * 100 + ")";
+ else
+ _DOMImageParts[0].style.opacity = [_backgroundColor alphaComponent];
+
+ var size = [self bounds].size;
+ CPDOMDisplayServerSetStyleSize(_DOMImageParts[0], size.width, size.height);
+ }
+ else
+ _DOMElement.style.background = colorCSS;
+ }
else
{
var slices = [patternImage imageSlices],
@@ -1377,23 +1393,31 @@ var CPViewFlags = { },
{
var image = slices[count],
size = _DOMImageSizes[count] = image ? [image size] : _CGSizeMakeZero();
-
+
CPDOMDisplayServerSetStyleSize(_DOMImageParts[count], size.width, size.height);
_DOMImageParts[count].style.background = image ? "url(\"" + [image filename] + "\")" : "";
+
+ if (!supportsRGBA)
+ {
+ if (CPFeatureIsCompatible(CPOpacityRequiresFilterFeature))
+ try { _DOMImageParts[count].style.removeAttribute("filter") } catch (anException) { }
+ else
+ _DOMImageParts[count].style.opacity = 1.0;
+ }
}
-
+
if (_backgroundType == BackgroundNinePartImage)
{
var width = frameSize.width - _DOMImageSizes[0].width - _DOMImageSizes[2].width,
height = frameSize.height - _DOMImageSizes[0].height - _DOMImageSizes[6].height;
-
+
CPDOMDisplayServerSetStyleSize(_DOMImageParts[1], width, _DOMImageSizes[0].height);
CPDOMDisplayServerSetStyleSize(_DOMImageParts[3], _DOMImageSizes[3].width, height);
CPDOMDisplayServerSetStyleSize(_DOMImageParts[4], width, height);
CPDOMDisplayServerSetStyleSize(_DOMImageParts[5], _DOMImageSizes[5].width, height);
CPDOMDisplayServerSetStyleSize(_DOMImageParts[7], width, _DOMImageSizes[7].height);
-
+
CPDOMDisplayServerSetStyleLeftTop(_DOMImageParts[0], NULL, 0.0, 0.0);
CPDOMDisplayServerSetStyleLeftTop(_DOMImageParts[1], NULL, _DOMImageSizes[0].width, 0.0);
CPDOMDisplayServerSetStyleRightTop(_DOMImageParts[2], NULL, 0.0, 0.0);
@@ -1407,7 +1431,7 @@ var CPViewFlags = { },
else if (_backgroundType == BackgroundVerticalThreePartImage)
{
CPDOMDisplayServerSetStyleSize(_DOMImageParts[1], frameSize.width, frameSize.height - _DOMImageSizes[0].height - _DOMImageSizes[2].height);
-
+
CPDOMDisplayServerSetStyleLeftTop(_DOMImageParts[0], NULL, 0.0, 0.0);
CPDOMDisplayServerSetStyleLeftTop(_DOMImageParts[1], NULL, 0.0, _DOMImageSizes[0].height);
CPDOMDisplayServerSetStyleLeftBottom(_DOMImageParts[2], NULL, 0.0, 0.0);
@@ -1415,7 +1439,7 @@ var CPViewFlags = { },
else if (_backgroundType == BackgroundHorizontalThreePartImage)
{
CPDOMDisplayServerSetStyleSize(_DOMImageParts[1], frameSize.width - _DOMImageSizes[0].width - _DOMImageSizes[2].width, frameSize.height);
-
+
CPDOMDisplayServerSetStyleLeftTop(_DOMImageParts[0], NULL, 0.0, 0.0);
CPDOMDisplayServerSetStyleLeftTop(_DOMImageParts[1], NULL, _DOMImageSizes[0].width, 0.0);
CPDOMDisplayServerSetStyleRightTop(_DOMImageParts[2], NULL, 0.0, 0.0);
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()