Twactors should inherit from Tweeny. An actor's step functionality should somehow wrap the tweeny.tween's step parameter.
How I'm going to do this...
First things first, window.tweeny needs to be a function so it can correctly start the prototype chain. - Done.
Tweeny also needs a hook function that can be called for every invocation of tweeny.tween(). Basically like step, but runs for every call to tween() implicitly. Twactor can hook into that and update the actor state for every tween, queued tween, etc. The setup of this hook will be done in the Twactor constructor. This will let me actually inherit all of the properties, instead of pretend-inheriting them.
Note to self: The Tweeny constructor needs to set up methods to access the hooks (setHook and removeHook, or something similar). The hooks themselves will be stored as private vars inside the Actor constructor.
| # Disable Spaces animation | |
| # /via http://hints.macworld.com/article.php?story=20110214074550501 | |
| defaults write com.apple.dock workspaces-swoosh-animation-off -bool YES && killall Dock | |
| # ... And re-enable. | |
| defaults delete com.apple.dock workspaces-swoosh-animation-off && killall Dock |
| // This whole function breaks event.preventDefault() for `a` | |
| // tags inside of the `li`s that this click handler binds to. | |
| // In fact, I'm not even sure why this code needs to be here. | |
| // Regardless, this `if` checks to see the contained `a` tag's href ends | |
| // in "#", in which case the default behavior _must_ be prevented. | |
| // tl;dr: Only update the URL if the href does NOT end in "#". | |
| if (/#$/.test(targetHref) === false) { | |
| window.location = $a[0].href; | |
| } |
| <html> | |
| <head></head> | |
| <body> | |
| <button id="mybutton">hello</button> | |
| <div id="output"></div> | |
| <script type="text/javascript" charset="utf-8"> |
| // Fixes random IE 6/7 issues. | |
| // Use case: JavaScript restyles parts of the DOM and certain elements don't reflow correctly. | |
| // This basically pokes those elements with a stick and reflows them. | |
| (function ($) { | |
| $.fn.forceLayoutUpdate = function () { | |
| return this | |
| .css({ | |
| 'zoom': 1 | |
| }) | |
| .css({ |
| // "noop" is short for "[no-op](http://en.wikipedia.org/wiki/NOP)." But it's more fun to say "noop." | |
| function noop () { | |
| return; | |
| } |
| /** | |
| Mifty - A custom build of Shifty for use with Morf.js. | |
| By Jeremy Kahn - jeremyckahn@gmail.com | |
| v0.4.1 | |
| For instructions on how to use Shifty, please consult the README: https://github.com/jeremyckahn/shifty/blob/master/README.md | |
| MIT Lincense. This code free to use, modify, distribute and enjoy. | |
| */ |