Re: Issue 66 in canviz: Don't require Prototype; allow using jQuery or other libraries

33 views
Skip to first unread message

can...@googlecode.com

unread,
Oct 5, 2011, 9:01:46 PM10/5/11
to canviz...@googlegroups.com
Updates:
Summary: Don't require Prototype; allow using jQuery or other libraries

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

can...@googlecode.com

unread,
Dec 14, 2011, 8:20:36 PM12/14/11
to canviz...@googlegroups.com

Comment #3 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

Removed use of Object.isUndefined() from path.js in r297 and canviz.js in
r298.

can...@googlecode.com

unread,
Dec 14, 2011, 8:34:49 PM12/14/11
to canviz...@googlegroups.com

Comment #4 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

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

can...@googlecode.com

unread,
Dec 15, 2011, 7:12:07 AM12/15/11
to canviz...@googlegroups.com

Comment #5 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

Removed prototype.js class-based inheritance from path.js in r299.

can...@googlecode.com

unread,
Dec 16, 2011, 8:56:25 AM12/16/11
to canviz...@googlegroups.com

Comment #6 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

Removed most occurrences of each() and bind() from path.js in r303.

can...@googlecode.com

unread,
Dec 23, 2011, 9:05:15 AM12/23/11
to canviz...@googlegroups.com

Comment #7 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

Slightly revert r303: use JavaScript-native forEach() method for iteration
in path.js, in r306.

can...@googlecode.com

unread,
Jan 21, 2012, 8:35:33 PM1/21/12
to canviz...@googlegroups.com

Comment #8 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

r308: revert r306; for loop is faster than forEach

can...@googlecode.com

unread,
Jan 21, 2012, 8:51:35 PM1/21/12
to canviz...@googlegroups.com

Comment #9 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

r309: use plain JavaScript objects instead of prototype.js hashes

can...@googlecode.com

unread,
Jan 21, 2012, 9:03:37 PM1/21/12
to canviz...@googlegroups.com

Comment #10 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

r311: removed use of prototype's $() from Path examples

can...@googlecode.com

unread,
Jan 21, 2012, 9:59:49 PM1/21/12
to canviz...@googlegroups.com

Comment #11 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

r313: removed use of prototype's String#startsWith

can...@googlecode.com

unread,
Jan 21, 2012, 10:28:52 PM1/21/12
to canviz...@googlegroups.com

Comment #12 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

r314: removed use of prototype's Array#each from Path examples

can...@googlecode.com

unread,
Jan 21, 2012, 10:33:53 PM1/21/12
to canviz...@googlegroups.com

Comment #13 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

r315: removed use of prototype's $F() from Path examples

can...@googlecode.com

unread,
Jan 22, 2012, 4:47:52 AM1/22/12
to canviz...@googlegroups.com

Comment #14 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

r316: removed use of prototype's Event#pointerX / Event#pointerY from Path
example1

can...@googlecode.com

unread,
Jul 11, 2012, 4:22:03 PM7/11/12
to canviz...@googlegroups.com

Comment #15 on issue 66 by pe...@clicksecurity.com: Don't require
Prototype; allow using jQuery or other libraries
http://code.google.com/p/canviz/issues/detail?id=66

John Resig wrote a great article/library on class-based inheritance.

http://ejohn.org/blog/simple-javascript-inheritance/

I come from a Java background, and having used Resig's solution it felt
very comfortable.

can...@googlecode.com

unread,
Oct 1, 2012, 2:08:41 PM10/1/12
to canviz...@googlegroups.com

Comment #16 on issue 66 by guys...@gmail.com: Don't require Prototype;
allow using jQuery or other libraries
http://code.google.com/p/canviz/issues/detail?id=66

Hey,
I tried applying canviz-libneutral.diff to canviz and to fix
examples/hello_world/new.html to work with it, however I keep getting in
the java console:
"Rect is not a constructor".

It looks like a bug, but I can't seem to figure out what is causing it.

Attached is the canviz tar.gz package, patched with canviz-libneutral.diff
and with the fixed examples/hello_world/new.html .

Could anyone please look at it and figure out what is wrong?


Thanks,
Guy

Attachments:
canviz_patched.zip 1.3 MB

can...@googlecode.com

unread,
May 6, 2013, 1:28:49 AM5/6/13
to canviz...@googlegroups.com

Comment #17 on issue 66 by sarkarbi...@gmail.com: Don't require Prototype;
allow using jQuery or other libraries
http://code.google.com/p/canviz/issues/detail?id=66

After applying all the patches on top of v0.1 I have the attached set of
files. I am uploading them for easy usage.

--
patches applied on top of canviz-0.1.tar.bz2:
path.js.diff
canviz-libneutral.diff
canviz-vanilla-and-tests.zip
-------------------------

Attachments:
canviz-0.1-patched.tgz 1.2 MB

--
You received this message because this project is configured to send all
issue notifications to this address.
You may adjust your notification preferences at:
https://code.google.com/hosting/settings

can...@googlecode.com

unread,
Jul 24, 2013, 3:06:46 PM7/24/13
to canviz...@googlegroups.com

Comment #18 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

r393: use plain JavaScript classes instead of PrototypeJS classes
r399: remove PrototypeJS-style Element creation and manipulation, arrays,
hashes, ajax, iteration (each)

can...@googlecode.com

unread,
Jul 24, 2013, 4:25:19 PM7/24/13
to canviz...@googlegroups.com
Updates:
Status: Fixed

Comment #19 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

r400: use escape-html from npm instead of String.prototype.escapeHTML from
PrototypeJS
r401: remove PrototypeJS include from examples that no longer need it
r402: remove some PrototypeJS usage from example
r404: use contentloaded() instead of document.observe('dom:loaded') from
PrototypeJS
r405: remove use of PrototypeJS Array.prototype.each for iteration
r406: remove hopefully last vestiges of PrototypeJS from example

can...@googlecode.com

unread,
Jul 30, 2013, 12:45:04 AM7/30/13
to canviz...@googlegroups.com

Comment #20 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

r430: fix transparent text; replace PrototypeJS setOpacity method with our
own

can...@googlecode.com

unread,
Aug 10, 2013, 3:32:42 AM8/10/13
to canviz...@googlegroups.com

Comment #21 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

r434: fix labels that begin with spaces: remove PrototypeJS "times" method
Reply all
Reply to author
Forward
0 new messages