mirror of
https://github.com/cappuccino/cappuccino.git
synced 2026-09-07 11:17:12 +00:00
Merge branch 'jake' of github.com:280north/cappuccino into jake
This commit is contained in:
@@ -459,7 +459,10 @@ CPRunContinuesResponse = -1002;
|
||||
|
||||
// Check if this is a candidate for key equivalent...
|
||||
if ([anEvent _couldBeKeyEquivalent] && [self _handleKeyEquivalent:anEvent])
|
||||
{
|
||||
[[[anEvent window] platformWindow] _propagateCurrentDOMEvent:NO];
|
||||
return;
|
||||
}
|
||||
|
||||
if (_eventListeners.length)
|
||||
{
|
||||
|
||||
@@ -978,7 +978,8 @@ var secureStringForString = function(aString)
|
||||
// This is true for when aString === "" and null/undefined.
|
||||
if (!aString)
|
||||
return "";
|
||||
return Array(aString.length).join(CPSecureTextFieldCharacter);
|
||||
|
||||
return Array(aString.length+1).join(CPSecureTextFieldCharacter);
|
||||
}
|
||||
|
||||
|
||||
|
||||
@@ -448,14 +448,16 @@ var supportsNativeDragAndDrop = [CPPlatform supportsDragAndDrop];
|
||||
KeyCodesToPrevent[aDOMEvent.keyCode];
|
||||
|
||||
var isNativePasteEvent = NO,
|
||||
isNativeCopyOrCutEvent = NO;
|
||||
isNativeCopyOrCutEvent = NO,
|
||||
overrideCharacters = nil;
|
||||
|
||||
switch (aDOMEvent.type)
|
||||
{
|
||||
case "keydown": // Grab and store the keycode now since it is correct and consistent at this point.
|
||||
_keyCode = aDOMEvent.keyCode;
|
||||
|
||||
|
||||
var characters = String.fromCharCode(_keyCode).toLowerCase();
|
||||
overrideCharacters = modifierFlags & CPShiftKeyMask ? characters.toUpperCase() : characters;
|
||||
|
||||
// If this could be a native PASTE event, then we need to further examine it before
|
||||
// sending a CPEvent. Select our element to see if anything gets pasted in it.
|
||||
@@ -474,7 +476,7 @@ var supportsNativeDragAndDrop = [CPPlatform supportsDragAndDrop];
|
||||
// can capture our internal Cappuccino pasteboard.
|
||||
else if ((characters == "c" || characters == "x") && (modifierFlags & CPPlatformActionKeyMask))
|
||||
isNativeCopyOrCutEvent = YES;
|
||||
|
||||
|
||||
// Also, certain browsers (IE and Safari), have broken keyboard supportwhere they don't send keypresses for certain events.
|
||||
// So, allow the keypress event to handle the event if we are not a browser with broken (remedial) key support...
|
||||
else if (!CPFeatureIsCompatible(CPJavascriptRemedialKeySupport))
|
||||
@@ -487,6 +489,7 @@ var supportsNativeDragAndDrop = [CPPlatform supportsDragAndDrop];
|
||||
// If this is in fact our broke state, continue to keypress and send the keydown.
|
||||
case "keypress": // If the source of this event is our pasteboard element, then simply let it continue
|
||||
// as normal, so that the paste event can successfully complete.
|
||||
|
||||
if ((aDOMEvent.target || aDOMEvent.srcElement) == _DOMPasteboardElement)
|
||||
return;
|
||||
|
||||
@@ -495,20 +498,22 @@ var supportsNativeDragAndDrop = [CPPlatform supportsDragAndDrop];
|
||||
isARepeat = (_charCodes[keyCode] != nil);
|
||||
|
||||
_charCodes[keyCode] = charCode;
|
||||
|
||||
var characters = String.fromCharCode(charCode),
|
||||
|
||||
var characters = overrideCharacters || String.fromCharCode(charCode),
|
||||
charactersIgnoringModifiers = characters.toLowerCase();
|
||||
|
||||
|
||||
// Safari won't send proper capitalization during cmd-key events
|
||||
if (!overrideCharacters && (modifierFlags & CPCommandKeyMask) && (modifierFlags & CPShiftKeyMask))
|
||||
characters = characters.toUpperCase();
|
||||
|
||||
event = [CPEvent keyEventWithType:CPKeyDown location:location modifierFlags:modifierFlags
|
||||
timestamp:timestamp windowNumber:windowNumber context:nil
|
||||
characters:characters charactersIgnoringModifiers:charactersIgnoringModifiers isARepeat:isARepeat keyCode:keyCode];
|
||||
|
||||
|
||||
if (isNativePasteEvent)
|
||||
{
|
||||
_pasteboardKeyDownEvent = event;
|
||||
|
||||
window.setNativeTimeout(function () { [self _checkPasteboardElement] }, 0);
|
||||
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
@@ -168,7 +168,7 @@ var _sprintf_justify = function(sign, prefix, string, suffix, width, leftJustify
|
||||
|
||||
var _sprintf_pad = function(n, ch)
|
||||
{
|
||||
return Array(MAX(0,n)).join(ch);
|
||||
return Array(MAX(0,n)+1).join(ch);
|
||||
}
|
||||
|
||||
// Base64 encoding and decoding
|
||||
|
||||
@@ -38,11 +38,16 @@ instead download a pre-compiled copy of Cappuccino from:
|
||||
|
||||
http://cappuccino.org/download/
|
||||
|
||||
To build Cappuccino from source, simply type "rake" from within the root of the Cappuccino directory.
|
||||
This will build a "release" copy of the frameworks. Typing "rake debug" will build a debug version.
|
||||
"rake install" will build Cappuccino and associated tools and install them for general use (similar to
|
||||
To build Cappuccino from source, simply type "jake" from within the root of the Cappuccino directory.
|
||||
This will build a "release" copy of the frameworks. Typing "jake debug" will build a debug version.
|
||||
"jake install" will build Cappuccino and associated tools and install them for general use (similar to
|
||||
downloading the tools from the website).
|
||||
|
||||
If this is your first build and your system does not have jake installed, run the bootstrap script to
|
||||
install it and all of its dependencies:
|
||||
|
||||
$ sudo ./bootstrap.sh
|
||||
|
||||
Getting Help
|
||||
------------
|
||||
If you need help with Cappuccino, you can get help from the following sources:
|
||||
|
||||
+24
@@ -1,4 +1,28 @@
|
||||
|
||||
function ensurePackageUpToDate(packageName, requiredVersion)
|
||||
{
|
||||
var version = require("packages").catalog[packageName].version;
|
||||
|
||||
if (version && require("util").compare(version.split("."), requiredVersion.split(".")) !== -1)
|
||||
return;
|
||||
|
||||
print("Your copy of " + packageName + " is out of date (version " + version + "). Update? yes or no:");
|
||||
|
||||
var response = system.stdin.readLine();
|
||||
|
||||
if (response !== "yes\n")
|
||||
{
|
||||
print("Jake aborted.");
|
||||
require("os").exit(1);
|
||||
}
|
||||
|
||||
require("os").system("NARWHAL_ENGINE_HOME='' NARWHAL_ENGINE=rhino tusk install --force " + packageName);
|
||||
}
|
||||
|
||||
// UPDATE THESE TO PICK UP CORRESPONDING CHANGES IN DEPENDENCIES
|
||||
ensurePackageUpToDate("jake", "0.1.1");
|
||||
ensurePackageUpToDate("browserjs", "0.1");
|
||||
|
||||
var Jake = require("jake");
|
||||
|
||||
global.ENV = require("system").env;
|
||||
|
||||
Reference in New Issue
Block a user