New Tools Release
I have packaged up a new release of my YAHOO.Tools package. The new release contains a couple of bug fixes, but also adds support for JSON encoding and parsing.
I have included a modified version of Douglas Crockford’s JSON parser that doesn’t mess with the Object prototypes.
Examples:
http://blog.davglass.com/files/yui/tools/
http://blog.davglass.com/files/yui/tools/json.php
Source:
http://blog.davglass.com/files/yui/tools/tools.js
Min Source:
http://blog.davglass.com/files/yui/tools/tools-min.js
Docs:
http://blog.davglass.com/files/yui/docs/?type=tools
Let me know what you think ![]()








February 21st, 2007 at 2:00 pm
Dav,
Is there a reason why you implemented the JSON parser of Douglas Crockford into your tools lib? The original Connection Manager accepts string’s so those can be used to construct strings, arrays and objects. Or is the originalYUI lib lacking some methods (like the decode method you added) ?
Hope to hear your thoughts.
Kind regards,
Jeroen
February 21st, 2007 at 2:18 pm
Jeroen –
I included both a parse and an encode as well as a Date fixer..
The Connection Manager does a “serialization” of form objects, the JSON encoder is a totally different beast.
With the JSON encoder, I can un/serialize a JavaScript object, so I can parse/encode data to be sent back and forth from the server without a form
I included the date fixer because of JSON’s inability to properly handle dates..
The main reason for “rebuilding” Crockford’s JSON parser, was that I don’t like having something “mess” with the built in JavaScript objects ..
Hope that answers your question
Dav
February 22nd, 2007 at 12:39 am
Yep, that answers my question just fine! Think I’m gonna rebuild my app, remove the dojo and add (once again) some YUI-sugar.
Thanks!
Btw, nice bike!
August 22nd, 2007 at 12:17 am
Hi,thanks for allowing to put your tools into my own toolshed.I just leeched the api-docs with wget, but that is always a task, that gives me more files, than I wanted, and I guess, you’d prefer less traffic too. Would it be possible to offer an archive of your tools ? Maybe even mirroring the YUI path-structure ?Any plans to add somemore tools ? Like a UUID generator. There is one here: http://www.af-design.com/resources/javascript_uuid.php but it would be nice to have it inside YUI. It may not be feasible, however, since it is pretty large, but since you are a geek (and I am not) maybe you could so something similare ? The above code is GPL, so you’d need to roll your own I guess.Oh, and how about a Preview Button for the comment section here
?
January 18th, 2008 at 12:09 pm
You are my star for the day, no week! Just used your JS to convert an unordered list into a YUI treeview for a plugin I am developing to use YUI in expression engine.Many many thanks.