mirror of
https://github.com/cappuccino/cappuccino.git
synced 2026-10-07 01:18:02 +00:00
Merge branch 'master' of github.com:280north/cappuccino
This commit is contained in:
commit
a3a4aed0d2
23 files changed
+628
-55
No files matched your search
+141
-22
@@ -179,6 +179,7 @@ CPTableViewFirstColumnOnlyAutoresizingStyle = 5;
|
||||
unsigned _gridStyleMask;
|
||||
|
||||
unsigned _numberOfRows;
|
||||
CPIndexSet _groupRows;
|
||||
|
||||
|
||||
CPTableHeaderView _headerView;
|
||||
@@ -319,6 +320,8 @@ CPTableViewFirstColumnOnlyAutoresizingStyle = 5;
|
||||
_exposedColumns = [CPIndexSet indexSet];
|
||||
_cachedDataViews = { };
|
||||
|
||||
_groupRows = [CPIndexSet indexSet];
|
||||
|
||||
_tableDrawView = [[_CPTableDrawView alloc] initWithTableView:self];
|
||||
[_tableDrawView setBackgroundColor:[CPColor clearColor]];
|
||||
[self addSubview:_tableDrawView];
|
||||
@@ -2362,6 +2365,22 @@ CPTableViewFirstColumnOnlyAutoresizingStyle = 5;
|
||||
else
|
||||
[dataView unsetThemeState:CPThemeStateSelectedDataView];
|
||||
|
||||
if (_implementedDelegateMethods & CPTableViewDelegate_tableView_isGroupRow_)
|
||||
{
|
||||
if([_delegate tableView:self isGroupRow:row])
|
||||
{
|
||||
[_groupRows addIndex:row];
|
||||
[dataView setThemeState:CPThemeStateGroupRow];
|
||||
}
|
||||
else
|
||||
{
|
||||
[_groupRows removeIndexesInRange:CPMakeRange(row, 1)];
|
||||
[dataView unsetThemeState:CPThemeStateGroupRow];
|
||||
}
|
||||
|
||||
[self setNeedsDisplay:YES]
|
||||
}
|
||||
|
||||
if (_implementedDelegateMethods & CPTableViewDelegate_tableView_willDisplayView_forTableColumn_row_)
|
||||
[_delegate tableView:self willDisplayView:dataView forTableColumn:tableColumn row:row];
|
||||
|
||||
@@ -2517,18 +2536,24 @@ CPTableViewFirstColumnOnlyAutoresizingStyle = 5;
|
||||
firstRow = exposedRows.location,
|
||||
lastRow = CPMaxRange(exposedRows) - 1,
|
||||
colorIndex = MIN(exposedRows.length, colorCount),
|
||||
heightFilled = 0.0;
|
||||
heightFilled = 0.0,
|
||||
groupRowRects = [ ];
|
||||
|
||||
while (colorIndex--)
|
||||
{
|
||||
var row = firstRow - firstRow % colorCount + colorIndex,
|
||||
fillRect = nil;
|
||||
fillRect = _CGRectMakeZero();
|
||||
|
||||
CGContextBeginPath(context);
|
||||
|
||||
for (; row <= lastRow; row += colorCount)
|
||||
if (row >= firstRow)
|
||||
CGContextAddRect(context, CGRectIntersection(aRect, fillRect = [self rectOfRow:row]));
|
||||
{
|
||||
if (![_groupRows containsIndex:row] && _selectionHighlightStyle !== CPTableViewSelectionHighlightStyleSourceList)
|
||||
CGContextAddRect(context, CGRectIntersection(aRect, fillRect = [self rectOfRow:row]));
|
||||
else
|
||||
groupRowRects.push(CGRectIntersection(aRect, [self rectOfRow:row]));
|
||||
}
|
||||
|
||||
if (row - colorCount === lastRow)
|
||||
heightFilled = _CGRectGetMaxY(fillRect);
|
||||
@@ -2540,22 +2565,33 @@ CPTableViewFirstColumnOnlyAutoresizingStyle = 5;
|
||||
}
|
||||
// console.profileEnd("row-paint");
|
||||
|
||||
|
||||
|
||||
// FIX ME: this is really terrible, it seems like such a hack...
|
||||
var totalHeight = _CGRectGetMaxY(aRect);
|
||||
|
||||
if (heightFilled >= totalHeight || _rowHeight <= 0.0)
|
||||
{
|
||||
[self _drawGroupRowsForRects:groupRowRects];
|
||||
return;
|
||||
}
|
||||
|
||||
var rowHeight = _rowHeight + _intercellSpacing.height,
|
||||
fillRect = _CGRectMake(_CGRectGetMinX(aRect), _CGRectGetMinY(aRect) + heightFilled, _CGRectGetWidth(aRect), rowHeight);
|
||||
|
||||
for (row = lastRow + 1; heightFilled < totalHeight; ++row)
|
||||
{
|
||||
CGContextSetFillColor(context, rowColors[row % colorCount]);
|
||||
CGContextFillRect(context, fillRect);
|
||||
if(![_groupRows containsIndex:row] && _selectionHighlightStyle !== CPTableViewSelectionHighlightStyleSourceList)
|
||||
{
|
||||
CGContextSetFillColor(context, rowColors[row % colorCount]);
|
||||
CGContextFillRect(context, fillRect);
|
||||
}
|
||||
|
||||
heightFilled += rowHeight;
|
||||
fillRect.origin.y += rowHeight;
|
||||
}
|
||||
|
||||
[self _drawGroupRowsForRects:groupRowRects];
|
||||
}
|
||||
|
||||
- (void)drawGridInClipRect:(CGRect)aRect
|
||||
@@ -2670,47 +2706,76 @@ CPTableViewFirstColumnOnlyAutoresizingStyle = 5;
|
||||
|
||||
CGContextBeginPath(context);
|
||||
|
||||
var gradientCache = [self selectionGradientColors],
|
||||
topLineColor = [gradientCache objectForKey:CPSourceListTopLineColor],
|
||||
bottomLineColor = [gradientCache objectForKey:CPSourceListBottomLineColor],
|
||||
gradientColor = [gradientCache objectForKey:CPSourceListGradient];
|
||||
if (drawGradient)
|
||||
{
|
||||
var gradientCache = [self selectionGradientColors],
|
||||
topLineColor = [gradientCache objectForKey:CPSourceListTopLineColor],
|
||||
bottomLineColor = [gradientCache objectForKey:CPSourceListBottomLineColor],
|
||||
gradientColor = [gradientCache objectForKey:CPSourceListGradient];
|
||||
}
|
||||
|
||||
var normalSelectionHighlightColor = [self selectionHighlightColor];
|
||||
|
||||
// dont do these lookups if there are no group rows
|
||||
if ([_groupRows count])
|
||||
{
|
||||
var topGroupLineColor = [CPColor colorWithCalibratedWhite:212.0 / 255.0 alpha:1.0],
|
||||
bottomGroupLineColor = [CPColor colorWithCalibratedWhite:185.0 / 255.0 alpha:1.0],
|
||||
gradientGroupColor = CGGradientCreateWithColorComponents(CGColorSpaceCreateDeviceRGB(), [212.0 / 255.0, 212.0 / 255.0, 212.0 / 255.0,1.0, 197.0 / 255.0, 197.0 / 255.0, 197.0 / 255.0,1.0], [0,1], 2);
|
||||
}
|
||||
|
||||
while (count--)
|
||||
{
|
||||
var rowRect = CGRectIntersection(objj_msgSend(self, rectSelector, indexes[count]), aRect);
|
||||
CGContextAddRect(context, rowRect);
|
||||
{
|
||||
var currentIndex = indexes[count],
|
||||
rowRect = CGRectIntersection(objj_msgSend(self, rectSelector, currentIndex), aRect);
|
||||
|
||||
if (drawGradient)
|
||||
// group rows get the same highlight style as other rows if they're source list...
|
||||
if (!drawGradient)
|
||||
var shouldUseGroupGradient = [_groupRows containsIndex:currentIndex];
|
||||
|
||||
if (drawGradient || shouldUseGroupGradient)
|
||||
{
|
||||
var minX = _CGRectGetMinX(rowRect),
|
||||
minY = _CGRectGetMinY(rowRect),
|
||||
maxX = _CGRectGetMaxX(rowRect),
|
||||
maxY = _CGRectGetMaxY(rowRect) - deltaHeight;
|
||||
|
||||
CGContextDrawLinearGradient(context, gradientColor, rowRect.origin, CGPointMake(minX, maxY), 0);
|
||||
if (!drawGradient)
|
||||
{
|
||||
//If there is no source list gradient we need to close the selection path and fill it now
|
||||
[normalSelectionHighlightColor setFill];
|
||||
CGContextClosePath(context);
|
||||
CGContextFillPath(context);
|
||||
CGContextBeginPath(context);
|
||||
}
|
||||
CGContextAddRect(context, rowRect);
|
||||
|
||||
CGContextDrawLinearGradient(context, (shouldUseGroupGradient) ? gradientGroupColor : gradientColor, rowRect.origin, _CGPointMake(minX, maxY), 0);
|
||||
CGContextClosePath(context);
|
||||
|
||||
CGContextBeginPath(context);
|
||||
CGContextMoveToPoint(context, minX, minY);
|
||||
CGContextAddLineToPoint(context, maxX, minY);
|
||||
CGContextClosePath(context);
|
||||
CGContextSetStrokeColor(context, topLineColor);
|
||||
CGContextSetStrokeColor(context, (shouldUseGroupGradient) ? topGroupLineColor : topLineColor);
|
||||
CGContextStrokePath(context);
|
||||
|
||||
CGContextBeginPath(context);
|
||||
CGContextMoveToPoint(context, minX, maxY);
|
||||
CGContextAddLineToPoint(context, maxX, maxY - 1);
|
||||
CGContextClosePath(context);
|
||||
CGContextSetStrokeColor(context, bottomLineColor);
|
||||
CGContextSetStrokeColor(context, (shouldUseGroupGradient) ? bottomGroupLineColor : bottomLineColor);
|
||||
CGContextStrokePath(context);
|
||||
}
|
||||
else
|
||||
CGContextAddRect(context, rowRect);
|
||||
}
|
||||
|
||||
CGContextClosePath(context);
|
||||
|
||||
if (!drawGradient)
|
||||
{
|
||||
[[self selectionHighlightColor] setFill];
|
||||
[normalSelectionHighlightColor setFill];
|
||||
CGContextFillPath(context);
|
||||
}
|
||||
|
||||
@@ -2719,10 +2784,10 @@ CPTableViewFirstColumnOnlyAutoresizingStyle = 5;
|
||||
for(var i = 0; i < count2; i++)
|
||||
{
|
||||
var rect = objj_msgSend(self, rectSelector, indexes[i]),
|
||||
minX = CGRectGetMinX(rect) - 0.5,
|
||||
maxX = CGRectGetMaxX(rect) - 0.5,
|
||||
minY = CGRectGetMinY(rect) - 0.5,
|
||||
maxY = CGRectGetMaxY(rect) - 0.5;
|
||||
minX = _CGRectGetMinX(rect) - 0.5,
|
||||
maxX = _CGRectGetMaxX(rect) - 0.5,
|
||||
minY = _CGRectGetMinY(rect) - 0.5,
|
||||
maxY = _CGRectGetMaxY(rect) - 0.5;
|
||||
|
||||
if ([_selectedRowIndexes count] >= 1 && gridStyleMask & CPTableViewSolidVerticalGridLineMask)
|
||||
{
|
||||
@@ -2736,7 +2801,7 @@ CPTableViewFirstColumnOnlyAutoresizingStyle = 5;
|
||||
for (var c = firstExposedColumn; c < exposedColumnCount; c++)
|
||||
{
|
||||
var colRect = [self rectOfColumn:exposedColumnIndexes[c]],
|
||||
colX = CGRectGetMaxX(colRect) + 0.5;
|
||||
colX = _CGRectGetMaxX(colRect) + 0.5;
|
||||
|
||||
CGContextMoveToPoint(context, colX, minY);
|
||||
CGContextAddLineToPoint(context, colX, maxY);
|
||||
@@ -2756,6 +2821,59 @@ CPTableViewFirstColumnOnlyAutoresizingStyle = 5;
|
||||
CGContextStrokePath(context);
|
||||
}
|
||||
|
||||
- (void)_drawGroupRowsForRects:(CPArray)rects
|
||||
{
|
||||
if (_selectionHighlightStyle === CPTableViewSelectionHighlightStyleSourceList || !rects.length)
|
||||
return;
|
||||
|
||||
var context = [[CPGraphicsContext currentContext] graphicsPort],
|
||||
i = rects.length;
|
||||
|
||||
CGContextBeginPath(context);
|
||||
|
||||
var gradientCache = [self selectionGradientColors],
|
||||
topLineColor = [CPColor colorWithHexString:"d3d3d3"],
|
||||
bottomLineColor = [CPColor colorWithHexString:"bebebd"],
|
||||
gradientColor = CGGradientCreateWithColorComponents(CGColorSpaceCreateDeviceRGB(), [220.0 / 255.0, 220.0 / 255.0, 220.0 / 255.0,1.0,
|
||||
199.0 / 255.0, 199.0 / 255.0, 199.0 / 255.0,1.0], [0,1], 2),
|
||||
drawGradient = YES;
|
||||
|
||||
while (i--)
|
||||
{
|
||||
var rowRect = rects[i];
|
||||
|
||||
CGContextAddRect(context, rowRect);
|
||||
|
||||
if (drawGradient)
|
||||
{
|
||||
var minX = CGRectGetMinX(rowRect),
|
||||
minY = CGRectGetMinY(rowRect),
|
||||
maxX = CGRectGetMaxX(rowRect),
|
||||
maxY = CGRectGetMaxY(rowRect);
|
||||
|
||||
CGContextDrawLinearGradient(context, gradientColor, rowRect.origin, CGPointMake(minX, maxY), 0);
|
||||
CGContextClosePath(context);
|
||||
|
||||
CGContextBeginPath(context);
|
||||
CGContextMoveToPoint(context, minX, minY);
|
||||
CGContextAddLineToPoint(context, maxX, minY);
|
||||
CGContextClosePath(context);
|
||||
CGContextSetStrokeColor(context, topLineColor);
|
||||
CGContextStrokePath(context);
|
||||
|
||||
CGContextBeginPath(context);
|
||||
CGContextMoveToPoint(context, minX, maxY);
|
||||
CGContextAddLineToPoint(context, maxX, maxY - 1);
|
||||
CGContextClosePath(context);
|
||||
CGContextSetStrokeColor(context, bottomLineColor);
|
||||
CGContextStrokePath(context);
|
||||
}
|
||||
}
|
||||
|
||||
CGContextClosePath(context);
|
||||
}
|
||||
|
||||
|
||||
- (void)_drawRows:(CPIndexSet)rowsIndexes clipRect:(CGRect)clipRect
|
||||
{
|
||||
var row = [rowsIndexes firstIndex];
|
||||
@@ -2770,6 +2888,7 @@ CPTableViewFirstColumnOnlyAutoresizingStyle = 5;
|
||||
- (void)drawRow:(CPInteger)row clipRect:(CGRect)rect
|
||||
{
|
||||
// This method does currently nothing in cappuccino. Can be overriden by subclasses.
|
||||
|
||||
}
|
||||
|
||||
- (void)layoutSubviews
|
||||
|
||||
@@ -403,6 +403,7 @@ CPThemeStateHighlighted = CPThemeState("highlighted");
|
||||
CPThemeStateSelected = CPThemeState("selected");
|
||||
CPThemeStateTableDataView = CPThemeState("tableDataView");
|
||||
CPThemeStateSelectedDataView = CPThemeStateSelectedTableDataView = CPThemeState("selectedTableDataView");
|
||||
CPThemeStateGroupRow = CPThemeState("CPThemeStateGroupRow");
|
||||
CPThemeStateBezeled = CPThemeState("bezeled");
|
||||
CPThemeStateBordered = CPThemeState("bordered");
|
||||
CPThemeStateEditable = CPThemeState("editable");
|
||||
|
||||
@@ -738,6 +738,13 @@ var themedButtonValues = nil,
|
||||
[@"text-color", [CPColor colorWithCalibratedWhite:51.0 / 255.0 alpha:1.0], CPThemeStateTableDataView],
|
||||
[@"text-color", [CPColor whiteColor], CPThemeStateTableDataView | CPThemeStateSelectedTableDataView],
|
||||
[@"font", [CPFont boldSystemFontOfSize:12.0], CPThemeStateTableDataView | CPThemeStateSelectedTableDataView],
|
||||
|
||||
[@"text-color", [CPColor colorWithCalibratedWhite:125.0 / 255.0 alpha:1.0], CPThemeStateTableDataView|CPThemeStateGroupRow],
|
||||
[@"text-color", [CPColor colorWithCalibratedWhite:1.0 alpha:1.0], CPThemeStateTableDataView|CPThemeStateGroupRow|CPThemeStateSelectedTableDataView],
|
||||
[@"text-shadow-color", [CPColor whiteColor], CPThemeStateTableDataView|CPThemeStateGroupRow],
|
||||
[@"text-shadow-offset", CGSizeMake(0,1), CPThemeStateTableDataView|CPThemeStateGroupRow],
|
||||
[@"text-shadow-color", [CPColor colorWithCalibratedWhite:0.0 alpha:0.6], CPThemeStateTableDataView|CPThemeStateGroupRow|CPThemeStateSelectedTableDataView],
|
||||
[@"font", [CPFont boldSystemFontOfSize:12.0], CPThemeStateTableDataView|CPThemeStateGroupRow]
|
||||
];
|
||||
|
||||
[self registerThemeValues:themedTextFieldValues forView:textfield];
|
||||
|
||||
@@ -6,7 +6,7 @@
|
||||
|
||||
|
||||
var FILE = require("file"),
|
||||
TERM = require("term"),
|
||||
TERM = require("narwhal/term"),
|
||||
task = require("jake").task,
|
||||
filedir = require("jake").filedir,
|
||||
BundleTask = require("objective-j/jake/bundletask").BundleTask;
|
||||
@@ -32,7 +32,7 @@ BlendTask.prototype.infoPlist = function()
|
||||
{
|
||||
var infoPlist = BundleTask.prototype.infoPlist.apply(this, arguments);
|
||||
|
||||
infoPlist.setValueForKey("CPKeyedThemes", require("util").unique(this._keyedThemes));
|
||||
infoPlist.setValueForKey("CPKeyedThemes", require("narwhal/util").unique(this._keyedThemes));
|
||||
|
||||
return infoPlist;
|
||||
}
|
||||
|
||||
@@ -8,12 +8,12 @@ require("narwhal").ensureEngine("rhino");
|
||||
|
||||
var FILE = require("file");
|
||||
var OS = require("os");
|
||||
var UTIL = require("util");
|
||||
var UTIL = require("narwhal/util");
|
||||
|
||||
var CACHEMANIFEST = require("objective-j/cache-manifest");
|
||||
|
||||
var stream = require("term").stream;
|
||||
var parser = new (require("args").Parser)();
|
||||
var stream = require("narwhal/term").stream;
|
||||
var parser = new (require("narwhal/args").Parser)();
|
||||
|
||||
parser.usage("INPUT_PROJECT OUTPUT_PROJECT");
|
||||
parser.help("Combine a Cappuccino application into a single JavaScript file.");
|
||||
|
||||
@@ -8,8 +8,8 @@ require("narwhal").ensureEngine("rhino");
|
||||
|
||||
var FILE = require("file");
|
||||
|
||||
var stream = require("term").stream
|
||||
var parser = new (require("args").Parser)();
|
||||
var stream = require("narwhal/term").stream
|
||||
var parser = new (require("narwhal/args").Parser)();
|
||||
|
||||
parser.usage("INPUT_PROJECT");
|
||||
parser.help("Checks a project for missing imports.");
|
||||
|
||||
+2
-2
@@ -12,8 +12,8 @@ var OS = require("os");
|
||||
|
||||
var CACHEMANIFEST = require("objective-j/cache-manifest");
|
||||
|
||||
var stream = require("term").stream;
|
||||
var parser = new (require("args").Parser)();
|
||||
var stream = require("narwhal/term").stream;
|
||||
var parser = new (require("narwhal/args").Parser)();
|
||||
|
||||
parser.usage("INPUT_PROJECT OUTPUT_PROJECT");
|
||||
parser.help("Analyze and strip unused files from a Cappuccino project's .sj bundles.");
|
||||
|
||||
@@ -4,9 +4,9 @@ require("./common.jake");
|
||||
var FILE = require("file"),
|
||||
SYSTEM = require("system"),
|
||||
OS = require("os"),
|
||||
UTIL = require("util"),
|
||||
UTIL = require("narwhal/util"),
|
||||
jake = require("jake"),
|
||||
stream = require("term").stream;
|
||||
stream = require("narwhal/term").stream;
|
||||
|
||||
var subprojects = ["Objective-J", "CommonJS", "Foundation", "AppKit", "Tools"];
|
||||
|
||||
|
||||
@@ -182,7 +182,7 @@ GLOBAL(CPLogPrint) = function(aString, aLevel, aTitle, aFormatter)
|
||||
{
|
||||
if (stream === undefined) {
|
||||
try {
|
||||
stream = require("term").stream;
|
||||
stream = require("narwhal/term").stream;
|
||||
} catch (e) {
|
||||
stream = null;
|
||||
}
|
||||
|
||||
@@ -5,7 +5,7 @@ var FILE = require("file"),
|
||||
OS = require("os"),
|
||||
ObjectiveJ = require("objective-j");
|
||||
|
||||
var parser = new (require("args").Parser)();
|
||||
var parser = new (require("narwhal/args").Parser)();
|
||||
|
||||
parser.usage("file...");
|
||||
parser.help("Cappuccino plist converter.");
|
||||
|
||||
@@ -23,7 +23,7 @@ var OBJJ_INCLUDE_PATHS = global.OBJJ_INCLUDE_PATHS = exports.OBJJ_INCLUDE_PATHS
|
||||
exports.objj_frameworks = [];
|
||||
exports.objj_debug_frameworks = [];
|
||||
|
||||
var catalog = require("packages").catalog;
|
||||
var catalog = require("narwhal/packages").catalog;
|
||||
for (var name in catalog)
|
||||
{
|
||||
if (!catalog.hasOwnProperty(name))
|
||||
|
||||
@@ -1,8 +1,8 @@
|
||||
|
||||
var FILE = require("file"),
|
||||
OS = require("os"),
|
||||
UTIL = require("util"),
|
||||
TERM = require("term"),
|
||||
UTIL = require("narwhal/util"),
|
||||
TERM = require("narwhal/term"),
|
||||
Jake = require("jake"),
|
||||
CLEAN = require("jake/clean").CLEAN,
|
||||
CLOBBER = require("jake/clean").CLOBBER,
|
||||
|
||||
@@ -24,7 +24,7 @@ require("../common.jake");
|
||||
|
||||
var FILE = require("file"),
|
||||
OS = require("os"),
|
||||
stream = require("term").stream;
|
||||
stream = require("narwhal/term").stream;
|
||||
|
||||
//$BUILD_CONFIGURATION_DIR = "../Build"
|
||||
$BROWSER_FILE = FILE.join("Browser", "Objective-J.js");
|
||||
|
||||
@@ -0,0 +1,130 @@
|
||||
/*
|
||||
* AppController.j
|
||||
* GroupRowTest
|
||||
*
|
||||
* Created by You on August 27, 2010.
|
||||
* Copyright 2010, Your Company All rights reserved.
|
||||
*/
|
||||
|
||||
@import <Foundation/CPObject.j>
|
||||
|
||||
|
||||
@implementation AppController : CPObject
|
||||
{
|
||||
}
|
||||
|
||||
- (void)applicationDidFinishLaunching:(CPNotification)aNotification
|
||||
{
|
||||
var theWindow = [[CPWindow alloc] initWithContentRect:CGRectMakeZero() styleMask:CPBorderlessBridgeWindowMask],
|
||||
contentView = [theWindow contentView];
|
||||
|
||||
tableView = [[CPTableView alloc] initWithFrame:CGRectMake(0.0, 0.0, 400.0, 400.0)];
|
||||
|
||||
[tableView setAllowsMultipleSelection:YES];
|
||||
[tableView setAllowsColumnSelection:YES];
|
||||
[tableView setUsesAlternatingRowBackgroundColors:YES];
|
||||
|
||||
[tableView setColumnAutoresizingStyle:CPTableViewLastColumnOnlyAutoresizingStyle];
|
||||
[tableView setDelegate:self];
|
||||
[tableView setDataSource:self];
|
||||
|
||||
|
||||
var iconView = [[CPImageView alloc] initWithFrame:CGRectMake(16,16,0,0)];
|
||||
[iconView setImageScaling:CPScaleNone];
|
||||
var iconColumn = [[CPTableColumn alloc] initWithIdentifier:"icons"];
|
||||
[iconColumn setWidth:32.0];
|
||||
[iconColumn setMinWidth:32.0];
|
||||
[iconColumn setDataView:iconView];
|
||||
[tableView addTableColumn:iconColumn];
|
||||
|
||||
iconImage = [[CPImage alloc] initWithContentsOfFile:"http://cappuccino.org/images/favicon.png" size:CGSizeMake(16,16)];
|
||||
|
||||
|
||||
for (var i = 1; i <= 5; i++)
|
||||
{
|
||||
var column = [[CPTableColumn alloc] initWithIdentifier:String(i)];
|
||||
|
||||
[[column headerView] setStringValue:"Number " + i];
|
||||
|
||||
[column setMaxWidth:500.0];
|
||||
[column setWidth:200.0];
|
||||
|
||||
[tableView addTableColumn:column];
|
||||
}
|
||||
|
||||
var scrollView = [[CPScrollView alloc] initWithFrame:CGRectMake(0, 0, CGRectGetWidth([contentView bounds]), CGRectGetHeight([contentView bounds]) / 2)];
|
||||
|
||||
[scrollView setDocumentView:tableView];
|
||||
[scrollView setAutoresizingMask:CPViewWidthSizable | CPViewHeightSizable];
|
||||
|
||||
[contentView addSubview:scrollView];
|
||||
|
||||
tableView = [[CPTableView alloc] initWithFrame:CGRectMake(0.0, 0.0, 400.0, 400.0)];
|
||||
|
||||
[tableView setAllowsMultipleSelection:YES];
|
||||
[tableView setAllowsColumnSelection:YES];
|
||||
|
||||
[tableView setColumnAutoresizingStyle:CPTableViewLastColumnOnlyAutoresizingStyle];
|
||||
[tableView setSelectionHighlightStyle:CPTableViewSelectionHighlightStyleSourceList];
|
||||
[tableView setDelegate:self];
|
||||
[tableView setDataSource:self];
|
||||
|
||||
|
||||
var iconView = [[CPImageView alloc] initWithFrame:CGRectMake(16,16,0,0)];
|
||||
[iconView setImageScaling:CPScaleNone];
|
||||
var iconColumn = [[CPTableColumn alloc] initWithIdentifier:"icons"];
|
||||
[iconColumn setWidth:32.0];
|
||||
[iconColumn setMinWidth:32.0];
|
||||
[iconColumn setDataView:iconView];
|
||||
[tableView addTableColumn:iconColumn];
|
||||
|
||||
iconImage = [[CPImage alloc] initWithContentsOfFile:"http://cappuccino.org/images/favicon.png" size:CGSizeMake(16,16)];
|
||||
|
||||
|
||||
for (var i = 1; i <= 5; i++)
|
||||
{
|
||||
var column = [[CPTableColumn alloc] initWithIdentifier:String(i)];
|
||||
|
||||
[[column headerView] setStringValue:"Number " + i];
|
||||
|
||||
[column setMaxWidth:500.0];
|
||||
[column setWidth:200.0];
|
||||
|
||||
[tableView addTableColumn:column];
|
||||
}
|
||||
|
||||
var scrollView = [[CPScrollView alloc] initWithFrame:CGRectMake(0, CGRectGetHeight([contentView bounds]) / 2, CGRectGetWidth([contentView bounds]), CGRectGetHeight([contentView bounds]) / 2)];
|
||||
|
||||
[scrollView setDocumentView:tableView];
|
||||
[scrollView setAutoresizingMask:CPViewWidthSizable | CPViewHeightSizable];
|
||||
|
||||
[contentView addSubview:scrollView];
|
||||
|
||||
[theWindow orderFront:self];
|
||||
|
||||
}
|
||||
|
||||
- (int)numberOfRowsInTableView:(CPTableView)atableView
|
||||
{
|
||||
return 500;
|
||||
}
|
||||
|
||||
- (id)tableView:(CPTableView)aTableView objectValueForTableColumn:(CPTableColumn)aColumn row:(int)aRow
|
||||
{
|
||||
if ([aColumn identifier] === "icons")
|
||||
return iconImage;
|
||||
|
||||
return aRow;
|
||||
}
|
||||
|
||||
- (BOOL)tableView:(CPTableView)aTableView isGroupRow:(int)aRow
|
||||
{
|
||||
var groups = [];
|
||||
|
||||
for(var i = 0; i < 100; i+=5)
|
||||
groups.push(i);
|
||||
|
||||
return [groups containsObject:aRow];
|
||||
}
|
||||
|
||||
@end
|
||||
@@ -0,0 +1,12 @@
|
||||
<?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>CPApplicationDelegateClass</key>
|
||||
<string>AppController</string>
|
||||
<key>CPBundleName</key>
|
||||
<string>GroupRowTest</string>
|
||||
<key>CPPrincipalClass</key>
|
||||
<string>CPApplication</string>
|
||||
</dict>
|
||||
</plist>
|
||||
@@ -0,0 +1,93 @@
|
||||
/*
|
||||
* Jakefile
|
||||
* GroupRowTest
|
||||
*
|
||||
* Created by You on August 27, 2010.
|
||||
* Copyright 2010, 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");
|
||||
|
||||
app ("GroupRowTest", function(task)
|
||||
{
|
||||
task.setBuildIntermediatesPath(FILE.join("Build", "GroupRowTest.build", configuration));
|
||||
task.setBuildPath(FILE.join("Build", configuration));
|
||||
|
||||
task.setProductName("GroupRowTest");
|
||||
task.setIdentifier("com.yourcompany.GroupRowTest");
|
||||
task.setVersion("1.0");
|
||||
task.setAuthor("Your Company");
|
||||
task.setEmail("feedback @nospam@ yourcompany.com");
|
||||
task.setSummary("GroupRowTest");
|
||||
task.setSources((new FileList("**/*.j")).exclude(FILE.join("Build", "**")));
|
||||
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", ["GroupRowTest"], function()
|
||||
{
|
||||
printResults(configuration);
|
||||
});
|
||||
|
||||
task ("build", ["default"]);
|
||||
|
||||
task ("debug", function()
|
||||
{
|
||||
ENV["CONFIGURATION"] = "Debug";
|
||||
JAKE.subjake(["."], "build", ENV);
|
||||
});
|
||||
|
||||
task ("release", function()
|
||||
{
|
||||
ENV["CONFIGURATION"] = "Release";
|
||||
JAKE.subjake(["."], "build", ENV);
|
||||
});
|
||||
|
||||
task ("run", ["debug"], function()
|
||||
{
|
||||
OS.system(["open", FILE.join("Build", "Debug", "GroupRowTest", "index.html")]);
|
||||
});
|
||||
|
||||
task ("run-release", ["release"], function()
|
||||
{
|
||||
OS.system(["open", FILE.join("Build", "Release", "GroupRowTest", "index.html")]);
|
||||
});
|
||||
|
||||
task ("deploy", ["release"], function()
|
||||
{
|
||||
FILE.mkdirs(FILE.join("Build", "Deployment", "GroupRowTest"));
|
||||
OS.system(["press", "-f", FILE.join("Build", "Release", "GroupRowTest"), FILE.join("Build", "Deployment", "GroupRowTest")]);
|
||||
printResults("Deployment")
|
||||
});
|
||||
|
||||
task ("desktop", ["release"], function()
|
||||
{
|
||||
FILE.mkdirs(FILE.join("Build", "Desktop", "GroupRowTest"));
|
||||
require("cappuccino/nativehost").buildNativeHost(FILE.join("Build", "Release", "GroupRowTest"), FILE.join("Build", "Desktop", "GroupRowTest", "GroupRowTest.app"));
|
||||
printResults("Desktop")
|
||||
});
|
||||
|
||||
task ("run-desktop", ["desktop"], function()
|
||||
{
|
||||
OS.system([FILE.join("Build", "Desktop", "GroupRowTest", "GroupRowTest.app", "Contents", "MacOS", "NativeHost"), "-i"]);
|
||||
});
|
||||
|
||||
function printResults(configuration)
|
||||
{
|
||||
print("----------------------------");
|
||||
print(configuration+" app built at path: "+FILE.join("Build", configuration, "GroupRowTest"));
|
||||
print("----------------------------");
|
||||
}
|
||||
Binary file not shown.
|
After Width: | Height: | Size: 1.8 KiB |
@@ -0,0 +1,104 @@
|
||||
<!DOCTYPE html
|
||||
PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
|
||||
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
|
||||
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
|
||||
<!--
|
||||
index-debug.html
|
||||
GroupRowTest
|
||||
|
||||
Created by You on August 27, 2010.
|
||||
Copyright 2010, Your Company All rights reserved.
|
||||
-->
|
||||
<head>
|
||||
<meta http-equiv="X-UA-Compatible" content="IE=EmulateIE7" />
|
||||
<meta http-equiv="X-UA-Compatible" content="chrome=1" />
|
||||
|
||||
<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>GroupRowTest</title>
|
||||
|
||||
<script type="text/javascript">
|
||||
OBJJ_MAIN_FILE = "main.j";
|
||||
OBJJ_INCLUDE_PATHS = ["Frameworks/Debug", "Frameworks", "SomethingElse"];
|
||||
</script>
|
||||
|
||||
<script src="Frameworks/Debug/Objective-J/Objective-J.js" type="text/javascript" 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);
|
||||
</script>
|
||||
|
||||
<style type="text/css">
|
||||
body{margin:0; padding:0;}
|
||||
#container {position: absolute; top:50%; left:50%;}
|
||||
#content {width:800px; text-align:center; margin-left: -400px; height:50px; margin-top:-25px; line-height: 50px;}
|
||||
#content {font-family: "Helvetica", "Arial", sans-serif; font-size: 18px; color: black; text-shadow: 0px 1px 0px white; }
|
||||
#loadgraphic {margin-right: 0.2em; margin-bottom:-2px;}
|
||||
</style>
|
||||
|
||||
<!--[if lt IE 7]>
|
||||
<STYLE type="text/css">
|
||||
#container { position: relative; top: 50%; }
|
||||
#content { position: relative;}
|
||||
</STYLE>
|
||||
<![endif]-->
|
||||
|
||||
</head>
|
||||
|
||||
<body style="">
|
||||
<div id="cappuccino-body">
|
||||
<div id="loadingcontainer" style="background-color: #eeeeee; overflow:hidden; width:100%; height:100%; position: absolute; top: 0; left: 0;">
|
||||
<script type="text/javascript">
|
||||
document.write("<div id='container'><p id='content'>" +
|
||||
"<img id='loadgraphic' width='16' height='16' src='Resources/spinner.gif' /> " +
|
||||
"Loading GroupRowTest...</p></div>");
|
||||
</script>
|
||||
|
||||
<noscript>
|
||||
<div id="container">
|
||||
<div style="width: 440px; padding: 10px 25px 20px 25px; font-family: sans-serif; background-color: #ffffff; position: relative; left: -245px; top: -120px; text-align: center; -moz-border-radius: 20px; -webkit-border-radius: 20px; color: #555555">
|
||||
<p style="line-height: 1.4em;">JavaScript is required for this site to work correctly but is either disabled or not supported by your browser.</p>
|
||||
<p style="font-size:120%; padding:10px;"><a href="http://cappuccino.org/noscript">Show me how to enable JavaScript</a></p>
|
||||
<p style="font-size:80%;">You may want to upgrade to a newer browser while you're at it:</p>
|
||||
<ul style="margin:0;padding:0; text-align: center; font-size:80%;" >
|
||||
<li style="display: inline;"><a href="http://www.apple.com/safari/download/">Safari</a></li>
|
||||
<li style="display: inline;"><a href="http://www.mozilla.com/en-US/firefox/">Firefox</a></li>
|
||||
<li style="display: inline;"><a href="http://www.google.com/chrome/">Chrome</a></li>
|
||||
<li style="display: inline;"><a href="http://www.opera.com/download/">Opera</a></li>
|
||||
<li style="display: inline;"><a href="http://www.microsoft.com/windows/downloads/ie/getitnow.mspx">Internet Explorer</a></li>
|
||||
</ul>
|
||||
</div>
|
||||
</div>
|
||||
</noscript>
|
||||
</div>
|
||||
</div>
|
||||
</body>
|
||||
|
||||
</html>
|
||||
@@ -0,0 +1,79 @@
|
||||
<!DOCTYPE html
|
||||
PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
|
||||
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
|
||||
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
|
||||
<!--
|
||||
index.html
|
||||
GroupRowTest
|
||||
|
||||
Created by You on August 27, 2010.
|
||||
Copyright 2010, Your Company All rights reserved.
|
||||
-->
|
||||
<head>
|
||||
<meta http-equiv="X-UA-Compatible" content="IE=EmulateIE7" />
|
||||
<meta http-equiv="X-UA-Compatible" content="chrome=1" />
|
||||
|
||||
<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>GroupRowTest</title>
|
||||
|
||||
<script type="text/javascript">
|
||||
OBJJ_MAIN_FILE = "main.j";
|
||||
</script>
|
||||
|
||||
<script type="text/javascript" src="Frameworks/Objective-J/Objective-J.js" charset="UTF-8"></script>
|
||||
|
||||
<style type="text/css">
|
||||
body{margin:0; padding:0;}
|
||||
#container {position: absolute; top:50%; left:50%;}
|
||||
#content {width:800px; text-align:center; margin-left: -400px; height:50px; margin-top:-25px; line-height: 50px;}
|
||||
#content {font-family: "Helvetica", "Arial", sans-serif; font-size: 18px; color: black; text-shadow: 0px 1px 0px white; }
|
||||
#loadgraphic {margin-right: 0.2em; margin-bottom:-2px;}
|
||||
</style>
|
||||
|
||||
<!--[if lt IE 7]>
|
||||
<STYLE type="text/css">
|
||||
#container { position: relative; top: 50%; }
|
||||
#content { position: relative;}
|
||||
</STYLE>
|
||||
<![endif]-->
|
||||
|
||||
</head>
|
||||
|
||||
<body style="">
|
||||
<div id="cappuccino-body">
|
||||
<div id="loadingcontainer" style="background-color: #eeeeee; overflow:hidden; width:100%; height:100%; position: absolute; top: 0; left: 0;">
|
||||
<script type="text/javascript">
|
||||
document.write("<div id='container'><p id='content'>" +
|
||||
"<img id='loadgraphic' width='16' height='16' src='Resources/spinner.gif' /> " +
|
||||
"Loading GroupRowTest...</p></div>");
|
||||
</script>
|
||||
|
||||
<noscript>
|
||||
<div id="container">
|
||||
<div style="width: 440px; padding: 10px 25px 20px 25px; font-family: sans-serif; background-color: #ffffff; position: relative; left: -245px; top: -120px; text-align: center; -moz-border-radius: 20px; -webkit-border-radius: 20px; color: #555555">
|
||||
<p style="line-height: 1.4em;">JavaScript is required for this site to work correctly but is either disabled or not supported by your browser.</p>
|
||||
<p style="font-size:120%; padding:10px;"><a href="http://cappuccino.org/noscript">Show me how to enable JavaScript</a></p>
|
||||
<p style="font-size:80%;">You may want to upgrade to a newer browser while you're at it:</p>
|
||||
<ul style="margin:0;padding:0; text-align: center; font-size:80%;" >
|
||||
<li style="display: inline;"><a href="http://www.apple.com/safari/download/">Safari</a></li>
|
||||
<li style="display: inline;"><a href="http://www.mozilla.com/en-US/firefox/">Firefox</a></li>
|
||||
<li style="display: inline;"><a href="http://www.google.com/chrome/">Chrome</a></li>
|
||||
<li style="display: inline;"><a href="http://www.opera.com/download/">Opera</a></li>
|
||||
<li style="display: inline;"><a href="http://www.microsoft.com/windows/downloads/ie/getitnow.mspx">Internet Explorer</a></li>
|
||||
</ul>
|
||||
</div>
|
||||
</div>
|
||||
</noscript>
|
||||
</div>
|
||||
</div>
|
||||
</body>
|
||||
|
||||
</html>
|
||||
|
||||
@@ -0,0 +1,18 @@
|
||||
/*
|
||||
* AppController.j
|
||||
* ScrollPerformanceTest
|
||||
*
|
||||
* Created by You on August 27, 2010.
|
||||
* Copyright 2010, Your Company All rights reserved.
|
||||
*/
|
||||
|
||||
@import <Foundation/Foundation.j>
|
||||
@import <AppKit/AppKit.j>
|
||||
|
||||
@import "AppController.j"
|
||||
|
||||
|
||||
function main(args, namedArgs)
|
||||
{
|
||||
CPApplicationMain(args, namedArgs);
|
||||
}
|
||||
@@ -6,9 +6,9 @@ var OS = require("os"),
|
||||
FILE = require("file"),
|
||||
OBJJ = require("objective-j");
|
||||
|
||||
var stream = require("term").stream;
|
||||
var stream = require("narwhal/term").stream;
|
||||
|
||||
var parser = new (require("args").Parser)();
|
||||
var parser = new (require("narwhal/args").Parser)();
|
||||
|
||||
parser.usage("DESTINATION_DIRECTORY");
|
||||
|
||||
@@ -63,7 +63,7 @@ parser.option("--list-frameworks", "listFrameworks")
|
||||
parser.helpful();
|
||||
|
||||
// FIXME: better way to do this:
|
||||
var CAPP_HOME = require("packages").catalog["cappuccino"].directory;
|
||||
var CAPP_HOME = require("narwhal/packages").catalog["cappuccino"].directory;
|
||||
var templatesDirectory = FILE.join(CAPP_HOME, "lib", "capp", "Resources", "Templates");
|
||||
|
||||
function gen(/*va_args*/)
|
||||
|
||||
@@ -33,7 +33,7 @@
|
||||
var FILE = require("file");
|
||||
var OS = require("os");
|
||||
|
||||
var parser = new (require("args").Parser)();
|
||||
var parser = new (require("narwhal/args").Parser)();
|
||||
|
||||
parser.usage("INPUT_FILE [OUTPUT_FILE]");
|
||||
|
||||
|
||||
+22
-12
@@ -1,8 +1,8 @@
|
||||
var SYSTEM = require("system");
|
||||
var FILE = require("file");
|
||||
var OS = require("os");
|
||||
var UTIL = require("util");
|
||||
var stream = require("term").stream;
|
||||
var UTIL = require("narwhal/util");
|
||||
var stream = require("narwhal/term").stream;
|
||||
|
||||
var requiresSudo = false;
|
||||
|
||||
@@ -15,7 +15,7 @@ function ensurePackageUpToDate(packageName, requiredVersion, options)
|
||||
{
|
||||
options = options || {};
|
||||
|
||||
var packageInfo = require("packages").catalog[packageName];
|
||||
var packageInfo = require("narwhal/packages").catalog[packageName];
|
||||
if (!packageInfo)
|
||||
{
|
||||
if (options.optional)
|
||||
@@ -39,7 +39,7 @@ function ensurePackageUpToDate(packageName, requiredVersion, options)
|
||||
|
||||
if (!options.noupdate)
|
||||
{
|
||||
print("Update? yes or no:");
|
||||
print("Update? Existing package will be overwritten. yes or no:");
|
||||
if (!SYSTEM.env["CAPP_AUTO_UPGRADE"] && system.stdin.readLine() !== "yes\n")
|
||||
{
|
||||
print("Jake aborted.");
|
||||
@@ -58,25 +58,35 @@ function ensurePackageUpToDate(packageName, requiredVersion, options)
|
||||
else
|
||||
OS.system(["tusk", "install", "--force", packageName]);
|
||||
}
|
||||
|
||||
|
||||
if (options.after)
|
||||
{
|
||||
options.after(packageInfo.directory);
|
||||
}
|
||||
|
||||
if (options.message)
|
||||
{
|
||||
print(options.message)
|
||||
print(options.message);
|
||||
OS.exit(1);
|
||||
}
|
||||
}
|
||||
|
||||
// UPDATE THESE TO PICK UP CORRESPONDING CHANGES IN DEPENDENCIES
|
||||
ensurePackageUpToDate("jake", "0.1.5");
|
||||
ensurePackageUpToDate("jake", "0.3");
|
||||
ensurePackageUpToDate("browserjs", "0.1.1");
|
||||
ensurePackageUpToDate("shrinksafe", "0.2");
|
||||
ensurePackageUpToDate("narwhal", "0.2.2", {
|
||||
ensurePackageUpToDate("narwhal", "0.3.1", {
|
||||
noupdate : true,
|
||||
message : "Update Narwhal to 0.2.1 by running bootstrap.sh, or pulling the latest from git (see: http://github.com/280north/narwhal)."
|
||||
message : "Update Narwhal by re-running bootstrap.sh, or pulling the latest from git (see: http://github.com/280north/narwhal)."
|
||||
});
|
||||
ensurePackageUpToDate("narwhal-jsc", "0.1.1", {
|
||||
ensurePackageUpToDate("narwhal-jsc", "0.3", {
|
||||
optional : true,
|
||||
message : "Rebuild narwhal-jsc by changing to the narwhal-jsc package directory and running \"make webkit\"."
|
||||
after : function(dir) {
|
||||
if (OS.system("cd " + OS.enquote(dir) + " && make webkit")) {
|
||||
print("Problem building narwhal-jsc.");
|
||||
OS.exit(1);
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
var JAKE = require("jake");
|
||||
@@ -163,7 +173,7 @@ function additionalPackages()
|
||||
// checks to see if a path is in the package catalog
|
||||
function packageInCatalog(path)
|
||||
{
|
||||
var catalog = require("packages").catalog;
|
||||
var catalog = require("narwhal/packages").catalog;
|
||||
for (var name in catalog)
|
||||
if (String(catalog[name].directory) === String(path))
|
||||
return true;
|
||||
|
||||
Reference in new issue
Block a user