old_sql 1.12.0 → 1.13.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (263) hide show
  1. data/public/javascripts/old_sql/MochiKit-1.4.2/Changes +362 -0
  2. data/public/javascripts/old_sql/MochiKit-1.4.2/LICENSE.txt +69 -0
  3. data/public/javascripts/old_sql/MochiKit-1.4.2/MANIFEST +179 -0
  4. data/public/javascripts/old_sql/MochiKit-1.4.2/META.json +17 -0
  5. data/public/javascripts/old_sql/MochiKit-1.4.2/doc/html/MochiKit/Async.html +814 -0
  6. data/public/javascripts/old_sql/MochiKit-1.4.2/doc/html/MochiKit/Base.html +1703 -0
  7. data/public/javascripts/old_sql/MochiKit-1.4.2/doc/html/MochiKit/Color.html +755 -0
  8. data/public/javascripts/old_sql/MochiKit-1.4.2/doc/html/MochiKit/DOM.html +1197 -0
  9. data/public/javascripts/old_sql/MochiKit-1.4.2/doc/html/MochiKit/DateTime.html +168 -0
  10. data/public/javascripts/old_sql/MochiKit-1.4.2/doc/html/MochiKit/DragAndDrop.html +187 -0
  11. data/public/javascripts/old_sql/MochiKit-1.4.2/doc/html/MochiKit/Format.html +300 -0
  12. data/public/javascripts/old_sql/MochiKit-1.4.2/doc/html/MochiKit/Iter.html +524 -0
  13. data/public/javascripts/old_sql/MochiKit-1.4.2/doc/html/MochiKit/Logging.html +420 -0
  14. data/public/javascripts/old_sql/MochiKit-1.4.2/doc/html/MochiKit/LoggingPane.html +142 -0
  15. data/public/javascripts/old_sql/MochiKit-1.4.2/doc/html/MochiKit/Position.html +38 -0
  16. data/public/javascripts/old_sql/MochiKit-1.4.2/doc/html/MochiKit/Selector.html +240 -0
  17. data/public/javascripts/old_sql/MochiKit-1.4.2/doc/html/MochiKit/Signal.html +508 -0
  18. data/public/javascripts/old_sql/MochiKit-1.4.2/doc/html/MochiKit/Sortable.html +244 -0
  19. data/public/javascripts/old_sql/MochiKit-1.4.2/doc/html/MochiKit/Style.html +385 -0
  20. data/public/javascripts/old_sql/MochiKit-1.4.2/doc/html/MochiKit/VersionHistory.html +384 -0
  21. data/public/javascripts/old_sql/MochiKit-1.4.2/doc/html/MochiKit/Visual.html +1161 -0
  22. data/public/javascripts/old_sql/MochiKit-1.4.2/doc/html/MochiKit/index.html +447 -0
  23. data/public/javascripts/old_sql/MochiKit-1.4.2/doc/js/toc.js +113 -0
  24. data/public/javascripts/old_sql/MochiKit-1.4.2/doc/rst/MochiKit/Async.rst +767 -0
  25. data/public/javascripts/old_sql/MochiKit-1.4.2/doc/rst/MochiKit/Base.rst +1445 -0
  26. data/public/javascripts/old_sql/MochiKit-1.4.2/doc/rst/MochiKit/Color.rst +651 -0
  27. data/public/javascripts/old_sql/MochiKit-1.4.2/doc/rst/MochiKit/DOM.rst +1143 -0
  28. data/public/javascripts/old_sql/MochiKit-1.4.2/doc/rst/MochiKit/DateTime.rst +145 -0
  29. data/public/javascripts/old_sql/MochiKit-1.4.2/doc/rst/MochiKit/DragAndDrop.rst +197 -0
  30. data/public/javascripts/old_sql/MochiKit-1.4.2/doc/rst/MochiKit/Format.rst +258 -0
  31. data/public/javascripts/old_sql/MochiKit-1.4.2/doc/rst/MochiKit/Iter.rst +454 -0
  32. data/public/javascripts/old_sql/MochiKit-1.4.2/doc/rst/MochiKit/Logging.rst +348 -0
  33. data/public/javascripts/old_sql/MochiKit-1.4.2/doc/rst/MochiKit/LoggingPane.rst +128 -0
  34. data/public/javascripts/old_sql/MochiKit-1.4.2/doc/rst/MochiKit/Position.rst +26 -0
  35. data/public/javascripts/old_sql/MochiKit-1.4.2/doc/rst/MochiKit/Selector.rst +203 -0
  36. data/public/javascripts/old_sql/MochiKit-1.4.2/doc/rst/MochiKit/Signal.rst +498 -0
  37. data/public/javascripts/old_sql/MochiKit-1.4.2/doc/rst/MochiKit/Sortable.rst +186 -0
  38. data/public/javascripts/old_sql/MochiKit-1.4.2/doc/rst/MochiKit/Style.rst +353 -0
  39. data/public/javascripts/old_sql/MochiKit-1.4.2/doc/rst/MochiKit/VersionHistory.rst +362 -0
  40. data/public/javascripts/old_sql/MochiKit-1.4.2/doc/rst/MochiKit/Visual.rst +895 -0
  41. data/public/javascripts/old_sql/MochiKit-1.4.2/doc/rst/MochiKit/index.rst +83 -0
  42. data/public/javascripts/old_sql/MochiKit-1.4.2/examples/ajax_tables/ajax_tables.css +69 -0
  43. data/public/javascripts/old_sql/MochiKit-1.4.2/examples/ajax_tables/ajax_tables.js +401 -0
  44. data/public/javascripts/old_sql/MochiKit-1.4.2/examples/ajax_tables/domains.json +10 -0
  45. data/public/javascripts/old_sql/MochiKit-1.4.2/examples/ajax_tables/domains.xml +40 -0
  46. data/public/javascripts/old_sql/MochiKit-1.4.2/examples/ajax_tables/index.html +96 -0
  47. data/public/javascripts/old_sql/MochiKit-1.4.2/examples/color_wheel/color_wheel.css +4 -0
  48. data/public/javascripts/old_sql/MochiKit-1.4.2/examples/color_wheel/color_wheel.js +95 -0
  49. data/public/javascripts/old_sql/MochiKit-1.4.2/examples/color_wheel/index.html +31 -0
  50. data/public/javascripts/old_sql/MochiKit-1.4.2/examples/dnd_sortable/dnd_sortable.css +23 -0
  51. data/public/javascripts/old_sql/MochiKit-1.4.2/examples/dnd_sortable/dropmarker.png +0 -0
  52. data/public/javascripts/old_sql/MochiKit-1.4.2/examples/dnd_sortable/icon.png +0 -0
  53. data/public/javascripts/old_sql/MochiKit-1.4.2/examples/dnd_sortable/index.html +54 -0
  54. data/public/javascripts/old_sql/MochiKit-1.4.2/examples/dnd_sortable/sortable2_test.html +150 -0
  55. data/public/javascripts/old_sql/MochiKit-1.4.2/examples/dnd_sortable/sortable3_test.html +42 -0
  56. data/public/javascripts/old_sql/MochiKit-1.4.2/examples/dnd_sortable/sortable4_test.html +90 -0
  57. data/public/javascripts/old_sql/MochiKit-1.4.2/examples/dnd_sortable/sortable5_test.html +29 -0
  58. data/public/javascripts/old_sql/MochiKit-1.4.2/examples/dnd_sortable/sortable_test.html +38 -0
  59. data/public/javascripts/old_sql/MochiKit-1.4.2/examples/dnd_sortable/sortable_tree_test.html +189 -0
  60. data/public/javascripts/old_sql/MochiKit-1.4.2/examples/draggable/draggable.css +28 -0
  61. data/public/javascripts/old_sql/MochiKit-1.4.2/examples/draggable/draggable.js +73 -0
  62. data/public/javascripts/old_sql/MochiKit-1.4.2/examples/draggable/index.html +38 -0
  63. data/public/javascripts/old_sql/MochiKit-1.4.2/examples/effects/effects_bigslide.html +36 -0
  64. data/public/javascripts/old_sql/MochiKit-1.4.2/examples/effects/effects_blind.html +65 -0
  65. data/public/javascripts/old_sql/MochiKit-1.4.2/examples/effects/effects_blindslide.html +31 -0
  66. data/public/javascripts/old_sql/MochiKit-1.4.2/examples/effects/effects_combi.css +18 -0
  67. data/public/javascripts/old_sql/MochiKit-1.4.2/examples/effects/effects_fadeappear.html +61 -0
  68. data/public/javascripts/old_sql/MochiKit-1.4.2/examples/effects/effects_grow_shrink.html +38 -0
  69. data/public/javascripts/old_sql/MochiKit-1.4.2/examples/effects/effects_onload.html +67 -0
  70. data/public/javascripts/old_sql/MochiKit-1.4.2/examples/effects/effects_queue.html +67 -0
  71. data/public/javascripts/old_sql/MochiKit-1.4.2/examples/effects/effects_queue_limit.html +30 -0
  72. data/public/javascripts/old_sql/MochiKit-1.4.2/examples/effects/effects_scroll.html +483 -0
  73. data/public/javascripts/old_sql/MochiKit-1.4.2/examples/effects/effects_slide.html +62 -0
  74. data/public/javascripts/old_sql/MochiKit-1.4.2/examples/effects/full.html +71 -0
  75. data/public/javascripts/old_sql/MochiKit-1.4.2/examples/effects/icon.png +0 -0
  76. data/public/javascripts/old_sql/MochiKit-1.4.2/examples/effects/index.html +150 -0
  77. data/public/javascripts/old_sql/MochiKit-1.4.2/examples/interpreter/index.html +88 -0
  78. data/public/javascripts/old_sql/MochiKit-1.4.2/examples/interpreter/interpreter.css +54 -0
  79. data/public/javascripts/old_sql/MochiKit-1.4.2/examples/interpreter/interpreter.js +373 -0
  80. data/public/javascripts/old_sql/MochiKit-1.4.2/examples/key_events/index.html +78 -0
  81. data/public/javascripts/old_sql/MochiKit-1.4.2/examples/key_events/key_events.css +5 -0
  82. data/public/javascripts/old_sql/MochiKit-1.4.2/examples/key_events/key_events.js +85 -0
  83. data/public/javascripts/old_sql/MochiKit-1.4.2/examples/logging_pane/index.html +46 -0
  84. data/public/javascripts/old_sql/MochiKit-1.4.2/examples/logging_pane/logging_pane.css +78 -0
  85. data/public/javascripts/old_sql/MochiKit-1.4.2/examples/logging_pane/logging_pane.js +11 -0
  86. data/public/javascripts/old_sql/MochiKit-1.4.2/examples/mochiregexp/index.html +74 -0
  87. data/public/javascripts/old_sql/MochiKit-1.4.2/examples/mochiregexp/mochiregexp.css +73 -0
  88. data/public/javascripts/old_sql/MochiKit-1.4.2/examples/mochiregexp/mochiregexp.js +125 -0
  89. data/public/javascripts/old_sql/MochiKit-1.4.2/examples/mouse_events/index.html +88 -0
  90. data/public/javascripts/old_sql/MochiKit-1.4.2/examples/mouse_events/mouse_events.css +17 -0
  91. data/public/javascripts/old_sql/MochiKit-1.4.2/examples/mouse_events/mouse_events.js +59 -0
  92. data/public/javascripts/old_sql/MochiKit-1.4.2/examples/rounded_corners/index.html +28 -0
  93. data/public/javascripts/old_sql/MochiKit-1.4.2/examples/rounded_corners/rounded_corners.css +3 -0
  94. data/public/javascripts/old_sql/MochiKit-1.4.2/examples/rounded_corners/rounded_corners.js +19 -0
  95. data/public/javascripts/old_sql/MochiKit-1.4.2/examples/simple_dnd/dnd_boxes.html +45 -0
  96. data/public/javascripts/old_sql/MochiKit-1.4.2/examples/simple_dnd/dnd_full.html +119 -0
  97. data/public/javascripts/old_sql/MochiKit-1.4.2/examples/simple_dnd/dnd_ghost.html +40 -0
  98. data/public/javascripts/old_sql/MochiKit-1.4.2/examples/simple_dnd/dnd_hoverclass.html +43 -0
  99. data/public/javascripts/old_sql/MochiKit-1.4.2/examples/simple_dnd/dnd_scroll.html +91 -0
  100. data/public/javascripts/old_sql/MochiKit-1.4.2/examples/simple_dnd/dnd_snap.html +54 -0
  101. data/public/javascripts/old_sql/MochiKit-1.4.2/examples/simple_dnd/index.html +93 -0
  102. data/public/javascripts/old_sql/MochiKit-1.4.2/examples/simple_dnd/simple_dnd.css +64 -0
  103. data/public/javascripts/old_sql/MochiKit-1.4.2/examples/sortable_tables/index.html +71 -0
  104. data/public/javascripts/old_sql/MochiKit-1.4.2/examples/sortable_tables/sortable_tables.css +66 -0
  105. data/public/javascripts/old_sql/MochiKit-1.4.2/examples/sortable_tables/sortable_tables.js +203 -0
  106. data/public/javascripts/old_sql/MochiKit-1.4.2/examples/view-source/lib/SyntaxHighlighter/SyntaxHighlighter.css +177 -0
  107. data/public/javascripts/old_sql/MochiKit-1.4.2/examples/view-source/lib/SyntaxHighlighter/Tests.html +339 -0
  108. data/public/javascripts/old_sql/MochiKit-1.4.2/examples/view-source/lib/SyntaxHighlighter/shBrushCSharp.js +30 -0
  109. data/public/javascripts/old_sql/MochiKit-1.4.2/examples/view-source/lib/SyntaxHighlighter/shBrushDelphi.js +31 -0
  110. data/public/javascripts/old_sql/MochiKit-1.4.2/examples/view-source/lib/SyntaxHighlighter/shBrushJScript.js +22 -0
  111. data/public/javascripts/old_sql/MochiKit-1.4.2/examples/view-source/lib/SyntaxHighlighter/shBrushPhp.js +23 -0
  112. data/public/javascripts/old_sql/MochiKit-1.4.2/examples/view-source/lib/SyntaxHighlighter/shBrushPython.js +71 -0
  113. data/public/javascripts/old_sql/MochiKit-1.4.2/examples/view-source/lib/SyntaxHighlighter/shBrushSql.js +40 -0
  114. data/public/javascripts/old_sql/MochiKit-1.4.2/examples/view-source/lib/SyntaxHighlighter/shBrushVb.js +29 -0
  115. data/public/javascripts/old_sql/MochiKit-1.4.2/examples/view-source/lib/SyntaxHighlighter/shBrushXml.js +61 -0
  116. data/public/javascripts/old_sql/MochiKit-1.4.2/examples/view-source/lib/SyntaxHighlighter/shCore.js +622 -0
  117. data/public/javascripts/old_sql/MochiKit-1.4.2/examples/view-source/view-source.css +1 -0
  118. data/public/javascripts/old_sql/MochiKit-1.4.2/examples/view-source/view-source.html +19 -0
  119. data/public/javascripts/old_sql/MochiKit-1.4.2/examples/view-source/view-source.js +70 -0
  120. data/public/javascripts/old_sql/MochiKit-1.4.2/include/_img/bg_docheader.gif +0 -0
  121. data/public/javascripts/old_sql/MochiKit-1.4.2/include/_img/g_bullet.gif +0 -0
  122. data/public/javascripts/old_sql/MochiKit-1.4.2/include/_img/g_logo_doc.gif +0 -0
  123. data/public/javascripts/old_sql/MochiKit-1.4.2/include/css/documentation.css +130 -0
  124. data/public/javascripts/old_sql/MochiKit-1.4.2/include/css/general.css +48 -0
  125. data/public/javascripts/old_sql/MochiKit-1.4.2/lib/MochiKit/Async.js +682 -0
  126. data/public/javascripts/old_sql/MochiKit-1.4.2/lib/MochiKit/Base.js +1489 -0
  127. data/public/javascripts/old_sql/MochiKit-1.4.2/lib/MochiKit/Color.js +863 -0
  128. data/public/javascripts/old_sql/MochiKit-1.4.2/lib/MochiKit/DOM.js +1256 -0
  129. data/public/javascripts/old_sql/MochiKit-1.4.2/lib/MochiKit/DateTime.js +222 -0
  130. data/public/javascripts/old_sql/MochiKit-1.4.2/lib/MochiKit/DragAndDrop.js +793 -0
  131. data/public/javascripts/old_sql/MochiKit-1.4.2/lib/MochiKit/Format.js +304 -0
  132. data/public/javascripts/old_sql/MochiKit-1.4.2/lib/MochiKit/Iter.js +844 -0
  133. data/public/javascripts/old_sql/MochiKit-1.4.2/lib/MochiKit/Logging.js +315 -0
  134. data/public/javascripts/old_sql/MochiKit-1.4.2/lib/MochiKit/LoggingPane.js +353 -0
  135. data/public/javascripts/old_sql/MochiKit-1.4.2/lib/MochiKit/MochiKit.js +188 -0
  136. data/public/javascripts/old_sql/MochiKit-1.4.2/lib/MochiKit/MockDOM.js +115 -0
  137. data/public/javascripts/old_sql/MochiKit-1.4.2/lib/MochiKit/Position.js +236 -0
  138. data/public/javascripts/old_sql/MochiKit-1.4.2/lib/MochiKit/Selector.js +415 -0
  139. data/public/javascripts/old_sql/MochiKit-1.4.2/lib/MochiKit/Signal.js +897 -0
  140. data/public/javascripts/old_sql/MochiKit-1.4.2/lib/MochiKit/Sortable.js +589 -0
  141. data/public/javascripts/old_sql/MochiKit-1.4.2/lib/MochiKit/Style.js +594 -0
  142. data/public/javascripts/old_sql/MochiKit-1.4.2/lib/MochiKit/Test.js +162 -0
  143. data/public/javascripts/old_sql/MochiKit-1.4.2/lib/MochiKit/Visual.js +2026 -0
  144. data/public/javascripts/old_sql/MochiKit-1.4.2/lib/MochiKit/__package__.js +18 -0
  145. data/public/javascripts/old_sql/MochiKit-1.4.2/packed/MochiKit/MochiKit.js +7829 -0
  146. data/public/javascripts/old_sql/MochiKit-1.4.2/packed/MochiKit/__package__.js +6 -0
  147. data/public/javascripts/old_sql/MochiKit-1.4.2/packed/MochiKit/customize.html +251 -0
  148. data/public/javascripts/old_sql/MochiKit-1.4.2/tests/FakeJSAN.js +40 -0
  149. data/public/javascripts/old_sql/MochiKit-1.4.2/tests/SimpleTest/SimpleTest.js +381 -0
  150. data/public/javascripts/old_sql/MochiKit-1.4.2/tests/SimpleTest/TestRunner.js +159 -0
  151. data/public/javascripts/old_sql/MochiKit-1.4.2/tests/SimpleTest/test.css +28 -0
  152. data/public/javascripts/old_sql/MochiKit-1.4.2/tests/cli.js +6 -0
  153. data/public/javascripts/old_sql/MochiKit-1.4.2/tests/index.html +25 -0
  154. data/public/javascripts/old_sql/MochiKit-1.4.2/tests/standalone.js +16 -0
  155. data/public/javascripts/old_sql/MochiKit-1.4.2/tests/test_Base.js +577 -0
  156. data/public/javascripts/old_sql/MochiKit-1.4.2/tests/test_Color.js +137 -0
  157. data/public/javascripts/old_sql/MochiKit-1.4.2/tests/test_DateTime.js +52 -0
  158. data/public/javascripts/old_sql/MochiKit-1.4.2/tests/test_DragAndDrop.js +30 -0
  159. data/public/javascripts/old_sql/MochiKit-1.4.2/tests/test_Format.js +89 -0
  160. data/public/javascripts/old_sql/MochiKit-1.4.2/tests/test_Iter.js +186 -0
  161. data/public/javascripts/old_sql/MochiKit-1.4.2/tests/test_Logging.js +88 -0
  162. data/public/javascripts/old_sql/MochiKit-1.4.2/tests/test_MochiKit-Async.html +408 -0
  163. data/public/javascripts/old_sql/MochiKit-1.4.2/tests/test_MochiKit-Async.json +1 -0
  164. data/public/javascripts/old_sql/MochiKit-1.4.2/tests/test_MochiKit-Base.html +34 -0
  165. data/public/javascripts/old_sql/MochiKit-1.4.2/tests/test_MochiKit-Color.html +84 -0
  166. data/public/javascripts/old_sql/MochiKit-1.4.2/tests/test_MochiKit-DOM-Safari.html +48 -0
  167. data/public/javascripts/old_sql/MochiKit-1.4.2/tests/test_MochiKit-DOM.html +363 -0
  168. data/public/javascripts/old_sql/MochiKit-1.4.2/tests/test_MochiKit-DateTime.html +39 -0
  169. data/public/javascripts/old_sql/MochiKit-1.4.2/tests/test_MochiKit-DragAndDrop.html +54 -0
  170. data/public/javascripts/old_sql/MochiKit-1.4.2/tests/test_MochiKit-Format.html +39 -0
  171. data/public/javascripts/old_sql/MochiKit-1.4.2/tests/test_MochiKit-Iter.html +38 -0
  172. data/public/javascripts/old_sql/MochiKit-1.4.2/tests/test_MochiKit-JSAN.html +32 -0
  173. data/public/javascripts/old_sql/MochiKit-1.4.2/tests/test_MochiKit-Logging.html +40 -0
  174. data/public/javascripts/old_sql/MochiKit-1.4.2/tests/test_MochiKit-MochiKit.html +18 -0
  175. data/public/javascripts/old_sql/MochiKit-1.4.2/tests/test_MochiKit-Selector.html +295 -0
  176. data/public/javascripts/old_sql/MochiKit-1.4.2/tests/test_MochiKit-Signal.html +43 -0
  177. data/public/javascripts/old_sql/MochiKit-1.4.2/tests/test_MochiKit-Style.html +223 -0
  178. data/public/javascripts/old_sql/MochiKit-1.4.2/tests/test_MochiKit-Visual.html +197 -0
  179. data/public/javascripts/old_sql/MochiKit-1.4.2/tests/test_Signal.js +481 -0
  180. data/public/javascripts/old_sql/plotkit-0.9.1/COPYING +28 -0
  181. data/public/javascripts/old_sql/plotkit-0.9.1/PlotKit/Base.js +406 -0
  182. data/public/javascripts/old_sql/plotkit-0.9.1/PlotKit/Canvas.js +683 -0
  183. data/public/javascripts/old_sql/plotkit-0.9.1/PlotKit/EasyPlot.js +161 -0
  184. data/public/javascripts/old_sql/plotkit-0.9.1/PlotKit/Layout.js +756 -0
  185. data/public/javascripts/old_sql/plotkit-0.9.1/PlotKit/PlotKit.js +151 -0
  186. data/public/javascripts/old_sql/plotkit-0.9.1/PlotKit/PlotKit_Packed.js +2177 -0
  187. data/public/javascripts/old_sql/plotkit-0.9.1/PlotKit/SVG.js +705 -0
  188. data/public/javascripts/old_sql/plotkit-0.9.1/PlotKit/SweetCanvas.js +348 -0
  189. data/public/javascripts/old_sql/plotkit-0.9.1/PlotKit/SweetSVG.js +247 -0
  190. data/public/javascripts/old_sql/plotkit-0.9.1/PlotKit/dummy.svg +9 -0
  191. data/public/javascripts/old_sql/plotkit-0.9.1/PlotKit/excanvas.js +723 -0
  192. data/public/javascripts/old_sql/plotkit-0.9.1/README +1 -0
  193. data/public/javascripts/old_sql/plotkit-0.9.1/doc/MochiKitAdditions.html +2 -0
  194. data/public/javascripts/old_sql/plotkit-0.9.1/doc/MochiKitAdditions.txt +2 -0
  195. data/public/javascripts/old_sql/plotkit-0.9.1/doc/PlotKit.Base.html +302 -0
  196. data/public/javascripts/old_sql/plotkit-0.9.1/doc/PlotKit.Base.txt +139 -0
  197. data/public/javascripts/old_sql/plotkit-0.9.1/doc/PlotKit.Canvas.html +172 -0
  198. data/public/javascripts/old_sql/plotkit-0.9.1/doc/PlotKit.Canvas.txt +81 -0
  199. data/public/javascripts/old_sql/plotkit-0.9.1/doc/PlotKit.EasyPlot.html +155 -0
  200. data/public/javascripts/old_sql/plotkit-0.9.1/doc/PlotKit.EasyPlot.txt +50 -0
  201. data/public/javascripts/old_sql/plotkit-0.9.1/doc/PlotKit.Layout.html +428 -0
  202. data/public/javascripts/old_sql/plotkit-0.9.1/doc/PlotKit.Layout.txt +330 -0
  203. data/public/javascripts/old_sql/plotkit-0.9.1/doc/PlotKit.QuickStart.html +368 -0
  204. data/public/javascripts/old_sql/plotkit-0.9.1/doc/PlotKit.QuickStart.txt +256 -0
  205. data/public/javascripts/old_sql/plotkit-0.9.1/doc/PlotKit.Renderer.html +436 -0
  206. data/public/javascripts/old_sql/plotkit-0.9.1/doc/PlotKit.Renderer.txt +299 -0
  207. data/public/javascripts/old_sql/plotkit-0.9.1/doc/PlotKit.SVG.html +159 -0
  208. data/public/javascripts/old_sql/plotkit-0.9.1/doc/PlotKit.SVG.txt +64 -0
  209. data/public/javascripts/old_sql/plotkit-0.9.1/doc/PlotKit.SweetCanvas.html +131 -0
  210. data/public/javascripts/old_sql/plotkit-0.9.1/doc/PlotKit.SweetCanvas.txt +34 -0
  211. data/public/javascripts/old_sql/plotkit-0.9.1/doc/PlotKit.SweetSVG.html +131 -0
  212. data/public/javascripts/old_sql/plotkit-0.9.1/doc/PlotKit.SweetSVG.txt +34 -0
  213. data/public/javascripts/old_sql/plotkit-0.9.1/doc/PlotKit.html +334 -0
  214. data/public/javascripts/old_sql/plotkit-0.9.1/doc/PlotKit.txt +151 -0
  215. data/public/javascripts/old_sql/plotkit-0.9.1/doc/SVGCanvasCompat.html +304 -0
  216. data/public/javascripts/old_sql/plotkit-0.9.1/doc/SVGCanvasCompat.txt +144 -0
  217. data/public/javascripts/old_sql/plotkit-0.9.1/doc/barsample.png +0 -0
  218. data/public/javascripts/old_sql/plotkit-0.9.1/doc/black.png +0 -0
  219. data/public/javascripts/old_sql/plotkit-0.9.1/doc/blue.png +0 -0
  220. data/public/javascripts/old_sql/plotkit-0.9.1/doc/cyan.png +0 -0
  221. data/public/javascripts/old_sql/plotkit-0.9.1/doc/doc.css +62 -0
  222. data/public/javascripts/old_sql/plotkit-0.9.1/doc/generate.py +37 -0
  223. data/public/javascripts/old_sql/plotkit-0.9.1/doc/green.png +0 -0
  224. data/public/javascripts/old_sql/plotkit-0.9.1/doc/orange.png +0 -0
  225. data/public/javascripts/old_sql/plotkit-0.9.1/doc/piesample.png +0 -0
  226. data/public/javascripts/old_sql/plotkit-0.9.1/doc/purple.png +0 -0
  227. data/public/javascripts/old_sql/plotkit-0.9.1/doc/red.png +0 -0
  228. data/public/javascripts/old_sql/plotkit-0.9.1/scripts/custom_rhino.jar +0 -0
  229. data/public/javascripts/old_sql/plotkit-0.9.1/scripts/pack.py +58 -0
  230. data/public/javascripts/old_sql/plotkit-0.9.1/tests/axis.html +31 -0
  231. data/public/javascripts/old_sql/plotkit-0.9.1/tests/basic.html +25 -0
  232. data/public/javascripts/old_sql/plotkit-0.9.1/tests/basic.js +143 -0
  233. data/public/javascripts/old_sql/plotkit-0.9.1/tests/debug.html +56 -0
  234. data/public/javascripts/old_sql/plotkit-0.9.1/tests/demo-svg.html +58 -0
  235. data/public/javascripts/old_sql/plotkit-0.9.1/tests/demo-svg.js +133 -0
  236. data/public/javascripts/old_sql/plotkit-0.9.1/tests/demo.html +57 -0
  237. data/public/javascripts/old_sql/plotkit-0.9.1/tests/demo.js +136 -0
  238. data/public/javascripts/old_sql/plotkit-0.9.1/tests/dynamic.html +161 -0
  239. data/public/javascripts/old_sql/plotkit-0.9.1/tests/img/firefox.png +0 -0
  240. data/public/javascripts/old_sql/plotkit-0.9.1/tests/img/konqueror.png +0 -0
  241. data/public/javascripts/old_sql/plotkit-0.9.1/tests/img/mozilla.ico +0 -0
  242. data/public/javascripts/old_sql/plotkit-0.9.1/tests/img/msie.gif +0 -0
  243. data/public/javascripts/old_sql/plotkit-0.9.1/tests/img/opera.ico +0 -0
  244. data/public/javascripts/old_sql/plotkit-0.9.1/tests/img/safari.gif +0 -0
  245. data/public/javascripts/old_sql/plotkit-0.9.1/tests/labels-img.html +38 -0
  246. data/public/javascripts/old_sql/plotkit-0.9.1/tests/labels.html +43 -0
  247. data/public/javascripts/old_sql/plotkit-0.9.1/tests/prototype_compat.html +28 -0
  248. data/public/javascripts/old_sql/plotkit-0.9.1/tests/quickstart-easy.html +29 -0
  249. data/public/javascripts/old_sql/plotkit-0.9.1/tests/quickstart-horiz.html +53 -0
  250. data/public/javascripts/old_sql/plotkit-0.9.1/tests/quickstart-neg.html +29 -0
  251. data/public/javascripts/old_sql/plotkit-0.9.1/tests/quickstart-svg.html +61 -0
  252. data/public/javascripts/old_sql/plotkit-0.9.1/tests/quickstart.html +57 -0
  253. data/public/javascripts/old_sql/plotkit-0.9.1/tests/sample.txt +6 -0
  254. data/public/javascripts/old_sql/plotkit-0.9.1/tests/svg-sweet.html +29 -0
  255. data/public/javascripts/old_sql/plotkit-0.9.1/tests/svg-sweet.js +141 -0
  256. data/public/javascripts/old_sql/plotkit-0.9.1/tests/svg.html +26 -0
  257. data/public/javascripts/old_sql/plotkit-0.9.1/tests/svg.js +147 -0
  258. data/public/javascripts/old_sql/plotkit-0.9.1/tests/sweet.html +24 -0
  259. data/public/javascripts/old_sql/plotkit-0.9.1/tests/sweet.js +89 -0
  260. data/public/javascripts/old_sql/plotkit-0.9.1/tests/tests.css +66 -0
  261. data/public/javascripts/old_sql/plotkit-0.9.1/tests/testsvg.html +20 -0
  262. data/public/javascripts/old_sql/plotkit-0.9.1/tests/testsvg.js +31 -0
  263. metadata +264 -2
@@ -0,0 +1,577 @@
1
+ if (typeof(dojo) != 'undefined') { dojo.require('MochiKit.Base'); }
2
+ if (typeof(JSAN) != 'undefined') { JSAN.use('MochiKit.Base'); }
3
+ if (typeof(tests) == 'undefined') { tests = {}; }
4
+
5
+ tests.test_Base = function (t) {
6
+ // test bind
7
+ var not_self = {"toString": function () { return "not self"; } };
8
+ var self = {"toString": function () { return "self"; } };
9
+ var func = function (arg) { return this.toString() + " " + arg; };
10
+ var boundFunc = bind(func, self);
11
+ not_self.boundFunc = boundFunc;
12
+
13
+ t.is( boundFunc("foo"), "self foo", "boundFunc bound to self properly" );
14
+ t.is( not_self.boundFunc("foo"), "self foo", "boundFunc bound to self on another obj" );
15
+ t.is( bind(boundFunc, not_self)("foo"), "not self foo", "boundFunc successfully rebound!" );
16
+ t.is( bind(boundFunc, undefined, "foo")(), "self foo", "boundFunc partial no self change" );
17
+ t.is( bind(boundFunc, not_self, "foo")(), "not self foo", "boundFunc partial self change" );
18
+
19
+ // test method
20
+ not_self = {"toString": function () { return "not self"; } };
21
+ self = {"toString": function () { return "self"; } };
22
+ func = function (arg) { return this.toString() + " " + arg; };
23
+ var boundMethod = method(self, func);
24
+ not_self.boundMethod = boundMethod;
25
+
26
+ t.is( boundMethod("foo"), "self foo", "boundMethod bound to self properly" );
27
+ t.is( not_self.boundMethod("foo"), "self foo", "boundMethod bound to self on another obj" );
28
+ t.is( method(not_self, boundMethod)("foo"), "not self foo", "boundMethod successfully rebound!" );
29
+ t.is( method(undefined, boundMethod, "foo")(), "self foo", "boundMethod partial no self change" );
30
+ t.is( method(not_self, boundMethod, "foo")(), "not self foo", "boundMethod partial self change" );
31
+
32
+ // test bindLate
33
+ self = {"toString": function () { return "self"; } };
34
+ boundFunc = bindLate("toString", self);
35
+ t.is( boundFunc(), "self", "bindLate binds properly" );
36
+ self.toString = function () { return "not self"; };
37
+ t.is( boundFunc(), "not self", "bindLate late function lookup" );
38
+ func = function (arg) { return this.toString() + " " + arg; };
39
+ boundFunc = bindLate(func, self);
40
+ t.is( boundFunc("foo"), "not self foo", "bindLate fallback to standard bind" );
41
+
42
+ // test bindMethods
43
+
44
+ var O = function (value) {
45
+ bindMethods(this);
46
+ this.value = value;
47
+ };
48
+ O.prototype.func = function () {
49
+ return this.value;
50
+ };
51
+
52
+ var o = new O("boring");
53
+ var p = {};
54
+ p.func = o.func;
55
+ var func = o.func;
56
+ t.is( o.func(), "boring", "bindMethods doesn't break shit" );
57
+ t.is( p.func(), "boring", "bindMethods works on other objects" );
58
+ t.is( func(), "boring", "bindMethods works on functions" );
59
+
60
+ var p = clone(o);
61
+ t.ok( p instanceof O, "cloned correct inheritance" );
62
+ var q = clone(p);
63
+ t.ok( q instanceof O, "clone-cloned correct inheritance" );
64
+ q.foo = "bar";
65
+ t.is( p.foo, undefined, "clone-clone is copy-on-write" );
66
+ p.bar = "foo";
67
+ t.is( o.bar, undefined, "clone is copy-on-write" );
68
+ t.is( q.bar, "foo", "clone-clone has proper delegation" );
69
+ // unbind
70
+ p.func = bind(p.func, null);
71
+ t.is( p.func(), "boring", "clone function calls correct" );
72
+ q.value = "awesome";
73
+ t.is( q.func(), "awesome", "clone really does work" );
74
+
75
+ // test boring boolean funcs
76
+ t.is( isNull(null), true, "isNull matches null" );
77
+ t.is( isNull(undefined), false, "isNull doesn't match undefined" );
78
+ t.is( isNull({}), false, "isNull doesn't match objects" );
79
+
80
+ t.is( isCallable(isCallable), true, "isCallable returns true on itself" );
81
+ t.is( isCallable(1), false, "isCallable returns false on numbers" );
82
+
83
+ t.is( isUndefined(null), false, "null is not undefined" );
84
+ t.is( isUndefined(""), false, "empty string is not undefined" );
85
+ t.is( isUndefined(undefined), true, "undefined is undefined" );
86
+ t.is( isUndefined({}.foo), true, "missing property is undefined" );
87
+
88
+ t.is( isUndefinedOrNull(null), true, "null is undefined or null" );
89
+ t.is( isUndefinedOrNull(""), false, "empty string is not undefined or null" );
90
+ t.is( isUndefinedOrNull(undefined), true, "undefined is undefined or null" );
91
+ t.is( isUndefinedOrNull({}.foo), true, "missing property is undefined or null" );
92
+
93
+ t.is( isEmpty(null), true, "isEmpty null" );
94
+ t.is( isEmpty([], [], ""), true, "isEmpty true" );
95
+ t.is( isEmpty([], [1], ""), true, "isEmpty true" );
96
+ t.is( isEmpty([1], [1], "1"), false, "isEmpty false" );
97
+ t.is( isEmpty([1], [1], "1"), false, "isEmpty false" );
98
+
99
+ t.is( isNotEmpty(null), false, "isNotEmpty null" );
100
+ t.is( isNotEmpty([], [], ""), false, "isNotEmpty false" );
101
+ t.is( isNotEmpty([], [1], ""), false, "isNotEmpty false" );
102
+ t.is( isNotEmpty([1], [1], "1"), true, "isNotEmpty true" );
103
+ t.is( isNotEmpty([1], [1], "1"), true, "isNotEmpty true" );
104
+
105
+ t.is( isArrayLike(undefined), false, "isArrayLike(undefined)" );
106
+ t.is( isArrayLike(null), false, "isArrayLike(null)" );
107
+ t.is( isArrayLike([]), true, "isArrayLike([])" );
108
+
109
+ // test extension of arrays
110
+ var a = [];
111
+ var b = [];
112
+ var three = [1, 2, 3];
113
+
114
+ extend(a, three, 1);
115
+ t.ok( objEqual(a, [2, 3]), "extend to an empty array" );
116
+ extend(a, three, 1)
117
+ t.ok( objEqual(a, [2, 3, 2, 3]), "extend to a non-empty array" );
118
+
119
+ extend(b, three);
120
+ t.ok( objEqual(b, three), "extend of an empty array" );
121
+
122
+ var c1 = extend(null, three);
123
+ t.ok( objEqual(c1, three), "extend null" );
124
+ var c2 = extend(undefined, three);
125
+ t.ok( objEqual(c2, three), "extend undefined" );
126
+
127
+
128
+ t.is( compare(1, 2), -1, "numbers compare lt" );
129
+ t.is( compare(2, 1), 1, "numbers compare gt" );
130
+ t.is( compare(1, 1), 0, "numbers compare eq" );
131
+ t.is( compare([1], [1]), 0, "arrays compare eq" );
132
+ t.is( compare([1], [1, 2]), -1, "arrays compare lt (length)" );
133
+ t.is( compare([1, 2], [2, 1]), -1, "arrays compare lt (contents)" );
134
+ t.is( compare([1, 2], [1]), 1, "arrays compare gt (length)" );
135
+ t.is( compare([2, 1], [1, 1]), 1, "arrays compare gt (contents)" );
136
+
137
+ // test partial application
138
+ var a = [];
139
+ var func = function (a, b) {
140
+ if (arguments.length != 2) {
141
+ return "bad args";
142
+ } else {
143
+ return this.value + a + b;
144
+ }
145
+ };
146
+ var self = {"value": 1, "func": func};
147
+ var self2 = {"value": 2};
148
+ t.is( self.func(2, 3), 6, "setup for test is correct" );
149
+ self.funcTwo = partial(self.func, 2);
150
+ t.is( self.funcTwo(3), 6, "partial application works" );
151
+ t.is( self.funcTwo(3), 6, "partial application works still" );
152
+ t.is( bind(self.funcTwo, self2)(3), 7, "rebinding partial works" );
153
+ self.funcTwo = bind(bind(self.funcTwo, self2), null);
154
+ t.is( self.funcTwo(3), 6, "re-unbinding partial application works" );
155
+
156
+
157
+ // nodeWalk test
158
+ // ... looks a lot like a DOM tree on purpose
159
+ var tree = {
160
+ "id": "nodeWalkTestTree",
161
+ "test:int": "1",
162
+ "childNodes": [
163
+ {
164
+ "test:int": "2",
165
+ "childNodes": [
166
+ {"test:int": "5"},
167
+ "ignored string",
168
+ {"ignored": "object"},
169
+ ["ignored", "list"],
170
+ {
171
+ "test:skipchildren": "1",
172
+ "childNodes": [{"test:int": 6}]
173
+ }
174
+ ]
175
+ },
176
+ {"test:int": "3"},
177
+ {"test:int": "4"}
178
+ ]
179
+ }
180
+
181
+ var visitedNodes = [];
182
+ nodeWalk(tree, function (node) {
183
+ var attr = node["test:int"];
184
+ if (attr) {
185
+ visitedNodes.push(attr);
186
+ }
187
+ if (node["test:skipchildren"]) {
188
+ return;
189
+ }
190
+ return node.childNodes;
191
+ });
192
+
193
+ t.ok( objEqual(visitedNodes, ["1", "2", "3", "4", "5"]), "nodeWalk looks like it works");
194
+
195
+ // test map
196
+ var minusOne = function (x) { return x - 1; };
197
+ var res = map(minusOne, [1, 2, 3]);
198
+ t.ok( objEqual(res, [0, 1, 2]), "map works" );
199
+
200
+ var res2 = xmap(minusOne, 1, 2, 3);
201
+ t.ok( objEqual(res2, res), "xmap works" );
202
+
203
+ res = map(operator.add, [1, 2, 3], [2, 4, 6]);
204
+ t.ok( objEqual(res, [3, 6, 9]), "map(fn, p, q) works" );
205
+
206
+ res = map(operator.add, [1, 2, 3], [2, 4, 6, 8]);
207
+ t.ok( objEqual(res, [3, 6, 9]), "map(fn, p, q) works (q long)" );
208
+
209
+ res = map(operator.add, [1, 2, 3, 4], [2, 4, 6]);
210
+ t.ok( objEqual(res, [3, 6, 9]), "map(fn, p, q) works (p long)" );
211
+
212
+ res = map(null, [1, 2, 3], [2, 4, 6]);
213
+ t.ok( objEqual(res, [[1, 2], [2, 4], [3, 6]]), "map(null, p, q) works" );
214
+
215
+ res = zip([1, 2, 3], [2, 4, 6]);
216
+ t.ok( objEqual(res, [[1, 2], [2, 4], [3, 6]]), "zip(p, q) works" );
217
+
218
+ res = map(null, [1, 2, 3]);
219
+ t.ok( objEqual(res, [1, 2, 3]), "map(null, lst) works" );
220
+
221
+
222
+
223
+
224
+ t.is( isNotEmpty("foo"), true, "3 char string is not empty" );
225
+ t.is( isNotEmpty(""), false, "0 char string is empty" );
226
+ t.is( isNotEmpty([1, 2, 3]), true, "3 element list is not empty" );
227
+ t.is( isNotEmpty([]), false, "0 element list is empty" );
228
+
229
+ // test filter
230
+ var greaterThanThis = function (x) { return x > this; };
231
+ var greaterThanOne = function (x) { return x > 1; };
232
+ var res = filter(greaterThanOne, [-1, 0, 1, 2, 3]);
233
+ t.ok( objEqual(res, [2, 3]), "filter works" );
234
+ var res = filter(greaterThanThis, [-1, 0, 1, 2, 3], 1);
235
+ t.ok( objEqual(res, [2, 3]), "filter self works" );
236
+ var res2 = xfilter(greaterThanOne, -1, 0, 1, 2, 3);
237
+ t.ok( objEqual(res2, res), "xfilter works" );
238
+
239
+ t.is(objMax(1, 2, 9, 12, 42, -16, 16), 42, "objMax works (with numbers)");
240
+ t.is(objMin(1, 2, 9, 12, 42, -16, 16), -16, "objMin works (with numbers)");
241
+
242
+ // test adapter registry
243
+
244
+ var R = new AdapterRegistry();
245
+ R.register("callable", isCallable, function () { return "callable"; });
246
+ R.register("arrayLike", isArrayLike, function () { return "arrayLike"; });
247
+ t.is( R.match(function () {}), "callable", "registry found callable" );
248
+ t.is( R.match([]), "arrayLike", "registry found ArrayLike" );
249
+ try {
250
+ R.match(null);
251
+ t.ok( false, "non-matching didn't raise!" );
252
+ } catch (e) {
253
+ t.is( e, NotFound, "non-matching raised correctly" );
254
+ }
255
+ R.register("undefinedOrNull", isUndefinedOrNull, function () { return "undefinedOrNull" });
256
+ R.register("undefined", isUndefined, function () { return "undefined" });
257
+ t.is( R.match(undefined), "undefinedOrNull", "priorities are as documented" );
258
+ t.ok( R.unregister("undefinedOrNull"), "removed adapter" );
259
+ t.is( R.match(undefined), "undefined", "adapter was removed" );
260
+ R.register("undefinedOrNull", isUndefinedOrNull, function () { return "undefinedOrNull" }, true);
261
+ t.is( R.match(undefined), "undefinedOrNull", "override works" );
262
+
263
+ var a1 = {"a": 1, "b": 2, "c": 2};
264
+ var a2 = {"a": 2, "b": 1, "c": 2};
265
+ t.is( keyComparator("a")(a1, a2), -1, "keyComparator 1 lt" );
266
+ t.is( keyComparator("c")(a1, a2), 0, "keyComparator 1 eq" );
267
+ t.is( keyComparator("c", "b")(a1, a2), 1, "keyComparator 2 eq gt" );
268
+ t.is( keyComparator("c", "a")(a1, a2), -1, "keyComparator 2 eq lt" );
269
+ t.is( reverseKeyComparator("a")(a1, a2), 1, "reverseKeyComparator" );
270
+ t.is( compare(concat([1], [2], [3]), [1, 2, 3]), 0, "concat" );
271
+ t.is( repr("foo"), '"foo"', "string repr" );
272
+ t.is( repr(1), '1', "number repr" );
273
+ t.is( listMin([1, 3, 5, 3, -1]), -1, "listMin" );
274
+ t.is( objMin(1, 3, 5, 3, -1), -1, "objMin" );
275
+ t.is( listMax([1, 3, 5, 3, -1]), 5, "listMax" );
276
+ t.is( objMax(1, 3, 5, 3, -1), 5, "objMax" );
277
+
278
+ var v = keys(a1);
279
+ v.sort();
280
+ t.is( compare(v, ["a", "b", "c"]), 0, "keys" );
281
+ v = items(a1);
282
+ v.sort();
283
+ t.is( compare(v, [["a", 1], ["b", 2], ["c", 2]]), 0, "items" );
284
+
285
+ var StringMap = function() {};
286
+ a = new StringMap();
287
+ a.foo = "bar";
288
+ b = new StringMap();
289
+ b.foo = "bar";
290
+ try {
291
+ compare(a, b);
292
+ t.ok( false, "bad comparison registered!?" );
293
+ } catch (e) {
294
+ t.ok( e instanceof TypeError, "bad comparison raised TypeError" );
295
+ }
296
+
297
+ t.is( repr(a), "[object Object]", "default repr for StringMap" );
298
+ var isStringMap = function () {
299
+ for (var i = 0; i < arguments.length; i++) {
300
+ if (!(arguments[i] instanceof StringMap)) {
301
+ return false;
302
+ }
303
+ }
304
+ return true;
305
+ };
306
+
307
+ registerRepr("stringMap",
308
+ isStringMap,
309
+ function (obj) {
310
+ return "StringMap(" + repr(items(obj)) + ")";
311
+ }
312
+ );
313
+
314
+ t.is( repr(a), 'StringMap([["foo", "bar"]])', "repr worked" );
315
+
316
+ // not public API
317
+ MochiKit.Base.reprRegistry.unregister("stringMap");
318
+
319
+ t.is( repr(a), "[object Object]", "default repr for StringMap" );
320
+
321
+ registerComparator("stringMap",
322
+ isStringMap,
323
+ function (a, b) {
324
+ // no sorted(...) in base
325
+ a = items(a);
326
+ b = items(b);
327
+ a.sort(compare);
328
+ b.sort(compare);
329
+ return compare(a, b);
330
+ }
331
+ );
332
+
333
+ t.is( compare(a, b), 0, "registerComparator" );
334
+
335
+ update(a, {"foo": "bar"}, {"wibble": "baz"}, undefined, null, {"grr": 1});
336
+ t.is( a.foo, "bar", "update worked (first obj)" );
337
+ t.is( a.wibble, "baz", "update worked (second obj)" );
338
+ t.is( a.grr, 1, "update worked (skipped undefined and null)" );
339
+ t.is( compare(a, b), 1, "update worked (comparison)" );
340
+
341
+
342
+ setdefault(a, {"foo": "unf"}, {"bar": "web taco"} );
343
+ t.is( a.foo, "bar", "setdefault worked (skipped existing)" );
344
+ t.is( a.bar, "web taco", "setdefault worked (set non-existing)" );
345
+
346
+ a = null;
347
+ a = setdefault(null, {"foo": "bar"});
348
+ t.is( a.foo, "bar", "setdefault worked (self is null)" );
349
+
350
+ a = null;
351
+ a = setdefault(undefined, {"foo": "bar"});
352
+ t.is( a.foo, "bar", "setdefault worked (self is undefined)" );
353
+
354
+ a = null;
355
+ a = update(null, {"foo": "bar"}, {"wibble": "baz"}, undefined, null, {"grr": 1});
356
+ t.is( a.foo, "bar", "update worked (self is null, first obj)" );
357
+ t.is( a.wibble, "baz", "update worked (self is null, second obj)" );
358
+ t.is( a.grr, 1, "update worked (self is null, skipped undefined and null)" );
359
+
360
+ a = null;
361
+ a = update(undefined, {"foo": "bar"}, {"wibble": "baz"}, undefined, null, {"grr": 1});
362
+ t.is( a.foo, "bar", "update worked (self is undefined, first obj)" );
363
+ t.is( a.wibble, "baz", "update worked (self is undefined, second obj)" );
364
+ t.is( a.grr, 1, "update worked (self is undefined, skipped undefined and null)" );
365
+
366
+
367
+ var c = items(merge({"foo": "bar"}, {"wibble": "baz"}));
368
+ c.sort(compare);
369
+ t.is( compare(c, [["foo", "bar"], ["wibble", "baz"]]), 0, "merge worked" );
370
+
371
+ // not public API
372
+ MochiKit.Base.comparatorRegistry.unregister("stringMap");
373
+
374
+ try {
375
+ compare(a, b);
376
+ t.ok( false, "bad comparison registered!?" );
377
+ } catch (e) {
378
+ t.ok( e instanceof TypeError, "bad comparison raised TypeError" );
379
+ }
380
+
381
+ var o = {"__repr__": function () { return "__repr__"; }};
382
+ t.is( repr(o), "__repr__", "__repr__ protocol" );
383
+ t.is( repr(MochiKit.Base), MochiKit.Base.__repr__(), "__repr__ protocol when repr is defined" );
384
+ var o = {"NAME": "NAME"};
385
+ t.is( repr(o), "NAME", "NAME protocol (obj)" );
386
+ o = function () { return "TACO" };
387
+ o.NAME = "NAME";
388
+ t.is( repr(o), "NAME", "NAME protocol (func)" );
389
+
390
+ t.is( repr(MochiKit.Base.nameFunctions), "MochiKit.Base.nameFunctions", "test nameFunctions" );
391
+ // Done!
392
+
393
+ t.is( urlEncode("1+2=2").toUpperCase(), "1%2B2%3D2", "urlEncode" );
394
+ t.is( queryString(["a", "b"], [1, "two"]), "a=1&b=two", "queryString");
395
+ t.is( queryString({"a": 1}), "a=1", "one item alternate form queryString" );
396
+ var o = {"a": 1, "b": 2, "c": function() {}};
397
+ var res = queryString(o).split("&");
398
+ res.sort();
399
+ t.is( res.join("&"), "a=1&b=2", "two item alternate form queryString, function skip" );
400
+ var res = parseQueryString("1+1=2&b=3%3D2");
401
+ t.is( res["1 1"], "2", "parseQueryString pathological name" );
402
+ t.is( res.b, "3=2", "parseQueryString second name:value pair" );
403
+ var res = parseQueryString("foo=one&foo=two", true);
404
+ t.is( res["foo"].join(" "), "one two", "parseQueryString useArrays" );
405
+ var res = parseQueryString("?foo=2&bar=1");
406
+ t.is( res["foo"], "2", "parseQueryString strip leading question mark");
407
+
408
+ var res = parseQueryString("x=1&y=2");
409
+ t.is( typeof(res['&']), "undefined", "extra cruft in parseQueryString output");
410
+
411
+ t.is( serializeJSON("foo\n\r\b\f\t\u000B\u001B"), "\"foo\\n\\r\\b\\f\\t\\u000B\\u001B\"", "string JSON" );
412
+ t.is( serializeJSON(null), "null", "null JSON");
413
+ try {
414
+ serializeJSON(undefined);
415
+ t.ok(false, "undefined should not be serializable");
416
+ } catch (e) {
417
+ t.ok(e instanceof TypeError, "undefined not serializable");
418
+ }
419
+ t.is( serializeJSON(1), "1", "1 JSON");
420
+ t.is( serializeJSON(1.23), "1.23", "1.23 JSON");
421
+ t.is( serializeJSON(serializeJSON), null, "function JSON (null, not string)" );
422
+ t.is( serializeJSON([1, "2", 3.3]), "[1, \"2\", 3.3]", "array JSON" );
423
+ var res = evalJSON(serializeJSON({"a":1, "b":2}));
424
+ t.is( res.a, 1, "evalJSON on an object (1)" );
425
+ t.is( res.b, 2, "evalJSON on an object (2)" );
426
+ var res = {"a": 1, "b": 2, "json": function () { return this; }};
427
+ var res = evalJSON(serializeJSON(res));
428
+ t.is( res.a, 1, "evalJSON on an object that jsons self (1)" );
429
+ t.is( res.b, 2, "evalJSON on an object that jsons self (2)" );
430
+ var strJSON = {"a": 1, "b": 2, "json": function () { return "json"; }};
431
+ t.is( serializeJSON(strJSON), "\"json\"", "json serialization calling" );
432
+ t.is( serializeJSON([strJSON]), "[\"json\"]", "json serialization calling in a structure" );
433
+ t.is( evalJSON('/* {"result": 1} */').result, 1, "json comment stripping" );
434
+ t.is( evalJSON('/* {"*/ /*": 1} */')['*/ /*'], 1, "json comment stripping" );
435
+ registerJSON("isDateLike",
436
+ isDateLike,
437
+ function (d) {
438
+ return "this was a date";
439
+ }
440
+ );
441
+ t.is( serializeJSON(new Date()), "\"this was a date\"", "json registry" );
442
+ MochiKit.Base.jsonRegistry.unregister("isDateLike");
443
+
444
+ var a = {"foo": {"bar": 12, "wibble": 13}};
445
+ var b = {"foo": {"baz": 4, "bar": 16}, "bar": 4};
446
+ updatetree(a, b);
447
+ var expect = [["bar", 16], ["baz", 4], ["wibble", 13]];
448
+ var got = items(a.foo);
449
+ got.sort(compare);
450
+ t.is( repr(got), repr(expect), "updatetree merge" );
451
+ t.is( a.bar, 4, "updatetree insert" );
452
+
453
+ var aa = {"foo": {"bar": 12, "wibble": 13}};
454
+ var bb = {"foo": {"baz": 4, "bar": 16}, "bar": 4};
455
+
456
+ cc = updatetree(null, aa, bb);
457
+ got = items(cc.foo);
458
+ got.sort(compare);
459
+ t.is( repr(got), repr(expect), "updatetree merge (self is null)" );
460
+ t.is( cc.bar, 4, "updatetree insert (self is null)" );
461
+
462
+ cc = updatetree(undefined, aa, bb);
463
+ got = items(cc.foo);
464
+ got.sort(compare);
465
+ t.is( repr(got), repr(expect), "updatetree merge (self is undefined)" );
466
+ t.is( cc.bar, 4, "updatetree insert (self is undefined)" );
467
+
468
+ var c = counter();
469
+ t.is( c(), 1, "counter starts at 1" );
470
+ t.is( c(), 2, "counter increases" );
471
+ c = counter(2);
472
+ t.is( c(), 2, "counter starts at 2" );
473
+ t.is( c(), 3, "counter increases" );
474
+
475
+ t.is( findValue([1, 2, 3], 4), -1, "findValue returns -1 on not found");
476
+ t.is( findValue([1, 2, 3], 1), 0, "findValue returns correct index");
477
+ t.is( findValue([1, 2, 3], 1, 1), -1, "findValue honors start");
478
+ t.is( findValue([1, 2, 3], 2, 0, 1), -1, "findValue honors end");
479
+ t.is( findIdentical([1, 2, 3], 4), -1, "findIdentical returns -1");
480
+ t.is( findIdentical([1, 2, 3], 1), 0, "findIdentical returns correct index");
481
+ t.is( findIdentical([1, 2, 3], 1, 1), -1, "findIdentical honors start");
482
+ t.is( findIdentical([1, 2, 3], 2, 0, 1), -1, "findIdentical honors end");
483
+
484
+ var flat = flattenArguments(1, "2", 3, [4, [5, [6, 7], 8, [], 9]]);
485
+ var expect = [1, "2", 3, 4, 5, 6, 7, 8, 9];
486
+ t.is( repr(flat), repr(expect), "flattenArguments" );
487
+
488
+ var fn = function () {
489
+ return [this, concat(arguments)];
490
+ }
491
+ t.is( methodcaller("toLowerCase")("FOO"), "foo", "methodcaller with a method name" );
492
+ t.is( repr(methodcaller(fn, 2, 3)(1)), "[1, [2, 3]]", "methodcaller with a function" );
493
+
494
+ var f1 = function (x) { return [1, x]; };
495
+ var f2 = function (x) { return [2, x]; };
496
+ var f3 = function (x) { return [3, x]; };
497
+ t.is( repr(f1(f2(f3(4)))), "[1, [2, [3, 4]]]", "test the compose test" );
498
+ t.is( repr(compose(f1,f2,f3)(4)), "[1, [2, [3, 4]]]", "three fn composition works" );
499
+ t.is( repr(compose(compose(f1,f2),f3)(4)), "[1, [2, [3, 4]]]", "associative left" );
500
+ t.is( repr(compose(f1,compose(f2,f3))(4)), "[1, [2, [3, 4]]]", "associative right" );
501
+
502
+ try {
503
+ compose(f1, "foo");
504
+ t.ok( false, "wrong compose argument not raised!" );
505
+ } catch (e) {
506
+ t.is( e.name, 'TypeError', "wrong compose argument raised correctly" );
507
+ }
508
+
509
+ t.is(camelize('one'), 'one', 'one word');
510
+ t.is(camelize('one-two'), 'oneTwo', 'two words');
511
+ t.is(camelize('one-two-three'), 'oneTwoThree', 'three words');
512
+ t.is(camelize('1-one'), '1One', 'letter and word');
513
+ t.is(camelize('one-'), 'one', 'trailing hyphen');
514
+ t.is(camelize('-one'), 'One', 'starting hyphen');
515
+ t.is(camelize('o-two'), 'oTwo', 'one character and word');
516
+
517
+ var flat = flattenArray([1, "2", 3, [4, [5, [6, 7], 8, [], 9]]]);
518
+ var expect = [1, "2", 3, 4, 5, 6, 7, 8, 9];
519
+ t.is( repr(flat), repr(expect), "flattenArray" );
520
+
521
+ /* mean */
522
+ try {
523
+ mean();
524
+ t.ok( false, "mean no arguments didn't raise!" );
525
+ } catch (e) {
526
+ t.is( e.name, 'TypeError', "no arguments raised correctly" );
527
+ }
528
+ t.is( mean(1), 1, 'single argument (arg list)');
529
+ t.is( mean([1]), 1, 'single argument (array)');
530
+ t.is( mean(1,2,3), 2, 'three arguments (arg list)');
531
+ t.is( mean([1,2,3]), 2, 'three arguments (array)');
532
+ t.is( average(1), 1, 'test the average alias');
533
+
534
+ /* median */
535
+ try {
536
+ median();
537
+ t.ok( false, "median no arguments didn't raise!" );
538
+ } catch (e) {
539
+ t.is( e.name, 'TypeError', "no arguments raised correctly" );
540
+ }
541
+ t.is( median(1), 1, 'single argument (arg list)');
542
+ t.is( median([1]), 1, 'single argument (array)');
543
+ t.is( median(3,1,2), 2, 'three arguments (arg list)');
544
+ t.is( median([3,1,2]), 2, 'three arguments (array)');
545
+ t.is( median(3,1,2,4), 2.5, 'four arguments (arg list)');
546
+ t.is( median([3,1,2,4]), 2.5, 'four arguments (array)');
547
+
548
+ /* #185 */
549
+ t.is( serializeJSON(parseQueryString("")), "{}", "parseQueryString('')" );
550
+ t.is( serializeJSON(parseQueryString("", true)), "{}", "parseQueryString('', true)" );
551
+
552
+ /* #109 */
553
+ t.is( queryString({ids: [1,2,3]}), "ids=1&ids=2&ids=3", "queryString array value" );
554
+ t.is( queryString({ids: "123"}), "ids=123", "queryString string value" );
555
+
556
+ /* test values */
557
+ var o = {a: 1, b: 2, c: 4, d: -1};
558
+ var got = values(o);
559
+ got.sort();
560
+ t.is( repr(got), repr([-1, 1, 2, 4]), "values()" );
561
+
562
+ t.is( queryString([["foo", "bar"], ["baz", "wibble"]]), "foo=baz&bar=wibble" );
563
+ o = parseQueryString("foo=1=1=1&bar=2&baz&wibble=");
564
+ t.is( o.foo, "1=1=1", "parseQueryString multiple = first" );
565
+ t.is( o.bar, "2", "parseQueryString multiple = second" );
566
+ t.is( o.baz, "", "parseQueryString multiple = third" );
567
+ t.is( o.wibble, "", "parseQueryString multiple = fourth" );
568
+
569
+ /* queryString with null values */
570
+ t.is( queryString(["a", "b"], [1, null]), "a=1", "queryString with null value" );
571
+ t.is( queryString({"a": 1, "b": null}), "a=1", "queryString with null value" );
572
+
573
+ var reprFunc = function (a, b) {
574
+ return;
575
+ }
576
+ t.is( repr(reprFunc), "function (a, b) {...}", "repr of function" );
577
+ };