mirror of
https://github.com/cappuccino/cappuccino.git
synced 2026-09-07 19:27:12 +00:00
Merge remote-tracking branch 'upstream/master' into CPAnimationContext
This commit is contained in:
@@ -234,10 +234,11 @@
|
||||
{
|
||||
var button = buttonsNotHidden[count];
|
||||
|
||||
[button removeFromSuperview];
|
||||
|
||||
if ([button isHidden])
|
||||
{
|
||||
[button removeFromSuperview];
|
||||
[buttonsNotHidden removeObject:button];
|
||||
}
|
||||
}
|
||||
|
||||
var currentButtonOffset = _resizeControlIsLeftAligned ? CGRectGetMaxX([self bounds]) + 1 : -1,
|
||||
|
||||
@@ -111,6 +111,30 @@ CPCheckBoxImageOffset = 4.0;
|
||||
return startedTracking;
|
||||
}
|
||||
|
||||
|
||||
#pragma mark -
|
||||
#pragma mark Override methods from CPButton
|
||||
|
||||
- (CGSize)_minimumFrameSize
|
||||
{
|
||||
var size = [super _minimumFrameSize],
|
||||
contentView = [self ephemeralSubviewNamed:@"content-view"];
|
||||
|
||||
if (!contentView && [[self title] length])
|
||||
{
|
||||
var minSize = [self currentValueForThemeAttribute:@"min-size"],
|
||||
maxSize = [self currentValueForThemeAttribute:@"max-size"];
|
||||
|
||||
// Here we always add the min size to the control which is the size of the view of the checkBox
|
||||
size.width += minSize.width + CPCheckBoxImageOffset;
|
||||
|
||||
if (maxSize.width >= 0.0)
|
||||
size.width = MIN(size.width, maxSize.width);
|
||||
}
|
||||
|
||||
return size;
|
||||
}
|
||||
|
||||
@end
|
||||
|
||||
@implementation _CPCheckBoxValueBinder : CPBinder
|
||||
|
||||
@@ -46,75 +46,12 @@
|
||||
return;
|
||||
|
||||
if (_documentView)
|
||||
{
|
||||
[self _removeObserverDocumentView:_documentView];
|
||||
[_documentView removeFromSuperview];
|
||||
}
|
||||
|
||||
_documentView = aView;
|
||||
|
||||
if (_documentView)
|
||||
{
|
||||
[self addSubview:_documentView];
|
||||
[self _observeDocumentView];
|
||||
}
|
||||
}
|
||||
|
||||
- (void)_observeDocumentView
|
||||
{
|
||||
var defaultCenter = [CPNotificationCenter defaultCenter];
|
||||
|
||||
[_documentView setPostsFrameChangedNotifications:YES];
|
||||
[_documentView setPostsBoundsChangedNotifications:YES];
|
||||
|
||||
[defaultCenter
|
||||
addObserver:self
|
||||
selector:@selector(viewFrameChanged:)
|
||||
name:CPViewFrameDidChangeNotification
|
||||
object:_documentView];
|
||||
|
||||
[defaultCenter
|
||||
addObserver:self
|
||||
selector:@selector(viewBoundsChanged:)
|
||||
name:CPViewBoundsDidChangeNotification
|
||||
object:_documentView];
|
||||
}
|
||||
|
||||
- (void)_removeObserverDocumentView:(CPView)aDocumentView
|
||||
{
|
||||
var defaultCenter = [CPNotificationCenter defaultCenter];
|
||||
|
||||
[defaultCenter
|
||||
removeObserver:self
|
||||
name:CPViewFrameDidChangeNotification
|
||||
object:_documentView];
|
||||
|
||||
[defaultCenter
|
||||
removeObserver:self
|
||||
name:CPViewBoundsDidChangeNotification
|
||||
object:_documentView];
|
||||
}
|
||||
|
||||
- (void)_addObservers
|
||||
{
|
||||
if (_isObserving)
|
||||
return;
|
||||
|
||||
[super _addObservers];
|
||||
|
||||
if (_documentView)
|
||||
[self _observeDocumentView];
|
||||
}
|
||||
|
||||
- (void)_removeObservers
|
||||
{
|
||||
if (!_isObserving)
|
||||
return;
|
||||
|
||||
[super _removeObservers];
|
||||
|
||||
if (_documentView)
|
||||
[self _removeObserverDocumentView:_documentView];
|
||||
}
|
||||
|
||||
/*!
|
||||
@@ -275,7 +212,6 @@ var CPClipViewDocumentViewKey = @"CPScrollViewDocumentView";
|
||||
// Don't call setDocumentView: here. It calls addSubview:, but it's A) not necessary since the
|
||||
// view hierarchy is fully encoded and B) dangerous if the subview is not fully decoded.
|
||||
_documentView = [aCoder decodeObjectForKey:CPClipViewDocumentViewKey];
|
||||
[self _observeDocumentView];
|
||||
}
|
||||
|
||||
return self;
|
||||
|
||||
+106
-65
@@ -53,6 +53,11 @@ CPComboBoxWillPopUpNotification = @"CPComboBoxWillPopUpNotification";
|
||||
|
||||
CPComboBoxStateButtonBordered = CPThemeState("button-bordered");
|
||||
|
||||
var CPComboBoxDelegate_comboBoxSelectionIsChanging_ = 1 << 0,
|
||||
CPComboBoxDelegate_comboBoxSelectionDidChange_ = 1 << 1,
|
||||
CPComboBoxDelegate_comboBoxWillPopUp_ = 1 << 2,
|
||||
CPComboBoxDelegate_comboBoxWillDismiss_ = 1 << 3;
|
||||
|
||||
var CPComboBoxTextSubview = @"text",
|
||||
CPComboBoxButtonSubview = @"button",
|
||||
CPComboBoxDefaultNumberOfVisibleItems = 5,
|
||||
@@ -61,19 +66,20 @@ var CPComboBoxTextSubview = @"text",
|
||||
|
||||
@implementation CPComboBox : CPTextField
|
||||
{
|
||||
CPArray _items;
|
||||
_CPPopUpList _listDelegate;
|
||||
id<CPComboBoxDataSource> _dataSource;
|
||||
BOOL _usesDataSource;
|
||||
BOOL _completes;
|
||||
BOOL _canComplete;
|
||||
int _numberOfVisibleItems;
|
||||
BOOL _completes;
|
||||
BOOL _forceSelection;
|
||||
BOOL _hasVerticalScroller;
|
||||
CPString _selectedStringValue;
|
||||
CGSize _intercellSpacing;
|
||||
float _itemHeight;
|
||||
BOOL _popUpButtonCausedResign;
|
||||
BOOL _usesDataSource;
|
||||
CGSize _intercellSpacing;
|
||||
CPArray _items;
|
||||
id<CPComboBoxDataSource> _dataSource;
|
||||
CPInteger _implementedDelegateComboBoxMethods;
|
||||
CPString _selectedStringValue;
|
||||
float _itemHeight;
|
||||
int _numberOfVisibleItems;
|
||||
_CPPopUpList _listDelegate;
|
||||
}
|
||||
|
||||
+ (CPString)defaultThemeClass
|
||||
@@ -228,41 +234,21 @@ var CPComboBoxTextSubview = @"text",
|
||||
if (aDelegate === delegate)
|
||||
return;
|
||||
|
||||
var defaultCenter = [CPNotificationCenter defaultCenter];
|
||||
|
||||
if (delegate)
|
||||
{
|
||||
[defaultCenter removeObserver:delegate name:CPComboBoxSelectionIsChangingNotification object:self];
|
||||
[defaultCenter removeObserver:delegate name:CPComboBoxSelectionDidChangeNotification object:self];
|
||||
[defaultCenter removeObserver:delegate name:CPComboBoxWillDismissNotification object:self];
|
||||
[defaultCenter removeObserver:delegate name:CPComboBoxWillPopUpNotification object:self];
|
||||
}
|
||||
_implementedDelegateComboBoxMethods = 0;
|
||||
|
||||
if (aDelegate)
|
||||
{
|
||||
if ([aDelegate respondsToSelector:@selector(comboBoxSelectionIsChanging:)])
|
||||
[defaultCenter addObserver:delegate
|
||||
selector:@selector(comboBoxSelectionIsChanging:)
|
||||
name:CPComboBoxSelectionIsChangingNotification
|
||||
object:self];
|
||||
_implementedDelegateComboBoxMethods |= CPComboBoxDelegate_comboBoxSelectionIsChanging_;
|
||||
|
||||
if ([aDelegate respondsToSelector:@selector(comboBoxSelectionDidChange:)])
|
||||
[defaultCenter addObserver:delegate
|
||||
selector:@selector(comboBoxSelectionDidChange:)
|
||||
name:CPComboBoxSelectionDidChangeNotification
|
||||
object:self];
|
||||
_implementedDelegateComboBoxMethods |= CPComboBoxDelegate_comboBoxSelectionDidChange_;
|
||||
|
||||
if ([aDelegate respondsToSelector:@selector(comboBoxWillPopUp:)])
|
||||
[defaultCenter addObserver:delegate
|
||||
selector:@selector(comboBoxWillPopUp:)
|
||||
name:CPComboBoxWillPopUpNotification
|
||||
object:self];
|
||||
_implementedDelegateComboBoxMethods |= CPComboBoxDelegate_comboBoxWillPopUp_;
|
||||
|
||||
if ([aDelegate respondsToSelector:@selector(comboBoxWillDismiss:)])
|
||||
[defaultCenter addObserver:delegate
|
||||
selector:@selector(comboBoxWillDissmis:)
|
||||
name:CPComboBoxWillDismissNotification
|
||||
object:self];
|
||||
_implementedDelegateComboBoxMethods |= CPComboBoxDelegate_comboBoxWillDismiss_;
|
||||
}
|
||||
|
||||
[super setDelegate:aDelegate];
|
||||
@@ -412,49 +398,57 @@ var CPComboBoxTextSubview = @"text",
|
||||
if (_listDelegate === aDelegate)
|
||||
return;
|
||||
|
||||
var defaultCenter = [CPNotificationCenter defaultCenter];
|
||||
|
||||
if (_listDelegate)
|
||||
{
|
||||
[defaultCenter removeObserver:self name:_CPPopUpListWillPopUpNotification object:_listDelegate];
|
||||
[defaultCenter removeObserver:self name:_CPPopUpListWillDismissNotification object:_listDelegate];
|
||||
[defaultCenter removeObserver:self name:_CPPopUpListDidDismissNotification object:_listDelegate];
|
||||
[defaultCenter removeObserver:self name:_CPPopUpListItemWasClickedNotification object:_listDelegate];
|
||||
|
||||
var oldTableView = [_listDelegate tableView];
|
||||
|
||||
if (oldTableView)
|
||||
{
|
||||
[defaultCenter removeObserver:self name:CPTableViewSelectionIsChangingNotification object:oldTableView];
|
||||
[defaultCenter removeObserver:self name:CPTableViewSelectionDidChangeNotification object:oldTableView];
|
||||
}
|
||||
}
|
||||
[self _removeObserversForListDelegate:_listDelegate];
|
||||
|
||||
_listDelegate = aDelegate;
|
||||
|
||||
// We only add the observers if the CPComboBox is displayed
|
||||
if ([self window])
|
||||
[self _addObserversForListDelegate:_listDelegate]
|
||||
|
||||
// Apply our text style to the list
|
||||
[_listDelegate setFont:[self font]];
|
||||
[_listDelegate setAlignment:[self alignment]];
|
||||
|
||||
[[_listDelegate scrollView] setHasVerticalScroller:_hasVerticalScroller];
|
||||
|
||||
if (_intercellSpacing)
|
||||
[[_listDelegate tableView] setIntercellSpacing:_intercellSpacing];
|
||||
|
||||
if (_itemHeight)
|
||||
[[_listDelegate tableView] setRowHeight:_itemHeight];
|
||||
}
|
||||
|
||||
- (void)_addObserversForListDelegate:(_CPPopUpList)aDelegate
|
||||
{
|
||||
if (!aDelegate)
|
||||
return;
|
||||
|
||||
var defaultCenter = [CPNotificationCenter defaultCenter];
|
||||
|
||||
[defaultCenter addObserver:self
|
||||
selector:@selector(comboBoxWillPopUp:)
|
||||
name:_CPPopUpListWillPopUpNotification
|
||||
object:_listDelegate];
|
||||
object:aDelegate];
|
||||
|
||||
[defaultCenter addObserver:self
|
||||
selector:@selector(comboBoxWillDismiss:)
|
||||
name:_CPPopUpListWillDismissNotification
|
||||
object:_listDelegate];
|
||||
object:aDelegate];
|
||||
|
||||
[defaultCenter addObserver:self
|
||||
selector:@selector(listDidDismiss:)
|
||||
name:_CPPopUpListDidDismissNotification
|
||||
object:_listDelegate];
|
||||
object:aDelegate];
|
||||
|
||||
[defaultCenter addObserver:self
|
||||
selector:@selector(itemWasClicked:)
|
||||
name:_CPPopUpListItemWasClickedNotification
|
||||
object:_listDelegate];
|
||||
object:aDelegate];
|
||||
|
||||
[[_listDelegate scrollView] setHasVerticalScroller:_hasVerticalScroller];
|
||||
[[aDelegate scrollView] setHasVerticalScroller:_hasVerticalScroller];
|
||||
|
||||
var tableView = [_listDelegate tableView];
|
||||
var tableView = [aDelegate tableView];
|
||||
|
||||
[defaultCenter addObserver:self
|
||||
selector:@selector(comboBoxSelectionIsChanging:)
|
||||
@@ -465,13 +459,27 @@ var CPComboBoxTextSubview = @"text",
|
||||
selector:@selector(comboBoxSelectionDidChange:)
|
||||
name:CPTableViewSelectionDidChangeNotification
|
||||
object:tableView];
|
||||
}
|
||||
|
||||
// Apply our text style to the list
|
||||
[_listDelegate setFont:[self font]];
|
||||
[_listDelegate setAlignment:[self alignment]];
|
||||
[[_listDelegate scrollView] setHasVerticalScroller:_hasVerticalScroller];
|
||||
[[_listDelegate tableView] setIntercellSpacing:_intercellSpacing];
|
||||
[[_listDelegate tableView] setRowHeight:_itemHeight];
|
||||
- (void)_removeObserversForListDelegate:(_CPPopUpList)aDelegate
|
||||
{
|
||||
if (!aDelegate)
|
||||
return;
|
||||
|
||||
var defaultCenter = [CPNotificationCenter defaultCenter];
|
||||
|
||||
[defaultCenter removeObserver:self name:_CPPopUpListWillPopUpNotification object:aDelegate];
|
||||
[defaultCenter removeObserver:self name:_CPPopUpListWillDismissNotification object:aDelegate];
|
||||
[defaultCenter removeObserver:self name:_CPPopUpListDidDismissNotification object:aDelegate];
|
||||
[defaultCenter removeObserver:self name:_CPPopUpListItemWasClickedNotification object:aDelegate];
|
||||
|
||||
var oldTableView = [aDelegate tableView];
|
||||
|
||||
if (oldTableView)
|
||||
{
|
||||
[defaultCenter removeObserver:self name:CPTableViewSelectionIsChangingNotification object:oldTableView];
|
||||
[defaultCenter removeObserver:self name:CPTableViewSelectionDidChangeNotification object:oldTableView];
|
||||
}
|
||||
}
|
||||
|
||||
- (int)indexOfItemWithObjectValue:(id)anObject
|
||||
@@ -516,8 +524,6 @@ var CPComboBoxTextSubview = @"text",
|
||||
if (!_listDelegate)
|
||||
[self setListDelegate:[[_CPPopUpList alloc] initWithDataSource:self]];
|
||||
|
||||
[self _selectMatchingItem];
|
||||
|
||||
// Note the offset here is 1 less than the focus ring width because the outer edge
|
||||
// of the focus ring is very transparent and it looks better if the list is closer.
|
||||
if (CPComboBoxFocusRingWidth < 0)
|
||||
@@ -528,6 +534,7 @@ var CPComboBoxTextSubview = @"text",
|
||||
}
|
||||
|
||||
[_listDelegate popUpRelativeToRect:[self _borderFrame] view:self offset:CPComboBoxFocusRingWidth - 1];
|
||||
[self _selectMatchingItem];
|
||||
}
|
||||
|
||||
/*! @ignore */
|
||||
@@ -998,6 +1005,28 @@ var CPComboBoxTextSubview = @"text",
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
#pragma mark -
|
||||
#pragma mark Observers method
|
||||
|
||||
- (void)_addObservers
|
||||
{
|
||||
if (_isObserving)
|
||||
return;
|
||||
|
||||
[super _addObservers];
|
||||
[self _addObserversForListDelegate:_listDelegate];
|
||||
}
|
||||
|
||||
- (void)_removeObservers
|
||||
{
|
||||
if (!_isObserving)
|
||||
return;
|
||||
|
||||
[super _removeObservers];
|
||||
[self _removeObserversForListDelegate:_listDelegate];
|
||||
}
|
||||
|
||||
@end
|
||||
|
||||
@implementation CPComboBox (CPComboBoxDelegate)
|
||||
@@ -1005,24 +1034,36 @@ var CPComboBoxTextSubview = @"text",
|
||||
/*! @ignore */
|
||||
- (void)comboBoxSelectionIsChanging:(CPNotification)aNotification
|
||||
{
|
||||
if (_implementedDelegateComboBoxMethods & CPComboBoxDelegate_comboBoxSelectionIsChanging_)
|
||||
[_delegate comboBoxSelectionIsChanging:[[CPNotification alloc] initWithName:CPComboBoxSelectionIsChangingNotification object:self userInfo:nil]];
|
||||
|
||||
[[CPNotificationCenter defaultCenter] postNotificationName:CPComboBoxSelectionIsChangingNotification object:self];
|
||||
}
|
||||
|
||||
/*! @ignore */
|
||||
- (void)comboBoxSelectionDidChange:(CPNotification)aNotification
|
||||
{
|
||||
if (_implementedDelegateComboBoxMethods & CPComboBoxDelegate_comboBoxSelectionDidChange_)
|
||||
[_delegate comboBoxSelectionDidChange:[[CPNotification alloc] initWithName:CPComboBoxSelectionDidChangeNotification object:self userInfo:nil]];
|
||||
|
||||
[[CPNotificationCenter defaultCenter] postNotificationName:CPComboBoxSelectionDidChangeNotification object:self];
|
||||
}
|
||||
|
||||
/*! @ignore */
|
||||
- (void)comboBoxWillPopUp:(CPNotification)aNotification
|
||||
{
|
||||
if (_implementedDelegateComboBoxMethods & CPComboBoxDelegate_comboBoxWillPopUp_)
|
||||
[_delegate comboBoxWillPopUp:[[CPNotification alloc] initWithName:CPComboBoxWillPopUpNotification object:self userInfo:nil]];
|
||||
|
||||
[[CPNotificationCenter defaultCenter] postNotificationName:CPComboBoxWillPopUpNotification object:self];
|
||||
}
|
||||
|
||||
/*! @ignore */
|
||||
- (void)comboBoxWillDismiss:(CPNotification)aNotification
|
||||
{
|
||||
if (_implementedDelegateComboBoxMethods & CPComboBoxDelegate_comboBoxWillDismiss_)
|
||||
[_delegate comboBoxWillDismiss:[[CPNotification alloc] initWithName:CPComboBoxWillDismissNotification object:self userInfo:nil]];
|
||||
|
||||
[[CPNotificationCenter defaultCenter] postNotificationName:CPComboBoxWillDismissNotification object:self];
|
||||
}
|
||||
|
||||
|
||||
@@ -22,6 +22,7 @@ Cursor support by browser:
|
||||
*/
|
||||
|
||||
@import <Foundation/CPObject.j>
|
||||
@import "CPImage.j"
|
||||
|
||||
@global CPApp
|
||||
|
||||
|
||||
@@ -737,7 +737,7 @@ var CPShortWeekDayNameArrayEn = [@"Mo", @"Tu", @"We", @"Th", @"Fr", @"Sa", @"Su"
|
||||
|
||||
[dayTile setDate:[currentDate copy]];
|
||||
[dayTile setStringValue:currentDate.getDate()];
|
||||
[dayTile setDisabled:![self isEnabled] || currentDate.getMonth() !== currentMonth.getMonth()];
|
||||
[dayTile setDisabled:![self isEnabled] || currentDate.getMonth() !== currentMonth.getMonth() || currentDate < [_datePicker minDate] || currentDate > [_datePicker maxDate]];
|
||||
[dayTile setHighlighted:isPresentMonth && currentDate.getDate() == now.getDate()];
|
||||
}
|
||||
|
||||
|
||||
@@ -25,7 +25,6 @@
|
||||
@import "CPImageView.j"
|
||||
@import "CALayer.j"
|
||||
|
||||
|
||||
@class _CPCibCustomResource
|
||||
@class CPDatePicker
|
||||
|
||||
|
||||
@@ -338,10 +338,11 @@ var CPZeroKeyCode = 48,
|
||||
if ([anEvent keyCode] == CPReturnKeyCode)
|
||||
{
|
||||
[_currentTextField _endEditing];
|
||||
return YES;
|
||||
|
||||
return [super performKeyEquivalent:anEvent];
|
||||
}
|
||||
|
||||
return NO;
|
||||
return [super performKeyEquivalent:anEvent];
|
||||
}
|
||||
|
||||
/*! KeyDown event
|
||||
@@ -1775,6 +1776,7 @@ var CPMonthDateType = 0,
|
||||
- (void)makeSelectable
|
||||
{
|
||||
[self setThemeState:CPThemeStateSelected];
|
||||
[_datePicker setThemeState:CPThemeStateEditing];
|
||||
}
|
||||
|
||||
/*! Unsert the theme CPThemeStateSelected
|
||||
@@ -1783,6 +1785,7 @@ var CPMonthDateType = 0,
|
||||
{
|
||||
_firstEvent = YES;
|
||||
[self unsetThemeState:CPThemeStateSelected];
|
||||
[_datePicker unsetThemeState:CPThemeStateEditing];
|
||||
}
|
||||
|
||||
|
||||
|
||||
@@ -32,6 +32,7 @@
|
||||
|
||||
@class CPTextField
|
||||
@class CPWindow
|
||||
@class CPGraphicsContext
|
||||
|
||||
@global CPApp
|
||||
|
||||
|
||||
@@ -28,6 +28,8 @@
|
||||
|
||||
@class CPWebScriptObject
|
||||
|
||||
@typedef DataTransfer
|
||||
|
||||
CPGeneralPboard = @"CPGeneralPboard";
|
||||
CPFontPboard = @"CPFontPboard";
|
||||
CPRulerPboard = @"CPRulerPboard";
|
||||
|
||||
@@ -28,6 +28,7 @@
|
||||
@import "CPImageView.j"
|
||||
@import "CPResponder.j"
|
||||
@import "CPView.j"
|
||||
@import "CPViewController.j"
|
||||
@import "_CPPopoverWindow.j"
|
||||
|
||||
@protocol CPPopoverDelegate <CPObject>
|
||||
|
||||
@@ -2207,7 +2207,7 @@ TODO: implement
|
||||
indexOfDropLine = FLOOR(y / _sliceHeight),
|
||||
numberOfRows = [self numberOfRows];
|
||||
|
||||
if (indexOfDropLine < 0 || indexOfDropLine > numberOfRows || (indexOfDropLine >= [_draggingRows firstIndex] && indexOfDropLine <= [_draggingRows lastIndex] + 1))
|
||||
if (indexOfDropLine <= 0 || indexOfDropLine > numberOfRows || (indexOfDropLine >= [_draggingRows firstIndex] && indexOfDropLine <= [_draggingRows lastIndex] + 1))
|
||||
{
|
||||
if (_subviewIndexOfDropLine !== CPNotFound && indexOfDropLine !== _subviewIndexOfDropLine)
|
||||
[self _clearDropLine];
|
||||
|
||||
@@ -122,8 +122,8 @@
|
||||
{
|
||||
var title = [[itemsArray objectAtIndex:index] title],
|
||||
font = [_ruleEditor font],
|
||||
width = [title sizeWithFont:font].width + 20,
|
||||
rect = CGRectMake(0, 0, (width - width % 40) + 80, [_ruleEditor rowHeight]),
|
||||
width = [title sizeWithFont:font].width + 35, // 35 for right arrows + margins
|
||||
rect = CGRectMake(0, 0, width, [_ruleEditor rowHeight]),
|
||||
popup = [[CPPopUpButton alloc] initWithFrame:rect];
|
||||
|
||||
[popup setValue:font forThemeAttribute:@"font"];
|
||||
@@ -315,8 +315,14 @@
|
||||
{
|
||||
[ruleView setControlSize:CPSmallControlSize];
|
||||
|
||||
var minSize = [ruleView currentValueForThemeAttribute:@"min-size"],
|
||||
frame = [ruleView frame];
|
||||
|
||||
// Force controls to their minimum size
|
||||
frame.size.height = minSize.height;
|
||||
[ruleView setFrame:frame];
|
||||
|
||||
[_ruleOptionViews addObject:ruleView];
|
||||
var frame = [ruleView frame];
|
||||
[_ruleOptionInitialViewFrames addObject:frame];
|
||||
[_ruleOptionFrames addObject:frame];
|
||||
|
||||
|
||||
+31
-5
@@ -264,11 +264,6 @@ var CPScrollerStyleGlobal = CPScrollerStyleOverlay,
|
||||
_delegate = nil;
|
||||
_scrollTimer = nil;
|
||||
_implementedDelegateMethods = 0;
|
||||
|
||||
[[CPNotificationCenter defaultCenter] addObserver:self
|
||||
selector:@selector(_didReceiveDefaultStyleChange:)
|
||||
name:CPScrollerStyleGlobalChangeNotification
|
||||
object:nil];
|
||||
}
|
||||
|
||||
return self;
|
||||
@@ -1270,6 +1265,37 @@ Notifies the delegate when the scroll view has finished scrolling.
|
||||
#pragma mark -
|
||||
#pragma mark Overrides
|
||||
|
||||
|
||||
- (void)_removeObservers
|
||||
{
|
||||
if (!_isObserving)
|
||||
return;
|
||||
|
||||
[[CPNotificationCenter defaultCenter] removeObserver:self
|
||||
name:CPScrollerStyleGlobalChangeNotification
|
||||
object:nil];
|
||||
|
||||
[super _removeObservers];
|
||||
}
|
||||
|
||||
- (void)_addObservers
|
||||
{
|
||||
if (_isObserving)
|
||||
return;
|
||||
|
||||
//Make sure to have the last global style for the scroller
|
||||
[self _didReceiveDefaultStyleChange:nil];
|
||||
|
||||
[[CPNotificationCenter defaultCenter] addObserver:self
|
||||
selector:@selector(_didReceiveDefaultStyleChange:)
|
||||
name:CPScrollerStyleGlobalChangeNotification
|
||||
object:nil];
|
||||
|
||||
[super _addObservers];
|
||||
}
|
||||
|
||||
|
||||
|
||||
- (void)drawRect:(CGRect)aRect
|
||||
{
|
||||
[super drawRect:aRect];
|
||||
|
||||
@@ -25,6 +25,7 @@
|
||||
@import "CPControl.j"
|
||||
@import "CPWindow_Constants.j"
|
||||
@import "_CPImageAndTextView.j"
|
||||
@import "CPMenu.j"
|
||||
|
||||
@global CPApp
|
||||
|
||||
|
||||
+5
-2
@@ -22,6 +22,9 @@
|
||||
|
||||
@import <Foundation/CPObject.j>
|
||||
|
||||
@import "CGGeometry.j"
|
||||
@import "CPColor.j"
|
||||
@import "CPGraphicsContext.j"
|
||||
|
||||
/*!
|
||||
@deprecated
|
||||
@@ -31,9 +34,9 @@
|
||||
*/
|
||||
@implementation CPShadow : CPObject
|
||||
{
|
||||
CGSize _offset @accessors(property=shadowOffset);
|
||||
CGSize _offset @accessors(property=shadowOffset);
|
||||
float _blurRadius @accessors(property=shadowBlurRadius);
|
||||
CPColor _color @accessors(property=shadowColor);
|
||||
CPColor _color @accessors(property=shadowColor);
|
||||
}
|
||||
|
||||
/*!
|
||||
|
||||
@@ -23,6 +23,7 @@
|
||||
@import <Foundation/CPObject.j>
|
||||
@import <Foundation/CPRunLoop.j>
|
||||
|
||||
@typedef HTMLAudioElement
|
||||
|
||||
@protocol CPSoundDelegate <CPObject>
|
||||
|
||||
|
||||
+7
-8
@@ -25,7 +25,6 @@
|
||||
@import "CPTextField.j"
|
||||
|
||||
|
||||
|
||||
/*!
|
||||
CPStepper is an implementation of Cocoa NSStepper.
|
||||
|
||||
@@ -53,9 +52,9 @@
|
||||
@param maxValue the maximal acceptable value of the stepper
|
||||
@return Initialized CPStepper
|
||||
*/
|
||||
+ (CPStepper)stepperWithInitialValue:(float)aValue minValue:(float)aMinValue maxValue:(float)aMaxValue
|
||||
+ (id)stepperWithInitialValue:(float)aValue minValue:(float)aMinValue maxValue:(float)aMaxValue
|
||||
{
|
||||
var stepper = [[CPStepper alloc] initWithFrame:CGRectMakeZero()];
|
||||
var stepper = [[self alloc] initWithFrame:CGRectMakeZero()];
|
||||
|
||||
[stepper setDoubleValue:aValue];
|
||||
[stepper setMinValue:aMinValue];
|
||||
@@ -75,14 +74,14 @@
|
||||
|
||||
@return Initialized CPStepper
|
||||
*/
|
||||
+ (CPStepper)stepper
|
||||
+ (id)stepper
|
||||
{
|
||||
return [CPStepper stepperWithInitialValue:0.0 minValue:0.0 maxValue:59.0];
|
||||
}
|
||||
|
||||
+ (Class)_binderClassForBinding:(CPString)aBinding
|
||||
{
|
||||
if (aBinding == CPValueBinding || aBinding == CPMinValueBinding || aBinding == CPMaxValueBinding)
|
||||
if (aBinding === CPValueBinding || aBinding === CPMinValueBinding || aBinding === CPMaxValueBinding)
|
||||
return [_CPStepperValueBinder class];
|
||||
|
||||
return [super _binderClassForBinding:aBinding];
|
||||
@@ -90,7 +89,7 @@
|
||||
|
||||
- (CPString)_replacementKeyPathForBinding:(CPString)aBinding
|
||||
{
|
||||
if (aBinding == CPValueBinding)
|
||||
if (aBinding === CPValueBinding)
|
||||
return @"doubleValue";
|
||||
|
||||
return [super _replacementKeyPathForBinding:aBinding];
|
||||
@@ -240,7 +239,7 @@
|
||||
if (![self isEnabled])
|
||||
return;
|
||||
|
||||
if (aSender == _buttonUp)
|
||||
if (aSender === _buttonUp)
|
||||
[self setDoubleValue:([self doubleValue] + _increment)];
|
||||
else
|
||||
[self setDoubleValue:([self doubleValue] - _increment)];
|
||||
@@ -293,7 +292,7 @@
|
||||
|
||||
- (void)_updatePlaceholdersWithOptions:(CPDictionary)options forBinding:(CPString)aBinding
|
||||
{
|
||||
var placeholder = (aBinding == CPMaxValueBinding) ? [_source maxValue] : [_source minValue];
|
||||
var placeholder = (aBinding === CPMaxValueBinding) ? [_source maxValue] : [_source minValue];
|
||||
|
||||
[super _updatePlaceholdersWithOptions:options];
|
||||
|
||||
|
||||
+1
-16
@@ -28,8 +28,6 @@
|
||||
|
||||
@import "CPTextField.j"
|
||||
|
||||
@global CPTableViewColumnDidResizeNotification
|
||||
|
||||
@class _CPTableColumnHeaderView
|
||||
@class CPTableView
|
||||
|
||||
@@ -186,7 +184,7 @@ CPTableColumnUserResizingMask = 1 << 1;
|
||||
[tableView tile];
|
||||
|
||||
if (!_disableResizingPosting)
|
||||
[self _postDidResizeNotificationWithOldWidth:oldWidth];
|
||||
[[self tableView] _didResizeTableColumn:self oldWidth:oldWidth];
|
||||
}
|
||||
}
|
||||
|
||||
@@ -539,19 +537,6 @@ CPTableColumnUserResizingMask = 1 << 1;
|
||||
return _headerToolTip;
|
||||
}
|
||||
|
||||
/*!
|
||||
@ignore
|
||||
*/
|
||||
- (void)_postDidResizeNotificationWithOldWidth:(float)oldWidth
|
||||
{
|
||||
[[self tableView] _didResizeTableColumn:self];
|
||||
|
||||
[[CPNotificationCenter defaultCenter]
|
||||
postNotificationName:CPTableViewColumnDidResizeNotification
|
||||
object:[self tableView]
|
||||
userInfo:@{ @"CPTableColumn": self, @"CPOldWidth": oldWidth }];
|
||||
}
|
||||
|
||||
@end
|
||||
|
||||
@implementation CPTableColumnValueBinder : CPBinder
|
||||
|
||||
@@ -625,7 +625,7 @@ var _CPTableColumnHeaderViewStringValueKey = @"_CPTableColumnHeaderViewStringVal
|
||||
- (void)stopResizingTableColumn:(CPInteger)aColumnIndex at:(CGPoint)aPoint
|
||||
{
|
||||
var tableColumn = [[_tableView tableColumns] objectAtIndex:aColumnIndex];
|
||||
[tableColumn _postDidResizeNotificationWithOldWidth:_columnOldWidth];
|
||||
[_tableView _didResizeTableColumn:tableColumn oldWidth:_columnOldWidth];
|
||||
[tableColumn setDisableResizingPosting:NO];
|
||||
[_tableView setDisableAutomaticResizing:NO];
|
||||
|
||||
|
||||
+91
-90
@@ -81,10 +81,12 @@ var CPTableViewDelegate_selectionShouldChangeInTableView_
|
||||
CPTableViewDelegate_tableView_typeSelectStringForTableColumn_row_ = 1 << 17,
|
||||
CPTableViewDelegate_tableView_willDisplayView_forTableColumn_row_ = 1 << 18,
|
||||
CPTableViewDelegate_tableView_willRemoveView_forTableColumn_row_ = 1 << 19,
|
||||
CPTableViewDelegate_tableViewSelectionDidChange_ = 1 << 20,
|
||||
CPTableViewDelegate_tableViewSelectionIsChanging_ = 1 << 21,
|
||||
CPTableViewDelegate_tableViewMenuForTableColumn_row_ = 1 << 22,
|
||||
CPTableViewDelegate_tableView_shouldReorderColumn_toColumn_ = 1 << 23;
|
||||
CPTableViewDelegate_tableViewColumnDidMove_ = 1 << 20,
|
||||
CPTableViewDelegate_tableViewColumnDidResize_ = 1 << 21,
|
||||
CPTableViewDelegate_tableViewSelectionDidChange_ = 1 << 22,
|
||||
CPTableViewDelegate_tableViewSelectionIsChanging_ = 1 << 23,
|
||||
CPTableViewDelegate_tableViewMenuForTableColumn_row_ = 1 << 24,
|
||||
CPTableViewDelegate_tableView_shouldReorderColumn_toColumn_ = 1 << 25;
|
||||
|
||||
//CPTableViewDraggingDestinationFeedbackStyles
|
||||
CPTableViewDraggingDestinationFeedbackStyleNone = -1;
|
||||
@@ -321,6 +323,8 @@ CPTableViewFirstColumnOnlyAutoresizingStyle = 5;
|
||||
|
||||
CPTableColumn _draggedColumn;
|
||||
CPArray _differedColumnDataToRemove;
|
||||
|
||||
CPView _observedClipView;
|
||||
}
|
||||
|
||||
/*!
|
||||
@@ -1167,6 +1171,9 @@ NOT YET IMPLEMENTED
|
||||
[[CPNotificationCenter defaultCenter] postNotificationName:CPTableViewColumnDidMoveNotification
|
||||
object:self
|
||||
userInfo:@{ @"CPOldColumn": fromIndex, @"CPNewColumn": toIndex }];
|
||||
|
||||
if (_implementedDelegateMethods & CPTableViewDelegate_tableViewColumnDidMove_)
|
||||
[_delegate tableViewColumnDidMove:[[CPNotification alloc] initWithName:CPTableViewColumnDidMoveNotification object:self userInfo:@{ @"CPOldColumn": fromIndex, @"CPNewColumn": toIndex }]];
|
||||
}
|
||||
|
||||
/*!
|
||||
@@ -1245,9 +1252,17 @@ NOT YET IMPLEMENTED
|
||||
/*!
|
||||
@ignore
|
||||
*/
|
||||
- (void)_didResizeTableColumn:(CPTableColumn)theColumn
|
||||
- (void)_didResizeTableColumn:(CPTableColumn)theColumn oldWidth:(int)oldWidth
|
||||
{
|
||||
[self _autosave];
|
||||
|
||||
[[CPNotificationCenter defaultCenter]
|
||||
postNotificationName:CPTableViewColumnDidResizeNotification
|
||||
object:self
|
||||
userInfo:@{ @"CPTableColumn": theColumn, @"CPOldWidth": oldWidth }];
|
||||
|
||||
if (_implementedDelegateMethods & CPTableViewDelegate_tableViewColumnDidResize_)
|
||||
[_delegate tableViewColumnDidResize:[[CPNotification alloc] initWithName:CPTableViewColumnDidResizeNotification object:self userInfo:@{ @"CPTableColumn": theColumn, @"CPOldWidth": oldWidth }]];
|
||||
}
|
||||
|
||||
//Selecting Columns and Rows
|
||||
@@ -2860,35 +2875,6 @@ Your delegate can implement this method to avoid subclassing the tableview to ad
|
||||
if (_delegate === aDelegate)
|
||||
return;
|
||||
|
||||
var defaultCenter = [CPNotificationCenter defaultCenter];
|
||||
|
||||
if (_delegate)
|
||||
{
|
||||
if ([_delegate respondsToSelector:@selector(tableViewColumnDidMove:)])
|
||||
[defaultCenter
|
||||
removeObserver:_delegate
|
||||
name:CPTableViewColumnDidMoveNotification
|
||||
object:self];
|
||||
|
||||
if ([_delegate respondsToSelector:@selector(tableViewColumnDidResize:)])
|
||||
[defaultCenter
|
||||
removeObserver:_delegate
|
||||
name:CPTableViewColumnDidResizeNotification
|
||||
object:self];
|
||||
|
||||
if ([_delegate respondsToSelector:@selector(tableViewSelectionDidChange:)])
|
||||
[defaultCenter
|
||||
removeObserver:_delegate
|
||||
name:CPTableViewSelectionDidChangeNotification
|
||||
object:self];
|
||||
|
||||
if ([_delegate respondsToSelector:@selector(tableViewSelectionIsChanging:)])
|
||||
[defaultCenter
|
||||
removeObserver:_delegate
|
||||
name:CPTableViewSelectionIsChangingNotification
|
||||
object:self];
|
||||
}
|
||||
|
||||
_delegate = aDelegate;
|
||||
_implementedDelegateMethods = 0;
|
||||
|
||||
@@ -2963,32 +2949,16 @@ Your delegate can implement this method to avoid subclassing the tableview to ad
|
||||
_implementedDelegateMethods |= CPTableViewDelegate_tableView_shouldReorderColumn_toColumn_;
|
||||
|
||||
if ([_delegate respondsToSelector:@selector(tableViewColumnDidMove:)])
|
||||
[defaultCenter
|
||||
addObserver:_delegate
|
||||
selector:@selector(tableViewColumnDidMove:)
|
||||
name:CPTableViewColumnDidMoveNotification
|
||||
object:self];
|
||||
_implementedDelegateMethods |= CPTableViewDelegate_tableViewColumnDidMove_;
|
||||
|
||||
if ([_delegate respondsToSelector:@selector(tableViewColumnDidResize:)])
|
||||
[defaultCenter
|
||||
addObserver:_delegate
|
||||
selector:@selector(tableViewColumnDidResize:)
|
||||
name:CPTableViewColumnDidResizeNotification
|
||||
object:self];
|
||||
_implementedDelegateMethods |= CPTableViewDelegate_tableViewColumnDidResize_;
|
||||
|
||||
if ([_delegate respondsToSelector:@selector(tableViewSelectionDidChange:)])
|
||||
[defaultCenter
|
||||
addObserver:_delegate
|
||||
selector:@selector(tableViewSelectionDidChange:)
|
||||
name:CPTableViewSelectionDidChangeNotification
|
||||
object:self];
|
||||
_implementedDelegateMethods |= CPTableViewDelegate_tableViewSelectionDidChange_;
|
||||
|
||||
if ([_delegate respondsToSelector:@selector(tableViewSelectionIsChanging:)])
|
||||
[defaultCenter
|
||||
addObserver:_delegate
|
||||
selector:@selector(tableViewSelectionIsChanging:)
|
||||
name:CPTableViewSelectionIsChangingNotification
|
||||
object:self];
|
||||
_implementedDelegateMethods |= CPTableViewDelegate_tableViewSelectionIsChanging_;
|
||||
}
|
||||
|
||||
/*!
|
||||
@@ -4455,41 +4425,15 @@ Your delegate can implement this method to avoid subclassing the tableview to ad
|
||||
*/
|
||||
- (void)viewWillMoveToSuperview:(CPView)aView
|
||||
{
|
||||
[super viewWillMoveToSuperview:aView];
|
||||
|
||||
var superview = [self superview],
|
||||
defaultCenter = [CPNotificationCenter defaultCenter];
|
||||
|
||||
if (superview)
|
||||
{
|
||||
[defaultCenter
|
||||
removeObserver:self
|
||||
name:CPViewFrameDidChangeNotification
|
||||
object:superview];
|
||||
|
||||
[defaultCenter
|
||||
removeObserver:self
|
||||
name:CPViewBoundsDidChangeNotification
|
||||
object:superview];
|
||||
}
|
||||
|
||||
if ([aView isKindOfClass:[CPClipView class]])
|
||||
_observedClipView = aView;
|
||||
else
|
||||
{
|
||||
[aView setPostsFrameChangedNotifications:YES];
|
||||
[aView setPostsBoundsChangedNotifications:YES];
|
||||
|
||||
[defaultCenter
|
||||
addObserver:self
|
||||
selector:@selector(superviewFrameChanged:)
|
||||
name:CPViewFrameDidChangeNotification
|
||||
object:aView];
|
||||
|
||||
[defaultCenter
|
||||
addObserver:self
|
||||
selector:@selector(superviewBoundsChanged:)
|
||||
name:CPViewBoundsDidChangeNotification
|
||||
object:aView];
|
||||
[self _stopObservingClipView];
|
||||
_observedClipView = nil;
|
||||
}
|
||||
|
||||
[super viewWillMoveToSuperview:aView];
|
||||
}
|
||||
|
||||
/*!
|
||||
@@ -5071,6 +5015,9 @@ Your delegate can implement this method to avoid subclassing the tableview to ad
|
||||
postNotificationName:CPTableViewSelectionIsChangingNotification
|
||||
object:self
|
||||
userInfo:nil];
|
||||
|
||||
if (_implementedDelegateMethods & CPTableViewDelegate_tableViewSelectionIsChanging_)
|
||||
[_delegate tableViewSelectionIsChanging:[[CPNotification alloc] initWithName:CPTableViewSelectionIsChangingNotification object:self userInfo:nil]];
|
||||
}
|
||||
|
||||
/*!
|
||||
@@ -5082,6 +5029,9 @@ Your delegate can implement this method to avoid subclassing the tableview to ad
|
||||
postNotificationName:CPTableViewSelectionDidChangeNotification
|
||||
object:self
|
||||
userInfo:nil];
|
||||
|
||||
if (_implementedDelegateMethods & CPTableViewDelegate_tableViewSelectionDidChange_)
|
||||
[_delegate tableViewSelectionDidChange:[[CPNotification alloc] initWithName:CPTableViewSelectionDidChangeNotification object:self userInfo:nil]];
|
||||
}
|
||||
|
||||
/*!
|
||||
@@ -5139,8 +5089,8 @@ Your delegate can implement this method to avoid subclassing the tableview to ad
|
||||
if (!_isObserving)
|
||||
return;
|
||||
|
||||
[self _stopObservingClipView];
|
||||
[super _removeObservers];
|
||||
[self _stopObservingFirstResponder];
|
||||
}
|
||||
|
||||
- (void)_addObservers
|
||||
@@ -5148,13 +5098,64 @@ Your delegate can implement this method to avoid subclassing the tableview to ad
|
||||
if (_isObserving)
|
||||
return;
|
||||
|
||||
[self _startObservingClipView];
|
||||
[super _addObservers];
|
||||
[self _startObservingFirstResponder];
|
||||
}
|
||||
|
||||
- (void)_startObservingFirstResponder
|
||||
/*!
|
||||
Called when the receiver is about to be moved to a new window.
|
||||
@param aWindow the window to which the receiver will be moved.
|
||||
*/
|
||||
- (void)viewWillMoveToWindow:(CPWindow)aWindow
|
||||
{
|
||||
[[CPNotificationCenter defaultCenter] addObserver:self selector:@selector(_firstResponderDidChange:) name:_CPWindowDidChangeFirstResponderNotification object:[self window]];
|
||||
[super viewWillMoveToWindow:aWindow];
|
||||
|
||||
[self _stopObservingFirstResponder];
|
||||
|
||||
if (aWindow)
|
||||
[self _startObservingFirstResponderForWindow:aWindow];
|
||||
}
|
||||
|
||||
- (void)_startObservingClipView
|
||||
{
|
||||
if (!_observedClipView)
|
||||
return;
|
||||
|
||||
var defaultCenter = [CPNotificationCenter defaultCenter];
|
||||
|
||||
[_observedClipView setPostsFrameChangedNotifications:YES];
|
||||
[_observedClipView setPostsBoundsChangedNotifications:YES];
|
||||
|
||||
[defaultCenter addObserver:self
|
||||
selector:@selector(superviewFrameChanged:)
|
||||
name:CPViewFrameDidChangeNotification
|
||||
object:_observedClipView];
|
||||
|
||||
[defaultCenter addObserver:self
|
||||
selector:@selector(superviewBoundsChanged:)
|
||||
name:CPViewBoundsDidChangeNotification
|
||||
object:_observedClipView];
|
||||
}
|
||||
|
||||
- (void)_stopObservingClipView
|
||||
{
|
||||
if (!_observedClipView)
|
||||
return;
|
||||
|
||||
var defaultCenter = [CPNotificationCenter defaultCenter];
|
||||
|
||||
[defaultCenter removeObserver:self
|
||||
name:CPViewFrameDidChangeNotification
|
||||
object:_observedClipView];
|
||||
|
||||
[defaultCenter removeObserver:self
|
||||
name:CPViewBoundsDidChangeNotification
|
||||
object:_observedClipView];
|
||||
}
|
||||
|
||||
- (void)_startObservingFirstResponderForWindow:(CPWindow)aWindow
|
||||
{
|
||||
[[CPNotificationCenter defaultCenter] addObserver:self selector:@selector(_firstResponderDidChange:) name:_CPWindowDidChangeFirstResponderNotification object:aWindow];
|
||||
}
|
||||
|
||||
- (void)_stopObservingFirstResponder
|
||||
|
||||
+47
-39
@@ -38,8 +38,13 @@
|
||||
|
||||
@end
|
||||
|
||||
var CPTextFieldDelegate_control_didFailToFormatString_errorDescription_ = 1 << 1,
|
||||
CPTextFieldDelegate_controlTextDidBeginEditing_ = 1 << 2,
|
||||
CPTextFieldDelegate_controlTextDidChange_ = 1 << 3,
|
||||
CPTextFieldDelegate_controlTextDidEndEditing_ = 1 << 4,
|
||||
CPTextFieldDelegate_controlTextDidFocus_ = 1 << 5,
|
||||
CPTextFieldDelegate_controlTextDidBlur_ = 1 << 6;
|
||||
|
||||
var CPTextFieldDelegate_control_didFailToFormatString_errorDescription_ = 1 << 1;
|
||||
|
||||
@typedef CPTextFieldBezelStyle
|
||||
CPTextFieldSquareBezel = 0; /*! A textfield bezel with squared corners. */
|
||||
@@ -877,7 +882,7 @@ CPTextFieldStatePlaceholder = CPThemeState("placeholder");
|
||||
|
||||
[super _addObservers];
|
||||
|
||||
if ([self window] === self)
|
||||
if ([[self window] firstResponder] === self)
|
||||
[self _setObserveWindowKeyNotifications:YES];
|
||||
}
|
||||
|
||||
@@ -1147,6 +1152,9 @@ CPTextFieldStatePlaceholder = CPThemeState("placeholder");
|
||||
if ([note object] != self)
|
||||
return;
|
||||
|
||||
if (_implementedDelegateMethods & CPTextFieldDelegate_controlTextDidBlur_)
|
||||
[_delegate controlTextDidBlur:note];
|
||||
|
||||
[[CPNotificationCenter defaultCenter] postNotification:note];
|
||||
}
|
||||
|
||||
@@ -1156,6 +1164,9 @@ CPTextFieldStatePlaceholder = CPThemeState("placeholder");
|
||||
if ([note object] != self)
|
||||
return;
|
||||
|
||||
if (_implementedDelegateMethods & CPTextFieldDelegate_controlTextDidFocus_)
|
||||
[_delegate controlTextDidFocus:note];
|
||||
|
||||
[[CPNotificationCenter defaultCenter] postNotification:note];
|
||||
}
|
||||
|
||||
@@ -1166,9 +1177,36 @@ CPTextFieldStatePlaceholder = CPThemeState("placeholder");
|
||||
|
||||
[self _continuouslyReverseSetBinding];
|
||||
|
||||
if (_implementedDelegateMethods & CPTextFieldDelegate_controlTextDidChange_)
|
||||
[_delegate controlTextDidChange:note];
|
||||
|
||||
[super textDidChange:note];
|
||||
}
|
||||
|
||||
- (void)textDidBeginEditing:(CPNotification)note
|
||||
{
|
||||
//this looks to prevent false propagation of notifications for other objects
|
||||
if ([note object] != self)
|
||||
return;
|
||||
|
||||
if (_implementedDelegateMethods & CPTextFieldDelegate_controlTextDidBeginEditing_)
|
||||
[_delegate controlTextDidBeginEditing:[[CPNotification alloc] initWithName:CPControlTextDidBeginEditingNotification object:self userInfo:@{"CPFieldEditor": [note object]}]]
|
||||
|
||||
[super textDidBeginEditing:note];
|
||||
}
|
||||
|
||||
- (void)textDidEndEditing:(CPNotification)note
|
||||
{
|
||||
//this looks to prevent false propagation of notifications for other objects
|
||||
if ([note object] != self)
|
||||
return;
|
||||
|
||||
[super textDidEndEditing:note];
|
||||
|
||||
if (_implementedDelegateMethods & CPTextFieldDelegate_controlTextDidEndEditing_)
|
||||
[_delegate controlTextDidEndEditing:note];
|
||||
}
|
||||
|
||||
- (void)_updateCursorForEvent:(CPEvent)anEvent
|
||||
{
|
||||
var frame = CGRectMakeCopy([self frame]),
|
||||
@@ -1713,17 +1751,8 @@ CPTextFieldStatePlaceholder = CPThemeState("placeholder");
|
||||
|
||||
- (void)setDelegate:(id <CPTextFieldDelegate>)aDelegate
|
||||
{
|
||||
var defaultCenter = [CPNotificationCenter defaultCenter];
|
||||
|
||||
//unsubscribe the existing delegate if it exists
|
||||
if (_delegate)
|
||||
{
|
||||
[defaultCenter removeObserver:_delegate name:CPControlTextDidBeginEditingNotification object:self];
|
||||
[defaultCenter removeObserver:_delegate name:CPControlTextDidChangeNotification object:self];
|
||||
[defaultCenter removeObserver:_delegate name:CPControlTextDidEndEditingNotification object:self];
|
||||
[defaultCenter removeObserver:_delegate name:CPTextFieldDidFocusNotification object:self];
|
||||
[defaultCenter removeObserver:_delegate name:CPTextFieldDidBlurNotification object:self];
|
||||
}
|
||||
if (_delegate === aDelegate)
|
||||
return;
|
||||
|
||||
_delegate = aDelegate;
|
||||
_implementedDelegateMethods = 0;
|
||||
@@ -1732,40 +1761,19 @@ CPTextFieldStatePlaceholder = CPThemeState("placeholder");
|
||||
_implementedDelegateMethods |= CPTextFieldDelegate_control_didFailToFormatString_errorDescription_
|
||||
|
||||
if ([_delegate respondsToSelector:@selector(controlTextDidBeginEditing:)])
|
||||
[defaultCenter
|
||||
addObserver:_delegate
|
||||
selector:@selector(controlTextDidBeginEditing:)
|
||||
name:CPControlTextDidBeginEditingNotification
|
||||
object:self];
|
||||
_implementedDelegateMethods |= CPTextFieldDelegate_controlTextDidBeginEditing_;
|
||||
|
||||
if ([_delegate respondsToSelector:@selector(controlTextDidChange:)])
|
||||
[defaultCenter
|
||||
addObserver:_delegate
|
||||
selector:@selector(controlTextDidChange:)
|
||||
name:CPControlTextDidChangeNotification
|
||||
object:self];
|
||||
|
||||
_implementedDelegateMethods |= CPTextFieldDelegate_controlTextDidChange_;
|
||||
|
||||
if ([_delegate respondsToSelector:@selector(controlTextDidEndEditing:)])
|
||||
[defaultCenter
|
||||
addObserver:_delegate
|
||||
selector:@selector(controlTextDidEndEditing:)
|
||||
name:CPControlTextDidEndEditingNotification
|
||||
object:self];
|
||||
_implementedDelegateMethods |= CPTextFieldDelegate_controlTextDidEndEditing_;
|
||||
|
||||
if ([_delegate respondsToSelector:@selector(controlTextDidFocus:)])
|
||||
[defaultCenter
|
||||
addObserver:_delegate
|
||||
selector:@selector(controlTextDidFocus:)
|
||||
name:CPTextFieldDidFocusNotification
|
||||
object:self];
|
||||
_implementedDelegateMethods |= CPTextFieldDelegate_controlTextDidFocus_;
|
||||
|
||||
if ([_delegate respondsToSelector:@selector(controlTextDidBlur:)])
|
||||
[defaultCenter
|
||||
addObserver:_delegate
|
||||
selector:@selector(controlTextDidBlur:)
|
||||
name:CPTextFieldDidBlurNotification
|
||||
object:self];
|
||||
_implementedDelegateMethods |= CPTextFieldDelegate_controlTextDidBlur_;
|
||||
}
|
||||
|
||||
- (id)delegate
|
||||
|
||||
+35
-14
@@ -175,6 +175,7 @@ var CPViewFlags = { },
|
||||
BOOL _postsBoundsChangedNotifications;
|
||||
BOOL _inhibitFrameAndBoundsChangedNotifications;
|
||||
BOOL _inLiveResize;
|
||||
BOOL _isSuperviewAClipView;
|
||||
|
||||
#if PLATFORM(DOM)
|
||||
DOMElement _DOMElement;
|
||||
@@ -830,6 +831,8 @@ var CPViewFlags = { },
|
||||
*/
|
||||
- (void)viewWillMoveToSuperview:(CPView)aView
|
||||
{
|
||||
_isSuperviewAClipView = [aView isKindOfClass:[CPClipView class]];
|
||||
|
||||
[self _removeObservers];
|
||||
|
||||
if (aView)
|
||||
@@ -961,6 +964,9 @@ var CPViewFlags = { },
|
||||
|
||||
if (_postsFrameChangedNotifications)
|
||||
[CachedNotificationCenter postNotificationName:CPViewFrameDidChangeNotification object:self];
|
||||
|
||||
if (_isSuperviewAClipView)
|
||||
[[self superview] viewFrameChanged:[[CPNotification alloc] initWithName:CPViewFrameDidChangeNotification object:self userInfo:nil]];
|
||||
}
|
||||
|
||||
/*!
|
||||
@@ -1023,6 +1029,9 @@ var CPViewFlags = { },
|
||||
if (_postsFrameChangedNotifications && !_inhibitFrameAndBoundsChangedNotifications)
|
||||
[CachedNotificationCenter postNotificationName:CPViewFrameDidChangeNotification object:self];
|
||||
|
||||
if (_isSuperviewAClipView && !_inhibitFrameAndBoundsChangedNotifications)
|
||||
[[self superview] viewFrameChanged:[[CPNotification alloc] initWithName:CPViewFrameDidChangeNotification object:self userInfo:nil]];
|
||||
|
||||
#if PLATFORM(DOM)
|
||||
var transform = _superview ? _superview._boundsTransform : NULL;
|
||||
|
||||
@@ -1092,7 +1101,7 @@ var CPViewFlags = { },
|
||||
// Make sure to repeat the top and bottom pieces horizontally if they're not the exact width needed.
|
||||
if (top)
|
||||
{
|
||||
CPDomDisplayServerSetStyleBackgroundSize(_DOMImageParts[partIndex], frameSize.width + "px", top + "px");
|
||||
CPDOMDisplayServerSetStyleBackgroundSize(_DOMImageParts[partIndex], frameSize.width + "px", top + "px");
|
||||
CPDOMDisplayServerSetStyleSize(_DOMImageParts[partIndex], size.width, top);
|
||||
partIndex++;
|
||||
}
|
||||
@@ -1100,13 +1109,13 @@ var CPViewFlags = { },
|
||||
{
|
||||
var height = frameSize.height - top - bottom;
|
||||
|
||||
CPDomDisplayServerSetStyleBackgroundSize(_DOMImageParts[partIndex], frameSize.width + "px", height + "px");
|
||||
CPDOMDisplayServerSetStyleBackgroundSize(_DOMImageParts[partIndex], frameSize.width + "px", height + "px");
|
||||
CPDOMDisplayServerSetStyleSize(_DOMImageParts[partIndex], size.width, size.height - top - bottom);
|
||||
partIndex++;
|
||||
}
|
||||
if (bottom)
|
||||
{
|
||||
CPDomDisplayServerSetStyleBackgroundSize(_DOMImageParts[partIndex], frameSize.width + "px", bottom + "px");
|
||||
CPDOMDisplayServerSetStyleBackgroundSize(_DOMImageParts[partIndex], frameSize.width + "px", bottom + "px");
|
||||
CPDOMDisplayServerSetStyleSize(_DOMImageParts[partIndex], size.width, bottom);
|
||||
}
|
||||
}
|
||||
@@ -1118,7 +1127,7 @@ var CPViewFlags = { },
|
||||
// Make sure to repeat the left and right pieces vertically if they're not the exact height needed.
|
||||
if (left)
|
||||
{
|
||||
CPDomDisplayServerSetStyleBackgroundSize(_DOMImageParts[partIndex], left + "px", frameSize.height + "px");
|
||||
CPDOMDisplayServerSetStyleBackgroundSize(_DOMImageParts[partIndex], left + "px", frameSize.height + "px");
|
||||
CPDOMDisplayServerSetStyleSize(_DOMImageParts[partIndex], left, size.height);
|
||||
partIndex++;
|
||||
}
|
||||
@@ -1126,13 +1135,13 @@ var CPViewFlags = { },
|
||||
{
|
||||
var width = (frameSize.width - left - right);
|
||||
|
||||
CPDomDisplayServerSetStyleBackgroundSize(_DOMImageParts[partIndex], width + "px", frameSize.height + "px");
|
||||
CPDOMDisplayServerSetStyleBackgroundSize(_DOMImageParts[partIndex], width + "px", frameSize.height + "px");
|
||||
CPDOMDisplayServerSetStyleSize(_DOMImageParts[partIndex], size.width - left - right, size.height);
|
||||
partIndex++;
|
||||
}
|
||||
if (right)
|
||||
{
|
||||
CPDomDisplayServerSetStyleBackgroundSize(_DOMImageParts[partIndex], right + "px", frameSize.height + "px");
|
||||
CPDOMDisplayServerSetStyleBackgroundSize(_DOMImageParts[partIndex], right + "px", frameSize.height + "px");
|
||||
CPDOMDisplayServerSetStyleSize(_DOMImageParts[partIndex], right, size.height);
|
||||
}
|
||||
}
|
||||
@@ -1182,6 +1191,9 @@ var CPViewFlags = { },
|
||||
|
||||
if (_postsFrameChangedNotifications && !_inhibitFrameAndBoundsChangedNotifications)
|
||||
[CachedNotificationCenter postNotificationName:CPViewFrameDidChangeNotification object:self];
|
||||
|
||||
if (_isSuperviewAClipView && !_inhibitFrameAndBoundsChangedNotifications)
|
||||
[[self superview] viewFrameChanged:[[CPNotification alloc] initWithName:CPViewFrameDidChangeNotification object:self userInfo:nil]];
|
||||
}
|
||||
|
||||
/*!
|
||||
@@ -1216,6 +1228,9 @@ var CPViewFlags = { },
|
||||
|
||||
if (_postsBoundsChangedNotifications)
|
||||
[CachedNotificationCenter postNotificationName:CPViewBoundsDidChangeNotification object:self];
|
||||
|
||||
if (_isSuperviewAClipView)
|
||||
[[self superview] viewBoundsChanged:[[CPNotification alloc] initWithName:CPViewBoundsDidChangeNotification object:self userInfo:nil]];
|
||||
}
|
||||
|
||||
/*!
|
||||
@@ -1278,6 +1293,9 @@ var CPViewFlags = { },
|
||||
|
||||
if (_postsBoundsChangedNotifications && !_inhibitFrameAndBoundsChangedNotifications)
|
||||
[CachedNotificationCenter postNotificationName:CPViewBoundsDidChangeNotification object:self];
|
||||
|
||||
if (_isSuperviewAClipView && !_inhibitFrameAndBoundsChangedNotifications)
|
||||
[[self superview] viewBoundsChanged:[[CPNotification alloc] initWithName:CPViewBoundsDidChangeNotification object:self userInfo:nil]];
|
||||
}
|
||||
|
||||
/*!
|
||||
@@ -1316,6 +1334,9 @@ var CPViewFlags = { },
|
||||
|
||||
if (_postsBoundsChangedNotifications && !_inhibitFrameAndBoundsChangedNotifications)
|
||||
[CachedNotificationCenter postNotificationName:CPViewBoundsDidChangeNotification object:self];
|
||||
|
||||
if (_isSuperviewAClipView && !_inhibitFrameAndBoundsChangedNotifications)
|
||||
[[self superview] viewBoundsChanged:[[CPNotification alloc] initWithName:CPViewBoundsDidChangeNotification object:self userInfo:nil]];
|
||||
}
|
||||
|
||||
|
||||
@@ -1874,7 +1895,7 @@ var CPViewFlags = { },
|
||||
_DOMImageParts[0].style.background = [_backgroundColor cssString];
|
||||
|
||||
if (patternImage)
|
||||
CPDomDisplayServerSetStyleBackgroundSize(_DOMImageParts[0], [patternImage size].width + "px", [patternImage size].height + "px");
|
||||
CPDOMDisplayServerSetStyleBackgroundSize(_DOMImageParts[0], [patternImage size].width + "px", [patternImage size].height + "px");
|
||||
|
||||
if (CPFeatureIsCompatible(CPOpacityRequiresFilterFeature))
|
||||
_DOMImageParts[0].style.filter = "alpha(opacity=" + [_backgroundColor alphaComponent] * 100 + ")";
|
||||
@@ -1888,7 +1909,7 @@ var CPViewFlags = { },
|
||||
_DOMElement.style.background = colorCSS;
|
||||
|
||||
if (patternImage)
|
||||
CPDomDisplayServerSetStyleBackgroundSize(_DOMElement, [patternImage size].width + "px", [patternImage size].height + "px");
|
||||
CPDOMDisplayServerSetStyleBackgroundSize(_DOMElement, [patternImage size].width + "px", [patternImage size].height + "px");
|
||||
}
|
||||
else
|
||||
{
|
||||
@@ -1993,7 +2014,7 @@ var CPViewFlags = { },
|
||||
// Make sure to repeat the top and bottom pieces horizontally if they're not the exact width needed.
|
||||
if (top)
|
||||
{
|
||||
CPDomDisplayServerSetStyleBackgroundSize(_DOMImageParts[partIndex], frameSize.width + "px", top + "px");
|
||||
CPDOMDisplayServerSetStyleBackgroundSize(_DOMImageParts[partIndex], frameSize.width + "px", top + "px");
|
||||
CPDOMDisplayServerSetStyleLeftTop(_DOMImageParts[partIndex], NULL, 0.0, 0.0);
|
||||
CPDOMDisplayServerSetStyleSize(_DOMImageParts[partIndex], frameSize.width, top);
|
||||
partIndex++;
|
||||
@@ -2003,14 +2024,14 @@ var CPViewFlags = { },
|
||||
var height = frameSize.height - top - bottom;
|
||||
|
||||
//_DOMImageParts[partIndex].style.backgroundSize = frameSize.width + "px " + height + "px";
|
||||
CPDomDisplayServerSetStyleBackgroundSize(_DOMImageParts[partIndex], frameSize.width + "px", height + "px");
|
||||
CPDOMDisplayServerSetStyleBackgroundSize(_DOMImageParts[partIndex], frameSize.width + "px", height + "px");
|
||||
CPDOMDisplayServerSetStyleLeftTop(_DOMImageParts[partIndex], NULL, 0.0, top);
|
||||
CPDOMDisplayServerSetStyleSize(_DOMImageParts[partIndex], frameSize.width, height);
|
||||
partIndex++;
|
||||
}
|
||||
if (bottom)
|
||||
{
|
||||
CPDomDisplayServerSetStyleBackgroundSize(_DOMImageParts[partIndex], frameSize.width + "px", bottom + "px");
|
||||
CPDOMDisplayServerSetStyleBackgroundSize(_DOMImageParts[partIndex], frameSize.width + "px", bottom + "px");
|
||||
CPDOMDisplayServerSetStyleLeftBottom(_DOMImageParts[partIndex], NULL, 0.0, 0.0);
|
||||
CPDOMDisplayServerSetStyleSize(_DOMImageParts[partIndex], frameSize.width, bottom);
|
||||
}
|
||||
@@ -2025,7 +2046,7 @@ var CPViewFlags = { },
|
||||
// Make sure to repeat the left and right pieces vertically if they're not the exact height needed.
|
||||
if (left)
|
||||
{
|
||||
CPDomDisplayServerSetStyleBackgroundSize(_DOMImageParts[partIndex], left + "px", frameSize.height + "px");
|
||||
CPDOMDisplayServerSetStyleBackgroundSize(_DOMImageParts[partIndex], left + "px", frameSize.height + "px");
|
||||
CPDOMDisplayServerSetStyleLeftTop(_DOMImageParts[partIndex], NULL, 0.0, 0.0);
|
||||
CPDOMDisplayServerSetStyleSize(_DOMImageParts[partIndex], left, frameSize.height);
|
||||
partIndex++;
|
||||
@@ -2034,14 +2055,14 @@ var CPViewFlags = { },
|
||||
{
|
||||
var width = (frameSize.width - left - right);
|
||||
|
||||
CPDomDisplayServerSetStyleBackgroundSize(_DOMImageParts[partIndex], width + "px", frameSize.height + "px");
|
||||
CPDOMDisplayServerSetStyleBackgroundSize(_DOMImageParts[partIndex], width + "px", frameSize.height + "px");
|
||||
CPDOMDisplayServerSetStyleLeftTop(_DOMImageParts[partIndex], NULL, left, 0.0);
|
||||
CPDOMDisplayServerSetStyleSize(_DOMImageParts[partIndex], width, frameSize.height);
|
||||
partIndex++;
|
||||
}
|
||||
if (right)
|
||||
{
|
||||
CPDomDisplayServerSetStyleBackgroundSize(_DOMImageParts[partIndex], right + "px", frameSize.height + "px");
|
||||
CPDOMDisplayServerSetStyleBackgroundSize(_DOMImageParts[partIndex], right + "px", frameSize.height + "px");
|
||||
CPDOMDisplayServerSetStyleRightTop(_DOMImageParts[partIndex], NULL, 0.0, 0.0);
|
||||
CPDOMDisplayServerSetStyleSize(_DOMImageParts[partIndex], right, frameSize.height);
|
||||
}
|
||||
|
||||
@@ -25,6 +25,8 @@
|
||||
|
||||
@class CPWebScriptObject
|
||||
|
||||
@typedef Window
|
||||
|
||||
// FIXME: implement these where possible:
|
||||
/*
|
||||
CPWebViewDidBeginEditingNotification = "CPWebViewDidBeginEditingNotification";
|
||||
|
||||
@@ -907,18 +907,21 @@ CPTexturedBackgroundWindowMask
|
||||
|
||||
- (void)_orderFront
|
||||
{
|
||||
[[self contentView] _addObservers];
|
||||
|
||||
#if PLATFORM(DOM)
|
||||
// -dw- if a sheet is clicked, the parent window should come up too
|
||||
if (_isSheet)
|
||||
[_parentView orderFront:self];
|
||||
|
||||
if (!_isVisible)
|
||||
[self _setFrame:_frame display:YES animate:NO constrainWidth:YES constrainHeight:YES];
|
||||
// Save the boolean since it will be updated in the method order:window:relativeTo:
|
||||
var wasVisible = _isVisible;
|
||||
|
||||
[_platformWindow orderFront:self];
|
||||
[_platformWindow order:CPWindowAbove window:self relativeTo:nil];
|
||||
|
||||
// setFrame is set after ordering the window as this method can send some notifications
|
||||
if (!wasVisible)
|
||||
[self _setFrame:_frame display:YES animate:NO constrainWidth:YES constrainHeight:YES];
|
||||
#endif
|
||||
|
||||
if (!CPApp._keyWindow)
|
||||
@@ -939,6 +942,23 @@ CPTexturedBackgroundWindowMask
|
||||
{
|
||||
}
|
||||
|
||||
/*
|
||||
Called when the window is displayed in the DOM
|
||||
*/
|
||||
- (void)_windowWillBeAddedToTheDOM
|
||||
{
|
||||
[[self contentView] _addObservers];
|
||||
}
|
||||
|
||||
/*
|
||||
Called when the window is removed in the DOM
|
||||
*/
|
||||
- (void)_windowWillBeRemovedFromTheDOM
|
||||
{
|
||||
[[self contentView] _removeObservers];
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
Makes the receiver the last window in the screen ordering.
|
||||
@param aSender the object that requested this
|
||||
@@ -968,8 +988,6 @@ CPTexturedBackgroundWindowMask
|
||||
if (!_isVisible)
|
||||
return;
|
||||
|
||||
[[self contentView] _removeObservers];
|
||||
|
||||
if ([self isSheet])
|
||||
{
|
||||
// -dw- as in Cocoa, orderOut: detaches the sheet and animates out
|
||||
|
||||
@@ -25,6 +25,7 @@
|
||||
|
||||
@import "CPCib.j"
|
||||
@import "CPResponder.j"
|
||||
@import "CPViewController.j"
|
||||
@import "CPWindow.j"
|
||||
|
||||
@class CPDocument
|
||||
|
||||
@@ -738,7 +738,7 @@ else if (CPFeatureIsCompatible(CPVMLFeature))
|
||||
else
|
||||
{
|
||||
// I have declared these functions here to make it compile without warnings with the new compiler under rhino.
|
||||
CGContextClearRect = CGContextDrawLinearGradient = CGContextClip = CGContextClipToRect = function() {throw new Error("function is not declared in this environment")}
|
||||
CGContextClearRect = CGContextDrawLinearGradient = CGContextClip = CGContextClipToRect = CGContextDrawImage = function() {throw new Error("function is not declared in this environment")}
|
||||
}
|
||||
/*!
|
||||
@endcond
|
||||
|
||||
@@ -80,7 +80,7 @@ aDOMElement.style.bottom = ROUND(____p.y) + "px";
|
||||
aDOMElement.width = MAX(0.0, ROUND(aWidth));\
|
||||
aDOMElement.height = MAX(0.0, ROUND(aHeight));
|
||||
|
||||
#define CPDomDisplayServerSetStyleBackgroundSize(aDOMElement, aWidth, aHeight)\
|
||||
#define CPDOMDisplayServerSetStyleBackgroundSize(aDOMElement, aWidth, aHeight)\
|
||||
aDOMElement.style.backgroundSize = aWidth + ' ' + aHeight;
|
||||
|
||||
#define CPDOMDisplayServerAppendChild(aParentElement, aChildElement) aParentElement.appendChild(aChildElement)
|
||||
@@ -129,7 +129,7 @@ aDOMElement.style.bottom = ROUND(____p.y) + "px";
|
||||
CPDOMDisplayServerInstructions[__index + 2] = aWidth;\
|
||||
CPDOMDisplayServerInstructions[__index + 3] = aHeight;
|
||||
|
||||
#define CPDomDisplayServerSetStyleBackgroundSize(aDOMElement, aWidth, aHeight)\
|
||||
#define CPDOMDisplayServerSetStyleBackgroundSize(aDOMElement, aWidth, aHeight)\
|
||||
aDOMElement.style.backgroundSize = aWidth + ' ' + aHeight;
|
||||
|
||||
#define CPDOMDisplayServerAppendChild(aParentElement, aChildElement)\
|
||||
|
||||
@@ -1299,7 +1299,10 @@ var PreventScroll = true;
|
||||
// When ordering out, ignore otherWindow, simply remove aWindow from its level.
|
||||
// If layer is nil, this will be a no-op.
|
||||
if (orderingMode === CPWindowOut)
|
||||
{
|
||||
[aWindow _windowWillBeRemovedFromTheDOM];
|
||||
return [layer removeWindow:aWindow];
|
||||
}
|
||||
|
||||
/*
|
||||
If aWindow is a child of otherWindow and is not yet visible,
|
||||
@@ -1345,6 +1348,8 @@ var PreventScroll = true;
|
||||
if (otherWindow)
|
||||
insertionIndex = orderingMode === CPWindowAbove ? otherWindow._index + 1 : otherWindow._index;
|
||||
|
||||
[aWindow _windowWillBeAddedToTheDOM];
|
||||
|
||||
// Place the window at the appropriate index.
|
||||
[layer insertWindow:aWindow atIndex:insertionIndex];
|
||||
|
||||
@@ -1395,6 +1400,9 @@ var PreventScroll = true;
|
||||
|
||||
var index = ordering === CPWindowAbove ? parent._index + 1 : parent._index;
|
||||
|
||||
if (!childWasVisible)
|
||||
[child _windowWillBeAddedToTheDOM];
|
||||
|
||||
[aLayer insertWindow:child atIndex:index];
|
||||
|
||||
if (!childWasVisible)
|
||||
|
||||
@@ -1258,6 +1258,19 @@ var themedButtonValues = nil,
|
||||
["textfield-bezel-square-disabled-8.png", 6.0, 6.0]
|
||||
]),
|
||||
|
||||
bezelFocusedColor = PatternColor(
|
||||
[
|
||||
["textfield-bezel-square-focused-0.png", 6.0, 6.0],
|
||||
["textfield-bezel-square-focused-1.png", 1.0, 6.0],
|
||||
["textfield-bezel-square-focused-2.png", 6.0, 6.0],
|
||||
["textfield-bezel-square-focused-3.png", 6.0, 1.0],
|
||||
["textfield-bezel-square-focused-4.png", 1.0, 1.0],
|
||||
["textfield-bezel-square-focused-5.png", 6.0, 1.0],
|
||||
["textfield-bezel-square-focused-6.png", 6.0, 6.0],
|
||||
["textfield-bezel-square-focused-7.png", 1.0, 6.0],
|
||||
["textfield-bezel-square-focused-8.png", 6.0, 6.0]
|
||||
]),
|
||||
|
||||
bezelColorDatePickerTextField = PatternColor(
|
||||
[
|
||||
[@"datepicker-date-segment-0.png", 4.0, 18.0],
|
||||
@@ -1268,6 +1281,7 @@ var themedButtonValues = nil,
|
||||
themeValues =
|
||||
[
|
||||
[@"bezel-color", bezelColor, CPThemeStateBezeled],
|
||||
[@"bezel-color", bezelFocusedColor, [CPThemeStateBezeled, CPThemeStateEditing]],
|
||||
[@"bezel-color", bezelDisabledColor, [CPThemeStateBezeled, CPThemeStateDisabled]],
|
||||
|
||||
[@"font", [CPFont boldSystemFontOfSize:13.0]],
|
||||
@@ -1275,8 +1289,10 @@ var themedButtonValues = nil,
|
||||
|
||||
[@"content-inset", CGInsetMake(6.0, 0.0, 0.0, 3.0), CPThemeStateNormal],
|
||||
[@"content-inset", CGInsetMake(6.0, 0.0, 0.0, 5.0), CPThemeStateBezeled],
|
||||
[@"content-inset", CGInsetMake(6.0, 0.0, 0.0, 5.0), [CPThemeStateBezeled, CPThemeStateEditing]],
|
||||
|
||||
[@"bezel-inset", CGInsetMake(0.0, -3.0, 0.0, -3.0), CPThemeStateBezeled],
|
||||
[@"bezel-inset", CGInsetMake(0.0, -3.0, 0.0, -3.0), [CPThemeStateBezeled, CPThemeStateEditing]],
|
||||
|
||||
[@"datepicker-textfield-bezel-color", [CPColor clearColor], CPThemeStateNormal],
|
||||
[@"datepicker-textfield-bezel-color", bezelColorDatePickerTextField, CPThemeStateSelected],
|
||||
@@ -1301,10 +1317,12 @@ var themedButtonValues = nil,
|
||||
// CPThemeStateControlSizeSmall
|
||||
[@"content-inset", CGInsetMake(5.0, 0.0, 0.0, 5.0), [CPThemeStateControlSizeSmall, CPThemeStateNormal]],
|
||||
[@"content-inset", CGInsetMake(5.0, 0.0, 0.0, 5.0), [CPThemeStateControlSizeSmall, CPThemeStateBezeled]],
|
||||
[@"content-inset", CGInsetMake(5.0, 0.0, 0.0, 5.0), [CPThemeStateControlSizeSmall, CPThemeStateEditing, CPThemeStateBezeled]],
|
||||
|
||||
[@"min-size-datepicker-textfield", CGSizeMake(6.0, 16.0), CPThemeStateControlSizeSmall],
|
||||
[@"date-hour-margin", 5.0, CPThemeStateControlSizeSmall],
|
||||
[@"stepper-margin", 3.0, CPThemeStateControlSizeSmall],
|
||||
[@"stepper-margin", 3.0, [CPThemeStateControlSizeSmall, CPThemeStateEditing]],
|
||||
|
||||
[@"min-size", CGSizeMake(0, 26.0), CPThemeStateControlSizeSmall],
|
||||
[@"max-size", CGSizeMake(-1.0, 26.0), CPThemeStateControlSizeSmall],
|
||||
@@ -1313,10 +1331,12 @@ var themedButtonValues = nil,
|
||||
// CPThemeStateControlSizeMini
|
||||
[@"content-inset", CGInsetMake(4.0, 0.0, 0.0, 4.0), [CPThemeStateControlSizeMini, CPThemeStateNormal]],
|
||||
[@"content-inset", CGInsetMake(4.0, 0.0, 0.0, 4.0), [CPThemeStateControlSizeMini, CPThemeStateBezeled]],
|
||||
[@"content-inset", CGInsetMake(4.0, 0.0, 0.0, 4.0), [CPThemeStateControlSizeMini, CPThemeStateEditing, CPThemeStateBezeled]],
|
||||
|
||||
[@"min-size-datepicker-textfield", CGSizeMake(6.0, 12.0), CPThemeStateControlSizeMini],
|
||||
[@"date-hour-margin", 2.0, CPThemeStateControlSizeMini],
|
||||
[@"stepper-margin", 2.0, CPThemeStateControlSizeMini],
|
||||
[@"stepper-margin", 2.0, [CPThemeStateControlSizeMini, CPThemeStateEditing]],
|
||||
|
||||
[@"min-size", CGSizeMake(0, 22.0), CPThemeStateControlSizeMini],
|
||||
[@"max-size", CGSizeMake(-1.0, 22.0), CPThemeStateControlSizeMini],
|
||||
|
||||
Binary file not shown.
|
After Width: | Height: | Size: 3.5 KiB |
Binary file not shown.
|
Before Width: | Height: | Size: 3.9 KiB After Width: | Height: | Size: 3.4 KiB |
Binary file not shown.
|
After Width: | Height: | Size: 3.5 KiB |
Binary file not shown.
|
Before Width: | Height: | Size: 3.9 KiB After Width: | Height: | Size: 3.4 KiB |
@@ -824,6 +824,14 @@ var themedButtonValues = nil,
|
||||
height: 4.0
|
||||
}),
|
||||
|
||||
bezelFocusedColor = PatternColor(
|
||||
"textfield-bezel-square-focused{position}.png",
|
||||
{
|
||||
positions: "#",
|
||||
width: 9.0,
|
||||
height: 9.0
|
||||
}),
|
||||
|
||||
bezelColorDatePickerTextField = PatternColor(
|
||||
[
|
||||
[@"datepicker-date-segment-0.png", 4.0, 18.0],
|
||||
@@ -835,14 +843,17 @@ var themedButtonValues = nil,
|
||||
[
|
||||
[@"bezel-color", bezelColor["@"], CPThemeStateBezeled],
|
||||
[@"bezel-color", bezelColor["disabled"], [CPThemeStateBezeled, CPThemeStateDisabled]],
|
||||
[@"bezel-color", bezelFocusedColor, [CPThemeStateBezeled, CPThemeStateEditing]],
|
||||
|
||||
[@"font", [CPFont systemFontOfSize:CPFontCurrentSystemSize]],
|
||||
[@"text-color", [CPColor colorWithWhite:0.2 alpha:0.5], CPThemeStateDisabled],
|
||||
|
||||
[@"content-inset", CGInsetMake(6.0, 0.0, 0.0, 3.0), CPThemeStateNormal],
|
||||
[@"content-inset", CGInsetMake(3.0, 0.0, 0.0, 3.0), CPThemeStateBezeled],
|
||||
[@"content-inset", CGInsetMake(6.0, 0.0, 0.0, 6.0), [CPThemeStateNormal, CPThemeStateBezeled, CPThemeStateEditing]],
|
||||
|
||||
[@"bezel-inset", CGInsetMake(3.0, 0.0, 3.0, 0.0), CPThemeStateBezeled],
|
||||
[@"bezel-inset", CGInsetMake(0.0, 0, 0.0, -3.0), [CPThemeStateNormal, CPThemeStateBezeled, CPThemeStateEditing]],
|
||||
|
||||
[@"datepicker-textfield-bezel-color", [CPColor clearColor], CPThemeStateNormal],
|
||||
[@"datepicker-textfield-bezel-color", bezelColorDatePickerTextField, CPThemeStateSelected],
|
||||
@@ -859,6 +870,7 @@ var themedButtonValues = nil,
|
||||
[@"min-size-datepicker-textfield", CGSizeMake(6.0, 18.0)],
|
||||
[@"date-hour-margin", 7.0],
|
||||
[@"stepper-margin", 5.0],
|
||||
[@"stepper-margin", 2.0, CPThemeStateEditing],
|
||||
|
||||
[@"min-size", CGSizeMake(0, 29.0)],
|
||||
[@"max-size", CGSizeMake(-1.0, 29.0)],
|
||||
@@ -867,10 +879,12 @@ var themedButtonValues = nil,
|
||||
// CPThemeStateControlSizeSmall
|
||||
[@"content-inset", CGInsetMake(5.0, 0.0, 0.0, 3.0), [CPThemeStateControlSizeSmall, CPThemeStateNormal]],
|
||||
[@"content-inset", CGInsetMake(2.0, 0.0, 0.0, 3.0), [CPThemeStateControlSizeSmall, CPThemeStateBezeled]],
|
||||
[@"content-inset", CGInsetMake(5.0, 0.0, 0.0, 6.0), [CPThemeStateControlSizeSmall, CPThemeStateBezeled, CPThemeStateEditing]],
|
||||
|
||||
[@"min-size-datepicker-textfield", CGSizeMake(6.0, 16.0), CPThemeStateControlSizeSmall],
|
||||
[@"date-hour-margin", 5.0, CPThemeStateControlSizeSmall],
|
||||
[@"stepper-margin", 3.0, CPThemeStateControlSizeSmall],
|
||||
[@"stepper-margin", 0.0, [CPThemeStateControlSizeSmall, CPThemeStateEditing]],
|
||||
|
||||
[@"min-size", CGSizeMake(0, 26.0), CPThemeStateControlSizeSmall],
|
||||
[@"max-size", CGSizeMake(-1.0, 26.0), CPThemeStateControlSizeSmall],
|
||||
@@ -879,10 +893,12 @@ var themedButtonValues = nil,
|
||||
// CPThemeStateControlSizeMini
|
||||
[@"content-inset", CGInsetMake(3.0, 0.0, 0.0, 3.0), [CPThemeStateControlSizeMini, CPThemeStateNormal]],
|
||||
[@"content-inset", CGInsetMake(1.0, 0.0, 0.0, 3.0), [CPThemeStateControlSizeMini, CPThemeStateBezeled]],
|
||||
[@"content-inset", CGInsetMake(4.0, 0.0, 0.0, 6.0), [CPThemeStateControlSizeMini, CPThemeStateBezeled, CPThemeStateEditing]],
|
||||
|
||||
[@"min-size-datepicker-textfield", CGSizeMake(6.0, 12.0), CPThemeStateControlSizeMini],
|
||||
[@"date-hour-margin", 2.0, CPThemeStateControlSizeMini],
|
||||
[@"stepper-margin", 2.0, CPThemeStateControlSizeMini],
|
||||
[@"stepper-margin", -1.0, [CPThemeStateControlSizeMini, CPThemeStateEditing]],
|
||||
|
||||
[@"min-size", CGSizeMake(0, 22.0), CPThemeStateControlSizeMini],
|
||||
[@"max-size", CGSizeMake(-1.0, 22.0), CPThemeStateControlSizeMini],
|
||||
@@ -2263,6 +2279,8 @@ var themedButtonValues = nil,
|
||||
sliceLastBottomBorderColor = [CPColor colorWithWhite:0.6 alpha:1.0],
|
||||
buttonAddImage = PatternImage(@"rule-editor-button-add-image.png", 20.0, 20.0),
|
||||
buttonRemoveImage = PatternImage(@"rule-editor-button-remove-image.png", 20.0, 20.0),
|
||||
buttonAddHighlightedImage = PatternImage(@"rule-editor-button-add-highlighted-image.png", 20.0, 20.0),
|
||||
buttonRemoveHighlightedImage = PatternImage(@"rule-editor-button-remove-highlighted-image.png", 20.0, 20.0),
|
||||
fontColor = [CPColor colorWithWhite:150 / 255 alpha:1],
|
||||
|
||||
ruleEditorThemedValues =
|
||||
@@ -2276,9 +2294,9 @@ var themedButtonValues = nil,
|
||||
[@"font", [CPFont systemFontOfSize:10.0]],
|
||||
[@"font-color", fontColor],
|
||||
[@"add-image", buttonAddImage, CPThemeStateNormal],
|
||||
[@"add-image", buttonAddImage, CPThemeStateHighlighted],
|
||||
[@"add-image", buttonAddHighlightedImage, CPThemeStateHighlighted],
|
||||
[@"remove-image", buttonRemoveImage, CPThemeStateNormal],
|
||||
[@"remove-image", buttonRemoveImage, CPThemeStateHighlighted],
|
||||
[@"remove-image", buttonRemoveHighlightedImage, CPThemeStateHighlighted],
|
||||
[@"vertical-alignment", CPCenterVerticalTextAlignment],
|
||||
];
|
||||
|
||||
|
||||
@@ -137,22 +137,27 @@ var BKLearnMoreToolbarItemIdentifier = @"BKLearnMoreToolbarItemId
|
||||
|
||||
[theWindow setFullPlatformWindow:YES];
|
||||
[theWindow makeKeyAndOrderFront:self];
|
||||
|
||||
[_themesCollectionView addObserver:self forKeyPath:@"selectionIndexes" options:CPKeyValueObservingOptionNew | CPKeyValueObservingOptionInitial context:nil];
|
||||
}
|
||||
|
||||
- (void)collectionViewDidChangeSelection:(CPCollectionView)aCollectionView
|
||||
- (void)observeValueForKeyPath:(CPString)keyPath ofObject:(id)object change:(CPDictionary)change context:(void)context
|
||||
{
|
||||
var themeDescriptorClass = _themeDescriptorClasses[[[aCollectionView selectionIndexes] firstIndex]],
|
||||
itemSize = [themeDescriptorClass itemSize];
|
||||
if (object == _themesCollectionView && keyPath == @"selectionIndexes")
|
||||
{
|
||||
var themeDescriptorClass = _themeDescriptorClasses[[[object selectionIndexes] firstIndex]],
|
||||
itemSize = [themeDescriptorClass itemSize];
|
||||
|
||||
// Make room for label and apply a minimum size.
|
||||
itemSize.width = MAX(100.0, itemSize.width + 20.0);
|
||||
itemSize.height = MAX(100.0, itemSize.height + 30.0);
|
||||
// Make room for label and apply a minimum size.
|
||||
itemSize.width = MAX(100.0, itemSize.width + 20.0);
|
||||
itemSize.height = MAX(100.0, itemSize.height + 30.0);
|
||||
|
||||
[_themedObjectsCollectionView setMinItemSize:itemSize];
|
||||
[_themedObjectsCollectionView setMaxItemSize:itemSize];
|
||||
[_themedObjectsCollectionView setMinItemSize:itemSize];
|
||||
[_themedObjectsCollectionView setMaxItemSize:itemSize];
|
||||
|
||||
[_themedObjectsCollectionView setContent:[themeDescriptorClass themedShowcaseObjectTemplates]];
|
||||
[BKShowcaseCell setBackgroundColor:[themeDescriptorClass showcaseBackgroundColor]];
|
||||
[_themedObjectsCollectionView setContent:[themeDescriptorClass themedShowcaseObjectTemplates]];
|
||||
[BKShowcaseCell setBackgroundColor:[themeDescriptorClass showcaseBackgroundColor]];
|
||||
}
|
||||
}
|
||||
|
||||
- (BOOL)hasLearnMoreURL
|
||||
|
||||
+28
-14
@@ -96,28 +96,41 @@ var ListColumnIdentifier = @"1";
|
||||
return [super sendEvent:anEvent];
|
||||
}
|
||||
|
||||
- (void)orderFront:(id)sender
|
||||
{
|
||||
[self _trapNextMouseDown];
|
||||
[super orderFront:sender];
|
||||
}
|
||||
|
||||
- (void)_mouseWasClicked:(CPEvent)anEvent
|
||||
{
|
||||
// This is needed, when the user close the list with the key enter
|
||||
if (![self isVisible])
|
||||
{
|
||||
[CPApp sendEvent:anEvent];
|
||||
return;
|
||||
}
|
||||
|
||||
var mouseWindow = [anEvent window],
|
||||
rect = [[[self delegate] dataSource] bounds],
|
||||
rect = CGRectInsetByInset([[[self delegate] dataSource] bounds], [[[self delegate] dataSource] currentValueForThemeAttribute:@"content-inset"]),
|
||||
point = [[[self delegate] dataSource] convertPoint:[anEvent locationInWindow] fromView:nil];
|
||||
|
||||
// If we click somewhere else than the comboBox or the panel we close the panel
|
||||
if (mouseWindow != self && !CGRectContainsPoint(rect, point))
|
||||
{
|
||||
[[self delegate] close];
|
||||
}
|
||||
else
|
||||
[self _trapNextMouseDown];
|
||||
{
|
||||
// If we click on the panel, the app will know what to do
|
||||
if (mouseWindow == self)
|
||||
[CPApp sendEvent:anEvent];
|
||||
|
||||
// If we click on the comboBox field, we will trap the next mouse down
|
||||
if (CGRectContainsPoint(rect, point))
|
||||
[self _trapNextMouseDown];
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
- (void)_trapNextMouseDown
|
||||
{
|
||||
// Don't dequeue the event so clicks in controls will work
|
||||
[CPApp setTarget:self selector:@selector(_mouseWasClicked:) forNextEventMatchingMask:CPLeftMouseDownMask untilDate:nil inMode:CPDefaultRunLoopMode dequeue:NO];
|
||||
// Dequeue the event and mouseWasClicked will do what it needs to do
|
||||
[CPApp setTarget:self selector:@selector(_mouseWasClicked:) forNextEventMatchingMask:CPLeftMouseDownMask untilDate:nil inMode:CPDefaultRunLoopMode dequeue:YES];
|
||||
}
|
||||
|
||||
@end
|
||||
@@ -323,6 +336,11 @@ var ListColumnIdentifier = @"1";
|
||||
if ([_panel isVisible])
|
||||
return;
|
||||
|
||||
[self listWillPopUp];
|
||||
|
||||
[_panel _trapNextMouseDown];
|
||||
[[aView window] addChildWindow:_panel ordered:CPWindowAbove];
|
||||
|
||||
var rowRect = [_tableView rectOfRow:[self numberOfRowsInTableView:_tableView] - 1],
|
||||
frame = CGRectMake(0, 0, MAX(_listWidth, CGRectGetWidth(aRect)), CGRectGetMaxY(rowRect));
|
||||
|
||||
@@ -333,10 +351,6 @@ var ListColumnIdentifier = @"1";
|
||||
[_scrollView setFrameSize:CGSizeMakeCopy(frame.size)];
|
||||
[_tableView setEnabled:[_dataSource numberOfItemsInList:self] > 0];
|
||||
[self scrollItemAtIndexToTop:[_tableView selectedRow]];
|
||||
|
||||
[self listWillPopUp];
|
||||
|
||||
[[aView window] addChildWindow:_panel ordered:CPWindowAbove];
|
||||
}
|
||||
|
||||
#pragma mark Setting Display Attributes
|
||||
|
||||
@@ -64,6 +64,7 @@ var _CPPopoverWindow_shouldClose_ = 1 << 4,
|
||||
BOOL _isObservingFrame;
|
||||
BOOL _shouldPerformAnimation;
|
||||
CPInteger _implementedDelegateMethods;
|
||||
CGRect _targetRect;
|
||||
CPWindow _targetWindow;
|
||||
JSObject _orderOutTransitionFunction;
|
||||
JSObject _transitionCompleteFunction;
|
||||
@@ -206,8 +207,7 @@ var _CPPopoverWindow_shouldClose_ = 1 << 4,
|
||||
if (![_targetView window])
|
||||
return;
|
||||
|
||||
var point = [self computeOriginFromRect:[_targetView bounds] ofView:_targetView preferredEdge:[_windowView preferredEdge]];
|
||||
|
||||
var point = [self computeOriginFromRect:_targetRect ofView:_targetView preferredEdge:[_windowView preferredEdge]];
|
||||
[self setFrameOrigin:point];
|
||||
}
|
||||
}
|
||||
@@ -362,7 +362,6 @@ var _CPPopoverWindow_shouldClose_ = 1 << 4,
|
||||
[self setFrameOrigin:point];
|
||||
[_windowView showCursor];
|
||||
[_windowView setNeedsDisplay:YES];
|
||||
[self makeKeyAndOrderFront:nil];
|
||||
|
||||
if (positioningView !== _targetView)
|
||||
{
|
||||
@@ -371,6 +370,9 @@ var _CPPopoverWindow_shouldClose_ = 1 << 4,
|
||||
_targetView = positioningView;
|
||||
}
|
||||
|
||||
_targetRect = aRect;
|
||||
[self makeKeyAndOrderFront:nil];
|
||||
|
||||
/*
|
||||
If _targetView's window is not a full platform window,
|
||||
add us as a child, because when we close we are detached from
|
||||
@@ -417,7 +419,7 @@ var _CPPopoverWindow_shouldClose_ = 1 << 4,
|
||||
|
||||
if ([self isVisible])
|
||||
{
|
||||
var point = [self computeOriginFromRect:[_targetView bounds] ofView:_targetView preferredEdge:[_windowView preferredEdge]];
|
||||
var point = [self computeOriginFromRect:_targetRect ofView:_targetView preferredEdge:[_windowView preferredEdge]];
|
||||
[self setFrameOrigin:point];
|
||||
}
|
||||
}
|
||||
@@ -581,10 +583,12 @@ var _CPPopoverWindow_shouldClose_ = 1 << 4,
|
||||
|
||||
- (void)_orderFront
|
||||
{
|
||||
if (![self isVisible])
|
||||
[self _addFrameObserver];
|
||||
var wasVisible = [self isVisible];
|
||||
|
||||
[super _orderFront];
|
||||
|
||||
if (!wasVisible)
|
||||
[self _addFrameObserver];
|
||||
}
|
||||
|
||||
- (void)_parentDidOrderInChild
|
||||
|
||||
@@ -53,7 +53,7 @@
|
||||
@param aType the structure or object type
|
||||
@param anObject the object to be encoded
|
||||
*/
|
||||
- (void)encodeValueOfObjCType:(CPString)aType at:(id)anObject
|
||||
- (void)encodeValueOfObjJType:(CPString)aType at:(id)anObject
|
||||
{
|
||||
_CPRaiseInvalidAbstractInvocation(self, _cmd);
|
||||
}
|
||||
|
||||
@@ -74,24 +74,36 @@ var CPDateReferenceDate = new Date(Date.UTC(2001, 0, 1, 0, 0, 0, 0));
|
||||
|
||||
- (id)initWithTimeIntervalSinceNow:(CPTimeInterval)seconds
|
||||
{
|
||||
if (!_isNumberType(seconds))
|
||||
CPLog.warn(@"The parameter of the method initWithTimeIntervalSinceNow: should be an integer or a float");
|
||||
|
||||
self = new Date((new Date()).getTime() + seconds * 1000);
|
||||
return self;
|
||||
}
|
||||
|
||||
- (id)initWithTimeIntervalSince1970:(CPTimeInterval)seconds
|
||||
{
|
||||
if (!_isNumberType(seconds))
|
||||
CPLog.warn(@"The parameter of the method initWithTimeIntervalSince1970: should be an integer or a float");
|
||||
|
||||
self = new Date(seconds * 1000);
|
||||
return self;
|
||||
}
|
||||
|
||||
- (id)initWithTimeIntervalSinceReferenceDate:(CPTimeInterval)seconds
|
||||
{
|
||||
if (!_isNumberType(seconds))
|
||||
CPLog.warn(@"The parameter of the method initWithTimeIntervalSinceReferenceDate: should be an integer or a float");
|
||||
|
||||
self = [self initWithTimeInterval:seconds sinceDate:CPDateReferenceDate];
|
||||
return self;
|
||||
}
|
||||
|
||||
- (id)initWithTimeInterval:(CPTimeInterval)seconds sinceDate:(CPDate)refDate
|
||||
{
|
||||
if (!_isNumberType(seconds))
|
||||
CPLog.warn(@"The parameter of the method initWithTimeInterval:sinceDate: should be an integer or a float");
|
||||
|
||||
self = new Date(refDate.getTime() + seconds * 1000);
|
||||
return self;
|
||||
}
|
||||
@@ -275,3 +287,11 @@ Date.parseISO8601 = function (date)
|
||||
};
|
||||
|
||||
Date.prototype.isa = CPDate;
|
||||
|
||||
function _isNumberType(value)
|
||||
{
|
||||
if (typeof value === 'number')
|
||||
return YES;
|
||||
else
|
||||
return NO;
|
||||
}
|
||||
+97
-26
@@ -24,31 +24,52 @@
|
||||
@import "CPObject.j"
|
||||
@import "CPString.j"
|
||||
|
||||
CPCappuccinoErrorDomain = CPCocoaErrorDomain = @"CPCappuccinoErrorDomain";
|
||||
// CPPOSIXErrorDomain = @"CPPOSIXErrorDomain";
|
||||
// CPOSStatusErrorDomain = @"CPOSStatusErrorDomain";
|
||||
CPCappuccinoErrorDomain = kCFErrorDomainCappuccino;
|
||||
CPCocoaErrorDomain = kCFErrorDomainCappuccino; // compat
|
||||
|
||||
CPUnderlyingErrorKey = @"CPUnderlyingErrorKey";
|
||||
CPUnderlyingErrorKey = kCFErrorUnderlyingErrorKey;
|
||||
|
||||
CPLocalizedDescriptionKey = @"CPLocalizedDescriptionKey";
|
||||
CPLocalizedFailureReasonErrorKey = @"CPLocalizedFailureReasonErrorKey";
|
||||
CPLocalizedRecoverySuggestionErrorKey = @"CPLocalizedRecoverySuggestionErrorKey";
|
||||
CPLocalizedDescriptionKey = kCFErrorLocalizedDescriptionKey;
|
||||
CPLocalizedFailureReasonErrorKey = kCFErrorLocalizedFailureReasonKey;
|
||||
CPLocalizedRecoverySuggestionErrorKey = kCFErrorLocalizedRecoverySuggestionKey;
|
||||
CPLocalizedRecoveryOptionsErrorKey = @"CPLocalizedRecoveryOptionsErrorKey";
|
||||
CPRecoveryAttempterErrorKey = @"CPRecoveryAttempterErrorKey";
|
||||
CPHelpAnchorErrorKey = @"CPHelpAnchorErrorKey";
|
||||
|
||||
CPStringEncodingErrorKey = @"CPStringEncodingErrorKey";
|
||||
CPURLErrorKey = @"CPURLErrorKey";
|
||||
CPFilePathErrorKey = @"CPFilePathErrorKey";
|
||||
CPURLErrorKey = kCFErrorURLKey;
|
||||
CPFilePathErrorKey = kCFErrorFilePathKey;
|
||||
|
||||
/*!
|
||||
@class CPError
|
||||
@ingroup foundation
|
||||
@brief Used for encapsulating, presenting, and recovery from errors.
|
||||
|
||||
CPError is toll-free bridged with CFError() methods.
|
||||
|
||||
An example of initializing a CPError:
|
||||
<pre>
|
||||
|
||||
var userInfo = @{CPLocalizedDescriptionKey: @"A localized error description",
|
||||
CPLocalizedFailureReasonErrorKey: @"A localized failure reason",
|
||||
CPUnderlyingErrorKey: @"An underlying error message"},
|
||||
|
||||
err = [CPError errorWithDomain:CPCappuccinoErrorDomain code:-10 userInfo:userInfo];
|
||||
</pre>
|
||||
*/
|
||||
@implementation CPError : CPObject
|
||||
{
|
||||
CPInteger _code @accessors(property=code, readonly);
|
||||
CPString _domain @accessors(property=domain, readonly);
|
||||
CPDictionary _userInfo @accessors(property=userInfo, readonly);
|
||||
}
|
||||
|
||||
+ (id)alloc
|
||||
{
|
||||
var obj = new CFError();
|
||||
obj.isa = [self class];
|
||||
|
||||
return obj;
|
||||
}
|
||||
|
||||
|
||||
+ (id)errorWithDomain:(CPString)aDomain code:(CPInteger)aCode userInfo:(CPDictionary)aDict
|
||||
{
|
||||
return [[CPError alloc] initWithDomain:aDomain code:aCode userInfo:aDict];
|
||||
@@ -56,44 +77,94 @@ CPFilePathErrorKey = @"CPFilePathErrorKey";
|
||||
|
||||
- (id)initWithDomain:(CPString)aDomain code:(CPInteger)aCode userInfo:(CPDictionary)aDict
|
||||
{
|
||||
if (self = [super init])
|
||||
{
|
||||
_domain = aDomain;
|
||||
_code = aCode;
|
||||
_userInfo = aDict;
|
||||
}
|
||||
|
||||
return self;
|
||||
var result = new CFError(aDomain, aCode, aDict);
|
||||
result.isa = [self class];
|
||||
return result;
|
||||
}
|
||||
|
||||
- (CPInteger)code
|
||||
{
|
||||
return self.code();
|
||||
}
|
||||
|
||||
- (CPString)userInfo
|
||||
{
|
||||
return self.userInfo();
|
||||
}
|
||||
|
||||
- (CPString)domain
|
||||
{
|
||||
return self.domain();
|
||||
}
|
||||
|
||||
/*!
|
||||
By default this method returns the object in the user info dictionary for the key
|
||||
CPLocalizedDescriptionKey. If the user info dictionary doesn’t contain a value for
|
||||
CPLocalizedDescriptionKey, a default string is constructed from the domain and code.
|
||||
*/
|
||||
- (CPString)localizedDescription
|
||||
{
|
||||
return [_userInfo objectForKey:CPLocalizedDescriptionKey];
|
||||
return self.description();
|
||||
}
|
||||
|
||||
- (CPString)localizedFailureReason
|
||||
{
|
||||
return [_userInfo objectForKey:CPLocalizedFailureReasonErrorKey];
|
||||
return self.failureReason();
|
||||
}
|
||||
|
||||
- (CPArray)localizedRecoveryOptions
|
||||
{
|
||||
return [_userInfo objectForKey:CPLocalizedRecoveryOptionsErrorKey];
|
||||
var userInfo = self.userInfo(),
|
||||
recoveryOptions = userInfo.valueForKey(CPLocalizedRecoveryOptionsErrorKey);
|
||||
|
||||
return recoveryOptions;
|
||||
}
|
||||
|
||||
- (CPString)localizedRecoverySuggestion
|
||||
{
|
||||
return [_userInfo objectForKey:CPLocalizedRecoverySuggestionErrorKey];
|
||||
return self.recoverySuggestion();
|
||||
}
|
||||
|
||||
- (id)recoveryAttempter
|
||||
{
|
||||
return [_userInfo objectForKey:CPRecoveryAttempterErrorKey];
|
||||
var userInfo = self.userInfo(),
|
||||
recoveryAttempter = userInfo.valueForKey(CPRecoveryAttempterErrorKey);
|
||||
|
||||
return recoveryAttempter;
|
||||
}
|
||||
|
||||
- (CPString)description
|
||||
{
|
||||
return [CPString stringWithFormat:@"Error Domain=%@ Code=%d UserInfo=%p %@", _domain, _code, _userInfo, [self localizedDescription]];
|
||||
return [CPString stringWithFormat:@"Error Domain=%@ Code=%d \"%@\" UserInfo=%@", self.domain(), self.code(), self.description(), self.userInfo()];
|
||||
}
|
||||
|
||||
@end
|
||||
|
||||
var CPErrorCodeKey = @"CPErrorCodeKey",
|
||||
CPErrorDomainKey = @"CPErrorDomainKey",
|
||||
CPErrorUserInfoKey = @"CPErrorUserInfoKey";
|
||||
|
||||
@implementation CPError (CPCoding)
|
||||
|
||||
- (id)initWithCoder:(CPCoder)aCoder
|
||||
{
|
||||
var code = [aCoder decodeIntForKey:CPErrorCodeKey],
|
||||
domain = [aCoder decodeObjectForKey:CPErrorDomainKey],
|
||||
userInfo = [aCoder decodeObjectForKey:CPErrorUserInfoKey];
|
||||
|
||||
return [self initWithDomain:domain
|
||||
code:code
|
||||
userInfo:userInfo];
|
||||
}
|
||||
|
||||
- (void)encodeWithCoder:(CPCoder)aCoder
|
||||
{
|
||||
[aCoder encodeObject:self.domain() forKey:CPErrorDomainKey];
|
||||
[aCoder encodeObject:self.code() forKey:CPErrorCodeKey];
|
||||
[aCoder encodeObject:self.userInfo() forKey:CPErrorUserInfoKey];
|
||||
}
|
||||
|
||||
@end
|
||||
|
||||
CFError.prototype.isa = CPError;
|
||||
|
||||
|
||||
@@ -21,6 +21,7 @@
|
||||
*/
|
||||
|
||||
@import "CPObject.j"
|
||||
@import "CPArray.j"
|
||||
|
||||
/*!
|
||||
@class CPInvocation
|
||||
|
||||
@@ -22,6 +22,7 @@
|
||||
|
||||
@import "CPException.j"
|
||||
@import "CPObject.j"
|
||||
@import "CPDictionary.j"
|
||||
|
||||
/*!
|
||||
@class CPNotification
|
||||
|
||||
@@ -117,10 +117,11 @@ CPOperationQueuePriorityVeryHigh = 8;
|
||||
[self willChangeValueForKey:@"isExecuting"];
|
||||
_executing = NO;
|
||||
[self didChangeValueForKey:@"isExecuting"];
|
||||
[self willChangeValueForKey:@"isFinished"];
|
||||
_finished = YES;
|
||||
[self didChangeValueForKey:@"isFinished"];
|
||||
}
|
||||
|
||||
[self willChangeValueForKey:@"isFinished"];
|
||||
_finished = YES;
|
||||
[self didChangeValueForKey:@"isFinished"];
|
||||
}
|
||||
|
||||
/*!
|
||||
|
||||
@@ -70,7 +70,7 @@ var cpOperationMainQueue = nil;
|
||||
for (; i < count; i++)
|
||||
{
|
||||
var op = [_operations objectAtIndex:i];
|
||||
if ([op isReady] && ![op isCancelled] && ![op isFinished] && ![op isExecuting])
|
||||
if ([op isReady] && ![op isFinished] && ![op isExecuting])
|
||||
{
|
||||
[op start];
|
||||
}
|
||||
@@ -260,7 +260,7 @@ var cpOperationMainQueue = nil;
|
||||
for (; i < count; i++)
|
||||
{
|
||||
var op = [ops objectAtIndex:i];
|
||||
if ([op isReady] && ![op isCancelled] && ![op isFinished] && ![op isExecuting])
|
||||
if ([op isReady] && ![op isFinished] && ![op isExecuting])
|
||||
{
|
||||
[op start];
|
||||
}
|
||||
|
||||
@@ -76,13 +76,12 @@ var CPURLConnectionDelegate = nil;
|
||||
*/
|
||||
@implementation CPURLConnection : CPObject
|
||||
{
|
||||
CPURLRequest _request;
|
||||
CPURLRequest _originalRequest @accessors(readonly, getter=originalRequest);
|
||||
CPURLRequest _request @accessors(readonly, getter=currentRequest);
|
||||
id _delegate;
|
||||
BOOL _isCanceled;
|
||||
BOOL _isLocalFileConnection;
|
||||
|
||||
BOOL _withCredentials @accessors(property=withCredentials);
|
||||
|
||||
HTTPRequest _HTTPRequest;
|
||||
}
|
||||
|
||||
@@ -99,25 +98,12 @@ var CPURLConnectionDelegate = nil;
|
||||
@return the data at the URL or \c nil if there was an error
|
||||
*/
|
||||
+ (CPData)sendSynchronousRequest:(CPURLRequest)aRequest returningResponse:(/*{*/CPURLResponse/*}*/)aURLResponse
|
||||
{
|
||||
var cfHTTPRequest = new CFHTTPRequest();
|
||||
|
||||
return [CPURLConnection _sendSynchronousRequest:aRequest returningResponse:aURLResponse withCFHTTPRequest:cfHTTPRequest];
|
||||
}
|
||||
|
||||
+ (CPData)sendSynchronousRequest:(CPURLRequest)aRequest returningResponse:(/*{*/CPURLResponse/*}*/)aURLResponse withCredentials:(BOOL)withCredentials
|
||||
{
|
||||
var cfHTTPRequest = new CFHTTPRequest();
|
||||
|
||||
cfHTTPRequest.setWithCredentials(withCredentials);
|
||||
|
||||
return [CPURLConnection _sendSynchronousRequest:aRequest returningResponse:aURLResponse withCFHTTPRequest:cfHTTPRequest];
|
||||
}
|
||||
|
||||
+ (CPData)_sendSynchronousRequest:(CPURLRequest)aRequest returningResponse:(/*{*/CPURLResponse/*}*/)aURLResponse withCFHTTPRequest:(CFHTTPRequest)aCFHTTPRequest
|
||||
{
|
||||
try
|
||||
{
|
||||
var aCFHTTPRequest = new CFHTTPRequest();
|
||||
aCFHTTPRequest.setWithCredentials([aRequest withCredentials]);
|
||||
|
||||
aCFHTTPRequest.open([aRequest HTTPMethod], [[aRequest URL] absoluteString], NO);
|
||||
|
||||
var fields = [aRequest allHTTPHeaderFields],
|
||||
@@ -152,17 +138,6 @@ var CPURLConnectionDelegate = nil;
|
||||
return [[self alloc] initWithRequest:aRequest delegate:aDelegate];
|
||||
}
|
||||
|
||||
//overloaded method that allows user to set _withCredentials
|
||||
+ (CPURLConnection)connectionWithRequest:(CPURLRequest)aRequest delegate:(id)aDelegate withCredentials:(BOOL)withCredentials
|
||||
{
|
||||
var connection = [[self alloc] initWithRequest:aRequest delegate:aDelegate startImmediately:NO];
|
||||
|
||||
[connection setWithCredentials:withCredentials];
|
||||
[connection start];
|
||||
|
||||
return connection;
|
||||
}
|
||||
|
||||
/*
|
||||
Default class initializer. Use one of the class methods instead.
|
||||
@param aRequest contains the URL to contact
|
||||
@@ -177,9 +152,9 @@ var CPURLConnectionDelegate = nil;
|
||||
if (self)
|
||||
{
|
||||
_request = aRequest;
|
||||
_originalRequest = [aRequest copy];
|
||||
_delegate = aDelegate;
|
||||
_isCanceled = NO;
|
||||
_withCredentials = NO;
|
||||
|
||||
var URL = [_request URL],
|
||||
scheme = [URL scheme];
|
||||
@@ -191,6 +166,7 @@ var CPURLConnectionDelegate = nil;
|
||||
(window.location.protocol === "file:" || window.location.protocol === "app:"));
|
||||
|
||||
_HTTPRequest = new CFHTTPRequest();
|
||||
_HTTPRequest.setWithCredentials([aRequest withCredentials]);
|
||||
|
||||
if (shouldStartImmediately)
|
||||
[self start];
|
||||
@@ -219,8 +195,6 @@ var CPURLConnectionDelegate = nil;
|
||||
{
|
||||
_isCanceled = NO;
|
||||
|
||||
_HTTPRequest.setWithCredentials(_withCredentials);
|
||||
|
||||
try
|
||||
{
|
||||
_HTTPRequest.open([_request HTTPMethod], [[_request URL] absoluteString], YES);
|
||||
|
||||
@@ -0,0 +1,39 @@
|
||||
|
||||
/*
|
||||
* The CPURL Error Domain
|
||||
*/
|
||||
CPURLErrorDomain = @"CPURLErrorDomain";
|
||||
|
||||
/*
|
||||
* CPURL UserInfo Error Keys
|
||||
*/
|
||||
CPURLErrorFailingURLErrorKey = @"CPErrorFailingURLKey";
|
||||
CPURLErrorFailingURLStringErrorKey = @"CPURLErrorFailingURLStringKey";
|
||||
|
||||
/*
|
||||
* CPURL Error Codes
|
||||
*/
|
||||
CPURLErrorUnknown = -1;
|
||||
CPURLErrorCancelled = kCFURLErrorCancelled;
|
||||
CPURLErrorBadURL = kCFURLErrorBadURL;
|
||||
CPURLErrorTimedOut = kCFURLErrorTimedOut;
|
||||
CPURLErrorUnsupportedURL = kCFURLErrorUnsupportedURL;
|
||||
CPURLErrorCannotFindHost = kCFURLErrorCannotFindHost;
|
||||
CPURLErrorCannotConnectToHost = kCFURLErrorCannotConnectToHost;
|
||||
CPURLErrorNetworkConnectionLost = kCFURLErrorNetworkConnectionLost;
|
||||
CPURLErrorDNSLookupFailed = kCFURLErrorDNSLookupFailed;
|
||||
CPURLErrorHTTPTooManyRedirects = kCFURLErrorHTTPTooManyRedirects;
|
||||
CPURLErrorResourceUnavailable = kCFURLErrorResourceUnavailable;
|
||||
CPURLErrorNotConnectedToInternet = kCFURLErrorNotConnectedToInternet;
|
||||
CPURLErrorRedirectToNonExistentLocation = kCFURLErrorRedirectToNonExistentLocation;
|
||||
CPURLErrorBadServerResponse = kCFURLErrorBadServerResponse;
|
||||
CPURLErrorUserCancelledAuthentication = kCFURLErrorUserCancelledAuthentication;
|
||||
CPURLErrorUserAuthenticationRequired = kCFURLErrorUserAuthenticationRequired;
|
||||
CPURLErrorZeroByteResource = kCFURLErrorZeroByteResource;
|
||||
CPURLErrorCannotDecodeRawData = kCFURLErrorCannotDecodeRawData;
|
||||
CPURLErrorCannotDecodeContentData = kCFURLErrorCannotDecodeContentData;
|
||||
CPURLErrorCannotParseResponse = kCFURLErrorCannotParseResponse;
|
||||
CPURLErrorFileDoesNotExist = kCFURLErrorFileDoesNotExist;
|
||||
CPURLErrorFileIsDirectory = kCFURLErrorFileIsDirectory;
|
||||
CPURLErrorNoPermissionsToReadFile = kCFURLErrorNoPermissionsToReadFile;
|
||||
CPURLErrorDataLengthExceedsMaximum = kCFURLErrorDataLengthExceedsMaximum;
|
||||
+27
-54
@@ -35,12 +35,14 @@
|
||||
*/
|
||||
@implementation CPURLRequest : CPObject
|
||||
{
|
||||
CPURL _URL;
|
||||
CPURL _URL @accessors(property=URL);
|
||||
|
||||
// FIXME: this should be CPData
|
||||
CPString _HTTPBody;
|
||||
CPString _HTTPMethod;
|
||||
CPDictionary _HTTPHeaderFields;
|
||||
CPString _HTTPBody @accessors(property=HTTPBody);
|
||||
CPString _HTTPMethod @accessors(property=HTTPMethod);
|
||||
BOOL _withCredentials @accessors(property=withCredentials);
|
||||
|
||||
CPDictionary _HTTPHeaderFields @accessors(readonly, getter=allHTTPHeaderFields);
|
||||
}
|
||||
|
||||
/*!
|
||||
@@ -78,6 +80,7 @@
|
||||
_HTTPBody = @"";
|
||||
_HTTPMethod = @"GET";
|
||||
_HTTPHeaderFields = @{};
|
||||
_withCredentials = NO;
|
||||
|
||||
[self setValue:"Thu, 01 Jan 1970 00:00:00 GMT" forHTTPHeaderField:"If-Modified-Since"];
|
||||
[self setValue:"no-cache" forHTTPHeaderField:"Cache-Control"];
|
||||
@@ -87,14 +90,6 @@
|
||||
return self;
|
||||
}
|
||||
|
||||
/*!
|
||||
Returns the request URL
|
||||
*/
|
||||
- (CPURL)URL
|
||||
{
|
||||
return _URL;
|
||||
}
|
||||
|
||||
/*!
|
||||
Sets the URL for this request.
|
||||
@param aURL the new URL
|
||||
@@ -105,48 +100,6 @@
|
||||
_URL = new CFURL(aURL);
|
||||
}
|
||||
|
||||
/*!
|
||||
Sets the HTTP body for this request
|
||||
@param anHTTPBody the new HTTP body
|
||||
*/
|
||||
- (void)setHTTPBody:(CPString)anHTTPBody
|
||||
{
|
||||
_HTTPBody = anHTTPBody;
|
||||
}
|
||||
|
||||
/*!
|
||||
Returns the request's http body.
|
||||
*/
|
||||
- (CPString)HTTPBody
|
||||
{
|
||||
return _HTTPBody;
|
||||
}
|
||||
|
||||
/*!
|
||||
Sets the request's http method.
|
||||
@param anHTPPMethod the new http method
|
||||
*/
|
||||
- (void)setHTTPMethod:(CPString)anHTTPMethod
|
||||
{
|
||||
_HTTPMethod = anHTTPMethod;
|
||||
}
|
||||
|
||||
/*!
|
||||
Returns the request's http method
|
||||
*/
|
||||
- (CPString)HTTPMethod
|
||||
{
|
||||
return _HTTPMethod;
|
||||
}
|
||||
|
||||
/*!
|
||||
Returns a dictionary of the http header fields
|
||||
*/
|
||||
- (CPDictionary)allHTTPHeaderFields
|
||||
{
|
||||
return _HTTPHeaderFields;
|
||||
}
|
||||
|
||||
/*!
|
||||
Returns the value for the specified header field.
|
||||
@param aField the header field to obtain a value for
|
||||
@@ -167,3 +120,23 @@
|
||||
}
|
||||
|
||||
@end
|
||||
|
||||
/*
|
||||
Implements the CPCopying Protocol for a CPURLRequest to provide deep copying for CPURLRequests
|
||||
*/
|
||||
@implementation CPURLRequest (CPCopying)
|
||||
{
|
||||
}
|
||||
|
||||
- (id)copy
|
||||
{
|
||||
var request = [[CPURLRequest alloc] initWithURL:[self URL]];
|
||||
[request setHTTPBody:[self HTTPBody]];
|
||||
[request setHTTPMethod:[self HTTPMethod]];
|
||||
[request setWithCredentials:[self withCredentials]];
|
||||
request._HTTPHeaderFields = [self allHTTPHeaderFields];
|
||||
|
||||
return request;
|
||||
}
|
||||
|
||||
@end
|
||||
|
||||
@@ -73,6 +73,7 @@
|
||||
@import "CPUndoManager.j"
|
||||
@import "CPURL.j"
|
||||
@import "CPURLConnection.j"
|
||||
@import "CPURLError.j"
|
||||
@import "CPURLRequest.j"
|
||||
@import "CPURLResponse.j"
|
||||
@import "CPUserDefaults.j"
|
||||
|
||||
@@ -111,6 +111,15 @@ task ("documentation-no-frame", function()
|
||||
generateDocs(true);
|
||||
});
|
||||
|
||||
task ("docset", function()
|
||||
{
|
||||
generateDocs(true);
|
||||
var documentationDir = FILE.canonical(FILE.join("Tools", "Documentation")),
|
||||
docsetShell = FILE.join(documentationDir, "support", "docset.sh");
|
||||
|
||||
OS.system([docsetShell, documentationDir]);
|
||||
});
|
||||
|
||||
function generateDocs(/* boolean */ noFrame)
|
||||
{
|
||||
// try to find a doxygen executable in the PATH;
|
||||
|
||||
@@ -0,0 +1,164 @@
|
||||
/*
|
||||
* CFError.js
|
||||
* Objective-J
|
||||
*
|
||||
* Created by Andrew Hankinson.
|
||||
* Copyright 2014, Andrew Hankinson.
|
||||
*
|
||||
* This library is free software; you can redistribute it and/or
|
||||
* modify it under the terms of the GNU Lesser General Public
|
||||
* License as published by the Free Software Foundation; either
|
||||
* version 2.1 of the License, or (at your option) any later version.
|
||||
*
|
||||
* This library is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||
* Lesser General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU Lesser General Public
|
||||
* License along with this library; if not, write to the Free Software
|
||||
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
|
||||
*/
|
||||
|
||||
GLOBAL(kCFErrorLocalizedDescriptionKey) = "CPLocalizedDescription";
|
||||
GLOBAL(kCFErrorLocalizedFailureReasonKey) = "CPLocalizedFailureReason";
|
||||
GLOBAL(kCFErrorLocalizedRecoverySuggestionKey) = "CPLocalizedRecoverySuggestion";
|
||||
GLOBAL(kCFErrorDescriptionKey) = "CPDescription";
|
||||
GLOBAL(kCFErrorUnderlyingErrorKey) = "CPUnderlyingError";
|
||||
|
||||
GLOBAL(kCFErrorURLKey) = "CPURL";
|
||||
GLOBAL(kCFErrorFilePathKey) = "CPFilePath";
|
||||
|
||||
// GLOBAL(kCFErrorDomainPOSIX) = "";
|
||||
// GLOBAL(kCFErrorDomainOSStatus) = "";
|
||||
// GLOBAL(kCFErrorDomainMach) = "";
|
||||
GLOBAL(kCFErrorDomainCappuccino) = "CPCappuccinoErrorDomain";
|
||||
GLOBAL(kCFErrorDomainCocoa) = kCFErrorDomainCappuccino;
|
||||
|
||||
|
||||
GLOBAL(CFError) = function(/* CFString */ domain, /* int */ code, /* CFDictionary */ userInfo)
|
||||
{
|
||||
this._domain = domain || NULL;
|
||||
this._code = code || 0;
|
||||
this._userInfo = userInfo || new CFDictionary();
|
||||
this._UID = objj_generateObjectUID();
|
||||
};
|
||||
|
||||
CFError.prototype.domain = function()
|
||||
{
|
||||
return this._domain;
|
||||
};
|
||||
|
||||
DISPLAY_NAME(CFError.prototype.domain);
|
||||
|
||||
CFError.prototype.code = function()
|
||||
{
|
||||
return this._code;
|
||||
};
|
||||
|
||||
DISPLAY_NAME(CFError.prototype.code);
|
||||
|
||||
/*
|
||||
This follows the same logic to generate a description as the "real" CFError.
|
||||
*/
|
||||
CFError.prototype.description = function()
|
||||
{
|
||||
var localizedDesc = this._userInfo.valueForKey(kCFErrorLocalizedDescriptionKey);
|
||||
if (localizedDesc)
|
||||
return localizedDesc;
|
||||
|
||||
var reason = this._userInfo.valueForKey(kCFErrorLocalizedFailureReasonKey);
|
||||
if (reason)
|
||||
{
|
||||
var operationFailedStr = "The operation couldn\u2019t be completed. " + reason;
|
||||
return operationFailedStr;
|
||||
}
|
||||
|
||||
// @TODO Add the bundle localized domain handler.
|
||||
var result = "",
|
||||
desc = this._userInfo.valueForKey(kCFErrorDescriptionKey);
|
||||
if (desc)
|
||||
{
|
||||
// we have a description key.
|
||||
var result = "The operation couldn\u2019t be completed. (error " + this._code + " - " + desc + ")";
|
||||
}
|
||||
else
|
||||
{
|
||||
// just use error and code;
|
||||
var result = "The operation couldn\u2019t be completed. (error " + this._code + ")";
|
||||
}
|
||||
|
||||
return result;
|
||||
};
|
||||
|
||||
DISPLAY_NAME(CFError.prototype.description);
|
||||
|
||||
CFError.prototype.failureReason = function()
|
||||
{
|
||||
return this._userInfo.valueForKey(kCFErrorLocalizedFailureReasonKey);
|
||||
};
|
||||
|
||||
DISPLAY_NAME(CFError.prototype.failureReason);
|
||||
|
||||
CFError.prototype.recoverySuggestion = function()
|
||||
{
|
||||
return this._userInfo.valueForKey(kCFErrorLocalizedRecoverySuggestionKey);
|
||||
};
|
||||
|
||||
DISPLAY_NAME(CFError.prototype.recoverySuggestion);
|
||||
|
||||
CFError.prototype.userInfo = function ()
|
||||
{
|
||||
return this._userInfo;
|
||||
};
|
||||
|
||||
DISPLAY_NAME(CFError.prototype.userInfo);
|
||||
|
||||
/*
|
||||
CFError Bridge Functions
|
||||
The "Create" and "Copy" in the function names do not have any meaning
|
||||
in Cappuccino; they are bridged here for compatibility reasons only.
|
||||
*/
|
||||
GLOBAL(CFErrorCreate) = function(/* String */ domain, /*int */ code, /* CFDictionary */ userInfo)
|
||||
{
|
||||
return new CFError(domain, code, userInfo);
|
||||
};
|
||||
|
||||
GLOBAL(CFErrorCreateWithUserInfoKeysAndValues) = function(/* String */ domain, /* int */ code, /* array */ userInfoKeys, /* array */ userInfoValues, /* int */ numUserInfoValues)
|
||||
{
|
||||
var userInfo = new CFMutableDictionary();
|
||||
while (numUserInfoValues--)
|
||||
userInfo.setValueForKey(userInfoKeys[numUserInfoValues], userInfoValues[numUserInfoValues]);
|
||||
|
||||
return new CFError(domain, code, userInfo);
|
||||
};
|
||||
|
||||
GLOBAL(CFErrorGetCode) = function(/* CFError */ err)
|
||||
{
|
||||
return err.code();
|
||||
};
|
||||
|
||||
GLOBAL(CFErrorGetDomain) = function(/* CFError */ err)
|
||||
{
|
||||
return err.domain();
|
||||
};
|
||||
|
||||
GLOBAL(CFErrorCopyDescription) = function(/* CFError */ err)
|
||||
{
|
||||
return err.description();
|
||||
};
|
||||
|
||||
GLOBAL(CFErrorCopyUserInfo) = function(/* CFError */ err)
|
||||
{
|
||||
return err.userInfo();
|
||||
};
|
||||
|
||||
GLOBAL(CFErrorCopyFailureReason) = function(/* CFError */ err)
|
||||
{
|
||||
return err.failureReason();
|
||||
};
|
||||
|
||||
GLOBAL(CFErrorCopyRecoverySuggestion) = function(/* CFError */err)
|
||||
{
|
||||
return err.recoverySuggestion();
|
||||
};
|
||||
@@ -103,6 +103,9 @@ GLOBAL(CFHTTPRequest) = function()
|
||||
this._eventDispatcher = new EventDispatcher(this);
|
||||
this._nativeRequest = new NativeRequest();
|
||||
|
||||
// by default, all requests will assume that credentials should not be sent.
|
||||
this._nativeRequest.withCredentials = false;
|
||||
|
||||
var self = this;
|
||||
this._stateChangeHandler = function()
|
||||
{
|
||||
@@ -279,7 +282,7 @@ CFHTTPRequest.prototype.setWithCredentials = function(/*Boolean*/ willSendWithCr
|
||||
this._nativeRequest.withCredentials = willSendWithCredentials;
|
||||
};
|
||||
|
||||
CFHTTPRequest.prototype.getWithCredentials = function()
|
||||
CFHTTPRequest.prototype.withCredentials = function()
|
||||
{
|
||||
return this._nativeRequest.withCredentials;
|
||||
};
|
||||
|
||||
@@ -0,0 +1,25 @@
|
||||
GLOBAL(kCFURLErrorUnknown) = -998;
|
||||
GLOBAL(kCFURLErrorCancelled) = -999;
|
||||
GLOBAL(kCFURLErrorBadURL) = -1000;
|
||||
GLOBAL(kCFURLErrorTimedOut) = -1001;
|
||||
GLOBAL(kCFURLErrorUnsupportedURL) = -1002;
|
||||
GLOBAL(kCFURLErrorCannotFindHost) = -1003;
|
||||
GLOBAL(kCFURLErrorCannotConnectToHost) = -1004;
|
||||
GLOBAL(kCFURLErrorNetworkConnectionLost) = -1005;
|
||||
GLOBAL(kCFURLErrorDNSLookupFailed) = -1006;
|
||||
GLOBAL(kCFURLErrorHTTPTooManyRedirects) = -1007;
|
||||
GLOBAL(kCFURLErrorResourceUnavailable) = -1008;
|
||||
GLOBAL(kCFURLErrorNotConnectedToInternet) = -1009;
|
||||
GLOBAL(kCFURLErrorRedirectToNonExistentLocation) = -1010;
|
||||
GLOBAL(kCFURLErrorBadServerResponse) = -1011;
|
||||
GLOBAL(kCFURLErrorUserCancelledAuthentication) = -1012;
|
||||
GLOBAL(kCFURLErrorUserAuthenticationRequired) = -1013;
|
||||
GLOBAL(kCFURLErrorZeroByteResource) = -1014;
|
||||
GLOBAL(kCFURLErrorCannotDecodeRawData) = -1015;
|
||||
GLOBAL(kCFURLErrorCannotDecodeContentData) = -1016;
|
||||
GLOBAL(kCFURLErrorCannotParseResponse) = -1017;
|
||||
GLOBAL(kCFURLErrorRequestBodyStreamExhausted) = -1021;
|
||||
GLOBAL(kCFURLErrorFileDoesNotExist) = -1100;
|
||||
GLOBAL(kCFURLErrorFileIsDirectory) = -1101;
|
||||
GLOBAL(kCFURLErrorNoPermissionsToReadFile) = -1102;
|
||||
GLOBAL(kCFURLErrorDataLengthExceedsMaximum) = -1103;
|
||||
@@ -38,6 +38,8 @@
|
||||
#include "CFHTTPRequest.js"
|
||||
#include "CFPropertyList.js"
|
||||
#include "CFDictionary.js"
|
||||
#include "CFError.js"
|
||||
#include "CFNetworkErrors.js"
|
||||
#include "CFData.js"
|
||||
#include "CFURL.js"
|
||||
#include "MarkedStream.js"
|
||||
|
||||
@@ -2381,9 +2381,9 @@ Reference: function(node, st, c) {
|
||||
buffer.concat(" "); // Add an extra space if it looks something like this: "return(<expression>)". No space between return and expression.
|
||||
}
|
||||
buffer.concat("function(__input) { if (arguments.length) return ");
|
||||
buffer.concat(node.element.name);
|
||||
c(node.element, st, "Expression");
|
||||
buffer.concat(" = __input; return ");
|
||||
buffer.concat(node.element.name);
|
||||
c(node.element, st, "Expression");
|
||||
buffer.concat("; }");
|
||||
if (!generate) compiler.lastPos = node.end;
|
||||
},
|
||||
|
||||
@@ -0,0 +1,78 @@
|
||||
@import <AppKit/CPComboBox.j>
|
||||
@import <AppKit/CPApplication.j>
|
||||
@import <Foundation/Foundation.j>
|
||||
|
||||
@import "CPNotificationCenterHelper.j"
|
||||
|
||||
[CPApplication sharedApplication];
|
||||
|
||||
@implementation CPComboBoxTest : OJTestCase
|
||||
{
|
||||
CPComboBox comboBox;
|
||||
BOOL wasClicked
|
||||
}
|
||||
|
||||
- (void)setUp
|
||||
{
|
||||
comboBox = [[CPComboBox alloc] initWithFrame:CGRectMake(0, 0, 200, 30)];
|
||||
}
|
||||
|
||||
- (void)testCanCreate
|
||||
{
|
||||
[self assertTrue:!!comboBox];
|
||||
}
|
||||
|
||||
- (void)testPublicAccessors
|
||||
{
|
||||
[comboBox setHasVerticalScroller:YES];
|
||||
[comboBox setIntercellSpacing:CGSizeMakeZero()];
|
||||
[comboBox setButtonBordered:YES];
|
||||
[comboBox setItemHeight:30];
|
||||
[comboBox setNumberOfVisibleItems:10];
|
||||
}
|
||||
|
||||
- (void)testPerformClick
|
||||
{
|
||||
[comboBox setTarget:self];
|
||||
[comboBox setAction:@selector(clickMe:)];
|
||||
[comboBox performClick:nil];
|
||||
[self assertTrue:wasClicked];
|
||||
}
|
||||
|
||||
- (void)clickMe:(id)sender
|
||||
{
|
||||
wasClicked = YES;
|
||||
}
|
||||
|
||||
- (void)testNotificationsRegistered
|
||||
{
|
||||
[self assert:[CPNotificationCenterHelper registeredNotificationsForObserver:comboBox] equals:[] message:@"Notications registered for the CPComboBox in the notification center are wrong"];
|
||||
[comboBox setListDelegate:[[_CPPopUpList alloc] initWithDataSource:comboBox]];
|
||||
[self assert:[CPNotificationCenterHelper registeredNotificationsForObserver:comboBox] equals:[] message:@"Notications registered for the CPComboBox in the notification center are wrong"];
|
||||
|
||||
var theWindow = [[CPWindow alloc] initWithContentRect:CGRectMake(0.0, 0.0, 1024.0, 768.0)
|
||||
styleMask:CPWindowNotSizable];
|
||||
|
||||
[[theWindow contentView] addSubview:comboBox];
|
||||
|
||||
var expectedNotifications = [@"_CPPopUpListWillPopUpNotification", @"_CPPopUpListWillDismissNotification", @"_CPPopUpListDidDismissNotification", @"_CPPopUpListItemWasClickedNotification", @"CPTableViewSelectionIsChangingNotification", @"CPTableViewSelectionDidChangeNotification"].sort();
|
||||
|
||||
[self assert:[CPNotificationCenterHelper registeredNotificationsForObserver:comboBox] equals:expectedNotifications message:@"Notications registered for the CPComboBox in the notification center are wrong"];
|
||||
|
||||
[comboBox removeFromSuperview];
|
||||
[self assert:[CPNotificationCenterHelper registeredNotificationsForObserver:comboBox] equals:[] message:@"Notications registered for the CPComboBox in the notification center are wrong"];
|
||||
|
||||
[[theWindow contentView] addSubview:comboBox];
|
||||
[self assert:[CPNotificationCenterHelper registeredNotificationsForObserver:comboBox] equals:expectedNotifications message:@"Notications registered for the CPComboBox in the notification center are wrong"];
|
||||
|
||||
[[theWindow contentView] addSubview:comboBox];
|
||||
[self assert:[CPNotificationCenterHelper registeredNotificationsForObserver:comboBox] equals:expectedNotifications message:@"Notications registered for the CPComboBox in the notification center are wrong"];
|
||||
|
||||
[comboBox setListDelegate:nil];
|
||||
[self assert:[CPNotificationCenterHelper registeredNotificationsForObserver:comboBox] equals:[] message:@"Notications registered for the CPComboBox in the notification center are wrong"];
|
||||
|
||||
[comboBox setListDelegate:[[_CPPopUpList alloc] initWithDataSource:comboBox]];
|
||||
[self assert:[CPNotificationCenterHelper registeredNotificationsForObserver:comboBox] equals:expectedNotifications message:@"Notications registered for the CPComboBox in the notification center are wrong"];
|
||||
}
|
||||
|
||||
@end
|
||||
@@ -0,0 +1,39 @@
|
||||
@import <Foundation/Foundation.j>
|
||||
|
||||
@implementation CPNotificationCenterHelper : CPObject
|
||||
{
|
||||
}
|
||||
|
||||
+ (void)registeredNotificationsForObserver:(id)anObserver
|
||||
{
|
||||
var defaultCenter = [CPNotificationCenter defaultCenter],
|
||||
names = [defaultCenter._namedRegistries keyEnumerator],
|
||||
notifications = [],
|
||||
name;
|
||||
|
||||
while ((name = [names nextObject]) !== nil)
|
||||
{
|
||||
var notificationRegistry = [defaultCenter._namedRegistries objectForKey:name],
|
||||
objectObservers = notificationRegistry._objectObservers,
|
||||
keys = [objectObservers keyEnumerator],
|
||||
key;
|
||||
|
||||
// Iterate through every set of observers
|
||||
while ((key = [keys nextObject]) !== nil)
|
||||
{
|
||||
var observers = [objectObservers objectForKey:key],
|
||||
observer = nil,
|
||||
observersEnumerator = [observers objectEnumerator];
|
||||
|
||||
while ((observer = [observersEnumerator nextObject]) !== nil)
|
||||
{
|
||||
if ([observer observer] == anObserver)
|
||||
[notifications addObject:name];
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return notifications.sort();
|
||||
}
|
||||
|
||||
@end
|
||||
@@ -1,5 +1,9 @@
|
||||
@import <AppKit/AppKit.j>
|
||||
|
||||
@import "CPNotificationCenterHelper.j"
|
||||
|
||||
[CPApplication sharedApplication];
|
||||
|
||||
@implementation CPScrollViewTest : OJTestCase
|
||||
{
|
||||
}
|
||||
@@ -256,6 +260,24 @@
|
||||
[self assertPoint:CGPointMake(0, 0) equals:visibleRect.origin message:@"VisibleRect origin not at top left corner again"];
|
||||
}
|
||||
|
||||
-(void)testNotificationsRegistered
|
||||
{
|
||||
var scrollView = [[CPScrollView alloc] initWithFrame:CGRectMake(0, 0, 100, 100)],
|
||||
theWindow = [[CPWindow alloc] initWithContentRect:CGRectMake(0.0, 0.0, 1024.0, 768.0)
|
||||
styleMask:CPWindowNotSizable];
|
||||
|
||||
[self assert:[CPNotificationCenterHelper registeredNotificationsForObserver:scrollView] equals:[] message:@"Notications registered for the scrollView in the notification center are wrong"];
|
||||
|
||||
[[theWindow contentView] addSubview:scrollView];
|
||||
[self assert:[CPNotificationCenterHelper registeredNotificationsForObserver:scrollView] equals:[@"CPScrollerStyleGlobalChangeNotification"] message:@"Notications registered for the scrollView in the notification center are wrong"];
|
||||
|
||||
[[theWindow contentView] addSubview:scrollView];
|
||||
[self assert:[CPNotificationCenterHelper registeredNotificationsForObserver:scrollView] equals:[@"CPScrollerStyleGlobalChangeNotification"] message:@"Notications registered for the scrollView in the notification center are wrong"];
|
||||
|
||||
[scrollView removeFromSuperview];
|
||||
[self assert:[CPNotificationCenterHelper registeredNotificationsForObserver:scrollView] equals:[] message:@"Notications registered for the scrollView in the notification center are wrong"];
|
||||
}
|
||||
|
||||
- (void)assertPoint:(CGPoint)expected equals:(CGPoint)actual message:(CPString)message
|
||||
{
|
||||
[self assert:expected.x equals:actual.x message:@"X: " + message];
|
||||
|
||||
@@ -1,5 +1,7 @@
|
||||
@import <AppKit/AppKit.j>
|
||||
|
||||
@import "CPNotificationCenterHelper.j"
|
||||
|
||||
[CPApplication sharedApplication];
|
||||
|
||||
@implementation CPTableViewTest : OJTestCase
|
||||
@@ -303,6 +305,36 @@
|
||||
[self assertTrue:[table bounds].size.width >= 200];
|
||||
}
|
||||
|
||||
-(void)testNotificationsRegistered
|
||||
{
|
||||
[self assert:[CPNotificationCenterHelper registeredNotificationsForObserver:tableView] equals:[@"_CPWindowDidChangeFirstResponderNotification"] message:@"Notications registered for the tableView in the notification center are wrong"];
|
||||
|
||||
[tableView removeFromSuperview];
|
||||
[self assert:[CPNotificationCenterHelper registeredNotificationsForObserver:tableView] equals:[] message:@"Notications registered for the tableView in the notification center are wrong"];
|
||||
|
||||
[[theWindow contentView] addSubview:tableView];
|
||||
[self assert:[CPNotificationCenterHelper registeredNotificationsForObserver:tableView] equals:[@"_CPWindowDidChangeFirstResponderNotification"] message:@"Notications registered for the tableView in the notification center are wrong"];
|
||||
|
||||
[[theWindow contentView] addSubview:tableView];
|
||||
[self assert:[CPNotificationCenterHelper registeredNotificationsForObserver:tableView] equals:[@"_CPWindowDidChangeFirstResponderNotification"] message:@"Notications registered for the tableView in the notification center are wrong"];
|
||||
|
||||
|
||||
var scrollView = [[CPScrollView alloc] initWithFrame:CGRectMake(0, 0, 100.0, 100.0)],
|
||||
expectedNotifications = [@"_CPWindowDidChangeFirstResponderNotification", @"CPViewFrameDidChangeNotification", @"CPViewBoundsDidChangeNotification"].sort();
|
||||
|
||||
[scrollView setDocumentView:tableView];
|
||||
|
||||
[[theWindow contentView] addSubview:scrollView];
|
||||
[self assert:[CPNotificationCenterHelper registeredNotificationsForObserver:tableView] equals:expectedNotifications message:@"Notications registered for the tableView in the notification center are wrong"];
|
||||
|
||||
[[theWindow contentView] addSubview:scrollView];
|
||||
[self assert:[CPNotificationCenterHelper registeredNotificationsForObserver:tableView] equals:expectedNotifications message:@"Notications registered for the tableView in the notification center are wrong"];
|
||||
|
||||
[scrollView removeFromSuperview];
|
||||
[self assert:[CPNotificationCenterHelper registeredNotificationsForObserver:tableView] equals:[] message:@"Notications registered for the tableView in the notification center are wrong"];
|
||||
|
||||
}
|
||||
|
||||
@end
|
||||
|
||||
@implementation FirstResponderConfigurableTableView : CPTableView
|
||||
|
||||
@@ -128,4 +128,12 @@
|
||||
[self assertTrue:[[[self window] representedURL] class] === [CPURL class]];
|
||||
}
|
||||
|
||||
- (void)testOrderingMethod
|
||||
{
|
||||
[_window orderFront:self];
|
||||
[_window orderBack:self];
|
||||
[_window orderFront:self];
|
||||
[_window orderOut:self];
|
||||
}
|
||||
|
||||
@end
|
||||
|
||||
@@ -0,0 +1,43 @@
|
||||
@import <Foundation/CPError.j>
|
||||
@import <OJUnit/OJTestCase.j>
|
||||
|
||||
@implementation CPErrorTest : OJTestCase
|
||||
{
|
||||
}
|
||||
|
||||
- (void)testInstanceInstantiation
|
||||
{
|
||||
var err = [[CPError alloc] initWithDomain:CPCappuccinoErrorDomain
|
||||
code:-10
|
||||
userInfo:nil];
|
||||
[self assertNotNull:err];
|
||||
}
|
||||
|
||||
- (void)testClassInstantiation
|
||||
{
|
||||
var err = [CPError errorWithDomain:CPCappuccinoErrorDomain
|
||||
code:-10
|
||||
userInfo:nil];
|
||||
[self assertNotNull:err];
|
||||
}
|
||||
|
||||
- (void)testUserInfoDict
|
||||
{
|
||||
var userInfo = @{
|
||||
CPLocalizedDescriptionKey: @"A localized error description",
|
||||
CPUnderlyingErrorKey: @"An underlying error",
|
||||
CPLocalizedFailureReasonErrorKey: @"A localized error reason",
|
||||
CPLocalizedRecoverySuggestionErrorKey: @"The world is about to explode. You can choose to ignore this.",
|
||||
CPLocalizedRecoveryOptionsErrorKey: ["Cry", "Ignore"]
|
||||
},
|
||||
err = [CPError errorWithDomain:CPCappuccinoErrorDomain
|
||||
code:-10
|
||||
userInfo:userInfo];
|
||||
|
||||
[self assertNotNull:[err userInfo]];
|
||||
[self assert:[err localizedDescription] equals:@"A localized error description"];
|
||||
[self assert:[err localizedRecoveryOptions] equals:["Cry", "Ignore"]];
|
||||
[self assertNull:[err recoveryAttempter]];
|
||||
}
|
||||
|
||||
@end
|
||||
@@ -16,6 +16,33 @@ globalResults = [];
|
||||
|
||||
@end
|
||||
|
||||
@implementation TestCancelOperation : CPOperation
|
||||
{
|
||||
BOOL _started @accessors(getter=didStart);
|
||||
BOOL _mained @accessors(getter=didMain);
|
||||
}
|
||||
|
||||
- (id)init
|
||||
{
|
||||
self = [super init];
|
||||
_started = NO;
|
||||
_mained = NO;
|
||||
return self;
|
||||
}
|
||||
|
||||
- (void)main
|
||||
{
|
||||
_mained = YES;
|
||||
}
|
||||
|
||||
- (void)start
|
||||
{
|
||||
[super start];
|
||||
_started = YES;
|
||||
}
|
||||
|
||||
@end
|
||||
|
||||
@implementation TestObserver : CPObject
|
||||
{
|
||||
CPArray changedKeyPaths @accessors;
|
||||
@@ -167,4 +194,27 @@ globalResults = [];
|
||||
[self assert:@"name" equals:[[obs changedKeyPaths] objectAtIndex:4]];
|
||||
}
|
||||
|
||||
- (void)testCancelledOperationDoesStart
|
||||
{
|
||||
var op = [[TestCancelOperation alloc] init],
|
||||
queue = [[CPOperationQueue alloc] init];
|
||||
|
||||
[self assertFalse:[op isCancelled]];
|
||||
[self assertFalse:[op isFinished]];
|
||||
[self assertFalse:[op didMain]];
|
||||
[self assertFalse:[op didStart]];
|
||||
|
||||
[op cancel];
|
||||
|
||||
[self assertTrue:[op isCancelled]];
|
||||
[self assertFalse:[op isFinished]];
|
||||
|
||||
[queue addOperations:[op] waitUntilFinished:YES];
|
||||
|
||||
[self assertFalse:[op didMain]];
|
||||
[self assertTrue:[op didStart]];
|
||||
[self assertTrue:[op isCancelled]];
|
||||
[self assertTrue:[op isFinished]];
|
||||
}
|
||||
|
||||
@end
|
||||
@@ -180,4 +180,21 @@
|
||||
[self assert:@"isCancelled" equals:[[obs changedKeyPaths] objectAtIndex:9]];
|
||||
}
|
||||
|
||||
- (void)testCancelledOperationIsFinished
|
||||
{
|
||||
var results = @[],
|
||||
funcOp = [CPFunctionOperation functionOperationWithFunction:function() {[results addObject:"funcOp"];}];
|
||||
|
||||
[funcOp cancel];
|
||||
[self assertTrue:[funcOp isCancelled]];
|
||||
[self assertFalse:[funcOp isFinished]];
|
||||
|
||||
[funcOp start];
|
||||
|
||||
[self assertTrue:[funcOp isCancelled]];
|
||||
[self assertTrue:[funcOp isFinished]];
|
||||
|
||||
[self assertTrue:([results count] == 0)];
|
||||
}
|
||||
|
||||
@end
|
||||
|
||||
@@ -1,3 +1,4 @@
|
||||
@import <OJUnit/OJTestCase.j>
|
||||
|
||||
@implementation CPURLConnectionTest : OJTestCase
|
||||
{
|
||||
@@ -36,10 +37,40 @@
|
||||
[self assertNull:data];
|
||||
}
|
||||
|
||||
- (void)testRequestWithCredentials
|
||||
- (void)testClassMethodConnectionWithCredentials
|
||||
{
|
||||
var connection = [CPURLConnection connectionWithRequest:[CPURLRequest requestWithURL:@"Tests/Foundation/CPURLConnectionTest.j"] delegate:self withCredentials:YES];
|
||||
[self assertTrue:[connection withCredentials]];
|
||||
var req = [CPURLRequest requestWithURL:[CPURL URLWithString:@"Tests/Foundation/CPURLConnectionTest.j"]];
|
||||
[req setWithCredentials:YES];
|
||||
var data = [CPURLConnection sendSynchronousRequest:req returningResponse:nil];
|
||||
|
||||
[self assertNotNull:data];
|
||||
}
|
||||
|
||||
- (void)testInstanceMethodConnectionWithCredentials
|
||||
{
|
||||
var req = [CPURLRequest requestWithURL:[CPURL URLWithString:@"Tests/Foundation/CPURLConnectionTest.j"]];
|
||||
[req setWithCredentials:YES];
|
||||
|
||||
var conn = [[CPURLConnection alloc] initWithRequest:req delegate:nil startImmediately:NO];
|
||||
|
||||
[self assertTrue:conn._HTTPRequest.withCredentials];
|
||||
|
||||
[req setWithCredentials:NO];
|
||||
[self assertTrue:conn._HTTPRequest.withCredentials];
|
||||
}
|
||||
|
||||
- (void)testRequestGetters
|
||||
{
|
||||
var req = [CPURLRequest requestWithURL:[CPURL URLWithString:@"Tests/Foundation/CPURLConnectionTest.j"]],
|
||||
conn = [[CPURLConnection alloc] initWithRequest:req delegate:nil startImmediately:NO];
|
||||
|
||||
var originalRequest = [conn originalRequest],
|
||||
currentRequest = [conn currentRequest];
|
||||
|
||||
[self assert:originalRequest._UID notEqual:currentRequest._UID];
|
||||
|
||||
[[conn currentRequest] setWithCredentials:YES];
|
||||
[self assert:[originalRequest withCredentials] notEqual:[currentRequest withCredentials]];
|
||||
}
|
||||
|
||||
@end
|
||||
|
||||
@@ -0,0 +1,30 @@
|
||||
@import <OJUnit/OJTestCase.j>
|
||||
|
||||
|
||||
var exampleURL = "http://www.cappuccino-project.org";
|
||||
|
||||
@implementation CPURLRequestTest : OJTestCase
|
||||
{
|
||||
}
|
||||
|
||||
- (void)testClassMethods
|
||||
{
|
||||
var url = [CPURL URLWithString:exampleURL],
|
||||
req = [CPURLRequest requestWithURL:url];
|
||||
|
||||
[self assert:[req HTTPMethod] equals:@"GET"];
|
||||
[self assert:[req URL] equals:url];
|
||||
}
|
||||
|
||||
- (void)testWithCredentials
|
||||
{
|
||||
var url = [CPURL URLWithString:exampleURL],
|
||||
req = [CPURLRequest requestWithURL:url];
|
||||
|
||||
[self assertFalse:[req withCredentials]];
|
||||
|
||||
[req setWithCredentials:YES];
|
||||
[self assertTrue:[req withCredentials]];
|
||||
}
|
||||
|
||||
@end
|
||||
@@ -0,0 +1,78 @@
|
||||
/*
|
||||
* AppController.j
|
||||
* CrossOriginTest
|
||||
*
|
||||
* Created by You on December 5, 2014.
|
||||
* Copyright 2014, Your Company All rights reserved.
|
||||
*/
|
||||
|
||||
@import <Foundation/Foundation.j>
|
||||
@import <AppKit/AppKit.j>
|
||||
|
||||
var corsServer = "http://localhost:8001";
|
||||
|
||||
@implementation AppController : CPObject
|
||||
{
|
||||
@outlet CPWindow theWindow;
|
||||
@outlet CPButton theButton;
|
||||
@outlet CPButton setsWithCredentials;
|
||||
}
|
||||
|
||||
- (void)applicationDidFinishLaunching:(CPNotification)aNotification
|
||||
{
|
||||
}
|
||||
|
||||
- (void)awakeFromCib
|
||||
{
|
||||
// This is called when the cib is done loading.
|
||||
// You can implement this method on any object instantiated from a Cib.
|
||||
// It's a useful hook for setting up current UI values, and other things.
|
||||
|
||||
// In this case, we want the window from Cib to become our full browser window
|
||||
[theWindow setFullPlatformWindow:YES];
|
||||
}
|
||||
|
||||
-(void)connection:(CPURLConnection)connection didReceiveResponse:(CPHTTPURLResponse)response
|
||||
{
|
||||
console.log("Response received");
|
||||
}
|
||||
|
||||
-(void)connection:(CPURLConnection)connection didReceiveData:(CPString)data
|
||||
{
|
||||
var wc = ([[connection originalRequest] withCredentials]) ? "YES" : "NO"
|
||||
console.log("CPURLConnection was sent with credentials? " + wc + " Response: " + data);
|
||||
}
|
||||
|
||||
- (@action)stateOfWithCredentials:(id)aSender
|
||||
{
|
||||
console.log([setsWithCredentials state]);
|
||||
}
|
||||
|
||||
- (@action)testCappuccinoRequest:(id)aSender
|
||||
{
|
||||
var req = [CPURLRequest requestWithURL:[CPURL URLWithString:corsServer + @"/resp.json"]];
|
||||
[req setValue:@"no-cache" forHTTPHeaderField:@"Pragma"];
|
||||
[req setValue:@"no-store, no-cache, must-revalidate, post-check=0, pre-check=0" forHTTPHeaderField:@"Cache-Control"];
|
||||
[req setWithCredentials:[setsWithCredentials state]];
|
||||
[[CPURLConnection alloc] initWithRequest:req delegate:self startImmediately:YES];
|
||||
}
|
||||
|
||||
- (@action)testNativeRequest:(id)aSender
|
||||
{
|
||||
var wc = ([setsWithCredentials state]) ? true : false;
|
||||
var req = new XMLHttpRequest();
|
||||
function reqListener ()
|
||||
{
|
||||
console.log("Native XHR was sent with credentials? " + wc + " Response: " + this.responseText);
|
||||
}
|
||||
|
||||
req.onload = reqListener;
|
||||
req.withCredentials = wc;
|
||||
req.open("GET", corsServer + "/resp.json", true);
|
||||
req.setRequestHeader("Pragma", "no-cache");
|
||||
req.setRequestHeader("Cache-Control", "no-store, no-cache, must-revalidate, post-check=0, pre-check=0");
|
||||
|
||||
req.send();
|
||||
}
|
||||
|
||||
@end
|
||||
@@ -0,0 +1,14 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
|
||||
<plist version="1.0">
|
||||
<dict>
|
||||
<key>Main cib file base name</key>
|
||||
<string>MainMenu.cib</string>
|
||||
<key>CPBundleName</key>
|
||||
<string>CrossOriginTest</string>
|
||||
<key>CPBundleVersion</key>
|
||||
<string>1.0</string>
|
||||
<key>CPHumanReadableCopyright</key>
|
||||
<string>Copyright © 2014, Your Company All rights reserved.</string>
|
||||
</dict>
|
||||
</plist>
|
||||
@@ -0,0 +1,184 @@
|
||||
/*
|
||||
* Jakefile
|
||||
* CrossOriginTest
|
||||
*
|
||||
* Created by You on December 9, 2014.
|
||||
* Copyright 2014, Your Company All rights reserved.
|
||||
*/
|
||||
|
||||
var ENV = require("system").env,
|
||||
FILE = require("file"),
|
||||
JAKE = require("jake"),
|
||||
task = JAKE.task,
|
||||
FileList = JAKE.FileList,
|
||||
app = require("cappuccino/jake").app,
|
||||
configuration = ENV["CONFIG"] || ENV["CONFIGURATION"] || ENV["c"] || "Debug",
|
||||
OS = require("os"),
|
||||
projectName = "CrossOriginTest";
|
||||
|
||||
app (projectName, function(task)
|
||||
{
|
||||
ENV["OBJJ_INCLUDE_PATHS"] = "Frameworks";
|
||||
|
||||
if (configuration === "Debug")
|
||||
ENV["OBJJ_INCLUDE_PATHS"] = FILE.join(ENV["OBJJ_INCLUDE_PATHS"], configuration);
|
||||
|
||||
task.setBuildIntermediatesPath(FILE.join("Build", "CrossOriginTest.build", configuration));
|
||||
task.setBuildPath(FILE.join("Build", configuration));
|
||||
|
||||
task.setProductName("CrossOriginTest");
|
||||
task.setIdentifier("com.yourcompany.CrossOriginTest");
|
||||
task.setVersion("1.0");
|
||||
task.setAuthor("Your Company");
|
||||
task.setEmail("feedback @nospam@ yourcompany.com");
|
||||
task.setSummary("CrossOriginTest");
|
||||
task.setSources(new FileList("**/*.j").exclude(FILE.join("Build", "**")).exclude(FILE.join("Frameworks", "Source", "**")));
|
||||
task.setResources(new FileList("Resources/**"));
|
||||
task.setIndexFilePath("index.html");
|
||||
task.setInfoPlistPath("Info.plist");
|
||||
|
||||
if (configuration === "Debug")
|
||||
task.setCompilerFlags("-DDEBUG -g");
|
||||
else
|
||||
task.setCompilerFlags("-O");
|
||||
});
|
||||
|
||||
task ("default", [projectName], function()
|
||||
{
|
||||
printResults(configuration);
|
||||
});
|
||||
|
||||
task ("build", ["default"], function()
|
||||
{
|
||||
updateApplicationSize();
|
||||
});
|
||||
|
||||
task ("debug", function()
|
||||
{
|
||||
configuration = ENV["CONFIGURATION"] = "Debug";
|
||||
JAKE.subjake(["."], "build", ENV);
|
||||
});
|
||||
|
||||
task ("release", function()
|
||||
{
|
||||
configuration = ENV["CONFIGURATION"] = "Release";
|
||||
JAKE.subjake(["."], "build", ENV);
|
||||
});
|
||||
|
||||
task ("run", ["debug"], function()
|
||||
{
|
||||
OS.system(["open", FILE.join("Build", "Debug", projectName, "index.html")]);
|
||||
});
|
||||
|
||||
task ("run-release", ["release"], function()
|
||||
{
|
||||
OS.system(["open", FILE.join("Build", "Release", projectName, "index.html")]);
|
||||
});
|
||||
|
||||
task ("deploy", ["release"], function()
|
||||
{
|
||||
FILE.mkdirs(FILE.join("Build", "Deployment", projectName));
|
||||
OS.system(["press", "-f", FILE.join("Build", "Release", projectName), FILE.join("Build", "Deployment", projectName)]);
|
||||
printResults("Deployment")
|
||||
});
|
||||
|
||||
task ("desktop", ["release"], function()
|
||||
{
|
||||
FILE.mkdirs(FILE.join("Build", "Desktop", projectName));
|
||||
require("cappuccino/nativehost").buildNativeHost(FILE.join("Build", "Release", projectName), FILE.join("Build", "Desktop", projectName, "CrossOriginTest.app"));
|
||||
printResults("Desktop")
|
||||
});
|
||||
|
||||
task ("run-desktop", ["desktop"], function()
|
||||
{
|
||||
OS.system([FILE.join("Build", "Desktop", projectName, "CrossOriginTest.app", "Contents", "MacOS", "NativeHost"), "-i"]);
|
||||
});
|
||||
|
||||
function printResults(configuration)
|
||||
{
|
||||
print("----------------------------");
|
||||
print(configuration+" app built at path: "+FILE.join("Build", configuration, projectName));
|
||||
print("----------------------------");
|
||||
}
|
||||
|
||||
function updateApplicationSize()
|
||||
{
|
||||
print("Calculating application file sizes...");
|
||||
|
||||
var contents = FILE.read(FILE.join("Build", configuration, projectName, "Info.plist"), { charset:"UTF-8" }),
|
||||
format = CFPropertyList.sniffedFormatOfString(contents),
|
||||
plist = CFPropertyList.propertyListFromString(contents),
|
||||
totalBytes = {executable:0, data:0, mhtml:0};
|
||||
|
||||
// Get the size of all framework executables and sprite data
|
||||
var frameworksDir = "Frameworks";
|
||||
|
||||
if (configuration === "Debug")
|
||||
frameworksDir = FILE.join(frameworksDir, "Debug");
|
||||
|
||||
var frameworks = FILE.list(frameworksDir);
|
||||
|
||||
frameworks.forEach(function(framework)
|
||||
{
|
||||
if (framework !== "Source")
|
||||
addBundleFileSizes(FILE.join(frameworksDir, framework), totalBytes);
|
||||
});
|
||||
|
||||
// Read in the default theme name, and attempt to get its size
|
||||
var themeName = plist.valueForKey("CPDefaultTheme") || "Aristo2",
|
||||
themePath = nil;
|
||||
|
||||
if (themeName === "Aristo" || themeName === "Aristo2")
|
||||
themePath = FILE.join(frameworksDir, "AppKit", "Resources", themeName + ".blend");
|
||||
else
|
||||
themePath = FILE.join("Frameworks", "Resources", themeName + ".blend");
|
||||
|
||||
if (FILE.isDirectory(themePath))
|
||||
addBundleFileSizes(themePath, totalBytes);
|
||||
|
||||
// Add sizes for the app
|
||||
addBundleFileSizes(FILE.join("Build", configuration, projectName), totalBytes);
|
||||
|
||||
print("Executables: " + totalBytes.executable + ", sprite data: " + totalBytes.data + ", total: " + (totalBytes.executable + totalBytes.data));
|
||||
|
||||
var dict = new CFMutableDictionary();
|
||||
|
||||
dict.setValueForKey("executable", totalBytes.executable);
|
||||
dict.setValueForKey("data", totalBytes.data);
|
||||
dict.setValueForKey("mhtml", totalBytes.mhtml);
|
||||
|
||||
plist.setValueForKey("CPApplicationSize", dict);
|
||||
|
||||
FILE.write(FILE.join("Build", configuration, projectName, "Info.plist"), CFPropertyList.stringFromPropertyList(plist, format), { charset:"UTF-8" });
|
||||
}
|
||||
|
||||
function addBundleFileSizes(bundlePath, totalBytes)
|
||||
{
|
||||
var bundleName = FILE.basename(bundlePath),
|
||||
environment = bundleName === "Foundation" ? "Objj" : "Browser",
|
||||
bundlePath = FILE.join(bundlePath, environment + ".environment");
|
||||
|
||||
if (FILE.isDirectory(bundlePath))
|
||||
{
|
||||
var filename = bundleName + ".sj",
|
||||
filePath = new FILE.Path(FILE.join(bundlePath, filename));
|
||||
|
||||
if (filePath.exists())
|
||||
totalBytes.executable += filePath.size();
|
||||
|
||||
filePath = new FILE.Path(FILE.join(bundlePath, "dataURLs.txt"));
|
||||
|
||||
if (filePath.exists())
|
||||
totalBytes.data += filePath.size();
|
||||
|
||||
filePath = new FILE.Path(FILE.join(bundlePath, "MHTMLData.txt"));
|
||||
|
||||
if (filePath.exists())
|
||||
totalBytes.mhtml += filePath.size();
|
||||
|
||||
filePath = new FILE.Path(FILE.join(bundlePath, "MHTMLPaths.txt"));
|
||||
|
||||
if (filePath.exists())
|
||||
totalBytes.mhtml += filePath.size();
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,45 @@
|
||||
This test checks the withCredentials CORS functionality with Cappuccino.
|
||||
|
||||
Running the test:
|
||||
|
||||
You will need to start two HTTP Servers; one on localhost:8000, and one on localhost:8001.
|
||||
|
||||
The first:
|
||||
|
||||
`$> python -m SimpleHTTPServer` // starts it on 8000
|
||||
|
||||
In another terminal window:
|
||||
|
||||
`$> python cors-server.py` // starts another on 8001
|
||||
|
||||
Visit http://localhost:8000 in your web browser. There are two buttons and a checkbox.
|
||||
|
||||
One button will issue a native XMLHTTPRequest. The other will issue a CPURLConnection request. The checkbox will control whether the withCredentials option is set on both types of requests.
|
||||
|
||||
With the checkbox checked, you should press either of the buttons. In the terminal with the 'cors-server.py' script running you will see output that should match the following:
|
||||
|
||||
```
|
||||
INFO:root:CORS: With Credentials
|
||||
127.0.0.1 - - [05/Dec/2014 18:44:48] "GET /resp.json HTTP/1.1" 200 -
|
||||
```
|
||||
|
||||
If you uncheck the checkbox, you should see the following:
|
||||
|
||||
```
|
||||
INFO:root:CORS: No Credentials
|
||||
127.0.0.1 - - [05/Dec/2014 18:44:56] "GET /resp.json HTTP/1.1" 200 -
|
||||
```
|
||||
|
||||
This error message is controlled by the presence of the 'Cookies' header.
|
||||
|
||||
NOTE: The cors-server.py will set a cookie for you (mycookie=cappuccino!), but only after the first request. If you don't have a cookie set for localhost, the server message will show 'No Credentials' on the first request since the Cookie header is not set. Subsequent requests will behave correctly.
|
||||
|
||||
The browser console will also provide some status information about the request and response.
|
||||
|
||||
# A note about IE<sup>**</sup>
|
||||
|
||||
As best I can tell, IE behaves differently than all other browsers. I have tested this in Chrome and Firefox on Mac & Windows, Safari on Mac, IE11 on Windows. In this test, unchecking the 'With Credentials' will tell the browser to not send a cookie to the server if the server and client are not on the same host. However, in IE, it will pass the cookie along if the server and host are on the same top domain, but not necessarily the same host. The corollary of this is that if the two servers are on different domains, the `withCredentials` setting in IE does absolutely nothing.
|
||||
|
||||
To get it to work, you must instruct your users to adjust their cookie privacy settings and allow third-party cookies. This seemed to work for me, but dynamically adjusting the `withCredentials` parameter did nothing with this on -- IE always sent the cookies if it was configured to do so.
|
||||
|
||||
<sup>*</sup> What, you expected IE to actually work like the rest of the world?
|
||||
File diff suppressed because it is too large
Load Diff
@@ -0,0 +1,44 @@
|
||||
import SimpleHTTPServer
|
||||
import SocketServer
|
||||
import logging
|
||||
import cgi
|
||||
|
||||
logging.basicConfig(level=logging.INFO)
|
||||
PORT = 8001
|
||||
|
||||
class ServerHandler(SimpleHTTPServer.SimpleHTTPRequestHandler):
|
||||
|
||||
def end_headers (self):
|
||||
self.send_header('Set-Cookie', 'mycookie=cappuccino!')
|
||||
self.send_header('Access-Control-Allow-Origin', 'http://142.157.142.237:8000')
|
||||
self.send_header('Access-Control-Allow-Methods', 'GET, OPTIONS')
|
||||
self.send_header("Access-Control-Allow-Headers", "X-Requested-With, If-Modified-Since, Cache-Control, Pragma")
|
||||
self.send_header('Access-Control-Allow-Credentials', 'true')
|
||||
SimpleHTTPServer.SimpleHTTPRequestHandler.end_headers(self)
|
||||
|
||||
def do_OPTIONS(self):
|
||||
logging.info("OPTIONS Request")
|
||||
self.send_response(204, "No Content")
|
||||
self.send_header('Access-Control-Allow-Origin', 'http://142.157.142.237:8000')
|
||||
self.send_header('Access-Control-Allow-Methods', 'GET, OPTIONS')
|
||||
self.send_header("Access-Control-Allow-Headers", "X-Requested-With, If-Modified-Since, Cache-Control, Pragma")
|
||||
self.send_header('Access-Control-Allow-Credentials', 'true')
|
||||
self.send_header("Access-Control-Max-Age", 10)
|
||||
self.send_header("content-length", 0)
|
||||
|
||||
def do_GET(self):
|
||||
try:
|
||||
self.headers['Cookie']
|
||||
logging.info("CORS: With Credentials")
|
||||
logging.info(self.headers['Cookie'])
|
||||
except KeyError, e:
|
||||
logging.info("CORS: No Credentials")
|
||||
SimpleHTTPServer.SimpleHTTPRequestHandler.do_GET(self)
|
||||
|
||||
Handler = ServerHandler
|
||||
|
||||
SocketServer.TCPServer.allow_reuse_address = True
|
||||
httpd = SocketServer.TCPServer(("0.0.0.0", PORT), Handler)
|
||||
|
||||
print "serving at port", PORT
|
||||
httpd.serve_forever()
|
||||
@@ -0,0 +1,191 @@
|
||||
<!DOCTYPE html>
|
||||
<html lang="en">
|
||||
<!--
|
||||
index-debug.html
|
||||
CrossOriginTest
|
||||
|
||||
Created by You on December 5, 2014.
|
||||
Copyright 2014, Your Company All rights reserved.
|
||||
-->
|
||||
<head>
|
||||
<meta charset="utf-8">
|
||||
|
||||
<!--[if lte IE 8]>
|
||||
<meta http-equiv="X-UA-Compatible" content="IE=EmulateIE7, chrome=1">
|
||||
<![endif]-->
|
||||
<!--[if gte IE 9]>
|
||||
<meta http-equiv="X-UA-Compatible" content="IE=edge, chrome=1">
|
||||
<![endif]-->
|
||||
|
||||
<meta name="viewport" content="initial-scale=1.0, user-scalable=no">
|
||||
|
||||
<meta name="apple-mobile-web-app-capable" content="yes">
|
||||
<meta name="apple-mobile-web-app-status-bar-style" content="black">
|
||||
|
||||
<link rel="apple-touch-icon" href="Resources/icon.png">
|
||||
<link rel="apple-touch-startup-image" href="Resources/default.png">
|
||||
|
||||
<title>TestIEWithCredentials</title>
|
||||
|
||||
<!-- Custom javascript goes here -->
|
||||
<!-- End custom javascript -->
|
||||
|
||||
<script type="text/javascript">
|
||||
OBJJ_MAIN_FILE = "main.j";
|
||||
OBJJ_INCLUDE_PATHS = ["Frameworks/Debug", "Frameworks"];
|
||||
|
||||
var progressBar = null;
|
||||
|
||||
OBJJ_PROGRESS_CALLBACK = function(percent, appSize, path)
|
||||
{
|
||||
percent = percent * 100;
|
||||
|
||||
if (!progressBar)
|
||||
progressBar = document.getElementById("progress-bar");
|
||||
|
||||
if (progressBar)
|
||||
progressBar.style.width = Math.min(percent, 100) + "%";
|
||||
}
|
||||
|
||||
var loadingHTML =
|
||||
'<div id="loading">' +
|
||||
' <div id="loading-text">Loading...</div>' +
|
||||
' <div id="progress-indicator">' +
|
||||
' <span id="progress-bar" style="width:0%"></span>' +
|
||||
' </div>' +
|
||||
'</div>';
|
||||
</script>
|
||||
|
||||
<script type="text/javascript" src="Frameworks/Debug/Objective-J/Objective-J.js" charset="UTF-8"></script>
|
||||
|
||||
<script type="text/javascript">
|
||||
objj_msgSend_reset();
|
||||
|
||||
// DEBUG OPTIONS:
|
||||
|
||||
// Uncomment to enable printing of backtraces on exceptions:
|
||||
//objj_msgSend_decorate(objj_backtrace_decorator);
|
||||
|
||||
// Uncomment to supress exceptions that take place inside a message
|
||||
//objj_msgSend_decorate(objj_supress_exceptions_decorator)
|
||||
|
||||
// Uncomment to enable runtime type checking:
|
||||
//objj_msgSend_decorate(objj_typecheck_decorator);
|
||||
|
||||
// Uncomment (along with both above) to print backtraces on type check errors:
|
||||
//objj_typecheck_prints_backtrace = true;
|
||||
|
||||
// Uncomment to disable the default logger (CPLogConsole if window.console exists, CPLogPopup otherwise):
|
||||
//CPLogUnregister(CPLogDefault);
|
||||
|
||||
// Uncomment to enable a specific logger:
|
||||
//CPLogRegister(CPLogConsole);
|
||||
//CPLogRegister(CPLogPopup);
|
||||
|
||||
// Tag view DOM elements with a "data-cappuccino-view" attribute that contains
|
||||
// the class name of the view that created them. Comment this or set to false to disable.
|
||||
appkit_tag_dom_elements = true;
|
||||
</script>
|
||||
|
||||
<style type="text/css">
|
||||
html, body, h1, p {
|
||||
margin: 0;
|
||||
padding: 0;
|
||||
}
|
||||
|
||||
/* We need a body wrapper because Cappuccino is unhappy if we change the body element */
|
||||
#cappuccino-body {
|
||||
/* Position it absolutely so it will fill the height without content */
|
||||
position: absolute;
|
||||
top: 0;
|
||||
bottom: 0;
|
||||
width: 100%;
|
||||
|
||||
/* Put it at the bottom of the stack so it doesn't interfere with UI */
|
||||
z-index: -1000;
|
||||
}
|
||||
|
||||
#cappuccino-body .container {
|
||||
display: table;
|
||||
margin: 0 auto;
|
||||
height: 100%;
|
||||
}
|
||||
|
||||
#cappuccino-body .content {
|
||||
display: table-cell;
|
||||
height: 100%;
|
||||
vertical-align: top;
|
||||
}
|
||||
|
||||
#loading {
|
||||
position: relative;
|
||||
top: 35%;
|
||||
}
|
||||
|
||||
#loading-text {
|
||||
height: 1.5em;
|
||||
color: #555;
|
||||
font: normal bold 36px/36px Arial, sans-serif;
|
||||
}
|
||||
|
||||
#progress-indicator {
|
||||
padding: 0px;
|
||||
height: 16px;
|
||||
border: 5px solid #555;
|
||||
border-radius: 18px;
|
||||
background-color: white;
|
||||
}
|
||||
|
||||
#progress-bar {
|
||||
position: relative;
|
||||
top: -1px;
|
||||
left: -1px;
|
||||
display: block;
|
||||
height: 18px;
|
||||
|
||||
/* Compensate for moving the bar left 1px to overlap the indicator border */
|
||||
border-right: 1px solid #555;
|
||||
background-color: #555;
|
||||
}
|
||||
|
||||
#noscript {
|
||||
position: relative;
|
||||
top: 35%;
|
||||
padding: 1em 1.5em;
|
||||
border: 5px solid #555;
|
||||
border-radius: 16px;
|
||||
background-color: white;
|
||||
color: #555;
|
||||
text-align: center;
|
||||
font: bold 24px Arial, sans-serif;
|
||||
}
|
||||
|
||||
#noscript a {
|
||||
color: #98c0ff;
|
||||
text-decoration: none;
|
||||
}
|
||||
</style>
|
||||
</head>
|
||||
|
||||
<body>
|
||||
<div id="cappuccino-body">
|
||||
<div class="container">
|
||||
<div class="content">
|
||||
<script type="text/javascript">
|
||||
document.write(loadingHTML);
|
||||
</script>
|
||||
</div>
|
||||
</div>
|
||||
<noscript style="position:absolute; top:0; left:0; width:100%; height:100%">
|
||||
<div class="container">
|
||||
<div class="content">
|
||||
<div id="noscript">
|
||||
<p style="font-size:120%; margin-bottom:.75em">JavaScript is required for this site.</p>
|
||||
<p><a href="http://www.enable-javascript.com" target="_blank">Enable JavaScript</a></p>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</noscript>
|
||||
</div>
|
||||
</body>
|
||||
</html>
|
||||
@@ -0,0 +1,161 @@
|
||||
<!DOCTYPE html>
|
||||
<html lang="en">
|
||||
<!--
|
||||
index.html
|
||||
CrossOriginTest
|
||||
|
||||
Created by You on December 5, 2014.
|
||||
Copyright 2014, Your Company All rights reserved.
|
||||
-->
|
||||
<head>
|
||||
<meta charset="utf-8">
|
||||
|
||||
<!--[if lte IE 8]>
|
||||
<meta http-equiv="X-UA-Compatible" content="IE=EmulateIE7, chrome=1">
|
||||
<![endif]-->
|
||||
<!--[if gte IE 9]>
|
||||
<meta http-equiv="X-UA-Compatible" content="IE=edge, chrome=1">
|
||||
<![endif]-->
|
||||
|
||||
<meta name="viewport" content="initial-scale=1.0, user-scalable=no">
|
||||
|
||||
<meta name="apple-mobile-web-app-capable" content="yes">
|
||||
<meta name="apple-mobile-web-app-status-bar-style" content="black">
|
||||
|
||||
<link rel="apple-touch-icon" href="Resources/icon.png">
|
||||
<link rel="apple-touch-startup-image" href="Resources/default.png">
|
||||
|
||||
<title>CrossOriginTest</title>
|
||||
|
||||
<!-- Custom javascript goes here -->
|
||||
<!-- End custom javascript -->
|
||||
|
||||
<script type="text/javascript">
|
||||
OBJJ_MAIN_FILE = "main.j";
|
||||
|
||||
var progressBar = null;
|
||||
|
||||
OBJJ_PROGRESS_CALLBACK = function(percent, appSize, path)
|
||||
{
|
||||
percent = percent * 100;
|
||||
|
||||
if (!progressBar)
|
||||
progressBar = document.getElementById("progress-bar");
|
||||
|
||||
if (progressBar)
|
||||
progressBar.style.width = Math.min(percent, 100) + "%";
|
||||
}
|
||||
|
||||
var loadingHTML =
|
||||
'<div id="loading">' +
|
||||
' <div id="loading-text">Loading...</div>' +
|
||||
' <div id="progress-indicator">' +
|
||||
' <span id="progress-bar" style="width:0%"></span>' +
|
||||
' </div>' +
|
||||
'</div>';
|
||||
</script>
|
||||
|
||||
<script type="text/javascript" src="Frameworks/Objective-J/Objective-J.js" charset="UTF-8"></script>
|
||||
|
||||
<style type="text/css">
|
||||
html, body, h1, p {
|
||||
margin: 0;
|
||||
padding: 0;
|
||||
}
|
||||
|
||||
/* We need a body wrapper because Cappuccino is unhappy if we change the body element */
|
||||
#cappuccino-body {
|
||||
/* Position it absolutely so it will fill the height without content */
|
||||
position: absolute;
|
||||
top: 0;
|
||||
bottom: 0;
|
||||
width: 100%;
|
||||
|
||||
/* Put it at the bottom of the stack so it doesn't interfere with UI */
|
||||
z-index: -1000;
|
||||
}
|
||||
|
||||
#cappuccino-body .container {
|
||||
display: table;
|
||||
margin: 0 auto;
|
||||
height: 100%;
|
||||
}
|
||||
|
||||
#cappuccino-body .content {
|
||||
display: table-cell;
|
||||
height: 100%;
|
||||
vertical-align: top;
|
||||
}
|
||||
|
||||
#loading {
|
||||
position: relative;
|
||||
top: 35%;
|
||||
}
|
||||
|
||||
#loading-text {
|
||||
height: 1.5em;
|
||||
color: #555;
|
||||
font: normal bold 36px/36px Arial, sans-serif;
|
||||
}
|
||||
|
||||
#progress-indicator {
|
||||
padding: 0px;
|
||||
height: 16px;
|
||||
border: 5px solid #555;
|
||||
border-radius: 18px;
|
||||
background-color: white;
|
||||
}
|
||||
|
||||
#progress-bar {
|
||||
position: relative;
|
||||
top: -1px;
|
||||
left: -1px;
|
||||
display: block;
|
||||
height: 18px;
|
||||
|
||||
/* Compensate for moving the bar left 1px to overlap the indicator border */
|
||||
border-right: 1px solid #555;
|
||||
background-color: #555;
|
||||
}
|
||||
|
||||
#noscript {
|
||||
position: relative;
|
||||
top: 35%;
|
||||
padding: 1em 1.5em;
|
||||
border: 5px solid #555;
|
||||
border-radius: 16px;
|
||||
background-color: white;
|
||||
color: #555;
|
||||
text-align: center;
|
||||
font: bold 24px Arial, sans-serif;
|
||||
}
|
||||
|
||||
#noscript a {
|
||||
color: #98c0ff;
|
||||
text-decoration: none;
|
||||
}
|
||||
</style>
|
||||
</head>
|
||||
|
||||
<body>
|
||||
<div id="cappuccino-body">
|
||||
<div class="container">
|
||||
<div class="content">
|
||||
<script type="text/javascript">
|
||||
document.write(loadingHTML);
|
||||
</script>
|
||||
</div>
|
||||
</div>
|
||||
<noscript style="position:absolute; top:0; left:0; width:100%; height:100%">
|
||||
<div class="container">
|
||||
<div class="content">
|
||||
<div id="noscript">
|
||||
<p style="font-size:120%; margin-bottom:.75em">JavaScript is required for this site.</p>
|
||||
<p><a href="http://www.enable-javascript.com" target="_blank">Enable JavaScript</a></p>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</noscript>
|
||||
</div>
|
||||
</body>
|
||||
</html>
|
||||
@@ -0,0 +1,18 @@
|
||||
/*
|
||||
* AppController.j
|
||||
* CrossOriginTest
|
||||
*
|
||||
* Created by You on December 9, 2014.
|
||||
* Copyright 2014, Your Company All rights reserved.
|
||||
*/
|
||||
|
||||
@import <Foundation/Foundation.j>
|
||||
@import <AppKit/AppKit.j>
|
||||
|
||||
@import "AppController.j"
|
||||
|
||||
|
||||
function main(args, namedArgs)
|
||||
{
|
||||
CPApplicationMain(args, namedArgs);
|
||||
}
|
||||
@@ -0,0 +1 @@
|
||||
{"response": "ok"}
|
||||
@@ -0,0 +1,60 @@
|
||||
@import <OJUnit/OJTestCase.j>
|
||||
|
||||
|
||||
@implementation CFErrorTest : OJTestCase
|
||||
|
||||
- (void)testCreate
|
||||
{
|
||||
var err = new CFError();
|
||||
[self assertNotNull:err];
|
||||
}
|
||||
|
||||
- (void)testCreateWithParams
|
||||
{
|
||||
var err = new CFError(kCFErrorDomainCappuccino, -1000, nil);
|
||||
[self assertNotNull:err];
|
||||
[self assert:-1000 equals:err.code()];
|
||||
}
|
||||
|
||||
- (void)testCreateGlobal
|
||||
{
|
||||
var err = CFErrorCreate(kCFErrorDomainCappuccino, -1000, nil);
|
||||
[self assertNotNull:err];
|
||||
|
||||
[self assert:kCFErrorDomainCappuccino equals:err.domain()];
|
||||
[self assert:-1000 equals:err.code()];
|
||||
[self assert:@"CPCappuccinoErrorDomain" equals:CFErrorGetDomain(err)];
|
||||
}
|
||||
|
||||
- (void)testCreateWithUserInfoKeysAndValues
|
||||
{
|
||||
var err = CFErrorCreateWithUserInfoKeysAndValues(kCFErrorDomainCappuccino, -1000, [kCFErrorLocalizedDescriptionKey, kCFErrorDescriptionKey], [@"A localized description", @"An error description"], 2);
|
||||
[self assertNotNull:err];
|
||||
|
||||
var info = err.userInfo();
|
||||
[self assert:2 equals:info.count()];
|
||||
}
|
||||
|
||||
- (void)testDescriptionCaseOne
|
||||
{
|
||||
// Description case 1: Localized Key set
|
||||
var err = CFErrorCreateWithUserInfoKeysAndValues(kCFErrorDomainCappuccino, -1000, [kCFErrorLocalizedDescriptionKey], [@"A localized Description Key"], 1);
|
||||
[self assert:@"A localized Description Key" equals:err.description()];
|
||||
[self assert:@"A localized Description Key" equals:CFErrorCopyDescription(err)];
|
||||
}
|
||||
|
||||
- (void)testDescriptionCaseTwo
|
||||
{
|
||||
// Case 2: Reason set; description generated
|
||||
var err = CFErrorCreateWithUserInfoKeysAndValues(kCFErrorDomainCappuccino, -1000, [kCFErrorLocalizedFailureReasonKey], [@"A localized reason"], 1);
|
||||
[self assert:@"The operation couldn\u2019t be completed. A localized reason" equals:err.description()];
|
||||
}
|
||||
|
||||
- (void)testDescriptionCaseThree
|
||||
{
|
||||
// Case 3: Final fall-back.
|
||||
var err = CFErrorCreateWithUserInfoKeysAndValues(kCFErrorDomainCappuccino, -1000, [kCFErrorDescriptionKey], [@"A description key"], 1);
|
||||
[self assert:@"The operation couldn\u2019t be completed. (error -1000 - A description key)" equals:err.description()];
|
||||
}
|
||||
|
||||
@end
|
||||
@@ -7,10 +7,10 @@
|
||||
- (void)testSetWithCredentials
|
||||
{
|
||||
var cfHTTPRequest = new CFHTTPRequest();
|
||||
[self assertFalse:cfHTTPRequest.getWithCredentials()];
|
||||
[self assertFalse:cfHTTPRequest.withCredentials()];
|
||||
|
||||
cfHTTPRequest.setWithCredentials(YES);
|
||||
[self assertTrue:cfHTTPRequest.getWithCredentials()];
|
||||
[self assertTrue:cfHTTPRequest.withCredentials()];
|
||||
}
|
||||
|
||||
@end
|
||||
|
||||
@@ -0,0 +1,11 @@
|
||||
@implementation TC
|
||||
{
|
||||
id _control;
|
||||
}
|
||||
|
||||
- (id)a
|
||||
{
|
||||
@ref(_control);
|
||||
}
|
||||
|
||||
@end
|
||||
@@ -0,0 +1,9 @@
|
||||
{var the_class = objj_allocateClassPair(Nil, "TC"),
|
||||
meta_class = the_class.isa;class_addIvars(the_class, [new objj_ivar("_control")]);objj_registerClassPair(the_class);
|
||||
class_addMethods(the_class, [new objj_method(sel_getUid("a"), function $TC__a(self, _cmd)
|
||||
{
|
||||
function(__input) { if (arguments.length) return self._control = __input; return self._control; };
|
||||
}
|
||||
|
||||
,["id"])]);
|
||||
}
|
||||
@@ -22,6 +22,7 @@ var FILENAMES = [
|
||||
"Misc/regex-simple-char-classes",
|
||||
"Misc/empty-loops",
|
||||
"Misc/empty-statements",
|
||||
"Misc/ref-self",
|
||||
];
|
||||
|
||||
@implementation OutputTest : OJTestCase
|
||||
|
||||
+1525
-838
File diff suppressed because it is too large
Load Diff
@@ -0,0 +1,13 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<!DOCTYPE plist PUBLIC "-//Apple Computer//DTD PLIST 1.0//EN"
|
||||
"http://www.apple.com/DTDs/PropertyList-1.0.dtd">
|
||||
<plist version="1.0">
|
||||
<dict>
|
||||
<key>CFBundleName</key>
|
||||
<string>Cappuccino</string>
|
||||
<key>CFBundleIdentifier</key>
|
||||
<string>cappuccino</string>
|
||||
<key>DocSetPlatformFamily</key>
|
||||
<string>cappuccino</string>
|
||||
</dict>
|
||||
</plist>
|
||||
Executable
+37
@@ -0,0 +1,37 @@
|
||||
#!/usr/bin/env bash
|
||||
|
||||
source "$1"/support/processor_setup.sh
|
||||
|
||||
processor_msg "Generating Docset"
|
||||
|
||||
MAKEFILE="Build/Documentation/html/Makefile"
|
||||
DOCSDIR="Build/Documentation/html"
|
||||
|
||||
processor_msg "Massaging Makefile"
|
||||
sed -i '.bak' 's/docsetutil index \$(DOCSET_NAME)/docsetutil index -skip-text \$(DOCSET_NAME)/g' $MAKEFILE
|
||||
|
||||
pushd $DOCSDIR
|
||||
processor_msg "Running Make"
|
||||
make
|
||||
|
||||
processor_msg "Finishing up"
|
||||
mv "org.cappuccino-project.cappuccino.docset" "Cappuccino.docset"
|
||||
cp "$1"/Info.plist "Cappuccino.docset/Contents"
|
||||
|
||||
processor_msg "Fixing CSS on Docset"
|
||||
cd Cappuccino.docset
|
||||
echo -e "open(FILE, \">>\$ARGV[0]\");\nprint FILE \"\\\n#top {display:none}\\\n#side-nav {display:none}\\\n\";\nprint \"Appended CSS to \$ARGV[0]\\\n\";\nclose(FILE);" > css.pl
|
||||
find . -type f -name "*.css" -exec perl css.pl {} \;
|
||||
rm -rf css.pl
|
||||
|
||||
popd
|
||||
|
||||
processor_msg "Moving docset to Build/Documentation"
|
||||
|
||||
if [ -d "Build/Documentation/Cappuccino.docset" ]; then
|
||||
rm -rf "Build/Documentation/Cappuccino.docset"
|
||||
fi
|
||||
|
||||
mv "$DOCSDIR"/Cappuccino.docset "Build/Documentation"
|
||||
|
||||
processor_msg "Done"
|
||||
@@ -68,6 +68,7 @@ syn match objjImported display contained "<[-_0-9a-zA-Z.\/]*>"
|
||||
syn match objjImport display "^\s*\(%:\|#\|@\)\s*import\>\s*["<]" contains=objjImported
|
||||
|
||||
" Match the important ObjJ directives
|
||||
syn match objjDirective "@typedef"
|
||||
syn match objjDirective "@interface\|@implementation\|@protocol\|@end"
|
||||
syn match objjScopeDecl "@public\|@protected\|@private\|@package"
|
||||
syn match objjScopeDecl "@required\|@optional"
|
||||
|
||||
@@ -155,7 +155,8 @@ AppController *SharedAppControllerInstance = nil;
|
||||
kDefaultUseSymlinkWhenCreatingProject: @YES,
|
||||
kDefaultXCCUseDebugFrameworkWithObjj: @YES,
|
||||
kDefaultXCCShouldProcessObjj: @YES,
|
||||
kDefaultXCCPanelStyleUtility: @NO
|
||||
kDefaultXCCPanelStyleUtility: @NO,
|
||||
kDefaultXCCPanelActiveAppWhenOpening: @NO
|
||||
};
|
||||
|
||||
NSUserDefaults *defaults = [NSUserDefaults standardUserDefaults];
|
||||
|
||||
@@ -32,5 +32,6 @@ extern NSString * const kDefaultAutoOpenXcodeProject;
|
||||
extern NSString * const kDefaultUseSymlinkWhenCreatingProject;
|
||||
extern NSString * const kDefaultUpdateCappuccinoWithLastVersionOfMasterBranch;
|
||||
extern NSString * const kDefaultXCCPanelStyleUtility;
|
||||
extern NSString * const kDefaultXCCPanelActiveAppWhenOpening;
|
||||
|
||||
#endif
|
||||
|
||||
@@ -29,4 +29,5 @@ NSString * const kDefaultLogLevel = @"logLevel";
|
||||
NSString * const kDefaultAutoOpenXcodeProject = @"autoOpenXcodeProject";
|
||||
NSString * const kDefaultUseSymlinkWhenCreatingProject = @"useSymlinkWhenCreatingProject";
|
||||
NSString * const kDefaultUpdateCappuccinoWithLastVersionOfMasterBranch = @"updateCappuccinoWithLastVersionOfMasterBranch";
|
||||
NSString * const kDefaultXCCPanelStyleUtility = @"XCCPanelStyleUtility";
|
||||
NSString * const kDefaultXCCPanelStyleUtility = @"XCCPanelStyleUtility";
|
||||
NSString * const kDefaultXCCPanelActiveAppWhenOpening = @"XCCPanelActiveAppWhenOpening";
|
||||
@@ -1565,9 +1565,17 @@ void fsevents_callback(ConstFSEventStreamRef streamRef,
|
||||
|
||||
- (IBAction)openErrorsPanel:(id)aSender
|
||||
{
|
||||
[[NSApplication sharedApplication] activateIgnoringOtherApps:YES];
|
||||
[self.errorsPanel setFloatingPanel:[[NSUserDefaults standardUserDefaults] boolForKey:kDefaultXCCPanelStyleUtility]];
|
||||
[self.errorsPanel makeKeyAndOrderFront:nil];
|
||||
|
||||
if ([[NSUserDefaults standardUserDefaults] boolForKey:kDefaultXCCPanelActiveAppWhenOpening])
|
||||
{
|
||||
[[NSApplication sharedApplication] activateIgnoringOtherApps:YES];
|
||||
[self.errorsPanel makeKeyAndOrderFront:nil];
|
||||
}
|
||||
else
|
||||
{
|
||||
[self.errorsPanel orderFrontRegardless];
|
||||
}
|
||||
}
|
||||
|
||||
- (IBAction)openErrorInEditor:(id)sender
|
||||
|
||||
@@ -2,13 +2,13 @@
|
||||
<archive type="com.apple.InterfaceBuilder3.Cocoa.XIB" version="8.00">
|
||||
<data>
|
||||
<int key="IBDocument.SystemTarget">1060</int>
|
||||
<string key="IBDocument.SystemVersion">14B17</string>
|
||||
<string key="IBDocument.InterfaceBuilderVersion">6250</string>
|
||||
<string key="IBDocument.AppKitVersion">1343.15</string>
|
||||
<string key="IBDocument.HIToolboxVersion">755.00</string>
|
||||
<string key="IBDocument.SystemVersion">14C94b</string>
|
||||
<string key="IBDocument.InterfaceBuilderVersion">6254</string>
|
||||
<string key="IBDocument.AppKitVersion">1344.60</string>
|
||||
<string key="IBDocument.HIToolboxVersion">757.30</string>
|
||||
<dictionary class="NSMutableDictionary" key="IBDocument.PluginVersions">
|
||||
<string key="com.apple.InterfaceBuilder.CocoaPlugin">6250</string>
|
||||
<string key="com.apple.pdfkit.ibplugin">6250</string>
|
||||
<string key="com.apple.InterfaceBuilder.CocoaPlugin">6254</string>
|
||||
<string key="com.apple.pdfkit.ibplugin">6254</string>
|
||||
</dictionary>
|
||||
<array key="IBDocument.IntegratedClassDependencies">
|
||||
<string>NSArrayController</string>
|
||||
@@ -361,12 +361,12 @@ bnRvaW5lIE1lcmNhZGFsCiAgICBhbnRvaW5lLm1lcmNhZGFsQGdtYWlsLmNvbQ</string>
|
||||
<reference key="NSWindow"/>
|
||||
<reference key="NSNextKeyView" ref="247765970"/>
|
||||
</object>
|
||||
<string key="NSScreenRect">{{0, 0}, {1440, 900}}</string>
|
||||
<string key="NSScreenRect">{{0, 0}, {1440, 877}}</string>
|
||||
<string key="NSMaxSize">{10000000000000, 10000000000000}</string>
|
||||
<bool key="NSWindowIsRestorable">NO</bool>
|
||||
</object>
|
||||
<object class="NSWindowTemplate" id="717487982">
|
||||
<int key="NSWindowStyleMask">15</int>
|
||||
<int key="NSWindowStyleMask">143</int>
|
||||
<int key="NSWindowBacking">2</int>
|
||||
<string key="NSWindowRect">{{890, 663}, {550, 237}}</string>
|
||||
<int key="NSWTFlags">1613759488</int>
|
||||
@@ -602,7 +602,7 @@ bnRvaW5lIE1lcmNhZGFsCiAgICBhbnRvaW5lLm1lcmNhZGFsQGdtYWlsLmNvbQ</string>
|
||||
<reference key="NSWindow"/>
|
||||
<reference key="NSNextKeyView" ref="396547698"/>
|
||||
</object>
|
||||
<string key="NSScreenRect">{{0, 0}, {1440, 900}}</string>
|
||||
<string key="NSScreenRect">{{0, 0}, {1440, 877}}</string>
|
||||
<string key="NSMinSize">{315, 99}</string>
|
||||
<string key="NSMaxSize">{10000000000000, 10000000000000}</string>
|
||||
<string key="NSFrameAutosaveName"/>
|
||||
@@ -611,7 +611,7 @@ bnRvaW5lIE1lcmNhZGFsCiAgICBhbnRvaW5lLm1lcmNhZGFsQGdtYWlsLmNvbQ</string>
|
||||
<object class="NSWindowTemplate" id="484209508">
|
||||
<int key="NSWindowStyleMask">3</int>
|
||||
<int key="NSWindowBacking">2</int>
|
||||
<string key="NSWindowRect">{{534, 231}, {369, 510}}</string>
|
||||
<string key="NSWindowRect">{{534, 231}, {389, 528}}</string>
|
||||
<int key="NSWTFlags">1613235200</int>
|
||||
<string key="NSWindowTitle">Preferences</string>
|
||||
<string key="NSWindowClass">NSWindow</string>
|
||||
@@ -632,7 +632,7 @@ bnRvaW5lIE1lcmNhZGFsCiAgICBhbnRvaW5lLm1lcmNhZGFsQGdtYWlsLmNvbQ</string>
|
||||
<object class="NSButton" id="49684265">
|
||||
<reference key="NSNextResponder" ref="881981747"/>
|
||||
<int key="NSvFlags">268</int>
|
||||
<string key="NSFrame">{{16, 118}, {271, 18}}</string>
|
||||
<string key="NSFrame">{{16, 136}, {271, 18}}</string>
|
||||
<reference key="NSSuperview" ref="881981747"/>
|
||||
<reference key="NSWindow"/>
|
||||
<reference key="NSNextKeyView" ref="668731100"/>
|
||||
@@ -666,7 +666,7 @@ bnRvaW5lIE1lcmNhZGFsCiAgICBhbnRvaW5lLm1lcmNhZGFsQGdtYWlsLmNvbQ</string>
|
||||
<object class="NSButton" id="668731100">
|
||||
<reference key="NSNextResponder" ref="881981747"/>
|
||||
<int key="NSvFlags">268</int>
|
||||
<string key="NSFrame">{{16, 88}, {241, 18}}</string>
|
||||
<string key="NSFrame">{{16, 106}, {241, 18}}</string>
|
||||
<reference key="NSSuperview" ref="881981747"/>
|
||||
<reference key="NSWindow"/>
|
||||
<reference key="NSNextKeyView" ref="493786566"/>
|
||||
@@ -691,10 +691,10 @@ bnRvaW5lIE1lcmNhZGFsCiAgICBhbnRvaW5lLm1lcmNhZGFsQGdtYWlsLmNvbQ</string>
|
||||
<object class="NSButton" id="493786566">
|
||||
<reference key="NSNextResponder" ref="881981747"/>
|
||||
<int key="NSvFlags">268</int>
|
||||
<string key="NSFrame">{{16, 58}, {260, 18}}</string>
|
||||
<string key="NSFrame">{{16, 76}, {260, 18}}</string>
|
||||
<reference key="NSSuperview" ref="881981747"/>
|
||||
<reference key="NSWindow"/>
|
||||
<reference key="NSNextKeyView" ref="59325359"/>
|
||||
<reference key="NSNextKeyView" ref="580602815"/>
|
||||
<bool key="NSEnabled">YES</bool>
|
||||
<object class="NSButtonCell" key="NSCell" id="549413473">
|
||||
<int key="NSCellFlags">-2080374784</int>
|
||||
@@ -713,10 +713,35 @@ bnRvaW5lIE1lcmNhZGFsCiAgICBhbnRvaW5lLm1lcmNhZGFsQGdtYWlsLmNvbQ</string>
|
||||
</object>
|
||||
<bool key="NSAllowsLogicalLayoutDirection">NO</bool>
|
||||
</object>
|
||||
<object class="NSButton" id="580602815">
|
||||
<reference key="NSNextResponder" ref="881981747"/>
|
||||
<int key="NSvFlags">268</int>
|
||||
<string key="NSFrame">{{16, 45}, {330, 18}}</string>
|
||||
<reference key="NSSuperview" ref="881981747"/>
|
||||
<reference key="NSWindow"/>
|
||||
<reference key="NSNextKeyView" ref="59325359"/>
|
||||
<bool key="NSEnabled">YES</bool>
|
||||
<object class="NSButtonCell" key="NSCell" id="171691988">
|
||||
<int key="NSCellFlags">-2080374784</int>
|
||||
<int key="NSCellFlags2">0</int>
|
||||
<string key="NSContents">Active xCodeCapp when opening the Errors panel</string>
|
||||
<reference key="NSSupport" ref="986470281"/>
|
||||
<reference key="NSControlView" ref="580602815"/>
|
||||
<int key="NSButtonFlags">1211912448</int>
|
||||
<int key="NSButtonFlags2">2</int>
|
||||
<reference key="NSNormalImage" ref="795665759"/>
|
||||
<reference key="NSAlternateImage" ref="989917290"/>
|
||||
<string key="NSAlternateContents"/>
|
||||
<string key="NSKeyEquivalent"/>
|
||||
<int key="NSPeriodicDelay">400</int>
|
||||
<int key="NSPeriodicInterval">75</int>
|
||||
</object>
|
||||
<bool key="NSAllowsLogicalLayoutDirection">NO</bool>
|
||||
</object>
|
||||
<object class="NSButton" id="497174199">
|
||||
<reference key="NSNextResponder" ref="881981747"/>
|
||||
<int key="NSvFlags">268</int>
|
||||
<string key="NSFrame">{{16, 146}, {298, 18}}</string>
|
||||
<string key="NSFrame">{{16, 164}, {298, 18}}</string>
|
||||
<reference key="NSSuperview" ref="881981747"/>
|
||||
<reference key="NSWindow"/>
|
||||
<reference key="NSNextKeyView" ref="49684265"/>
|
||||
@@ -836,13 +861,13 @@ bnRvaW5lIE1lcmNhZGFsCiAgICBhbnRvaW5lLm1lcmNhZGFsQGdtYWlsLmNvbQ</string>
|
||||
<bool key="NSAllowsLogicalLayoutDirection">NO</bool>
|
||||
</object>
|
||||
</array>
|
||||
<string key="NSFrame">{{1, 1}, {330, 176}}</string>
|
||||
<string key="NSFrame">{{1, 1}, {353, 194}}</string>
|
||||
<reference key="NSSuperview" ref="359969914"/>
|
||||
<reference key="NSWindow"/>
|
||||
<reference key="NSNextKeyView" ref="497174199"/>
|
||||
</object>
|
||||
</array>
|
||||
<string key="NSFrame">{{17, 303}, {332, 192}}</string>
|
||||
<string key="NSFrame">{{17, 303}, {355, 210}}</string>
|
||||
<reference key="NSSuperview" ref="853177344"/>
|
||||
<reference key="NSWindow"/>
|
||||
<reference key="NSNextKeyView" ref="881981747"/>
|
||||
@@ -995,13 +1020,13 @@ bnRvaW5lIE1lcmNhZGFsCiAgICBhbnRvaW5lLm1lcmNhZGFsQGdtYWlsLmNvbQ</string>
|
||||
<bool key="NSAllowsLogicalLayoutDirection">NO</bool>
|
||||
</object>
|
||||
</array>
|
||||
<string key="NSFrame">{{1, 1}, {330, 124}}</string>
|
||||
<string key="NSFrame">{{1, 1}, {353, 124}}</string>
|
||||
<reference key="NSSuperview" ref="913026852"/>
|
||||
<reference key="NSWindow"/>
|
||||
<reference key="NSNextKeyView" ref="1052114206"/>
|
||||
</object>
|
||||
</array>
|
||||
<string key="NSFrame">{{17, 159}, {332, 140}}</string>
|
||||
<string key="NSFrame">{{17, 159}, {355, 140}}</string>
|
||||
<reference key="NSSuperview" ref="853177344"/>
|
||||
<reference key="NSWindow"/>
|
||||
<reference key="NSNextKeyView" ref="224066843"/>
|
||||
@@ -1099,14 +1124,14 @@ bnRvaW5lIE1lcmNhZGFsCiAgICBhbnRvaW5lLm1lcmNhZGFsQGdtYWlsLmNvbQ</string>
|
||||
<int key="NSTextFieldAlignmentRectInsetsVersion">1</int>
|
||||
</object>
|
||||
</array>
|
||||
<string key="NSFrame">{{1, 1}, {333, 65}}</string>
|
||||
<string key="NSFrame">{{1, 1}, {353, 65}}</string>
|
||||
<reference key="NSSuperview" ref="185960776"/>
|
||||
<reference key="NSWindow"/>
|
||||
<reference key="NSNextKeyView" ref="36622245"/>
|
||||
<string key="NSReuseIdentifierKey">_NS:11</string>
|
||||
</object>
|
||||
</array>
|
||||
<string key="NSFrame">{{17, 74}, {335, 81}}</string>
|
||||
<string key="NSFrame">{{17, 74}, {355, 81}}</string>
|
||||
<reference key="NSSuperview" ref="853177344"/>
|
||||
<reference key="NSWindow"/>
|
||||
<reference key="NSNextKeyView" ref="122117781"/>
|
||||
@@ -1160,13 +1185,13 @@ bnRvaW5lIE1lcmNhZGFsCiAgICBhbnRvaW5lLm1lcmNhZGFsQGdtYWlsLmNvbQ</string>
|
||||
<bool key="NSAllowsLogicalLayoutDirection">NO</bool>
|
||||
</object>
|
||||
</array>
|
||||
<string key="NSFrame">{{1, 1}, {333, 38}}</string>
|
||||
<string key="NSFrame">{{1, 1}, {353, 38}}</string>
|
||||
<reference key="NSSuperview" ref="929990427"/>
|
||||
<reference key="NSWindow"/>
|
||||
<reference key="NSNextKeyView" ref="660812811"/>
|
||||
</object>
|
||||
</array>
|
||||
<string key="NSFrame">{{17, 16}, {335, 54}}</string>
|
||||
<string key="NSFrame">{{17, 16}, {355, 54}}</string>
|
||||
<reference key="NSSuperview" ref="853177344"/>
|
||||
<reference key="NSWindow"/>
|
||||
<reference key="NSNextKeyView" ref="435554705"/>
|
||||
@@ -1186,12 +1211,12 @@ bnRvaW5lIE1lcmNhZGFsCiAgICBhbnRvaW5lLm1lcmNhZGFsQGdtYWlsLmNvbQ</string>
|
||||
<bool key="NSTransparent">NO</bool>
|
||||
</object>
|
||||
</array>
|
||||
<string key="NSFrameSize">{369, 510}</string>
|
||||
<string key="NSFrameSize">{389, 528}</string>
|
||||
<reference key="NSSuperview"/>
|
||||
<reference key="NSWindow"/>
|
||||
<reference key="NSNextKeyView" ref="359969914"/>
|
||||
</object>
|
||||
<string key="NSScreenRect">{{0, 0}, {1440, 900}}</string>
|
||||
<string key="NSScreenRect">{{0, 0}, {1440, 877}}</string>
|
||||
<string key="NSMaxSize">{10000000000000, 10000000000000}</string>
|
||||
<string key="NSFrameAutosaveName">xcc-prefs</string>
|
||||
<bool key="NSWindowIsRestorable">YES</bool>
|
||||
@@ -1206,7 +1231,7 @@ bnRvaW5lIE1lcmNhZGFsCiAgICBhbnRvaW5lLm1lcmNhZGFsQGdtYWlsLmNvbQ</string>
|
||||
<nil key="NSViewClass"/>
|
||||
<nil key="NSUserInterfaceItemIdentifier"/>
|
||||
<object class="NSView" key="NSWindowView" id="993549244">
|
||||
<nil key="NSNextResponder"/>
|
||||
<reference key="NSNextResponder"/>
|
||||
<int key="NSvFlags">256</int>
|
||||
<array class="NSMutableArray" key="NSSubviews">
|
||||
<object class="PDFView" id="921834304">
|
||||
@@ -1218,6 +1243,8 @@ bnRvaW5lIE1lcmNhZGFsCiAgICBhbnRvaW5lLm1lcmNhZGFsQGdtYWlsLmNvbQ</string>
|
||||
</set>
|
||||
<string key="NSFrame">{{0, 8}, {716, 654}}</string>
|
||||
<reference key="NSSuperview" ref="993549244"/>
|
||||
<reference key="NSWindow"/>
|
||||
<reference key="NSNextKeyView"/>
|
||||
<bool key="NSViewIsLayerTreeHost">YES</bool>
|
||||
<int key="DisplayMode">1</int>
|
||||
<bool key="PageBreaks">NO</bool>
|
||||
@@ -1226,9 +1253,11 @@ bnRvaW5lIE1lcmNhZGFsCiAgICBhbnRvaW5lLm1lcmNhZGFsQGdtYWlsLmNvbQ</string>
|
||||
</object>
|
||||
</array>
|
||||
<string key="NSFrameSize">{716, 662}</string>
|
||||
<reference key="NSSuperview"/>
|
||||
<reference key="NSWindow"/>
|
||||
<reference key="NSNextKeyView" ref="921834304"/>
|
||||
</object>
|
||||
<string key="NSScreenRect">{{0, 0}, {1440, 900}}</string>
|
||||
<string key="NSScreenRect">{{0, 0}, {1440, 877}}</string>
|
||||
<string key="NSMaxSize">{10000000000000, 10000000000000}</string>
|
||||
<bool key="NSWindowIsRestorable">YES</bool>
|
||||
</object>
|
||||
@@ -1329,7 +1358,7 @@ bnRvaW5lIE1lcmNhZGFsCiAgICBhbnRvaW5lLm1lcmNhZGFsQGdtYWlsLmNvbQ</string>
|
||||
<reference key="NSNextKeyView" ref="231116691"/>
|
||||
<string key="NSReuseIdentifierKey">_NS:21</string>
|
||||
</object>
|
||||
<string key="NSScreenRect">{{0, 0}, {1440, 900}}</string>
|
||||
<string key="NSScreenRect">{{0, 0}, {1440, 877}}</string>
|
||||
<string key="NSMaxSize">{10000000000000, 10000000000000}</string>
|
||||
<string key="NSFrameAutosaveName">updatingCappuccinoPanel</string>
|
||||
<bool key="NSWindowIsRestorable">YES</bool>
|
||||
@@ -1610,6 +1639,14 @@ bnRvaW5lIE1lcmNhZGFsCiAgICBhbnRvaW5lLm1lcmNhZGFsQGdtYWlsLmNvbQ</string>
|
||||
</object>
|
||||
<string key="id">A92-fj-Uci</string>
|
||||
</object>
|
||||
<object class="IBConnectionRecord">
|
||||
<object class="IBActionConnection" key="connection">
|
||||
<string key="label">save:</string>
|
||||
<reference key="source" ref="246574361"/>
|
||||
<reference key="destination" ref="580602815"/>
|
||||
</object>
|
||||
<string key="id">0Il-yd-iuZ</string>
|
||||
</object>
|
||||
<object class="IBConnectionRecord">
|
||||
<object class="IBActionConnection" key="connection">
|
||||
<string key="label">openXcodeProject:</string>
|
||||
@@ -2076,6 +2113,26 @@ bnRvaW5lIE1lcmNhZGFsCiAgICBhbnRvaW5lLm1lcmNhZGFsQGdtYWlsLmNvbQ</string>
|
||||
</object>
|
||||
<string key="id">dP2-Fc-one</string>
|
||||
</object>
|
||||
<object class="IBConnectionRecord">
|
||||
<object class="IBBindingConnection" key="connection">
|
||||
<string key="label">value: values.XCCPanelActiveAppWhenOpening</string>
|
||||
<reference key="source" ref="580602815"/>
|
||||
<reference key="destination" ref="246574361"/>
|
||||
<object class="NSNibBindingConnector" key="connector">
|
||||
<reference key="NSSource" ref="580602815"/>
|
||||
<reference key="NSDestination" ref="246574361"/>
|
||||
<string key="NSLabel">value: values.XCCPanelActiveAppWhenOpening</string>
|
||||
<string key="NSBinding">value</string>
|
||||
<string key="NSKeyPath">values.XCCPanelActiveAppWhenOpening</string>
|
||||
<object class="NSDictionary" key="NSOptions">
|
||||
<string key="NS.key.0">NSValidatesImmediately</string>
|
||||
<boolean value="YES" key="NS.object.0"/>
|
||||
</object>
|
||||
<int key="NSNibBindingConnectorVersion">2</int>
|
||||
</object>
|
||||
</object>
|
||||
<string key="id">kgU-89-aRS</string>
|
||||
</object>
|
||||
<object class="IBConnectionRecord">
|
||||
<object class="IBBindingConnection" key="connection">
|
||||
<string key="label">value: values.XCCPanelStyleUtility</string>
|
||||
@@ -2552,9 +2609,10 @@ bnRvaW5lIE1lcmNhZGFsCiAgICBhbnRvaW5lLm1lcmNhZGFsQGdtYWlsLmNvbQ</string>
|
||||
<reference ref="49684265"/>
|
||||
<reference ref="668731100"/>
|
||||
<reference ref="497174199"/>
|
||||
<reference ref="493786566"/>
|
||||
<reference ref="580602815"/>
|
||||
<reference ref="59325359"/>
|
||||
<reference ref="665261882"/>
|
||||
<reference ref="493786566"/>
|
||||
</array>
|
||||
<reference key="parent" ref="853177344"/>
|
||||
</object>
|
||||
@@ -2934,6 +2992,19 @@ bnRvaW5lIE1lcmNhZGFsCiAgICBhbnRvaW5lLm1lcmNhZGFsQGdtYWlsLmNvbQ</string>
|
||||
<reference key="object" ref="549413473"/>
|
||||
<reference key="parent" ref="493786566"/>
|
||||
</object>
|
||||
<object class="IBObjectRecord">
|
||||
<string key="id">CQP-MN-ubd</string>
|
||||
<reference key="object" ref="580602815"/>
|
||||
<array class="NSMutableArray" key="children">
|
||||
<reference ref="171691988"/>
|
||||
</array>
|
||||
<reference key="parent" ref="359969914"/>
|
||||
</object>
|
||||
<object class="IBObjectRecord">
|
||||
<string key="id">GLQ-ZT-xXR</string>
|
||||
<reference key="object" ref="171691988"/>
|
||||
<reference key="parent" ref="580602815"/>
|
||||
</object>
|
||||
</array>
|
||||
</object>
|
||||
<dictionary class="NSMutableDictionary" key="flattenedProperties">
|
||||
@@ -2976,16 +3047,17 @@ bnRvaW5lIE1lcmNhZGFsCiAgICBhbnRvaW5lLm1lcmNhZGFsQGdtYWlsLmNvbQ</string>
|
||||
<boolean value="NO" key="540.showNotes"/>
|
||||
<boolean value="NO" key="541.IBNSWindowAutoPositionCentersHorizontal"/>
|
||||
<boolean value="NO" key="541.IBNSWindowAutoPositionCentersVertical"/>
|
||||
<string key="541.IBPersistedLastKnownCanvasPosition">{239, 248.5}</string>
|
||||
<string key="541.IBPersistedLastKnownCanvasPosition">{345, 214.5}</string>
|
||||
<string key="541.IBPluginDependency">com.apple.InterfaceBuilder.CocoaPlugin</string>
|
||||
<boolean value="NO" key="541.showNotes"/>
|
||||
<boolean value="NO" key="542.IBNSWindowAutoPositionCentersHorizontal"/>
|
||||
<boolean value="NO" key="542.IBNSWindowAutoPositionCentersVertical"/>
|
||||
<string key="542.IBPersistedLastKnownCanvasPosition">{-183.5, 363}</string>
|
||||
<string key="542.IBPersistedLastKnownCanvasPosition">{-173.5, 372}</string>
|
||||
<string key="542.IBPluginDependency">com.apple.InterfaceBuilder.CocoaPlugin</string>
|
||||
<boolean value="NO" key="542.showNotes"/>
|
||||
<boolean value="YES" key="543.IBNSWindowAutoPositionCentersHorizontal"/>
|
||||
<boolean value="YES" key="543.IBNSWindowAutoPositionCentersVertical"/>
|
||||
<string key="543.IBPersistedLastKnownCanvasPosition">{650, 268}</string>
|
||||
<string key="543.IBPluginDependency">com.apple.InterfaceBuilder.CocoaPlugin</string>
|
||||
<boolean value="NO" key="543.showNotes"/>
|
||||
<string key="544.IBPluginDependency">com.apple.InterfaceBuilder.CocoaPlugin</string>
|
||||
@@ -3165,6 +3237,18 @@ bnRvaW5lIE1lcmNhZGFsCiAgICBhbnRvaW5lLm1lcmNhZGFsQGdtYWlsLmNvbQ</string>
|
||||
<string key="9wn-zh-iT9.IBPluginDependency">com.apple.InterfaceBuilder.CocoaPlugin</string>
|
||||
<string key="BYW-Rk-rZ4.IBPluginDependency">com.apple.InterfaceBuilder.CocoaPlugin</string>
|
||||
<boolean value="NO" key="BYW-Rk-rZ4.showNotes"/>
|
||||
<object class="NSMutableDictionary" key="CQP-MN-ubd.IBAttributePlaceholdersKey">
|
||||
<string key="NS.key.0">ToolTip</string>
|
||||
<object class="IBToolTipAttribute" key="NS.object.0">
|
||||
<string key="name">ToolTip</string>
|
||||
<reference key="object" ref="580602815"/>
|
||||
<string key="toolTip">If this is checked, xCodeCapp will be the main application of the system when the errors & warnings panel is about to open</string>
|
||||
</object>
|
||||
</object>
|
||||
<boolean value="NO" key="CQP-MN-ubd.IBNSControlSetsMaxLayoutWidthAtFirstLayoutMetadataKey"/>
|
||||
<string key="CQP-MN-ubd.IBPluginDependency">com.apple.InterfaceBuilder.CocoaPlugin</string>
|
||||
<reference key="CQP-MN-ubd.IBUserGuides" ref="0"/>
|
||||
<boolean value="NO" key="CQP-MN-ubd.showNotes"/>
|
||||
<string key="D0i-5i-RLQ.IBPluginDependency">com.apple.InterfaceBuilder.CocoaPlugin</string>
|
||||
<string key="E18-tY-KOl.IBPluginDependency">com.apple.InterfaceBuilder.CocoaPlugin</string>
|
||||
<object class="NSMutableDictionary" key="GDP-7Q-0W5.IBAttributePlaceholdersKey">
|
||||
@@ -3172,13 +3256,15 @@ bnRvaW5lIE1lcmNhZGFsCiAgICBhbnRvaW5lLm1lcmNhZGFsQGdtYWlsLmNvbQ</string>
|
||||
<object class="IBToolTipAttribute" key="NS.object.0">
|
||||
<string key="name">ToolTip</string>
|
||||
<reference key="object" ref="493786566"/>
|
||||
<string key="toolTip">If this is checked, when a Cappuccino project is opened, the project’s Xcode support project will be opened automatically</string>
|
||||
<string key="toolTip">If this is checked, the error panel will be a floating panel.</string>
|
||||
</object>
|
||||
</object>
|
||||
<boolean value="NO" key="GDP-7Q-0W5.IBNSControlSetsMaxLayoutWidthAtFirstLayoutMetadataKey"/>
|
||||
<string key="GDP-7Q-0W5.IBPluginDependency">com.apple.InterfaceBuilder.CocoaPlugin</string>
|
||||
<reference key="GDP-7Q-0W5.IBUserGuides" ref="0"/>
|
||||
<boolean value="NO" key="GDP-7Q-0W5.showNotes"/>
|
||||
<string key="GLQ-ZT-xXR.IBPluginDependency">com.apple.InterfaceBuilder.CocoaPlugin</string>
|
||||
<boolean value="NO" key="GLQ-ZT-xXR.showNotes"/>
|
||||
<object class="NSMutableDictionary" key="GR3-Dn-qSe.IBAttributePlaceholdersKey">
|
||||
<string key="NS.key.0">ToolTip</string>
|
||||
<object class="IBToolTipAttribute" key="NS.object.0">
|
||||
|
||||
@@ -102,7 +102,7 @@
|
||||
width: 100%;
|
||||
|
||||
/* Put it at the bottom of the stack so it doesn't interfere with UI */
|
||||
z-index: -1000;
|
||||
z-index: 0;
|
||||
}
|
||||
|
||||
#cappuccino-body .container {
|
||||
|
||||
@@ -72,7 +72,7 @@
|
||||
width: 100%;
|
||||
|
||||
/* Put it at the bottom of the stack so it doesn't interfere with UI */
|
||||
z-index: -1000;
|
||||
z-index: 0;
|
||||
}
|
||||
|
||||
#cappuccino-body .container {
|
||||
|
||||
@@ -102,7 +102,7 @@
|
||||
width: 100%;
|
||||
|
||||
/* Put it at the bottom of the stack so it doesn't interfere with UI */
|
||||
z-index: -1000;
|
||||
z-index: 0;
|
||||
}
|
||||
|
||||
#cappuccino-body .container {
|
||||
|
||||
@@ -72,7 +72,7 @@
|
||||
width: 100%;
|
||||
|
||||
/* Put it at the bottom of the stack so it doesn't interfere with UI */
|
||||
z-index: -1000;
|
||||
z-index: 0;
|
||||
}
|
||||
|
||||
#cappuccino-body .container {
|
||||
|
||||
Reference in New Issue
Block a user