README 4.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103
  1. -------------------------------------------------------------------------------
  2. DojoX jq
  3. -------------------------------------------------------------------------------
  4. Version 0.0.1
  5. Release date: 8/9/2009
  6. -------------------------------------------------------------------------------
  7. Project state:
  8. experimental
  9. -------------------------------------------------------------------------------
  10. Credits
  11. James Burke
  12. -------------------------------------------------------------------------------
  13. Project description
  14. DojoX jq is a compatibility layer that tries to match the jquery 1.3.2 API.
  15. -------------------------------------------------------------------------------
  16. Dependencies:
  17. - Dojo Core.
  18. -------------------------------------------------------------------------------
  19. Documentation
  20. IF YOU WISH TO WORK ON THIS MODULE, PLEASE DO NOT LOOK AT THE JQUERY SOURCE.
  21. We want CLA-clean code to be put in the Dojo repos. Just refer to the jquery API
  22. documentation and unit tests. As we get bug reports, we can build up our own test
  23. suite, and then hopefully contribute those tests back to jquery if their tests
  24. do not adequately cover an API call.
  25. This module needs a lot of work, it is in the very initial, rough stages. Some
  26. (all?) of the code is ugly. It is missing some APIs, notably queue/dequeue,
  27. the FX methods and live/die.
  28. There are also some incompatibilities with how acme and sizzle operate at the moment,
  29. mentioned in the comments in jq.js
  30. The tests for this module so far have been the jquery 1.3.2 tests. Since those
  31. tests are not CLA-clean, you will need to download them from here:
  32. http://www.tagneto.org/dojo/jquery132.zip
  33. Place the zip file in the dojox/jq/tests directory and unzip it. Then you can
  34. run the jquery132/test/index.html file inside there to start the tests.
  35. The tests were changed in a couple ways. For the tests I modified,
  36. you can look for //JRB changed: to find the original test construction.
  37. Things that were changed:
  38. 1) acme requires spaces between CSS3 selectors, where sizzle does
  39. not ("div>span" fails in acme, but works in sizzle). There is a
  40. dtk.org bug on it, and it is allowed by the CSS3 spec to not have
  41. spaces so hopefully that incompatibility can go away after a while.
  42. 2) sizzle supports some psuedos like :last, :first: :odd, :even that
  43. work on the list of matched elements, not just individual elements or
  44. their children. This is a more fundamental change to acme, but it is probably
  45. doable.
  46. 3) The XML tests and ajax tests that call out to files fail because of
  47. some weird timing interaction between the jquery unit test thing and
  48. our XHR code. I believe since our code has a timer where we check the
  49. status of the XHR calls instead of using load callbacks directly on
  50. the XHR callbacks, something is confused in jquery -- the failure case
  51. is fired before our callbacks work. If only they used deferreds. ;)
  52. To get those tests to sort of work, I modified qunit/testrunner.js's process()
  53. method to be like so:
  54. function process() {
  55. if(config.queue.length && !config.blocking){
  56. setTimeout(function(){
  57. if(config.queue.length && !config.blocking){
  58. config.queue.shift()();
  59. process();
  60. }
  61. }, 100);
  62. }
  63. }
  64. Change 100 above to tune it depending on your patience and how much
  65. you want to make sure the tests have enough time to run. With 100, you
  66. can see some of the ajax tests passing.
  67. From some previous notes (I have not checked more recently), it looks
  68. like the compat layer fires "ajaxStop" more than jquery, I think due
  69. to how we do our async in-flight testing, so that messes up some of
  70. the testing in the ajax calls, but I think that is a detail that is
  71. fine to go with. I just have to make sure that is really the cause of
  72. a test failure and not something else. So I will probably need to
  73. modify the tests more.
  74. -------------------------------------------------------------------------------
  75. Installation instructions
  76. Grab the following from the Dojo SVN Repository:
  77. http://svn.dojotoolkit.org/src/dojox/trunk/jq.js
  78. http://svn.dojotoolkit.org/src/dojox/trunk/jq/*
  79. Install into the following directory structure:
  80. /dojox/jq.js
  81. ...which should be at the same level as your Dojo checkout.
  82. -------------------------------------------------------------------------------