mirror of
https://github.com/cappuccino/cappuccino.git
synced 2026-09-10 12:47:13 +00:00
Compare commits
16
Commits
v0.9.2-RC1
...
v0.9.5-RC5
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
4ec7cea6c4 | ||
|
|
0036f329f5 | ||
|
|
15af54efda | ||
|
|
07966bb7fe | ||
|
|
e7d9b0503b | ||
|
|
072b43d178 | ||
|
|
281d2295ae | ||
|
|
79cf4370b4 | ||
|
|
6217fc8459 | ||
|
|
f1fd3d170a | ||
|
|
4e410f8a81 | ||
|
|
7a1b273d8d | ||
|
|
820531342d | ||
|
|
353db3277a | ||
|
|
82f37549ae | ||
|
|
09e1bd6bf1 |
+16
-8
@@ -97,7 +97,6 @@ var CPThemeStateAutoCompleting = @"CPThemeStateAutoCompleting",
|
||||
{
|
||||
if (self = [super initWithFrame:frame])
|
||||
{
|
||||
_selectedRange = CPMakeRange(0, 0);
|
||||
_completionDelay = [CPTokenField defaultCompletionDelay];
|
||||
_tokenizingCharacterSet = [[self class] defaultTokenizingCharacterSet];
|
||||
[self setBezeled:YES];
|
||||
@@ -114,6 +113,8 @@ var CPThemeStateAutoCompleting = @"CPThemeStateAutoCompleting",
|
||||
|
||||
- (void)_init
|
||||
{
|
||||
_selectedRange = CPMakeRange(0, 0);
|
||||
|
||||
var frame = [self frame];
|
||||
|
||||
_tokenScrollView = [[CPScrollView alloc] initWithFrame:CGRectMakeZero()];
|
||||
@@ -171,19 +172,20 @@ var CPThemeStateAutoCompleting = @"CPThemeStateAutoCompleting",
|
||||
|
||||
- (void)_autocompleteWithDOMEvent:(JSObject)DOMEvent
|
||||
{
|
||||
if (!_cachedCompletions || ![self hasThemeState:CPThemeStateAutoCompleting])
|
||||
if (![self _inputElement].value && (!_cachedCompletions || ![self hasThemeState:CPThemeStateAutoCompleting]))
|
||||
return;
|
||||
|
||||
[self _hideCompletions];
|
||||
|
||||
var token = _cachedCompletions[[_autocompleteView selectedRow]],
|
||||
var token = _cachedCompletions ? _cachedCompletions[[_autocompleteView selectedRow]] : nil,
|
||||
shouldRemoveLastObject = token !== @"" && [self _inputElement].value !== @"";
|
||||
|
||||
if (!token)
|
||||
token = [self _inputElement].value;
|
||||
|
||||
// Make sure the user typed an actual token to prevent the previous token from being emptied
|
||||
// If the input area is empty, we want to fallback to the normal behavior, resigning first responder or select the next or previous key view
|
||||
// If the input area is empty, we want to fall back to the normal behavior, resigning first
|
||||
// responder or selecting the next or previous key view.
|
||||
if (!token || token === @"")
|
||||
{
|
||||
if (DOMEvent && DOMEvent.keyCode === CPTabKeyCode)
|
||||
@@ -198,7 +200,6 @@ var CPThemeStateAutoCompleting = @"CPThemeStateAutoCompleting",
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
var objectValue = [self objectValue];
|
||||
|
||||
// Remove the uncompleted token and add the token string.
|
||||
@@ -269,8 +270,13 @@ var CPThemeStateAutoCompleting = @"CPThemeStateAutoCompleting",
|
||||
var indexOfToken = [[self _tokens] indexOfObject:token],
|
||||
objectValue = [self objectValue];
|
||||
|
||||
// If the token was selected, deselect it for selection preservation.
|
||||
[self _deselectToken:token];
|
||||
// If the selection was to the right of the deleted token, move it to the left. If the deleted token was
|
||||
// selected, deselect it.
|
||||
if (indexOfToken < _selectedRange.location)
|
||||
_selectedRange.location--;
|
||||
else
|
||||
[self _deselectToken:token];
|
||||
|
||||
// Preserve selection.
|
||||
var selection = CPCopyRange(_selectedRange);
|
||||
[objectValue removeObjectAtIndex:indexOfToken];
|
||||
@@ -602,14 +608,16 @@ var CPThemeStateAutoCompleting = @"CPThemeStateAutoCompleting",
|
||||
{
|
||||
}
|
||||
|
||||
|
||||
// ========
|
||||
// = VIEW =
|
||||
// ========
|
||||
- (void)viewDidMoveToWindow
|
||||
{
|
||||
[[[self window] contentView] addSubview:_autocompleteContainer];
|
||||
|
||||
#if PLATFORM(DOM)
|
||||
_autocompleteContainer._DOMElement.style.zIndex = 1000; // Anything else doesn't seem to work
|
||||
#endif
|
||||
}
|
||||
|
||||
- (void)removeFromSuperview
|
||||
|
||||
@@ -108,7 +108,7 @@ function CGColorCreateCopy(aColor)
|
||||
*/
|
||||
function CGColorCreateGenericGray(gray, alpha)
|
||||
{
|
||||
return CGColorCreate(CGColorSpaceCreateDeviceRGB(), [gray,gray,gray, alpha]);
|
||||
return CGColorCreate(CGColorSpaceCreateDeviceRGB(), [gray, gray, gray, alpha]);
|
||||
}
|
||||
|
||||
/*!
|
||||
@@ -137,7 +137,7 @@ function CGColorCreateGenericRGB(red, green, blue, alpha)
|
||||
*/
|
||||
function CGColorCreateGenericCMYK(cyan, magenta, yellow, black, alpha)
|
||||
{
|
||||
return CGColorCreate(CGColorSpaceCreateDeviceCMYK(),
|
||||
return CGColorCreate(CGColorSpaceCreateDeviceCMYK(),
|
||||
[cyan, magenta, yellow, black, alpha]);
|
||||
}
|
||||
|
||||
@@ -150,7 +150,8 @@ function CGColorCreateGenericCMYK(cyan, magenta, yellow, black, alpha)
|
||||
*/
|
||||
function CGColorCreateCopyWithAlpha(aColor, anAlpha)
|
||||
{
|
||||
if ( !aColor ) return aColor; // Avoid error null pointer in next line
|
||||
if (!aColor)
|
||||
return aColor; // Avoid error null pointer in next line
|
||||
|
||||
var components = aColor.components.slice();
|
||||
|
||||
|
||||
+1
-1
@@ -33,7 +33,7 @@ Getting Started
|
||||
---------------
|
||||
To get started, download and install the current release version of Cappuccino:
|
||||
|
||||
$ curl https://raw.github.com/cappuccino/cappuccino/0.9.2a/bootstrap.sh >/tmp/cappuccino_bootstrap.sh && sh /tmp/cappuccino_bootstrap.sh
|
||||
$ curl https://raw.github.com/cappuccino/cappuccino/v0.9.5/bootstrap.sh >/tmp/cappuccino_bootstrap.sh && sh /tmp/cappuccino_bootstrap.sh
|
||||
|
||||
If you'd just like to get started using Cappuccino for your web apps, you are done.
|
||||
|
||||
|
||||
@@ -1,5 +1,7 @@
|
||||
@import <AppKit/CPTokenField.j>
|
||||
|
||||
[CPApplication sharedApplication];
|
||||
|
||||
@implementation CPTokenFieldTest : OJTestCase
|
||||
{
|
||||
}
|
||||
@@ -17,4 +19,13 @@
|
||||
[self assert:[unarchived tokenizingCharacterSet] equals:[CPCharacterSet characterSetWithCharactersInString:@","]];
|
||||
}
|
||||
|
||||
@end
|
||||
- (void)testCreate
|
||||
{
|
||||
var aWindow = [[CPWindow alloc] initWithContentRect:CGRectMake(0.0, 0.0, 1024.0, 768.0) styleMask:CPWindowNotSizable],
|
||||
tokenField = [[CPTokenField alloc] initWithFrame:CGRectMake(10, 10, 100, 28)];
|
||||
|
||||
// This shouldn't crash.
|
||||
[[aWindow contentView] addSubview:tokenField];
|
||||
}
|
||||
|
||||
@end
|
||||
|
||||
+1
-1
File diff suppressed because one or more lines are too long
@@ -31,7 +31,7 @@ PROJECT_NAME = " API"
|
||||
# This could be handy for archiving the generated documentation or
|
||||
# if some version control system is used.
|
||||
|
||||
PROJECT_NUMBER = 0.9.1
|
||||
PROJECT_NUMBER = 0.9.5
|
||||
|
||||
PROJECT_LOGO = ./Tools/Documentation/logo.png
|
||||
|
||||
|
||||
@@ -43,7 +43,7 @@ void fsevents_callback(ConstFSEventStreamRef streamRef,
|
||||
NSString *path = [[(NSArray *)eventPaths objectAtIndex:i] stringByStandardizingPath];
|
||||
|
||||
if (useFileBasedListening)
|
||||
{
|
||||
{
|
||||
if (flags & kFSEventStreamEventFlagItemIsFile &&
|
||||
flags & kFSEventStreamEventFlagItemRemoved)
|
||||
{
|
||||
|
||||
@@ -68,7 +68,7 @@ NSString * const XCCListeningStartNotification = @"XCCListeningStartNotification
|
||||
|
||||
[self setSupportFileLevelAPI:versionMajor >= 10 && versionMinor >= 7];
|
||||
// Uncomment to simulate 10.6 mode
|
||||
[self setSupportFileLevelAPI:NO];
|
||||
// [self setSupportFileLevelAPI:NO];
|
||||
|
||||
[self configure];
|
||||
|
||||
@@ -277,11 +277,14 @@ NSString * const XCCListeningStartNotification = @"XCCListeningStartNotification
|
||||
*/
|
||||
- (void)handleFileModification:(NSString*)fullPath notify:(BOOL)shouldNotify
|
||||
{
|
||||
if (![self isXIBFile:fullPath] && ![self isObjJFile:fullPath] && ![self isXCCIgnoreFile:fullPath])
|
||||
return;
|
||||
|
||||
if ([self isPathMatchingIgnoredPaths:fullPath] || ![fm fileExistsAtPath:fullPath])
|
||||
return;
|
||||
|
||||
|
||||
DLog(@"Parsing modified file: %@", fullPath);
|
||||
|
||||
|
||||
NSArray *arguments = nil;
|
||||
NSString *successTitle = nil;
|
||||
NSString *successMsg = nil;
|
||||
@@ -292,58 +295,54 @@ NSString * const XCCListeningStartNotification = @"XCCListeningStartNotification
|
||||
|
||||
DLog(@"Shadow path: %@", shadowPath);
|
||||
|
||||
if ([self isXIBFile:fullPath] || [self isObjJFile:fullPath] || [self isXCCIgnoreFile:fullPath])
|
||||
[[NSNotificationCenter defaultCenter] postNotificationName:XCCConversionStartNotification object:self];
|
||||
|
||||
if ([self isXIBFile:fullPath])
|
||||
{
|
||||
[[NSNotificationCenter defaultCenter] postNotificationName:XCCConversionStartNotification object:self];
|
||||
|
||||
if ([self isXIBFile:fullPath])
|
||||
{
|
||||
arguments = [NSArray arrayWithObjects: @"-c", [NSString stringWithFormat:@"(%@; nib2cib '%@';) 2>&1", profilePath, fullPath],@"",nil];
|
||||
successTitle = @"XIB converted";
|
||||
successMsg = splitPath;
|
||||
}
|
||||
else if ([self isObjJFile:fullPath])
|
||||
{
|
||||
arguments = [NSArray arrayWithObjects: @"-c", [NSString stringWithFormat:@"(%@; objj '%@' '%@' '%@';) 2>&1", profilePath, parserPath, fullPath, shadowPath],@"",nil];
|
||||
successTitle = @"Objective-J source processed";
|
||||
successMsg = splitPath;
|
||||
}
|
||||
else if ([self isXCCIgnoreFile:fullPath])
|
||||
{
|
||||
[self computeIgnoredPaths];
|
||||
successTitle = @".xcodecapp-ignore processed";
|
||||
successMsg = @"Ignored files list updated";
|
||||
arguments = nil;
|
||||
}
|
||||
|
||||
// Run the task and get the response if needed
|
||||
if (arguments)
|
||||
{
|
||||
DLog(@"Running task...");
|
||||
NSArray *statusInfo = [self runTask:arguments];
|
||||
|
||||
status = [statusInfo objectAtIndex:0];
|
||||
response = [statusInfo objectAtIndex:1];
|
||||
|
||||
DLog(@"Task result/response: %@/%@", status, response);
|
||||
}
|
||||
|
||||
|
||||
if ([status intValue] == 0 && shouldNotify)
|
||||
{
|
||||
[delegate performSelector:@selector(growlWithTitle:message:) withObject:successTitle withObject:successMsg];
|
||||
}
|
||||
else if (![status intValue] == 0)
|
||||
{
|
||||
if (response)
|
||||
[errorList addObject:response];
|
||||
|
||||
[delegate performSelector:@selector(growlWithTitle:message:) withObject:@"Error processing file" withObject:splitPath];
|
||||
}
|
||||
|
||||
[[NSNotificationCenter defaultCenter] postNotificationName:XCCConversionStopNotification object:self];
|
||||
DLog(@"Processed: %@", fullPath);
|
||||
arguments = [NSArray arrayWithObjects: @"-c", [NSString stringWithFormat:@"(%@; nib2cib '%@';) 2>&1", profilePath, fullPath],@"",nil];
|
||||
successTitle = @"XIB converted";
|
||||
successMsg = splitPath;
|
||||
}
|
||||
else if ([self isObjJFile:fullPath])
|
||||
{
|
||||
arguments = [NSArray arrayWithObjects: @"-c", [NSString stringWithFormat:@"(%@; objj '%@' '%@' '%@';) 2>&1", profilePath, parserPath, fullPath, shadowPath],@"",nil];
|
||||
successTitle = @"Objective-J source processed";
|
||||
successMsg = splitPath;
|
||||
}
|
||||
else if ([self isXCCIgnoreFile:fullPath])
|
||||
{
|
||||
[self computeIgnoredPaths];
|
||||
successTitle = @".xcodecapp-ignore processed";
|
||||
successMsg = @"Ignored files list updated";
|
||||
arguments = nil;
|
||||
}
|
||||
|
||||
// Run the task and get the response if needed
|
||||
if (arguments)
|
||||
{
|
||||
DLog(@"Running task...");
|
||||
NSArray *statusInfo = [self runTask:arguments];
|
||||
|
||||
status = [statusInfo objectAtIndex:0];
|
||||
response = [statusInfo objectAtIndex:1];
|
||||
|
||||
DLog(@"Task result/response: %@/%@", status, response);
|
||||
}
|
||||
|
||||
if ([status intValue] == 0 && shouldNotify)
|
||||
{
|
||||
[delegate performSelector:@selector(growlWithTitle:message:) withObject:successTitle withObject:successMsg];
|
||||
}
|
||||
else if (![status intValue] == 0)
|
||||
{
|
||||
if (response)
|
||||
[errorList addObject:response];
|
||||
|
||||
[delegate performSelector:@selector(growlWithTitle:message:) withObject:@"Error processing file" withObject:splitPath];
|
||||
}
|
||||
|
||||
[[NSNotificationCenter defaultCenter] postNotificationName:XCCConversionStopNotification object:self];
|
||||
DLog(@"Processed: %@", fullPath);
|
||||
}
|
||||
|
||||
/*!
|
||||
@@ -443,7 +442,7 @@ NSString * const XCCListeningStartNotification = @"XCCListeningStartNotification
|
||||
[PBXContent writeToFile:XCodeSupportPBXPath atomically:YES encoding:NSUTF8StringEncoding error:nil];
|
||||
DLog(@"PBX file adapted to the project");
|
||||
|
||||
DLog(@"Creating source folder");
|
||||
DLog(@"Creating source folder %@", [XCodeSupportProjectSources path]);
|
||||
[fm createDirectoryAtPath:[XCodeSupportProjectSources path] withIntermediateDirectories:YES attributes:nil error:nil];
|
||||
return NO;
|
||||
}
|
||||
@@ -471,11 +470,10 @@ NSString * const XCCListeningStartNotification = @"XCCListeningStartNotification
|
||||
BOOL isDir = NO;
|
||||
[fm fileExistsAtPath:filePath isDirectory:&isDir];
|
||||
|
||||
if (isDir
|
||||
|| (![self isXIBFile:filePath] && ![self isObjJFile:filePath]))
|
||||
if (isDir || (![self isXIBFile:filePath] && ![self isObjJFile:filePath]))
|
||||
continue;
|
||||
|
||||
NSURL *eventualShadow = [self shadowURLForSourceURL:[NSURL URLWithString:filePath]];
|
||||
NSURL *eventualShadow = [self shadowURLForSourceURL:[NSURL fileURLWithPath:filePath]];
|
||||
|
||||
if (![fm fileExistsAtPath:[eventualShadow path]])
|
||||
{
|
||||
@@ -539,7 +537,7 @@ NSString * const XCCListeningStartNotification = @"XCCListeningStartNotification
|
||||
options:0
|
||||
range:NSMakeRange(0, [unshadowedPath length])];
|
||||
|
||||
return [NSURL URLWithString:[NSString stringWithString:unshadowedPath]];
|
||||
return [NSURL fileURLWithPath:[NSString stringWithString:unshadowedPath]];
|
||||
}
|
||||
|
||||
|
||||
@@ -585,31 +583,35 @@ NSString * const XCCListeningStartNotification = @"XCCListeningStartNotification
|
||||
{
|
||||
if ([ignoredPath length] == 0)
|
||||
continue;
|
||||
|
||||
NSMutableString *regexp = [NSMutableString stringWithFormat:@"%@/%@", [currentProjectURL path], ignoredPath];
|
||||
|
||||
NSMutableString *regexp = [ignoredPath mutableCopy];
|
||||
|
||||
[regexp replaceOccurrencesOfString:@"/"
|
||||
withString:@"\\/"
|
||||
options:0
|
||||
range:NSMakeRange(0, [regexp length])];
|
||||
|
||||
|
||||
[regexp replaceOccurrencesOfString:@"."
|
||||
withString:@"\\."
|
||||
options:0
|
||||
range:NSMakeRange(0, [regexp length])];
|
||||
|
||||
|
||||
[regexp replaceOccurrencesOfString:@"*"
|
||||
withString:@".*"
|
||||
options:0
|
||||
range:NSMakeRange(0, [regexp length])];
|
||||
|
||||
|
||||
[regexp replaceOccurrencesOfString:@" "
|
||||
withString:@"\\ "
|
||||
options:0
|
||||
range:NSMakeRange(0, [regexp length])];
|
||||
|
||||
NSPredicate *regextest = [NSPredicate predicateWithFormat:@"SELF MATCHES %@", regexp];
|
||||
|
||||
|
||||
if ([regextest evaluateWithObject:aPath])
|
||||
{
|
||||
return YES;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
return NO;
|
||||
}
|
||||
|
||||
@@ -621,8 +623,8 @@ NSString * const XCCListeningStartNotification = @"XCCListeningStartNotification
|
||||
{
|
||||
NSMutableString *tempName = [NSMutableString stringWithString:[path lastPathComponent]];
|
||||
|
||||
currentProjectURL = [NSURL URLWithString:path];
|
||||
|
||||
currentProjectURL = [NSURL fileURLWithPath:path];
|
||||
|
||||
[tempName replaceOccurrencesOfString:@" "
|
||||
withString:@"_"
|
||||
options:NSCaseInsensitiveSearch
|
||||
@@ -654,7 +656,7 @@ NSString * const XCCListeningStartNotification = @"XCCListeningStartNotification
|
||||
{
|
||||
NSString *unshadowed = [[self sourceURLForShadowName:subpath] path];
|
||||
NSString *shadowFullPath = [NSString stringWithFormat:@"%@/%@", [XCodeSupportProjectSources path], subpath];
|
||||
|
||||
|
||||
if (![fm fileExistsAtPath:unshadowed])
|
||||
{
|
||||
DLog(@"cleaning shadow file: %@", subpath);
|
||||
|
||||
+1
-1
@@ -139,7 +139,7 @@ install_directory=""
|
||||
tmp_zip="/tmp/cappuccino.zip"
|
||||
|
||||
github_user="cappuccino"
|
||||
github_ref="0.9.2"
|
||||
github_ref="0.9.5"
|
||||
|
||||
noprompt=""
|
||||
install_capp=""
|
||||
|
||||
+1
-1
@@ -1,3 +1,3 @@
|
||||
{
|
||||
"version": "0.9.2"
|
||||
"version": "0.9.5"
|
||||
}
|
||||
Reference in New Issue
Block a user