mirror of
https://github.com/cappuccino/cappuccino.git
synced 2026-11-18 12:39:22 +00:00
Merge branch 'master' into URL
This commit is contained in:
commit
4634c6cf3b
13 files changed
+72
-39
No files matched your search
@@ -78,7 +78,9 @@
|
||||
@import "CPTextField.j"
|
||||
@import "CPToolbar.j"
|
||||
@import "CPToolbarItem.j"
|
||||
@import "CPTreeNode.j"
|
||||
@import "CPView.j"
|
||||
@import "CPViewAnimation.j"
|
||||
@import "CPViewController.j"
|
||||
@import "CPWebView.j"
|
||||
@import "CPWindow.j"
|
||||
|
||||
+21
-3
@@ -229,6 +229,19 @@
|
||||
if (shouldShowHorizontalScroller)
|
||||
contentFrame.size.height -= horizontalScrollerHeight;
|
||||
|
||||
var _window = [self window],
|
||||
forceCornerSpace = NO;
|
||||
|
||||
if (_window && [_window contentView])
|
||||
{
|
||||
var windowIsResizable = !!(([_window styleMask] & CPResizableWindowMask) || ([_window styleMask] & CPBorderlessBridgeWindowMask)),
|
||||
relativeFrame = [self convertRect:[[_window contentView] frame] fromView:nil],
|
||||
maxPoint = CGPointMake(CGRectGetMaxX([self bounds]), CGRectGetMaxY([self bounds])),
|
||||
isInWindowCorner = CGRectGetMaxX(relativeFrame) >= maxPoint.x && CGRectGetMaxY(relativeFrame) >= maxPoint.y;
|
||||
|
||||
forceCornerSpace = windowIsResizable && isInWindowCorner;
|
||||
}
|
||||
|
||||
var scrollPoint = [_contentView bounds].origin,
|
||||
wasShowingVerticalScroller = ![_verticalScroller isHidden],
|
||||
wasShowingHorizontalScroller = ![_horizontalScroller isHidden];
|
||||
@@ -238,7 +251,7 @@
|
||||
var verticalScrollerY = MAX(_CGRectGetHeight([self _cornerViewFrame]), headerClipViewHeight),
|
||||
verticalScrollerHeight = _CGRectGetHeight([self bounds]) - verticalScrollerY;
|
||||
|
||||
if (shouldShowHorizontalScroller)
|
||||
if (forceCornerSpace || shouldShowHorizontalScroller)
|
||||
verticalScrollerHeight -= horizontalScrollerHeight;
|
||||
|
||||
[_verticalScroller setFloatValue:(difference.height <= 0.0) ? 0.0 : scrollPoint.y / difference.height];
|
||||
@@ -255,7 +268,7 @@
|
||||
{
|
||||
[_horizontalScroller setFloatValue:(difference.width <= 0.0) ? 0.0 : scrollPoint.x / difference.width];
|
||||
[_horizontalScroller setKnobProportion:_CGRectGetWidth(contentFrame) / _CGRectGetWidth(documentFrame)];
|
||||
[_horizontalScroller setFrame:_CGRectMake(0.0, _CGRectGetMaxY(contentFrame), _CGRectGetWidth(contentFrame), horizontalScrollerHeight)];
|
||||
[_horizontalScroller setFrame:_CGRectMake(0.0, _CGRectGetMaxY(contentFrame), _CGRectGetWidth(contentFrame) - ((!shouldShowVerticalScroller && forceCornerSpace) ? verticalScrollerWidth : 0), horizontalScrollerHeight)];
|
||||
}
|
||||
else if (wasShowingHorizontalScroller)
|
||||
{
|
||||
@@ -720,6 +733,11 @@
|
||||
[_headerClipView scrollToPoint:CGPointMake(contentBounds.origin, 0)];
|
||||
}
|
||||
|
||||
- (void)viewDidMoveToWindow
|
||||
{
|
||||
[self reflectScrolledClipView:_contentView];
|
||||
}
|
||||
|
||||
@end
|
||||
|
||||
var CPScrollViewContentViewKey = "CPScrollViewContentView",
|
||||
@@ -788,4 +806,4 @@ var CPScrollViewContentViewKey = "CPScrollViewContentView",
|
||||
[aCoder encodeObject:_cornerView forKey:CPScrollViewCornerViewKey];
|
||||
}
|
||||
|
||||
@end
|
||||
@end
|
||||
@@ -1799,13 +1799,13 @@ CPTexturedBackgroundWindowMask
|
||||
*/
|
||||
- (void)makeMainWindow
|
||||
{
|
||||
if (![self canBecomeMainWindow])
|
||||
if (CPApp._mainWindow === self || ![self canBecomeMainWindow])
|
||||
return;
|
||||
|
||||
[CPApp._mainWindow resignMainWindow];
|
||||
|
||||
|
||||
CPApp._mainWindow = self;
|
||||
|
||||
|
||||
[self becomeMainWindow];
|
||||
}
|
||||
|
||||
|
||||
+1
-1
@@ -60,7 +60,7 @@ var CPCibObjectDataKey = @"CPCibObjectDataKey";
|
||||
|
||||
if (self)
|
||||
{
|
||||
_data = [CPURLConnection sendSynchronousRequest:[CPURLRequest requestWithURL:aURL] returningResponse:nil error:nil];
|
||||
_data = [CPURLConnection sendSynchronousRequest:[CPURLRequest requestWithURL:aURL] returningResponse:nil];
|
||||
_awakenCustomResources = YES;
|
||||
}
|
||||
|
||||
|
||||
+32
-21
@@ -7,6 +7,7 @@ require("narwhal").ensureEngine("rhino");
|
||||
@import "../lib/cappuccino/objj-analysis-tools.j"
|
||||
|
||||
var FILE = require("file");
|
||||
var OS = require("os");
|
||||
|
||||
var stream = require("term").stream;
|
||||
var parser = new (require("args").Parser)();
|
||||
@@ -25,9 +26,14 @@ parser.option("-F", "--framework", "frameworks")
|
||||
.help("Add a frameworks directory, relative to INPUT_PROJECT (default: ['Frameworks'])");
|
||||
|
||||
parser.option("-f", "--force", "force")
|
||||
.def(false)
|
||||
.set(true)
|
||||
.help("Force overwriting OUTPUT_PROJECT if it exists");
|
||||
.def(false)
|
||||
.set(true)
|
||||
.help("Force overwriting OUTPUT_PROJECT if it exists");
|
||||
|
||||
parser.option("--index", "index")
|
||||
.def("index.html")
|
||||
.set()
|
||||
.help("The root HTML file to modify (default: index.html)");
|
||||
|
||||
parser.option("-v", "--verbose", "verbose")
|
||||
.def(false)
|
||||
@@ -54,7 +60,7 @@ function main(args)
|
||||
//outputPath.rmtree();
|
||||
OS.system(["rm", "-rf", outputPath]);
|
||||
} else {
|
||||
CPLog.error("OUTPUT_PROJECT " + outputPath + " exists. Use -f to overwrite.");
|
||||
stream.print("\0red(OUTPUT_PROJECT " + outputPath + " exists. Use -f to overwrite.\0)");
|
||||
OS.exit(1);
|
||||
}
|
||||
}
|
||||
@@ -98,8 +104,7 @@ function main(args)
|
||||
|
||||
outputPath.join("Application.js").write(applicationJS);
|
||||
|
||||
rewriteMainHTML(outputPath.join("index.html"));
|
||||
rewriteMainHTML(outputPath.join("index-debug.html"));
|
||||
rewriteMainHTML(outputPath.join(options.index));
|
||||
}
|
||||
|
||||
// ObjectiveJFlattener inherits from ObjectiveJRuntimeAnalyzer
|
||||
@@ -211,24 +216,30 @@ ObjectiveJFlattener.prototype.serializeStaticResources = function(node, depth) {
|
||||
this.resourceBuffer.push("currentNode = nodeStack.pop();");
|
||||
}
|
||||
|
||||
// "$1" is the matching indentation
|
||||
var scriptTagsBefore = '$1<script type = "text/javascript">\n$1 OBJJ_AUTO_BOOTSTRAP = false;\n$1</script>';
|
||||
var scriptTagsAfter = '$1<script type = "text/javascript" src = "Application.js"></script>';
|
||||
|
||||
function rewriteMainHTML(indexHTMLPath) {
|
||||
var indexHTML = indexHTMLPath.read();
|
||||
if (indexHTMLPath.isFile()) {
|
||||
var indexHTML = indexHTMLPath.read();
|
||||
|
||||
// "$1" is the matching indentation
|
||||
var scriptTagsBefore = '$1<script type = "text/javascript">\n$1 OBJJ_AUTO_BOOTSTRAP = false;\n$1</script>';
|
||||
var scriptTagsAfter = '$1<script type = "text/javascript" src = "Application.js"></script>';
|
||||
// attempt to find Objective-J script tag and add ours
|
||||
var newIndexHTML = indexHTML.replace(/([ \t]+)<script[^>]+Objective-J\.js[^>]+>(?:\s*<\/script>)?/,
|
||||
scriptTagsBefore+'\n$&\n'+scriptTagsAfter);
|
||||
|
||||
// attempt to find Objective-J script tag and add ours
|
||||
var newIndexHTML = indexHTML.replace(/([ \t]+)<script[^>]+Objective-J\.js[^>]+>(?:\s*<\/script>)?/,
|
||||
scriptTagsBefore+'\n$&\n'+scriptTagsAfter);
|
||||
|
||||
if (newIndexHTML === indexHTML) {
|
||||
stream.print("\0yellow(Warning: Unable to automatically modify "+indexHTMLPath + "\0)");
|
||||
stream.print("\nAdd the following before the Objective-J script tag:");
|
||||
stream.print(scriptTagsBefore.replace(/\$1/g, " "));
|
||||
stream.print("\nAdd the following after the Objective-J script tag:");
|
||||
stream.print(scriptTagsAfter.replace(/\$1/g, " "));
|
||||
if (newIndexHTML !== indexHTML) {
|
||||
stream.print("\0green(Modified: "+indexHTMLPath+".\0)");
|
||||
indexHTMLPath.write(newIndexHTML);
|
||||
return;
|
||||
}
|
||||
} else {
|
||||
indexHTMLPath.write(newIndexHTML);
|
||||
stream.print("\0yellow(Warning: "+indexHTMLPath+" does not exist. Specify an alternate index HTML file with the --index option.\0)");
|
||||
}
|
||||
|
||||
stream.print("\0yellow(Warning: Unable to automatically modify "+indexHTMLPath + ".\0)");
|
||||
stream.print("\nAdd the following before the Objective-J script tag:");
|
||||
stream.print(scriptTagsBefore.replace(/\$1/g, " "));
|
||||
stream.print("\nAdd the following after the Objective-J script tag:");
|
||||
stream.print(scriptTagsAfter.replace(/\$1/g, " "));
|
||||
}
|
||||
+1
-1
@@ -64,7 +64,7 @@ function main(args)
|
||||
//outputPath.rmtree();
|
||||
OS.system(["rm", "-rf", outputPath]);
|
||||
} else {
|
||||
CPLog.error("OUTPUT_PROJECT " + outputPath + " exists. Use -f to overwrite.");
|
||||
stream.print("\0red(OUTPUT_PROJECT " + outputPath + " exists. Use -f to overwrite.\0)");
|
||||
OS.exit(1);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -100,7 +100,7 @@ CPWebDAVManagerNonCollectionResourceType = 0;
|
||||
[request setHTTPBody:HTTPBody.join("")];
|
||||
|
||||
if (!aBlock)
|
||||
return parsePROPFINDResponse([[CPURLConnection sendSynchronousRequest:request returningResponse:nil error:nil] rawString]);
|
||||
return parsePROPFINDResponse([[CPURLConnection sendSynchronousRequest:request returningResponse:nil] rawString]);
|
||||
|
||||
else
|
||||
{
|
||||
|
||||
@@ -187,8 +187,8 @@ if (!this.JSON) {
|
||||
};
|
||||
}
|
||||
|
||||
var cx = new RegExp('/[\\u0000\\u00ad\\u0600-\\u0604\\u070f\\u17b4\\u17b5\\u200c-\\u200f\\u2028-\\u202f\\u2060-\\u206f\\ufeff\\ufff0-\\uffff]/g');
|
||||
var escapable = new RegExp('/[\\\\\\"\\x00-\\x1f\\x7f-\\x9f\\u00ad\\u0600-\\u0604\\u070f\\u17b4\\u17b5\\u200c-\\u200f\\u2028-\\u202f\\u2060-\\u206f\\ufeff\\ufff0-\\uffff]/g');
|
||||
var cx = new RegExp('[\\u0000\\u00ad\\u0600-\\u0604\\u070f\\u17b4\\u17b5\\u200c-\\u200f\\u2028-\\u202f\\u2060-\\u206f\\ufeff\\ufff0-\\uffff]', "g");
|
||||
var escapable = new RegExp('[\\\\\\"\\x00-\\x1f\\x7f-\\x9f\\u00ad\\u0600-\\u0604\\u070f\\u17b4\\u17b5\\u200c-\\u200f\\u2028-\\u202f\\u2060-\\u206f\\ufeff\\ufff0-\\uffff]', "g");
|
||||
|
||||
var gap,
|
||||
indent,
|
||||
|
||||
@@ -608,7 +608,7 @@ FILE_PATTERNS = *.c *.cc *.cxx *.cpp *.c++ *.java *.ii *.ixx *.ipp *.i+
|
||||
# should be searched for input files as well. Possible values are YES and NO.
|
||||
# If left blank NO is used.
|
||||
|
||||
RECURSIVE = NO
|
||||
RECURSIVE = YES
|
||||
|
||||
# The EXCLUDE tag can be used to specify files and/or directories that should
|
||||
# excluded from the INPUT source files. This way you can easily exclude a
|
||||
|
||||
@@ -41,7 +41,7 @@ parser.option("--build", "useCappBuild")
|
||||
.help("Uses frameworks in the $CAPP_BUILD.");
|
||||
|
||||
parser.option("-l")
|
||||
.action(function(o) { o.symlink = o.shouldUseCappBuild = true; })
|
||||
.action(function(o) { o.symlink = o.useCappBuild = true; })
|
||||
.help("Enables both the --symlink and --build options.");
|
||||
|
||||
parser.option("--force", "force")
|
||||
@@ -174,8 +174,10 @@ function gen(/*va_args*/)
|
||||
|
||||
createFrameworksInFile(frameworks, frameworkDestination, options.symlink, options.useCappBuild);
|
||||
}
|
||||
else
|
||||
else {
|
||||
stream.print("Directory already exists");
|
||||
OS.exit(1);
|
||||
}
|
||||
}
|
||||
|
||||
function createFrameworksInFile(/*Array*/ frameworks, /*String*/ aFile, /*Boolean*/ symlink, /*Boolean*/ build, /*Boolean*/ force)
|
||||
|
||||
@@ -76,6 +76,6 @@ task ("run-release", ["release"], function()
|
||||
task ("deploy", ["release"], function()
|
||||
{
|
||||
FILE.mkdirs(FILE.join("Build", "Deployment", "__project.nameasidentifier__"));
|
||||
OS.system(["press", "-f", FILE.join("Build", "Release", "__project.nameasidentifier__), FILE.join("Build", "Deployment", __project.nameasidentifier__)]);
|
||||
OS.system(["press", "-f", FILE.join("Build", "Release", "__project.nameasidentifier__"), FILE.join("Build", "Deployment", "__project.nameasidentifier__")]);
|
||||
printResults("Deployment")
|
||||
});
|
||||
@@ -77,6 +77,6 @@ task ("run-release", ["release"], function()
|
||||
task ("deploy", ["release"], function()
|
||||
{
|
||||
FILE.mkdirs(FILE.join("Build", "Deployment", "__project.nameasidentifier__"));
|
||||
OS.system(["press", "-f", FILE.join("Build", "Release", "__project.nameasidentifier__), FILE.join("Build", "Deployment", __project.nameasidentifier__)]);
|
||||
OS.system(["press", "-f", FILE.join("Build", "Release", "__project.nameasidentifier__"), FILE.join("Build", "Deployment", "__project.nameasidentifier__")]);
|
||||
printResults("Deployment")
|
||||
});
|
||||
+2
-2
@@ -48,7 +48,7 @@ function ensurePackageUpToDate(packageName, requiredVersion, options)
|
||||
}
|
||||
|
||||
// UPDATE THESE TO PICK UP CORRESPONDING CHANGES IN DEPENDENCIES
|
||||
ensurePackageUpToDate("jake", "0.1.2");
|
||||
ensurePackageUpToDate("jake", "0.1.3");
|
||||
ensurePackageUpToDate("browserjs", "0.1.1");
|
||||
ensurePackageUpToDate("shrinksafe", "0.2");
|
||||
ensurePackageUpToDate("narwhal", "0.2.1", {
|
||||
@@ -162,7 +162,7 @@ serializedENV = function()
|
||||
// pseudo-HACK: add NARWHALOPT with packages we should ensure are loaded
|
||||
var packages = additionalPackages();
|
||||
if (packages.length) {
|
||||
envNew["NARWHALOPT"] = packages.map(function(p) { return "-p " + p; }).join(" ");
|
||||
envNew["NARWHALOPT"] = packages.map(function(p) { return "-p " + OS.enquote(p); }).join(" ");
|
||||
envNew["PATH"] = packages.map(function(p) { return FILE.join(p, "bin"); }).concat(SYSTEM.env["PATH"]).join(":");
|
||||
}
|
||||
|
||||
|
||||
Reference in new issue
Block a user