mirror of
https://github.com/cappuccino/cappuccino.git
synced 2026-11-07 23:53:16 +00:00
Merge branch 'master' of git://github.com/280north/cappuccino
This commit is contained in:
commit
970859311d
11 files changed
+66
-15
No files matched your search
+2
-2
@@ -149,7 +149,7 @@ var CPAlertWarningImage,
|
||||
[_alertPanel setFloatingPanel:YES];
|
||||
[_alertPanel center];
|
||||
|
||||
[_messageLabel setTextColor:(styleMask == CPHUDBackgroundWindowMask) ? [CPColor whiteColor] : [CPColor blackColor]];
|
||||
[_messageLabel setTextColor:(styleMask & CPHUDBackgroundWindowMask) ? [CPColor whiteColor] : [CPColor blackColor]];
|
||||
|
||||
var count = [_buttons count];
|
||||
for(var i=0; i < count; i++)
|
||||
@@ -157,7 +157,7 @@ var CPAlertWarningImage,
|
||||
var button = _buttons[i];
|
||||
|
||||
[button setFrameSize:CGSizeMake([button frame].size.width, (styleMask == CPHUDBackgroundWindowMask) ? 20.0 : 24.0)];
|
||||
[button setBezelStyle:(styleMask == CPHUDBackgroundWindowMask) ? CPHUDBezelStyle : CPRoundedBezelStyle];
|
||||
[button setBezelStyle:(styleMask & CPHUDBackgroundWindowMask) ? CPHUDBezelStyle : CPRoundedBezelStyle];
|
||||
|
||||
[[_alertPanel contentView] addSubview:button];
|
||||
}
|
||||
|
||||
+3
-1
@@ -58,7 +58,9 @@ CPGrooveBorder = 3;
|
||||
|
||||
- (id)initWithFrame:(CPRect)frameRect
|
||||
{
|
||||
if (self = [super initWithFrame:frameRect])
|
||||
self = [super initWithFrame:frameRect];
|
||||
|
||||
if (self)
|
||||
{
|
||||
_fillColor = [CPColor clearColor];
|
||||
_borderColor = [CPColor blackColor];
|
||||
|
||||
@@ -114,7 +114,7 @@ else if (USER_AGENT.indexOf("AppleWebKit/") != -1)
|
||||
majorVersion = parseInt(versionString.substring(0, versionDivision)),
|
||||
minorVersion = parseInt(versionString.substr(versionDivision + 1));
|
||||
|
||||
if((USER_AGENT.indexOf("Safari") !== CPNotFound && (majorVersion >= 525 && minorVersion > 14)) || USER_AGENT.indexOf("Chrome") !== CPNotFound)
|
||||
if((USER_AGENT.indexOf("Safari") !== CPNotFound && (majorVersion > 525 || (majorVersion === 525 && minorVersion > 14))) || USER_AGENT.indexOf("Chrome") !== CPNotFound)
|
||||
PLATFORM_FEATURES |= CPJavascriptRemedialKeySupport;
|
||||
}
|
||||
|
||||
|
||||
+9
-4
@@ -90,6 +90,11 @@ function CPImageInBundle(aFilename, aSize, aBundle)
|
||||
Image _image;
|
||||
}
|
||||
|
||||
- (id)init
|
||||
{
|
||||
return [self initByReferencingFile:@"" size:CGSizeMake(-1, -1)];
|
||||
}
|
||||
|
||||
/*!
|
||||
Initializes the image, by associating it with a filename. The image
|
||||
denoted in \c aFilename is not actually loaded. It will
|
||||
@@ -98,7 +103,7 @@ function CPImageInBundle(aFilename, aSize, aBundle)
|
||||
@param aSize the image's size
|
||||
@return the initialized image
|
||||
*/
|
||||
- (CPImage)initByReferencingFile:(CPString)aFilename size:(CGSize)aSize
|
||||
- (id)initByReferencingFile:(CPString)aFilename size:(CGSize)aSize
|
||||
{
|
||||
self = [super init];
|
||||
|
||||
@@ -118,7 +123,7 @@ function CPImageInBundle(aFilename, aSize, aBundle)
|
||||
@param aSize the size of the image
|
||||
@return the initialized image.
|
||||
*/
|
||||
- (CPImage)initWithContentsOfFile:(CPString)aFilename size:(CGSize)aSize
|
||||
- (id)initWithContentsOfFile:(CPString)aFilename size:(CGSize)aSize
|
||||
{
|
||||
self = [self initByReferencingFile:aFilename size:aSize];
|
||||
|
||||
@@ -134,9 +139,9 @@ function CPImageInBundle(aFilename, aSize, aBundle)
|
||||
@param aFilename the file name of the image
|
||||
@return the initialized image
|
||||
*/
|
||||
- (CPImage)initWithContentsOfFile:(CPString)aFilename
|
||||
- (id)initWithContentsOfFile:(CPString)aFilename
|
||||
{
|
||||
self = [self initByReferencingFile:aFilename size: CGSizeMake(-1, -1)];
|
||||
self = [self initByReferencingFile:aFilename size:CGSizeMake(-1, -1)];
|
||||
|
||||
if (self)
|
||||
[self load];
|
||||
|
||||
@@ -78,6 +78,11 @@
|
||||
_CPMenuItemView _menuItemView;
|
||||
}
|
||||
|
||||
- (id)init
|
||||
{
|
||||
return [self initWithTitle:@"" action:nil keyEquivalent:nil];
|
||||
}
|
||||
|
||||
/*!
|
||||
Initializes the menu item with a title, action, and keyboard equivalent.
|
||||
@param aTitle the menu item's title
|
||||
|
||||
@@ -60,6 +60,11 @@ CPPressedTab = 2;
|
||||
CPView _auxiliaryView;
|
||||
}
|
||||
|
||||
- (id)init
|
||||
{
|
||||
return [self initWithIdentifier:@""];
|
||||
}
|
||||
|
||||
/*!
|
||||
Initializes the tab view item with the specified identifier.
|
||||
@return the initialized CPTabViewItem
|
||||
|
||||
@@ -62,6 +62,11 @@ CPTableColumnUserResizingMask = 2;
|
||||
CPString _headerToolTip;
|
||||
}
|
||||
|
||||
- (id)init
|
||||
{
|
||||
return [self initWithIdentifier:@""];
|
||||
}
|
||||
|
||||
- (id)initWithIdentifier:(id)anIdentifier
|
||||
{
|
||||
self = [super init];
|
||||
|
||||
+25
-6
@@ -239,11 +239,14 @@ CPTextFieldStatePlaceholder = CPThemeState("placeholder");
|
||||
return true;
|
||||
}
|
||||
|
||||
CPTextFieldKeyDownFunction = function(anEvent)
|
||||
CPTextFieldKeyDownFunction = function(aDOMEvent)
|
||||
{
|
||||
CPTextFieldTextDidChangeValue = [CPTextFieldInputOwner stringValue];
|
||||
|
||||
CPTextFieldKeyPressFunction(anEvent);
|
||||
aDOMEvent = aDOMEvent || window.event;
|
||||
|
||||
if (aDOMEvent.keyCode == CPReturnKeyCode || aDOMEvent.keyCode == CPTabKeyCode)
|
||||
CPTextFieldKeyPressFunction(aDOMEvent);
|
||||
|
||||
return true;
|
||||
}
|
||||
@@ -252,6 +255,8 @@ CPTextFieldStatePlaceholder = CPThemeState("placeholder");
|
||||
{
|
||||
aDOMEvent = aDOMEvent || window.event;
|
||||
|
||||
CPTextFieldKeyUpFunction();
|
||||
|
||||
if (aDOMEvent.keyCode == CPReturnKeyCode || aDOMEvent.keyCode == CPTabKeyCode)
|
||||
{
|
||||
if (aDOMEvent.preventDefault)
|
||||
@@ -274,19 +279,19 @@ CPTextFieldStatePlaceholder = CPThemeState("placeholder");
|
||||
else
|
||||
[[owner window] selectPreviousKeyView:owner];
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
[[CPRunLoop currentRunLoop] limitDateForMode:CPDefaultRunLoopMode];
|
||||
}
|
||||
|
||||
CPTextFieldKeyUpFunction = function()
|
||||
{
|
||||
[CPTextFieldInputOwner setStringValue:CPTextFieldDOMInputElement.value];
|
||||
[CPTextFieldInputOwner _setStringValue:CPTextFieldDOMInputElement.value];
|
||||
|
||||
if ([CPTextFieldInputOwner stringValue] !== CPTextFieldTextDidChangeValue)
|
||||
{
|
||||
CPTextFieldTextDidChangeValue = [CPTextFieldInputOwner stringValue];
|
||||
[CPTextFieldInputOwner textDidChange:[CPNotification notificationWithName:CPControlTextDidChangeNotification object:CPTextFieldInputOwner userInfo:nil]];
|
||||
CPTextFieldTextDidChangeValue = [CPTextFieldInputOwner stringValue];
|
||||
}
|
||||
|
||||
[[CPRunLoop currentRunLoop] limitDateForMode:CPDefaultRunLoopMode];
|
||||
@@ -551,8 +556,10 @@ CPTextFieldStatePlaceholder = CPThemeState("placeholder");
|
||||
/* @ignore */
|
||||
- (BOOL)becomeFirstResponder
|
||||
{
|
||||
#if PLATFORM(DOM)
|
||||
if (CPTextFieldInputOwner && [CPTextFieldInputOwner window] !== [self window])
|
||||
[[CPTextFieldInputOwner window] makeFirstResponder:nil];
|
||||
#endif
|
||||
|
||||
[self setThemeState:CPThemeStateEditing];
|
||||
|
||||
@@ -590,7 +597,8 @@ CPTextFieldStatePlaceholder = CPThemeState("placeholder");
|
||||
|
||||
window.setTimeout(function()
|
||||
{
|
||||
element.focus();
|
||||
element.value = [self stringValue];
|
||||
element.focus();
|
||||
CPTextFieldInputOwner = self;
|
||||
}, 0.0);
|
||||
|
||||
@@ -681,10 +689,21 @@ CPTextFieldStatePlaceholder = CPThemeState("placeholder");
|
||||
/*
|
||||
@ignore
|
||||
*/
|
||||
- (void)_setStringValue:(id)aValue
|
||||
{
|
||||
[super setObjectValue:String(aValue)];
|
||||
[self _updatePlaceholderState];
|
||||
}
|
||||
|
||||
- (void)setObjectValue:(id)aValue
|
||||
{
|
||||
[super setObjectValue:aValue];
|
||||
|
||||
#if PLATFORM(DOM)
|
||||
if (CPTextFieldInputOwner === self)
|
||||
[self _inputElement].value = aValue;
|
||||
#endif
|
||||
|
||||
[self _updatePlaceholderState];
|
||||
}
|
||||
|
||||
|
||||
@@ -128,6 +128,11 @@ var CPToolbarConfigurationsByIdentifier = nil;
|
||||
[toolbarsSharingIdentifier addObject:toolbar];
|
||||
}
|
||||
|
||||
- (id)init
|
||||
{
|
||||
return [self initWithIdentifier:@""];
|
||||
}
|
||||
|
||||
/*!
|
||||
Initializes the toolbar with the specified identifier.
|
||||
@param anIdentifier the identifier for the toolbar
|
||||
|
||||
@@ -86,6 +86,11 @@ CPToolbarPrintItemIdentifier = @"CPToolbarPrintItemIdentifier";
|
||||
int _visibilityPriority;
|
||||
}
|
||||
|
||||
- (id)init
|
||||
{
|
||||
return [self initWithItemIdentifier:@""];
|
||||
}
|
||||
|
||||
// Creating a Toolbar Item
|
||||
/*!
|
||||
Initializes the toolbar item with a specified identifier.
|
||||
|
||||
@@ -159,7 +159,7 @@ function fragment_evaluate_code(aFragment)
|
||||
{
|
||||
#if RHINO
|
||||
var functionText = "function(){"+GET_CODE(aFragment)+"/**/\n}";
|
||||
if (system.engine === "rhino")
|
||||
if (typeof system !== "undefined" && system.engine === "rhino")
|
||||
compiled = Packages.org.mozilla.javascript.Context.getCurrentContext().compileFunction(window, functionText, GET_FILE(aFragment).path, 0, null);
|
||||
else
|
||||
compiled = eval(functionText);
|
||||
|
||||
Reference in new issue
Block a user