mirror of
https://github.com/cappuccino/cappuccino.git
synced 2026-08-27 05:57:04 +00:00
Format code, fix accidental global.
This commit is contained in:
@@ -253,7 +253,7 @@ var _CPLevelIndicatorBezelColor = nil,
|
||||
|
||||
var location = [self convertPoint:[anEvent locationInWindow] fromView:nil],
|
||||
bounds = [self bounds],
|
||||
oldValue = [self doubleValue];
|
||||
oldValue = [self doubleValue],
|
||||
newValue = oldValue;
|
||||
|
||||
// Moving the mouse outside of the widget to the left sets it
|
||||
|
||||
@@ -185,7 +185,8 @@ CPTransformableAttributeType = 1800;
|
||||
if (![[self operators] containsObject:[predicate predicateOperatorType]])
|
||||
return 0;
|
||||
|
||||
if (!_rightIsWildcard && ![[self rightExpressions] containsObject:[predicate rightExpression]]) return 0;
|
||||
if (!_rightIsWildcard && ![[self rightExpressions] containsObject:[predicate rightExpression]])
|
||||
return 0;
|
||||
|
||||
return 1;
|
||||
}
|
||||
|
||||
@@ -24,7 +24,7 @@ var _CPStandardWindowViewBodyBackgroundColor = nil;
|
||||
if (self)
|
||||
{
|
||||
var theClass = [self class],
|
||||
bounds = [self bounds];
|
||||
bounds = [self bounds];
|
||||
|
||||
_bodyView = [[CPView alloc] initWithFrame:_CGRectMake(0.0, 0.0, _CGRectGetWidth(bounds), _CGRectGetHeight(bounds))];
|
||||
|
||||
@@ -54,4 +54,4 @@ var _CPStandardWindowViewBodyBackgroundColor = nil;
|
||||
return aContentRect;
|
||||
}
|
||||
|
||||
@end
|
||||
@end
|
||||
|
||||
@@ -31,9 +31,8 @@
|
||||
[_CPCibCustomResource imageResourceWithName:"horizontal-track-center.png" size:CPSizeMake(1.0, 4.0)],
|
||||
[_CPCibCustomResource imageResourceWithName:"horizontal-track-right.png" size:CPSizeMake(2.0, 4.0)]
|
||||
]
|
||||
isVertical:NO]];
|
||||
|
||||
var horizontalSlider = [[CPSlider alloc] initWithFrame:CGRectMake(0.0, 0.0, 50.0, 24.0)];
|
||||
isVertical:NO]],
|
||||
horizontalSlider = [[CPSlider alloc] initWithFrame:CGRectMake(0.0, 0.0, 50.0, 24.0)];
|
||||
|
||||
[horizontalSlider setTrackWidth:4.0];
|
||||
[horizontalSlider setHorizontalTrackColor:horizontalTrackColor];
|
||||
@@ -55,9 +54,8 @@
|
||||
[_CPCibCustomResource imageResourceWithName:"vertical-track-center.png" size:CPSizeMake(4.0, 1.0)],
|
||||
[_CPCibCustomResource imageResourceWithName:"vertical-track-bottom.png" size:CPSizeMake(4.0, 2.0)]
|
||||
]
|
||||
isVertical:YES]];
|
||||
|
||||
var verticalSlider = [[CPSlider alloc] initWithFrame:CGRectMake(0.0, 0.0, 24.0, 50.0)];
|
||||
isVertical:YES]],
|
||||
verticalSlider = [[CPSlider alloc] initWithFrame:CGRectMake(0.0, 0.0, 24.0, 50.0)];
|
||||
|
||||
[verticalSlider setTrackWidth:4];
|
||||
[verticalSlider setVerticalTrackColor:verticalTrackColor];
|
||||
|
||||
+1
-1
@@ -245,7 +245,7 @@ Date.parseISO8601 = function (date)
|
||||
|
||||
if (isNaN(timestamp) && (struct = /^(\d{4}|[+\-]\d{6})(?:-(\d{2})(?:-(\d{2}))?)?(?:T(\d{2}):(\d{2})(?::(\d{2})(?:\.(\d{3}))?)?(?:(Z)|([+\-])(\d{2})(?::(\d{2}))?)?)?$/.exec(date)))
|
||||
{
|
||||
// avoid NaN timestamps caused by “undefined” values being passed to Date.UTC
|
||||
// avoid NaN timestamps caused by "undefined" values being passed to Date.UTC
|
||||
for (var i = 0, k; (k = numericKeys[i]); ++i)
|
||||
struct[k] = +struct[k] || 0;
|
||||
|
||||
|
||||
@@ -181,7 +181,7 @@ function CPDecimalMakeWithParts(mantissa, exponent)
|
||||
var m = [],
|
||||
isNegative = NO;
|
||||
|
||||
if (mantissa < 0 )
|
||||
if (mantissa < 0)
|
||||
{
|
||||
isNegative = YES;
|
||||
mantissa = ABS(mantissa);
|
||||
@@ -1400,10 +1400,9 @@ function CPDecimalRound(result, dcm, scale ,roundingMode)
|
||||
function CPDecimalCompact(dcm)
|
||||
{
|
||||
// if positive or zero exp leading zeros simply delete, trailing ones u need to increment exponent
|
||||
if (!dcm || dcm._mantissa.length == 0 || CPDecimalIsNotANumber(dcm) )
|
||||
if (!dcm || dcm._mantissa.length == 0 || CPDecimalIsNotANumber(dcm))
|
||||
return;
|
||||
|
||||
|
||||
if (CPDecimalIsZero(dcm))
|
||||
{
|
||||
// handle zero number compacting
|
||||
|
||||
+24
-12
@@ -222,7 +222,8 @@ FIXME: Do we need this?
|
||||
|
||||
- (CPString)descriptionWithLocale:(CPDictionary)aDictionary
|
||||
{
|
||||
if (!aDictionary) return toString();
|
||||
if (!aDictionary)
|
||||
return toString();
|
||||
|
||||
throw new Error("descriptionWithLocale: NOT YET IMPLEMENTED");
|
||||
}
|
||||
@@ -234,37 +235,43 @@ FIXME: Do we need this?
|
||||
|
||||
- (double)doubleValue
|
||||
{
|
||||
if (typeof self == "boolean") return self ? 1 : 0;
|
||||
if (typeof self == "boolean")
|
||||
return self ? 1 : 0;
|
||||
return self;
|
||||
}
|
||||
|
||||
- (float)floatValue
|
||||
{
|
||||
if (typeof self == "boolean") return self ? 1 : 0;
|
||||
if (typeof self == "boolean")
|
||||
return self ? 1 : 0;
|
||||
return self;
|
||||
}
|
||||
|
||||
- (int)intValue
|
||||
{
|
||||
if (typeof self == "boolean") return self ? 1 : 0;
|
||||
if (typeof self == "boolean")
|
||||
return self ? 1 : 0;
|
||||
return self;
|
||||
}
|
||||
|
||||
- (long long)longLongValue
|
||||
{
|
||||
if (typeof self == "boolean") return self ? 1 : 0;
|
||||
if (typeof self == "boolean")
|
||||
return self ? 1 : 0;
|
||||
return self;
|
||||
}
|
||||
|
||||
- (long)longValue
|
||||
{
|
||||
if (typeof self == "boolean") return self ? 1 : 0;
|
||||
if (typeof self == "boolean")
|
||||
return self ? 1 : 0;
|
||||
return self;
|
||||
}
|
||||
|
||||
- (short)shortValue
|
||||
{
|
||||
if (typeof self == "boolean") return self ? 1 : 0;
|
||||
if (typeof self == "boolean")
|
||||
return self ? 1 : 0;
|
||||
return self;
|
||||
}
|
||||
|
||||
@@ -280,7 +287,8 @@ FIXME: Do we need this?
|
||||
|
||||
- (unsigned int)unsignedIntValue
|
||||
{
|
||||
if (typeof self == "boolean") return self ? 1 : 0;
|
||||
if (typeof self == "boolean")
|
||||
return self ? 1 : 0;
|
||||
return self;
|
||||
}
|
||||
/*
|
||||
@@ -292,20 +300,24 @@ FIXME: Do we need this?
|
||||
*/
|
||||
- (unsigned long)unsignedLongValue
|
||||
{
|
||||
if (typeof self == "boolean") return self ? 1 : 0;
|
||||
if (typeof self == "boolean")
|
||||
return self ? 1 : 0;
|
||||
return self;
|
||||
}
|
||||
|
||||
- (unsigned short)unsignedShortValue
|
||||
{
|
||||
if (typeof self == "boolean") return self ? 1 : 0;
|
||||
if (typeof self == "boolean")
|
||||
return self ? 1 : 0;
|
||||
return self;
|
||||
}
|
||||
|
||||
- (CPComparisonResult)compare:(CPNumber)aNumber
|
||||
{
|
||||
if (self > aNumber) return CPOrderedDescending;
|
||||
else if (self < aNumber) return CPOrderedAscending;
|
||||
if (self > aNumber)
|
||||
return CPOrderedDescending;
|
||||
else if (self < aNumber) return
|
||||
CPOrderedAscending;
|
||||
|
||||
return CPOrderedSame;
|
||||
}
|
||||
|
||||
@@ -292,7 +292,7 @@
|
||||
|
||||
loc += (""+f).length;
|
||||
var i = 0;
|
||||
while (!isNaN(parseFloat(str.substring(loc+i, str.length))))
|
||||
while (!isNaN(parseFloat(str.substring(loc + i, str.length))))
|
||||
{i++;}
|
||||
|
||||
[self setScanLocation:loc + i];
|
||||
|
||||
Reference in New Issue
Block a user