diff options
author | lupo49 <post@lupo49.de> | 2011-08-22 19:11:18 +0200 |
---|---|---|
committer | lupo49 <post@lupo49.de> | 2011-08-22 19:11:18 +0200 |
commit | d8f231b5162801fe333f899552b5808a83282634 (patch) | |
tree | f8021011b52502521eeff4f33e368628bb73ba89 /lib/scripts/events.js | |
parent | 8e5a3957cd8de15f48dc27e9c07dfe4033fd6997 (diff) | |
parent | 1c5f7481f4e685ad3ffe9ba48ed47ed75196e64a (diff) | |
download | rpg-d8f231b5162801fe333f899552b5808a83282634.tar.gz rpg-d8f231b5162801fe333f899552b5808a83282634.tar.bz2 |
Merge remote branch 'upstream/master'
Diffstat (limited to 'lib/scripts/events.js')
-rw-r--r-- | lib/scripts/events.js | 50 |
1 files changed, 0 insertions, 50 deletions
diff --git a/lib/scripts/events.js b/lib/scripts/events.js deleted file mode 100644 index 796d3cc4c..000000000 --- a/lib/scripts/events.js +++ /dev/null @@ -1,50 +0,0 @@ -/** - * The event functions are no longer in use and a mere wrapper around - * jQuery's event handlers. - * - * @deprecated - */ -function addEvent(element, type, handler) { - DEPRECATED('Use jQuery.bind() instead.'); - jQuery(element).bind(type,{},handler); -} - -function removeEvent(element, type, handler) { - DEPRECATED('Use jQuery.unbind() instead.'); - jQuery(element).unbind(type,handler); -} - -function addInitEvent(func) { - DEPRECATED('Use jQuery(<function>) instead'); - jQuery(func); -} - -/** - * Bind variables to a function call creating a closure - * - * Use this to circumvent variable scope problems when creating closures - * inside a loop - * - * @author Adrian Lang <lang@cosmocode.de> - * @fixme Is there a jQuery equivalent? Otherwise move to somewhere else - * @link http://www.cosmocode.de/en/blog/gohr/2009-10/15-javascript-fixing-the-closure-scope-in-loops - * @param functionref fnc - the function to be called - * @param mixed - any arguments to be passed to the function - * @returns functionref - */ -function bind(fnc/*, ... */) { - var Aps = Array.prototype.slice; - // Store passed arguments in this scope. - // Since arguments is no Array nor has an own slice method, - // we have to apply the slice method from the Array.prototype - var static_args = Aps.call(arguments, 1); - - // Return a function evaluating the passed function with the - // given args and optional arguments passed on invocation. - return function (/* ... */) { - // Same here, but we use Array.prototype.slice solely for - // converting arguments to an Array. - return fnc.apply(this, - static_args.concat(Aps.call(arguments, 0))); - }; -} |