This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
ORYX.Core.UIObject.prototype.getChildById = function(id, deep) { | |
var i, child, ret; | |
for(var i = 0; i < this.children.length && ret === undefined; i++){ | |
child = this.children[i]; | |
if(child.getId() === id) | |
ret = child; | |
else if(deep){ | |
ret = child.getChildById(id, deep); | |
} | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// overrides ORYX.Editor constructor for accessing to unique instance (Singleton-like) | |
(function(OE){ | |
var proxy = OE.prototype.construct; | |
OE.getInstance = function(){ | |
return OE.instance; | |
}; | |
OE.prototype.construct= function(){ | |
proxy.apply(this, arguments); | |
OE.instance = this; | |
}; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(function(dc){ | |
var proxy = dc.prototype.execute; | |
dc.prototype.execute = function(){ | |
var StopPropagationException = function(){}; | |
var event = { | |
type: "shapedeleted", | |
shapes:this.shapesAsJson, | |
dockers:this.dockers, | |
cancel: false | |
}; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
* Fix for containsMorphingRules and showStencilButtons | |
* which avoids in some case to show the shape menu | |
* see this bug : http://code.google.com/p/oryx-editor/issues/detail?id=481 | |
*/ | |
(function(){ | |
var prot = ORYX.Core.StencilSet.Rules.prototype; | |
var origFn = prot.containsMorphingRules; | |
prot.containsMorphingRules = function(){ | |
// we get the caller function : |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* | |
Copyright (C) 2011 by Florent FAYOLLE | |
Permission is hereby granted, free of charge, to any person obtaining a copy | |
of this software and associated documentation files (the "Software"), to deal | |
in the Software without restriction, including without limitation the rights | |
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell | |
copies of the Software, and to permit persons to whom the Software is | |
furnished to do so, subject to the following conditions: |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* | |
Copyright (C) 2011 by Florent FAYOLLE | |
Permission is hereby granted, free of charge, to any person obtaining a copy | |
of this software and associated documentation files (the "Software"), to deal | |
in the Software without restriction, including without limitation the rights | |
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell | |
copies of the Software, and to permit persons to whom the Software is | |
furnished to do so, subject to the following conditions: |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* run it in a web console (firebug, etc.) */ | |
alert("will it blend?"); Array.prototype.forEach.call(document.querySelectorAll("*"), function(el){ el.style.MozTransform = "rotate(10000deg) scale(0)"; el.style.MozTransition = "50s linear"; }); var ok = function(){ alert('yes, it blends !'); document.body.removeEventListener("transitionend", ok, false);}; document.body.addEventListener("transitionend", ok, false); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
document.body.addEventListener("click", function(ev) | |
{ | |
var el = ev.originalTarget; | |
el.style.MozTransition = "3s"; | |
el.style.MozTransform = "rotate(360deg)"; | |
}); | |
document.body.addEventListener("transitionend", function(ev){ | |
var el = ev.originalTarget; | |
el.style.MozTransition = "0s"; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function loop(f) | |
{ | |
for(var i = 0; i < 10000; i++) | |
f(Math.floor(Math.random() * 2 - 1)); | |
} | |
console.time(">-1"); | |
loop(function(index) index * eval("1") > -1); | |
console.timeEnd(">-1"); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function evaluate(context, expr, origExpr, onSuccess, onError) | |
{ | |
var result; | |
var commandLine = createFirebugCommandLine(context, win); | |
// gets the debuggee object: | |
var dglobal = DebuggerLib.getDebuggeeGlobal(context.window, context); | |
var resObj; | |
// that works: | |
commandLine.someFunction = dglobal.makeDebuggeeValue(function() |
OlderNewer