mirror of
https://github.com/cappuccino/cappuccino.git
synced 2026-09-03 17:33:41 +00:00
Merge branch 'jake' of github.com:280north/cappuccino into jake
This commit is contained in:
+66
-2
@@ -30,6 +30,10 @@
|
||||
@implementation CPFlashView : CPView
|
||||
{
|
||||
CPFlashMovie _flashMovie;
|
||||
CPDictionary _flashVars;
|
||||
|
||||
CPDictionary _params;
|
||||
CPDictionary _paramElements;
|
||||
|
||||
DOMElement _DOMEmbedElement;
|
||||
DOMElement _DOMMParamElement;
|
||||
@@ -61,12 +65,12 @@
|
||||
_DOMObjectElement.appendChild(param);
|
||||
|
||||
_DOMEmbedElement = document.createElement("embed");
|
||||
|
||||
|
||||
_DOMEmbedElement.type = "application/x-shockwave-flash";
|
||||
_DOMEmbedElement.setAttribute("wmode", "transparent");
|
||||
_DOMEmbedElement.width = "100%";
|
||||
_DOMEmbedElement.height = "100%";
|
||||
|
||||
|
||||
// IE requires this thing to be in the _DOMElement and not the _DOMObjectElement.
|
||||
_DOMElement.appendChild(_DOMEmbedElement);
|
||||
|
||||
@@ -94,6 +98,66 @@
|
||||
return _flashMovie;
|
||||
}
|
||||
|
||||
- (void)setFlashVars:(CPDictionary)aDictionary
|
||||
{
|
||||
_flashVars = aDictionary;
|
||||
|
||||
var varString = @"",
|
||||
enumerator = [_flashVars keyEnumerator];
|
||||
|
||||
var key;
|
||||
while (key = [enumerator nextObject])
|
||||
varString = [varString stringByAppendingFormat:@"&%@=%@", key, [_flashVars objectForKey:key]];
|
||||
|
||||
var param = document.createElement(@"param");
|
||||
param.name = @"flashvars";
|
||||
param.value = varString;
|
||||
|
||||
_DOMObjectElement.appendChild(param);
|
||||
|
||||
if (_DOMEmbedElement)
|
||||
_DOMEmbedElement.setAttribute(@"flashvars", varString);
|
||||
}
|
||||
|
||||
- (CPDictionary)flashVars
|
||||
{
|
||||
return _flashVars;
|
||||
}
|
||||
|
||||
- (void)setParameters:(CPDictionary)aDictionary
|
||||
{
|
||||
if (_paramElements)
|
||||
{
|
||||
var elements = [_paramElements allValues],
|
||||
count = [elements count];
|
||||
|
||||
for (var i = 0; i < count; i++)
|
||||
_DOMObjectElement.removeChild([elements objectAtIndex:i]);
|
||||
}
|
||||
|
||||
_params = aDictionary;
|
||||
_paramElements = [CPDictionary dictionary];
|
||||
|
||||
var enumerator = [_params keyEnumerator],
|
||||
key;
|
||||
|
||||
while (key = [enumerator nextObject])
|
||||
{
|
||||
var param = document.createElement(@"param");
|
||||
param.name = key;
|
||||
param.value = [_params objectForKey:key];
|
||||
|
||||
_DOMObjectElement.appendChild(param);
|
||||
|
||||
[_paramElements setObject:param forKey:key];
|
||||
}
|
||||
}
|
||||
|
||||
- (CPDictionary)parameters
|
||||
{
|
||||
return _params;
|
||||
}
|
||||
|
||||
- (void)mouseDragged:(CPEvent)anEvent
|
||||
{
|
||||
[[[self window] platformWindow] _propagateCurrentDOMEvent:YES];
|
||||
|
||||
Binary file not shown.
|
After Width: | Height: | Size: 1.4 KiB |
Vendored
+25
-1
@@ -21,4 +21,28 @@
|
||||
*/
|
||||
|
||||
if (window.OBJJ_MAIN_FILE)
|
||||
objj_import(OBJJ_MAIN_FILE, YES, function() { main(); });
|
||||
{
|
||||
var addOnload = function(handler)
|
||||
{
|
||||
if (window.addEventListener)
|
||||
window.addEventListener("load", handler, false);
|
||||
else if (window.attachEvent)
|
||||
window.attachEvent("onload", handler);
|
||||
}
|
||||
|
||||
var documentLoaded = NO;
|
||||
var defaultHandler = function()
|
||||
{
|
||||
documentLoaded = YES;
|
||||
}
|
||||
|
||||
addOnload(defaultHandler);
|
||||
|
||||
objj_import(OBJJ_MAIN_FILE, YES, function()
|
||||
{
|
||||
if (documentLoaded)
|
||||
main();
|
||||
else
|
||||
addOnload(main);
|
||||
});
|
||||
}
|
||||
|
||||
@@ -32,10 +32,13 @@ var OBJJ_ENVIRONMENTS = ENVIRONMENTS;
|
||||
#ifdef PLATFORM_USERAGENT
|
||||
var userAgent = window.navigator.userAgent;
|
||||
|
||||
if (userAgent.indexOf("MSIE 7") !== -1)
|
||||
OBJJ_ENVIRONMENTS.unshift("IE7");
|
||||
else if (userAgent.indexOf("MSIE 8") !== -1)
|
||||
OBJJ_ENVIRONMENTS.unshift("IE8");
|
||||
if (userAgent.indexOf("MSIE") !== -1)
|
||||
{
|
||||
if (userAgent.indexOf("MSIE 8") !== -1)
|
||||
OBJJ_ENVIRONMENTS.unshift("IE8");
|
||||
else
|
||||
OBJJ_ENVIRONMENTS.unshift("IE7");
|
||||
}
|
||||
else
|
||||
OBJJ_ENVIRONMENTS.unshift("W3C");
|
||||
#endif
|
||||
|
||||
+1
-1
@@ -31,7 +31,7 @@ function ensurePackageUpToDate(packageName, requiredVersion)
|
||||
}
|
||||
|
||||
// UPDATE THESE TO PICK UP CORRESPONDING CHANGES IN DEPENDENCIES
|
||||
ensurePackageUpToDate("jake", "0.1.1");
|
||||
ensurePackageUpToDate("jake", "0.1.2");
|
||||
ensurePackageUpToDate("browserjs", "0.1.1");
|
||||
|
||||
var Jake = require("jake");
|
||||
|
||||
Reference in New Issue
Block a user