mirror of
https://github.com/cappuccino/cappuccino.git
synced 2026-09-10 12:47:13 +00:00
Compare commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
bce83e45b5 | ||
|
|
77bd8d3a76 | ||
|
|
118ece9f1c | ||
|
|
971956a6ba | ||
|
|
48cd362015 | ||
|
|
b12b1bf662 | ||
|
|
6829d502d7 |
+27
-11
@@ -275,15 +275,15 @@ CPRunContinuesResponse = -1002;
|
||||
postNotificationName:CPApplicationWillFinishLaunchingNotification
|
||||
object:self];
|
||||
|
||||
var filename = window.cpOpeningFilename && window.cpOpeningFilename(),
|
||||
needsUntitled = !!_documentController;
|
||||
var needsUntitled = !!_documentController,
|
||||
URLStrings = window.cpOpeningURLStrings && window.cpOpeningURLStrings(),
|
||||
index = 0,
|
||||
count = [URLStrings count];
|
||||
|
||||
if ([filename length])
|
||||
{
|
||||
needsUntitled = ![self _openFile:filename];
|
||||
}
|
||||
for (; index < count; ++index)
|
||||
needsUntitled = ![self _openURL:[CPURL URLWithString:URLStrings[index]]] || needsUntitled;
|
||||
|
||||
if (needsUntitled && [_delegate respondsToSelector: @selector(applicationShouldOpenUntitledFile:)])
|
||||
if (needsUntitled && [_delegate respondsToSelector:@selector(applicationShouldOpenUntitledFile:)])
|
||||
needsUntitled = [_delegate applicationShouldOpenUntitledFile:self];
|
||||
|
||||
if (needsUntitled)
|
||||
@@ -333,6 +333,11 @@ CPRunContinuesResponse = -1002;
|
||||
[CPPlatform activateIgnoringOtherApps:shouldIgnoreOtherApps];
|
||||
}
|
||||
|
||||
- (void)hideOtherApplications:(id)aSender
|
||||
{
|
||||
[CPPlatform hideOtherApplications:self];
|
||||
}
|
||||
|
||||
/*!
|
||||
Calls \c -finishLaunching method which results in starting
|
||||
the main event loop.
|
||||
@@ -515,6 +520,11 @@ CPRunContinuesResponse = -1002;
|
||||
return _windows;
|
||||
}
|
||||
|
||||
- (void)hide:(id)aSender
|
||||
{
|
||||
[CPPlatform hide:self];
|
||||
}
|
||||
|
||||
// Accessing the Main Menu
|
||||
/*!
|
||||
Returns the application's main menu
|
||||
@@ -834,12 +844,18 @@ CPRunContinuesResponse = -1002;
|
||||
return _namedArgs;
|
||||
}
|
||||
|
||||
- (BOOL)_openFile:(CPString)aFilename
|
||||
- (BOOL)_openURL:(CPURL)aURL
|
||||
{
|
||||
if (_delegate && [_delegate respondsToSelector:@selector(application:openFile:)])
|
||||
return [_delegate application:self openFile:aFilename];
|
||||
else
|
||||
return [_documentController openDocumentWithContentsOfURL:aFilename display:YES error:NULL];
|
||||
{
|
||||
CPLog.warn("application:openFile: is deprecated, use application:openURL: instead.");
|
||||
return [_delegate application:self openFile:[aURL absoluteString]];
|
||||
}
|
||||
|
||||
if (_delegate && [_delegate respondsToSelector:@selector(application:openURL:)])
|
||||
return [_delegate application:self openURL:aURL];
|
||||
|
||||
return !![_documentController openDocumentWithContentsOfURL:aURL display:YES error:NULL];
|
||||
}
|
||||
|
||||
- (void)_didResignActive
|
||||
|
||||
@@ -146,6 +146,8 @@ var CPSharedDocumentController = nil;
|
||||
|
||||
result = [self makeDocumentWithContentsOfURL:anAbsoluteURL ofType:type delegate:self didReadSelector:@selector(document:didRead:contextInfo:) contextInfo:[CPDictionary dictionaryWithObject:shouldDisplay forKey:@"shouldDisplay"]];
|
||||
|
||||
[self addDocument:result];
|
||||
|
||||
if (result)
|
||||
[self noteNewRecentDocument:result];
|
||||
}
|
||||
@@ -207,7 +209,6 @@ var CPSharedDocumentController = nil;
|
||||
if (!didRead)
|
||||
return;
|
||||
|
||||
[self addDocument:aDocument];
|
||||
[aDocument makeWindowControllers];
|
||||
|
||||
if ([aContextInfo objectForKey:@"shouldDisplay"])
|
||||
|
||||
@@ -53,4 +53,20 @@
|
||||
#endif
|
||||
}
|
||||
|
||||
+ (void)hideOtherApplications:(id)aSender
|
||||
{
|
||||
#if PLATFORM(DOM)
|
||||
if (typeof window["cpHideOtherApplications"] === "function")
|
||||
window.cpHideOtherApplications();
|
||||
#endif
|
||||
}
|
||||
|
||||
+ (void)hide:(id)aSender
|
||||
{
|
||||
#if PLATFORM(DOM)
|
||||
if (typeof window["cpHide"] === "function")
|
||||
window.cpHide();
|
||||
#endif
|
||||
}
|
||||
|
||||
@end
|
||||
|
||||
@@ -1,15 +1,17 @@
|
||||
var file = require("file"),
|
||||
objj = require("objective-j"),
|
||||
CPPropertyListCreateData = objj.CPPropertyListCreateData,
|
||||
kCFPropertyListXMLFormat_v1_0 = objj.kCFPropertyListXMLFormat_v1_0;
|
||||
var FILE = require("file"),
|
||||
OBJJ = require("objective-j"),
|
||||
CPPropertyListCreateData = OBJJ.CPPropertyListCreateData,
|
||||
kCFPropertyListXMLFormat_v1_0 = OBJJ.kCFPropertyListXMLFormat_v1_0;
|
||||
|
||||
exports.readPlist = function(path) {
|
||||
var plistData = new objj.objj_data();
|
||||
plistData.string = file.read(path);
|
||||
return objj.CPPropertyListCreateFromData(plistData);
|
||||
exports.readPlist = function(aPath)
|
||||
{
|
||||
var plistData = new OBJJ.objj_data();
|
||||
plistData.string = FILE.read(aPath, { charset:"UTF-8" });
|
||||
return OBJJ.CPPropertyListCreateFromData(plistData);
|
||||
}
|
||||
|
||||
exports.writePlist = function(path, plist, format) {
|
||||
format = format || objj.kCFPropertyListXMLFormat_v1_0;
|
||||
file.write(path, objj.CPPropertyListCreateData(plist, format).string);
|
||||
exports.writePlist = function(aPath, plist, format)
|
||||
{
|
||||
format = format || OBJJ.kCFPropertyListXMLFormat_v1_0;
|
||||
FILE.write(aPath, OBJJ.CPPropertyListCreateData(plist, format).string, { charset:"UTF-8" });
|
||||
}
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
|
||||
@import "Configuration.j"
|
||||
|
||||
var OS = require("OS"),
|
||||
var OS = require("os"),
|
||||
SYSTEM = require("system"),
|
||||
FILE = require("file"),
|
||||
OBJJ = require("objective-j");
|
||||
|
||||
+11
-7
@@ -15,6 +15,10 @@ function prompt () {
|
||||
done
|
||||
}
|
||||
|
||||
function which () {
|
||||
echo "$PATH" | tr ":" "\n" | while read line; do [ -f "$line/$1" ] && return 0; done
|
||||
}
|
||||
|
||||
function path_instructions () {
|
||||
echo "Add \"$INSTALL_DIRECTORY/bin\" to your PATH environment variable in your shell configuration file (e.x. .profile, .bashrc, .bash_profile)."
|
||||
echo "For example:"
|
||||
@@ -26,20 +30,20 @@ INSTALL_DIRECTORY="/usr/local/narwhal"
|
||||
|
||||
ORIGINAL_PATH="$PATH"
|
||||
|
||||
if ! which -s "narwhal"; then
|
||||
if ! which "narwhal"; then
|
||||
echo "================================================================================"
|
||||
echo "Narwhal JavaScript platform is required. Install it into \"$INSTALL_DIRECTORY\"?"
|
||||
if prompt; then
|
||||
echo "Downloading Narwhal..."
|
||||
curl -L -o "$TEMPZIP" "http://github.com/tlrobinson/narwhal/zipball/master"
|
||||
curl -L -o "$TEMPZIP" "http://github.com/280north/narwhal/zipball/master"
|
||||
echo "Installing Narwhal..."
|
||||
unzip "$TEMPZIP" -d "$INSTALL_DIRECTORY"
|
||||
rm "$TEMPZIP"
|
||||
|
||||
mv $INSTALL_DIRECTORY/tlrobinson-narwhal-*/* $INSTALL_DIRECTORY/.
|
||||
rm -rf $INSTALL_DIRECTORY/tlrobinson-narwhal-*
|
||||
mv $INSTALL_DIRECTORY/280north-narwhal-*/* $INSTALL_DIRECTORY/.
|
||||
rm -rf $INSTALL_DIRECTORY/280north-narwhal-*
|
||||
|
||||
if ! which -s "narwhal"; then
|
||||
if ! which "narwhal"; then
|
||||
export PATH="$INSTALL_DIRECTORY/bin:$PATH"
|
||||
fi
|
||||
else
|
||||
@@ -48,7 +52,7 @@ if ! which -s "narwhal"; then
|
||||
fi
|
||||
fi
|
||||
|
||||
if ! which -s "narwhal"; then
|
||||
if ! which "narwhal"; then
|
||||
echo "Error: problem installing Narwhal"
|
||||
exit 1
|
||||
fi
|
||||
@@ -77,7 +81,7 @@ if [ `uname` = "Darwin" ]; then
|
||||
fi
|
||||
|
||||
export PATH="$ORIGINAL_PATH"
|
||||
if ! which -s "narwhal"; then
|
||||
if ! which "narwhal"; then
|
||||
|
||||
SHELL_CONFIG=""
|
||||
if [ -f "$HOME/.profile" ]; then
|
||||
|
||||
Reference in New Issue
Block a user