Comment #2 on issue 66 by ryandesi...@gmail.com: Don't require Prototype;
allow using jQuery or other libraries
http://code.google.com/p/canviz/issues/detail?id=66
Xavier Roger-Machart wrote to the discussion group about this problem:
http://groups.google.com/group/canviz/browse_thread/thread/ec535a3da645f790
He provided a link to a patch that removes Prototype-specific code from
Canviz and factors it out into "adapters" that let Canviz use either
Prototype or jQuery or perhaps other libraries later. To ensure that patch
is not lost, I'm attaching it here. Since the patch appears to have been
made without knowledge of the above considerations, we'll talk about it
some more on the discussion group first.
Attachments:
canviz-libneutral.diff 50.2 KB
Removed use of Object.isUndefined() from path.js in r297 and canviz.js in
r298.
Now attaching additional files by Xavier Roger-Machart: a no-library
vanilla.js adapter, and index.html files showing use of each adapter.
Attachments:
canviz-vanilla-and-tests.zip 13.0 KB
Removed prototype.js class-based inheritance from path.js in r299.
Removed most occurrences of each() and bind() from path.js in r303.
Slightly revert r303: use JavaScript-native forEach() method for iteration
in path.js, in r306.
r308: revert r306; for loop is faster than forEach
r309: use plain JavaScript objects instead of prototype.js hashes
r311: removed use of prototype's $() from Path examples
r313: removed use of prototype's String#startsWith
r314: removed use of prototype's Array#each from Path examples
r315: removed use of prototype's $F() from Path examples
r316: removed use of prototype's Event#pointerX / Event#pointerY from Path
example1