mirror of
https://github.com/cappuccino/cappuccino.git
synced 2026-09-05 02:13:40 +00:00
Merge branch 'fixes' of https://github.com/stevegeek/cappuccino into stevegeek-fixes
Conflicts: Foundation/CPValueTransformer.j
This commit is contained in:
+19
-24
@@ -20,7 +20,6 @@
|
||||
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
|
||||
*/
|
||||
|
||||
|
||||
function CPStringFromSelector(aSelector)
|
||||
{
|
||||
return sel_getName(aSelector);
|
||||
@@ -41,27 +40,23 @@ function CPStringFromClass(aClass)
|
||||
return class_getName(aClass);
|
||||
}
|
||||
|
||||
CPOrderedAscending = -1;
|
||||
CPOrderedSame = 0;
|
||||
CPOrderedDescending = 1;
|
||||
/*!
|
||||
The left operand is smaller than the right.
|
||||
@global
|
||||
@group CPComparisonResult
|
||||
*/
|
||||
CPOrderedAscending = -1;
|
||||
/*!
|
||||
The left and right operands are equal.
|
||||
@global
|
||||
@group CPComparisonResult
|
||||
*/
|
||||
CPOrderedSame = 0;
|
||||
/*!
|
||||
The left operand is greater than the right.
|
||||
@global
|
||||
@group CPComparisonResult
|
||||
*/
|
||||
CPOrderedDescending = 1;
|
||||
|
||||
CPNotFound = -1;
|
||||
|
||||
MIN = Math.min;
|
||||
MAX = Math.max;
|
||||
ABS = Math.abs;
|
||||
|
||||
/*function MIN(lhs, rhs)
|
||||
{
|
||||
return Math.min(lhs, rhs);
|
||||
}
|
||||
|
||||
function MAX(lhs, rhs)
|
||||
{
|
||||
return Math.max(lhs, rhs);
|
||||
}
|
||||
|
||||
function ABS(argument)
|
||||
{
|
||||
return Math.abs(argument);
|
||||
}*/
|
||||
CPNotFound = -1;
|
||||
|
||||
@@ -22,26 +22,7 @@
|
||||
|
||||
@import "CPObject.j"
|
||||
@import "CPObjJRuntime.j"
|
||||
|
||||
|
||||
/*!
|
||||
The left operand is smaller than the right.
|
||||
@global
|
||||
@group CPComparisonResult
|
||||
*/
|
||||
CPOrderedAscending = -1;
|
||||
/*!
|
||||
The left and right operands are equal.
|
||||
@global
|
||||
@group CPComparisonResult
|
||||
*/
|
||||
CPOrderedSame = 0;
|
||||
/*!
|
||||
The left operand is greater than the right.
|
||||
@global
|
||||
@group CPComparisonResult
|
||||
*/
|
||||
CPOrderedDescending = 1;
|
||||
@import "CPString.j"
|
||||
|
||||
/*!
|
||||
@class CPSortDescriptor
|
||||
|
||||
@@ -22,10 +22,11 @@
|
||||
|
||||
@import "CPException.j"
|
||||
@import "CPObject.j"
|
||||
@import "CPObjJRuntime.j"
|
||||
@import "CPRange.j"
|
||||
@import "CPSortDescriptor.j"
|
||||
@import "CPValue.j"
|
||||
|
||||
|
||||
/*!
|
||||
A case insensitive search
|
||||
@global
|
||||
|
||||
@@ -25,7 +25,6 @@
|
||||
@import "CPObject.j"
|
||||
@import "CPRunLoop.j"
|
||||
|
||||
|
||||
/*!
|
||||
@class CPTimer
|
||||
@ingroup foundation
|
||||
@@ -51,7 +50,6 @@
|
||||
{
|
||||
var timer = [[self alloc] initWithFireDate:[CPDate dateWithTimeIntervalSinceNow:seconds] interval:seconds invocation:anInvocation repeats:shouldRepeat];
|
||||
|
||||
//add to the runloop
|
||||
[[CPRunLoop currentRunLoop] addTimer:timer forMode:CPDefaultRunLoopMode];
|
||||
|
||||
return timer;
|
||||
@@ -64,7 +62,6 @@
|
||||
{
|
||||
var timer = [[self alloc] initWithFireDate:[CPDate dateWithTimeIntervalSinceNow:seconds] interval:seconds target:aTarget selector:aSelector userInfo:userInfo repeats:shouldRepeat];
|
||||
|
||||
//add to the runloop
|
||||
[[CPRunLoop currentRunLoop] addTimer:timer forMode:CPDefaultRunLoopMode];
|
||||
|
||||
return timer;
|
||||
@@ -77,7 +74,6 @@
|
||||
{
|
||||
var timer = [[self alloc] initWithFireDate:[CPDate dateWithTimeIntervalSinceNow:seconds] interval:seconds callback:aFunction repeats:shouldRepeat];
|
||||
|
||||
//add to the runloop
|
||||
[[CPRunLoop currentRunLoop] addTimer:timer forMode:CPDefaultRunLoopMode];
|
||||
|
||||
return timer;
|
||||
|
||||
@@ -21,6 +21,7 @@
|
||||
*/
|
||||
|
||||
@import "CPObject.j"
|
||||
@import "CPString.j"
|
||||
|
||||
CPURLNameKey = @"CPURLNameKey";
|
||||
CPURLLocalizedNameKey = @"CPURLLocalizedNameKey";
|
||||
|
||||
@@ -20,12 +20,12 @@
|
||||
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
|
||||
*/
|
||||
|
||||
@import "CPData.j"
|
||||
@import "CPObject.j"
|
||||
@import "CPRunLoop.j"
|
||||
@import "CPURLRequest.j"
|
||||
@import "CPURLResponse.j"
|
||||
|
||||
|
||||
var CPURLConnectionDelegate = nil;
|
||||
|
||||
/*!
|
||||
|
||||
@@ -20,8 +20,10 @@
|
||||
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
|
||||
*/
|
||||
|
||||
@import "CPDictionary.j"
|
||||
@import "CPObject.j"
|
||||
|
||||
@import "CPString.j"
|
||||
@import "CPURL.j"
|
||||
|
||||
/*!
|
||||
@class CPURLRequest
|
||||
|
||||
@@ -21,7 +21,7 @@
|
||||
*/
|
||||
|
||||
@import "CPObject.j"
|
||||
|
||||
@import "CPURL.j"
|
||||
|
||||
/*
|
||||
CPURL _URL;
|
||||
|
||||
@@ -20,12 +20,15 @@
|
||||
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
|
||||
*/
|
||||
|
||||
@import "CPArray.j"
|
||||
@import "CPException.j"
|
||||
@import "CPInvocation.j"
|
||||
@import "CPNotificationCenter.j"
|
||||
@import "CPObject.j"
|
||||
@import "CPProxy.j"
|
||||
@import "CPKeyValueObserving.j"
|
||||
@import "CPRunLoop.j"
|
||||
|
||||
|
||||
var CPUndoManagerNormal = 0,
|
||||
CPUndoManagerUndoing = 1,
|
||||
CPUndoManagerRedoing = 2;
|
||||
|
||||
+40
-22
@@ -20,14 +20,28 @@
|
||||
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
|
||||
*/
|
||||
|
||||
@import <AppKit/CPApplication.j>
|
||||
@import <AppKit/CPCookie.j>
|
||||
|
||||
@import "CPBundle.j"
|
||||
@import "CPData.j"
|
||||
@import "CPDictionary.j"
|
||||
@import "CPException.j"
|
||||
@import "CPKeyedArchiver.j"
|
||||
@import "CPKeyedUnarchiver.j"
|
||||
@import "CPNotificationCenter.j"
|
||||
@import "CPObject.j"
|
||||
@import "CPRunLoop.j"
|
||||
@import "CPString.j"
|
||||
@import "CPURL.j"
|
||||
@import "CPURLConnection.j"
|
||||
@import "CPURLRequest.j"
|
||||
|
||||
|
||||
CPArgumentDomain = @"CPArgumentDomain";
|
||||
CPApplicationDomain = [[[CPBundle mainBundle] infoDictionary] objectForKey:@"CPBundleIdentifier"] || @"CPApplicationDomain";
|
||||
CPGlobalDomain = @"CPGlobalDomain";
|
||||
CPLocaleDomain = @"CPLocaleDomain";
|
||||
CPRegistrationDomain = @"CPRegistrationDomain";
|
||||
CPArgumentDomain = @"CPArgumentDomain";
|
||||
CPApplicationDomain = [[[CPBundle mainBundle] infoDictionary] objectForKey:@"CPBundleIdentifier"] || @"CPApplicationDomain";
|
||||
CPGlobalDomain = @"CPGlobalDomain";
|
||||
CPLocaleDomain = @"CPLocaleDomain";
|
||||
CPRegistrationDomain = @"CPRegistrationDomain";
|
||||
|
||||
CPUserDefaultsDidChangeNotification = @"CPUserDefaultsDidChangeNotification";
|
||||
|
||||
@@ -110,9 +124,10 @@ var StandardUserDefaults;
|
||||
{
|
||||
var args = [CPApp namedArguments],
|
||||
keys = [args allKeys],
|
||||
count = [keys count];
|
||||
count = [keys count],
|
||||
i = 0;
|
||||
|
||||
for (var i = 0; i < count; i++)
|
||||
for (; i < count; i++)
|
||||
{
|
||||
var key = keys[i];
|
||||
[self setObject:[args objectForKey:key] forKey:key inDomain:CPArgumentDomain];
|
||||
@@ -214,9 +229,10 @@ var StandardUserDefaults;
|
||||
- (void)registerDefaults:(CPDictionary)aDictionary
|
||||
{
|
||||
var keys = [aDictionary allKeys],
|
||||
count = [keys count];
|
||||
count = [keys count],
|
||||
i = 0;
|
||||
|
||||
for (var i = 0; i < count; i++)
|
||||
for (; i < count; i++)
|
||||
{
|
||||
var key = keys[i];
|
||||
[self setObject:[aDictionary objectForKey:key] forKey:key inDomain:CPRegistrationDomain];
|
||||
@@ -231,8 +247,8 @@ var StandardUserDefaults;
|
||||
*/
|
||||
- (void)registerDefaultsFromContentsOfFile:(CPURL)aURL
|
||||
{
|
||||
var contents = [CPURLConnection sendSynchronousRequest:[CPURLRequest requestWithURL:aURL] returningResponse:nil error:nil],
|
||||
data = [CPData dataWithRawString:[contents string]],
|
||||
var contents = [CPURLConnection sendSynchronousRequest:[CPURLRequest requestWithURL:aURL] returningResponse:nil],
|
||||
data = [CPData dataWithRawString:[contents rawString]],
|
||||
plist = [data plistObject];
|
||||
|
||||
[self registerDefaults:plist];
|
||||
@@ -246,20 +262,22 @@ var StandardUserDefaults;
|
||||
_searchListNeedsReload = NO;
|
||||
|
||||
var dicts = [CPRegistrationDomain, CPGlobalDomain, CPApplicationDomain, CPArgumentDomain],
|
||||
count = [dicts count];
|
||||
count = [dicts count],
|
||||
i = 0;
|
||||
|
||||
_searchList = [CPDictionary dictionary];
|
||||
|
||||
for (var i = 0; i < count; i++)
|
||||
for (; i < count; i++)
|
||||
{
|
||||
var domain = [_domains objectForKey:dicts[i]];
|
||||
if (!domain)
|
||||
continue;
|
||||
|
||||
var keys = [domain allKeys],
|
||||
keysCount = [keys count];
|
||||
keysCount = [keys count],
|
||||
j = 0;
|
||||
|
||||
for (var j = 0; j < keysCount; j++)
|
||||
for (; j < keysCount; j++)
|
||||
{
|
||||
var key = keys[j];
|
||||
[_searchList setObject:[domain objectForKey:key] forKey:key];
|
||||
@@ -557,7 +575,7 @@ var StandardUserDefaults;
|
||||
|
||||
@implementation CPUserDefaultsStore : CPObject
|
||||
{
|
||||
CPString domain @accessors;
|
||||
CPString _domain @accessors(property=domain);
|
||||
}
|
||||
|
||||
- (CPData)data
|
||||
@@ -580,12 +598,12 @@ var StandardUserDefaults;
|
||||
|
||||
- (void)setDomain:(CPString)aDomain
|
||||
{
|
||||
if (domain === aDomain)
|
||||
if (_domain === aDomain)
|
||||
return;
|
||||
|
||||
domain = aDomain;
|
||||
_domain = aDomain;
|
||||
|
||||
_cookie = [[CPCookie alloc] initWithName:domain];
|
||||
_cookie = [[CPCookie alloc] initWithName:_domain];
|
||||
}
|
||||
|
||||
- (CPData)data
|
||||
@@ -626,7 +644,7 @@ var StandardUserDefaults;
|
||||
|
||||
- (CPData)data
|
||||
{
|
||||
var result = localStorage.getItem(domain);
|
||||
var result = localStorage.getItem(_domain);
|
||||
if (!result || [result length] < 1)
|
||||
return nil;
|
||||
|
||||
@@ -635,7 +653,7 @@ var StandardUserDefaults;
|
||||
|
||||
- (void)setData:(CPData)aData
|
||||
{
|
||||
localStorage.setItem(domain, encodeURIComponent([aData rawString]));
|
||||
localStorage.setItem(_domain, encodeURIComponent([aData rawString]));
|
||||
}
|
||||
|
||||
@end
|
||||
|
||||
@@ -20,10 +20,10 @@
|
||||
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
|
||||
*/
|
||||
|
||||
@import "CPNotificationCenter.j"
|
||||
@import "CPObject.j"
|
||||
@import "CPString.j"
|
||||
|
||||
|
||||
CPUserSessionUndeterminedStatus = 0;
|
||||
CPUserSessionLoggedInStatus = 1;
|
||||
CPUserSessionLoggedOutStatus = 2;
|
||||
|
||||
@@ -23,7 +23,6 @@
|
||||
@import "CPCoder.j"
|
||||
@import "CPObject.j"
|
||||
|
||||
|
||||
/*!
|
||||
@class CPValue
|
||||
@ingroup foundation
|
||||
|
||||
@@ -23,13 +23,16 @@
|
||||
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
|
||||
*/
|
||||
|
||||
@import "CPObject.j"
|
||||
@import "CPData.j"
|
||||
@import "CPDictionary.j"
|
||||
|
||||
@import "CPException.j"
|
||||
@import "CPKeyedArchiver.j"
|
||||
@import "CPKeyedUnarchiver.j"
|
||||
@import "CPNumber.j"
|
||||
@import "CPObject.j"
|
||||
|
||||
var transformerMap = [CPDictionary dictionary];
|
||||
|
||||
|
||||
@implementation CPValueTransformer : CPObject
|
||||
{
|
||||
|
||||
@@ -75,7 +78,7 @@ var transformerMap = [CPDictionary dictionary];
|
||||
{
|
||||
if ([[self class] allowsReverseTransformation])
|
||||
{
|
||||
[CPException raise:CPInvalidArgumentException reason:(self+" is not reversible.")];
|
||||
[CPException raise:CPInvalidArgumentException reason:(self + " is not reversible.")];
|
||||
}
|
||||
|
||||
return [self transformedValue:aValue];
|
||||
|
||||
@@ -20,9 +20,13 @@
|
||||
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
|
||||
*/
|
||||
|
||||
@import <Foundation/CPObject.j>
|
||||
@import <Foundation/CPDictionary.j>
|
||||
@import <Foundation/CPURL.j>
|
||||
@import "CPArray.j"
|
||||
@import "CPDictionary.j"
|
||||
@import "CPObject.j"
|
||||
@import "CPString.j"
|
||||
@import "CPURL.j"
|
||||
@import "CPURLConnection.j"
|
||||
@import "CPURLRequest.j"
|
||||
|
||||
var setURLResourceValuesForKeysFromProperties = function(aURL, keys, properties)
|
||||
{
|
||||
@@ -174,7 +178,7 @@ WebDAVPropertiesForURLKeys[CPURLIsDirectoryKey] = @"resourcetype";
|
||||
//CPURLCustomIconKey = @"CPURLCustomIconKey";
|
||||
|
||||
var XMLDocumentFromString = function(anXMLString)
|
||||
{//console.log(anXMLString);
|
||||
{
|
||||
if (typeof window["ActiveXObject"] !== "undefined")
|
||||
{
|
||||
var XMLDocument = new ActiveXObject("Microsoft.XMLDOM");
|
||||
@@ -193,9 +197,8 @@ var parsePROPFINDResponse = function(anXMLString)
|
||||
var XMLDocument = XMLDocumentFromString(anXMLString),
|
||||
responses = XMLDocument.getElementsByTagNameNS("*", "response"),
|
||||
responseIndex = 0,
|
||||
responseCount = responses.length;
|
||||
|
||||
var propertiesForURLs = [CPDictionary dictionary];
|
||||
responseCount = responses.length,
|
||||
propertiesForURLs = [CPDictionary dictionary];
|
||||
|
||||
for (; responseIndex < responseCount; ++responseIndex)
|
||||
{
|
||||
@@ -220,7 +223,6 @@ var parsePROPFINDResponse = function(anXMLString)
|
||||
|
||||
if (nodeName === @"resourcetype")
|
||||
[properties setObject:element.firstChild ? CPWebDAVManagerCollectionResourceType : CPWebDAVManagerNonCollectionResourceType forKey:nodeName];
|
||||
|
||||
else
|
||||
[properties setObject:element.firstChild.nodeValue forKey:nodeName];
|
||||
}
|
||||
|
||||
@@ -33,8 +33,8 @@
|
||||
@import "CPDictionary.j"
|
||||
@import "CPEnumerator.j"
|
||||
@import "CPException.j"
|
||||
@import "CPFormatter.j"
|
||||
@import "CPExpression.j"
|
||||
@import "CPFormatter.j"
|
||||
@import "CPIndexSet.j"
|
||||
@import "CPInvocation.j"
|
||||
@import "CPJSONPConnection.j"
|
||||
|
||||
Reference in New Issue
Block a user