old_sql 1.16.0 → 1.17.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (273) hide show
  1. data/README.md +24 -13
  2. data/app/controllers/old_sql/report_controller.rb +3 -17
  3. data/app/views/layouts/old_sql/chart.html.erb +11 -0
  4. data/app/views/old_sql/report/chart.html.erb +8 -25
  5. data/lib/generators/old_sql/templates/user_design_template.csv +2 -3
  6. data/lib/generators/old_sql/templates/user_old_sql_demo_chart_design.yml +18 -9
  7. data/lib/old_sql/report_design/chart.rb +2 -2
  8. data/lib/old_sql/report_design/chart_item.rb +4 -4
  9. data/lib/old_sql/report_design/chart_parser.rb +2 -2
  10. data/public/javascripts/old_sql/chart.js +33 -0
  11. metadata +5 -265
  12. data/public/javascripts/old_sql/MochiKit-1.4.2/Changes +0 -362
  13. data/public/javascripts/old_sql/MochiKit-1.4.2/LICENSE.txt +0 -69
  14. data/public/javascripts/old_sql/MochiKit-1.4.2/MANIFEST +0 -179
  15. data/public/javascripts/old_sql/MochiKit-1.4.2/META.json +0 -17
  16. data/public/javascripts/old_sql/MochiKit-1.4.2/doc/html/MochiKit/Async.html +0 -814
  17. data/public/javascripts/old_sql/MochiKit-1.4.2/doc/html/MochiKit/Base.html +0 -1703
  18. data/public/javascripts/old_sql/MochiKit-1.4.2/doc/html/MochiKit/Color.html +0 -755
  19. data/public/javascripts/old_sql/MochiKit-1.4.2/doc/html/MochiKit/DOM.html +0 -1197
  20. data/public/javascripts/old_sql/MochiKit-1.4.2/doc/html/MochiKit/DateTime.html +0 -168
  21. data/public/javascripts/old_sql/MochiKit-1.4.2/doc/html/MochiKit/DragAndDrop.html +0 -187
  22. data/public/javascripts/old_sql/MochiKit-1.4.2/doc/html/MochiKit/Format.html +0 -300
  23. data/public/javascripts/old_sql/MochiKit-1.4.2/doc/html/MochiKit/Iter.html +0 -524
  24. data/public/javascripts/old_sql/MochiKit-1.4.2/doc/html/MochiKit/Logging.html +0 -420
  25. data/public/javascripts/old_sql/MochiKit-1.4.2/doc/html/MochiKit/LoggingPane.html +0 -142
  26. data/public/javascripts/old_sql/MochiKit-1.4.2/doc/html/MochiKit/Position.html +0 -38
  27. data/public/javascripts/old_sql/MochiKit-1.4.2/doc/html/MochiKit/Selector.html +0 -240
  28. data/public/javascripts/old_sql/MochiKit-1.4.2/doc/html/MochiKit/Signal.html +0 -508
  29. data/public/javascripts/old_sql/MochiKit-1.4.2/doc/html/MochiKit/Sortable.html +0 -244
  30. data/public/javascripts/old_sql/MochiKit-1.4.2/doc/html/MochiKit/Style.html +0 -385
  31. data/public/javascripts/old_sql/MochiKit-1.4.2/doc/html/MochiKit/VersionHistory.html +0 -384
  32. data/public/javascripts/old_sql/MochiKit-1.4.2/doc/html/MochiKit/Visual.html +0 -1161
  33. data/public/javascripts/old_sql/MochiKit-1.4.2/doc/html/MochiKit/index.html +0 -447
  34. data/public/javascripts/old_sql/MochiKit-1.4.2/doc/js/toc.js +0 -113
  35. data/public/javascripts/old_sql/MochiKit-1.4.2/doc/rst/MochiKit/Async.rst +0 -767
  36. data/public/javascripts/old_sql/MochiKit-1.4.2/doc/rst/MochiKit/Base.rst +0 -1445
  37. data/public/javascripts/old_sql/MochiKit-1.4.2/doc/rst/MochiKit/Color.rst +0 -651
  38. data/public/javascripts/old_sql/MochiKit-1.4.2/doc/rst/MochiKit/DOM.rst +0 -1143
  39. data/public/javascripts/old_sql/MochiKit-1.4.2/doc/rst/MochiKit/DateTime.rst +0 -145
  40. data/public/javascripts/old_sql/MochiKit-1.4.2/doc/rst/MochiKit/DragAndDrop.rst +0 -197
  41. data/public/javascripts/old_sql/MochiKit-1.4.2/doc/rst/MochiKit/Format.rst +0 -258
  42. data/public/javascripts/old_sql/MochiKit-1.4.2/doc/rst/MochiKit/Iter.rst +0 -454
  43. data/public/javascripts/old_sql/MochiKit-1.4.2/doc/rst/MochiKit/Logging.rst +0 -348
  44. data/public/javascripts/old_sql/MochiKit-1.4.2/doc/rst/MochiKit/LoggingPane.rst +0 -128
  45. data/public/javascripts/old_sql/MochiKit-1.4.2/doc/rst/MochiKit/Position.rst +0 -26
  46. data/public/javascripts/old_sql/MochiKit-1.4.2/doc/rst/MochiKit/Selector.rst +0 -203
  47. data/public/javascripts/old_sql/MochiKit-1.4.2/doc/rst/MochiKit/Signal.rst +0 -498
  48. data/public/javascripts/old_sql/MochiKit-1.4.2/doc/rst/MochiKit/Sortable.rst +0 -186
  49. data/public/javascripts/old_sql/MochiKit-1.4.2/doc/rst/MochiKit/Style.rst +0 -353
  50. data/public/javascripts/old_sql/MochiKit-1.4.2/doc/rst/MochiKit/VersionHistory.rst +0 -362
  51. data/public/javascripts/old_sql/MochiKit-1.4.2/doc/rst/MochiKit/Visual.rst +0 -895
  52. data/public/javascripts/old_sql/MochiKit-1.4.2/doc/rst/MochiKit/index.rst +0 -83
  53. data/public/javascripts/old_sql/MochiKit-1.4.2/examples/ajax_tables/ajax_tables.css +0 -69
  54. data/public/javascripts/old_sql/MochiKit-1.4.2/examples/ajax_tables/ajax_tables.js +0 -401
  55. data/public/javascripts/old_sql/MochiKit-1.4.2/examples/ajax_tables/domains.json +0 -10
  56. data/public/javascripts/old_sql/MochiKit-1.4.2/examples/ajax_tables/domains.xml +0 -40
  57. data/public/javascripts/old_sql/MochiKit-1.4.2/examples/ajax_tables/index.html +0 -96
  58. data/public/javascripts/old_sql/MochiKit-1.4.2/examples/color_wheel/color_wheel.css +0 -4
  59. data/public/javascripts/old_sql/MochiKit-1.4.2/examples/color_wheel/color_wheel.js +0 -95
  60. data/public/javascripts/old_sql/MochiKit-1.4.2/examples/color_wheel/index.html +0 -31
  61. data/public/javascripts/old_sql/MochiKit-1.4.2/examples/dnd_sortable/dnd_sortable.css +0 -23
  62. data/public/javascripts/old_sql/MochiKit-1.4.2/examples/dnd_sortable/dropmarker.png +0 -0
  63. data/public/javascripts/old_sql/MochiKit-1.4.2/examples/dnd_sortable/icon.png +0 -0
  64. data/public/javascripts/old_sql/MochiKit-1.4.2/examples/dnd_sortable/index.html +0 -54
  65. data/public/javascripts/old_sql/MochiKit-1.4.2/examples/dnd_sortable/sortable2_test.html +0 -150
  66. data/public/javascripts/old_sql/MochiKit-1.4.2/examples/dnd_sortable/sortable3_test.html +0 -42
  67. data/public/javascripts/old_sql/MochiKit-1.4.2/examples/dnd_sortable/sortable4_test.html +0 -90
  68. data/public/javascripts/old_sql/MochiKit-1.4.2/examples/dnd_sortable/sortable5_test.html +0 -29
  69. data/public/javascripts/old_sql/MochiKit-1.4.2/examples/dnd_sortable/sortable_test.html +0 -38
  70. data/public/javascripts/old_sql/MochiKit-1.4.2/examples/dnd_sortable/sortable_tree_test.html +0 -189
  71. data/public/javascripts/old_sql/MochiKit-1.4.2/examples/draggable/draggable.css +0 -28
  72. data/public/javascripts/old_sql/MochiKit-1.4.2/examples/draggable/draggable.js +0 -73
  73. data/public/javascripts/old_sql/MochiKit-1.4.2/examples/draggable/index.html +0 -38
  74. data/public/javascripts/old_sql/MochiKit-1.4.2/examples/effects/effects_bigslide.html +0 -36
  75. data/public/javascripts/old_sql/MochiKit-1.4.2/examples/effects/effects_blind.html +0 -65
  76. data/public/javascripts/old_sql/MochiKit-1.4.2/examples/effects/effects_blindslide.html +0 -31
  77. data/public/javascripts/old_sql/MochiKit-1.4.2/examples/effects/effects_combi.css +0 -18
  78. data/public/javascripts/old_sql/MochiKit-1.4.2/examples/effects/effects_fadeappear.html +0 -61
  79. data/public/javascripts/old_sql/MochiKit-1.4.2/examples/effects/effects_grow_shrink.html +0 -38
  80. data/public/javascripts/old_sql/MochiKit-1.4.2/examples/effects/effects_onload.html +0 -67
  81. data/public/javascripts/old_sql/MochiKit-1.4.2/examples/effects/effects_queue.html +0 -67
  82. data/public/javascripts/old_sql/MochiKit-1.4.2/examples/effects/effects_queue_limit.html +0 -30
  83. data/public/javascripts/old_sql/MochiKit-1.4.2/examples/effects/effects_scroll.html +0 -483
  84. data/public/javascripts/old_sql/MochiKit-1.4.2/examples/effects/effects_slide.html +0 -62
  85. data/public/javascripts/old_sql/MochiKit-1.4.2/examples/effects/full.html +0 -71
  86. data/public/javascripts/old_sql/MochiKit-1.4.2/examples/effects/icon.png +0 -0
  87. data/public/javascripts/old_sql/MochiKit-1.4.2/examples/effects/index.html +0 -150
  88. data/public/javascripts/old_sql/MochiKit-1.4.2/examples/interpreter/index.html +0 -88
  89. data/public/javascripts/old_sql/MochiKit-1.4.2/examples/interpreter/interpreter.css +0 -54
  90. data/public/javascripts/old_sql/MochiKit-1.4.2/examples/interpreter/interpreter.js +0 -373
  91. data/public/javascripts/old_sql/MochiKit-1.4.2/examples/key_events/index.html +0 -78
  92. data/public/javascripts/old_sql/MochiKit-1.4.2/examples/key_events/key_events.css +0 -5
  93. data/public/javascripts/old_sql/MochiKit-1.4.2/examples/key_events/key_events.js +0 -85
  94. data/public/javascripts/old_sql/MochiKit-1.4.2/examples/logging_pane/index.html +0 -46
  95. data/public/javascripts/old_sql/MochiKit-1.4.2/examples/logging_pane/logging_pane.css +0 -78
  96. data/public/javascripts/old_sql/MochiKit-1.4.2/examples/logging_pane/logging_pane.js +0 -11
  97. data/public/javascripts/old_sql/MochiKit-1.4.2/examples/mochiregexp/index.html +0 -74
  98. data/public/javascripts/old_sql/MochiKit-1.4.2/examples/mochiregexp/mochiregexp.css +0 -73
  99. data/public/javascripts/old_sql/MochiKit-1.4.2/examples/mochiregexp/mochiregexp.js +0 -125
  100. data/public/javascripts/old_sql/MochiKit-1.4.2/examples/mouse_events/index.html +0 -88
  101. data/public/javascripts/old_sql/MochiKit-1.4.2/examples/mouse_events/mouse_events.css +0 -17
  102. data/public/javascripts/old_sql/MochiKit-1.4.2/examples/mouse_events/mouse_events.js +0 -59
  103. data/public/javascripts/old_sql/MochiKit-1.4.2/examples/rounded_corners/index.html +0 -28
  104. data/public/javascripts/old_sql/MochiKit-1.4.2/examples/rounded_corners/rounded_corners.css +0 -3
  105. data/public/javascripts/old_sql/MochiKit-1.4.2/examples/rounded_corners/rounded_corners.js +0 -19
  106. data/public/javascripts/old_sql/MochiKit-1.4.2/examples/simple_dnd/dnd_boxes.html +0 -45
  107. data/public/javascripts/old_sql/MochiKit-1.4.2/examples/simple_dnd/dnd_full.html +0 -119
  108. data/public/javascripts/old_sql/MochiKit-1.4.2/examples/simple_dnd/dnd_ghost.html +0 -40
  109. data/public/javascripts/old_sql/MochiKit-1.4.2/examples/simple_dnd/dnd_hoverclass.html +0 -43
  110. data/public/javascripts/old_sql/MochiKit-1.4.2/examples/simple_dnd/dnd_scroll.html +0 -91
  111. data/public/javascripts/old_sql/MochiKit-1.4.2/examples/simple_dnd/dnd_snap.html +0 -54
  112. data/public/javascripts/old_sql/MochiKit-1.4.2/examples/simple_dnd/index.html +0 -93
  113. data/public/javascripts/old_sql/MochiKit-1.4.2/examples/simple_dnd/simple_dnd.css +0 -64
  114. data/public/javascripts/old_sql/MochiKit-1.4.2/examples/sortable_tables/index.html +0 -71
  115. data/public/javascripts/old_sql/MochiKit-1.4.2/examples/sortable_tables/sortable_tables.css +0 -66
  116. data/public/javascripts/old_sql/MochiKit-1.4.2/examples/sortable_tables/sortable_tables.js +0 -203
  117. data/public/javascripts/old_sql/MochiKit-1.4.2/examples/view-source/lib/SyntaxHighlighter/SyntaxHighlighter.css +0 -177
  118. data/public/javascripts/old_sql/MochiKit-1.4.2/examples/view-source/lib/SyntaxHighlighter/Tests.html +0 -339
  119. data/public/javascripts/old_sql/MochiKit-1.4.2/examples/view-source/lib/SyntaxHighlighter/shBrushCSharp.js +0 -30
  120. data/public/javascripts/old_sql/MochiKit-1.4.2/examples/view-source/lib/SyntaxHighlighter/shBrushDelphi.js +0 -31
  121. data/public/javascripts/old_sql/MochiKit-1.4.2/examples/view-source/lib/SyntaxHighlighter/shBrushJScript.js +0 -22
  122. data/public/javascripts/old_sql/MochiKit-1.4.2/examples/view-source/lib/SyntaxHighlighter/shBrushPhp.js +0 -23
  123. data/public/javascripts/old_sql/MochiKit-1.4.2/examples/view-source/lib/SyntaxHighlighter/shBrushPython.js +0 -71
  124. data/public/javascripts/old_sql/MochiKit-1.4.2/examples/view-source/lib/SyntaxHighlighter/shBrushSql.js +0 -40
  125. data/public/javascripts/old_sql/MochiKit-1.4.2/examples/view-source/lib/SyntaxHighlighter/shBrushVb.js +0 -29
  126. data/public/javascripts/old_sql/MochiKit-1.4.2/examples/view-source/lib/SyntaxHighlighter/shBrushXml.js +0 -61
  127. data/public/javascripts/old_sql/MochiKit-1.4.2/examples/view-source/lib/SyntaxHighlighter/shCore.js +0 -622
  128. data/public/javascripts/old_sql/MochiKit-1.4.2/examples/view-source/view-source.css +0 -1
  129. data/public/javascripts/old_sql/MochiKit-1.4.2/examples/view-source/view-source.html +0 -19
  130. data/public/javascripts/old_sql/MochiKit-1.4.2/examples/view-source/view-source.js +0 -70
  131. data/public/javascripts/old_sql/MochiKit-1.4.2/include/_img/bg_docheader.gif +0 -0
  132. data/public/javascripts/old_sql/MochiKit-1.4.2/include/_img/g_bullet.gif +0 -0
  133. data/public/javascripts/old_sql/MochiKit-1.4.2/include/_img/g_logo_doc.gif +0 -0
  134. data/public/javascripts/old_sql/MochiKit-1.4.2/include/css/documentation.css +0 -130
  135. data/public/javascripts/old_sql/MochiKit-1.4.2/include/css/general.css +0 -48
  136. data/public/javascripts/old_sql/MochiKit-1.4.2/lib/MochiKit/Async.js +0 -682
  137. data/public/javascripts/old_sql/MochiKit-1.4.2/lib/MochiKit/Base.js +0 -1489
  138. data/public/javascripts/old_sql/MochiKit-1.4.2/lib/MochiKit/Color.js +0 -863
  139. data/public/javascripts/old_sql/MochiKit-1.4.2/lib/MochiKit/DOM.js +0 -1256
  140. data/public/javascripts/old_sql/MochiKit-1.4.2/lib/MochiKit/DateTime.js +0 -222
  141. data/public/javascripts/old_sql/MochiKit-1.4.2/lib/MochiKit/DragAndDrop.js +0 -793
  142. data/public/javascripts/old_sql/MochiKit-1.4.2/lib/MochiKit/Format.js +0 -304
  143. data/public/javascripts/old_sql/MochiKit-1.4.2/lib/MochiKit/Iter.js +0 -844
  144. data/public/javascripts/old_sql/MochiKit-1.4.2/lib/MochiKit/Logging.js +0 -315
  145. data/public/javascripts/old_sql/MochiKit-1.4.2/lib/MochiKit/LoggingPane.js +0 -353
  146. data/public/javascripts/old_sql/MochiKit-1.4.2/lib/MochiKit/MochiKit.js +0 -188
  147. data/public/javascripts/old_sql/MochiKit-1.4.2/lib/MochiKit/MockDOM.js +0 -115
  148. data/public/javascripts/old_sql/MochiKit-1.4.2/lib/MochiKit/Position.js +0 -236
  149. data/public/javascripts/old_sql/MochiKit-1.4.2/lib/MochiKit/Selector.js +0 -415
  150. data/public/javascripts/old_sql/MochiKit-1.4.2/lib/MochiKit/Signal.js +0 -897
  151. data/public/javascripts/old_sql/MochiKit-1.4.2/lib/MochiKit/Sortable.js +0 -589
  152. data/public/javascripts/old_sql/MochiKit-1.4.2/lib/MochiKit/Style.js +0 -594
  153. data/public/javascripts/old_sql/MochiKit-1.4.2/lib/MochiKit/Test.js +0 -162
  154. data/public/javascripts/old_sql/MochiKit-1.4.2/lib/MochiKit/Visual.js +0 -2026
  155. data/public/javascripts/old_sql/MochiKit-1.4.2/lib/MochiKit/__package__.js +0 -18
  156. data/public/javascripts/old_sql/MochiKit-1.4.2/packed/MochiKit/MochiKit.js +0 -7829
  157. data/public/javascripts/old_sql/MochiKit-1.4.2/packed/MochiKit/__package__.js +0 -6
  158. data/public/javascripts/old_sql/MochiKit-1.4.2/packed/MochiKit/customize.html +0 -251
  159. data/public/javascripts/old_sql/MochiKit-1.4.2/tests/FakeJSAN.js +0 -40
  160. data/public/javascripts/old_sql/MochiKit-1.4.2/tests/SimpleTest/SimpleTest.js +0 -381
  161. data/public/javascripts/old_sql/MochiKit-1.4.2/tests/SimpleTest/TestRunner.js +0 -159
  162. data/public/javascripts/old_sql/MochiKit-1.4.2/tests/SimpleTest/test.css +0 -28
  163. data/public/javascripts/old_sql/MochiKit-1.4.2/tests/cli.js +0 -6
  164. data/public/javascripts/old_sql/MochiKit-1.4.2/tests/index.html +0 -25
  165. data/public/javascripts/old_sql/MochiKit-1.4.2/tests/standalone.js +0 -16
  166. data/public/javascripts/old_sql/MochiKit-1.4.2/tests/test_Base.js +0 -577
  167. data/public/javascripts/old_sql/MochiKit-1.4.2/tests/test_Color.js +0 -137
  168. data/public/javascripts/old_sql/MochiKit-1.4.2/tests/test_DateTime.js +0 -52
  169. data/public/javascripts/old_sql/MochiKit-1.4.2/tests/test_DragAndDrop.js +0 -30
  170. data/public/javascripts/old_sql/MochiKit-1.4.2/tests/test_Format.js +0 -89
  171. data/public/javascripts/old_sql/MochiKit-1.4.2/tests/test_Iter.js +0 -186
  172. data/public/javascripts/old_sql/MochiKit-1.4.2/tests/test_Logging.js +0 -88
  173. data/public/javascripts/old_sql/MochiKit-1.4.2/tests/test_MochiKit-Async.html +0 -408
  174. data/public/javascripts/old_sql/MochiKit-1.4.2/tests/test_MochiKit-Async.json +0 -1
  175. data/public/javascripts/old_sql/MochiKit-1.4.2/tests/test_MochiKit-Base.html +0 -34
  176. data/public/javascripts/old_sql/MochiKit-1.4.2/tests/test_MochiKit-Color.html +0 -84
  177. data/public/javascripts/old_sql/MochiKit-1.4.2/tests/test_MochiKit-DOM-Safari.html +0 -48
  178. data/public/javascripts/old_sql/MochiKit-1.4.2/tests/test_MochiKit-DOM.html +0 -363
  179. data/public/javascripts/old_sql/MochiKit-1.4.2/tests/test_MochiKit-DateTime.html +0 -39
  180. data/public/javascripts/old_sql/MochiKit-1.4.2/tests/test_MochiKit-DragAndDrop.html +0 -54
  181. data/public/javascripts/old_sql/MochiKit-1.4.2/tests/test_MochiKit-Format.html +0 -39
  182. data/public/javascripts/old_sql/MochiKit-1.4.2/tests/test_MochiKit-Iter.html +0 -38
  183. data/public/javascripts/old_sql/MochiKit-1.4.2/tests/test_MochiKit-JSAN.html +0 -32
  184. data/public/javascripts/old_sql/MochiKit-1.4.2/tests/test_MochiKit-Logging.html +0 -40
  185. data/public/javascripts/old_sql/MochiKit-1.4.2/tests/test_MochiKit-MochiKit.html +0 -18
  186. data/public/javascripts/old_sql/MochiKit-1.4.2/tests/test_MochiKit-Selector.html +0 -295
  187. data/public/javascripts/old_sql/MochiKit-1.4.2/tests/test_MochiKit-Signal.html +0 -43
  188. data/public/javascripts/old_sql/MochiKit-1.4.2/tests/test_MochiKit-Style.html +0 -223
  189. data/public/javascripts/old_sql/MochiKit-1.4.2/tests/test_MochiKit-Visual.html +0 -197
  190. data/public/javascripts/old_sql/MochiKit-1.4.2/tests/test_Signal.js +0 -481
  191. data/public/javascripts/old_sql/plotkit-0.9.1/COPYING +0 -28
  192. data/public/javascripts/old_sql/plotkit-0.9.1/PlotKit/Base.js +0 -406
  193. data/public/javascripts/old_sql/plotkit-0.9.1/PlotKit/Canvas.js +0 -683
  194. data/public/javascripts/old_sql/plotkit-0.9.1/PlotKit/EasyPlot.js +0 -161
  195. data/public/javascripts/old_sql/plotkit-0.9.1/PlotKit/Layout.js +0 -756
  196. data/public/javascripts/old_sql/plotkit-0.9.1/PlotKit/PlotKit.js +0 -151
  197. data/public/javascripts/old_sql/plotkit-0.9.1/PlotKit/PlotKit_Packed.js +0 -2177
  198. data/public/javascripts/old_sql/plotkit-0.9.1/PlotKit/SVG.js +0 -705
  199. data/public/javascripts/old_sql/plotkit-0.9.1/PlotKit/SweetCanvas.js +0 -348
  200. data/public/javascripts/old_sql/plotkit-0.9.1/PlotKit/SweetSVG.js +0 -247
  201. data/public/javascripts/old_sql/plotkit-0.9.1/PlotKit/dummy.svg +0 -9
  202. data/public/javascripts/old_sql/plotkit-0.9.1/PlotKit/excanvas.js +0 -723
  203. data/public/javascripts/old_sql/plotkit-0.9.1/README +0 -1
  204. data/public/javascripts/old_sql/plotkit-0.9.1/doc/MochiKitAdditions.html +0 -2
  205. data/public/javascripts/old_sql/plotkit-0.9.1/doc/MochiKitAdditions.txt +0 -2
  206. data/public/javascripts/old_sql/plotkit-0.9.1/doc/PlotKit.Base.html +0 -302
  207. data/public/javascripts/old_sql/plotkit-0.9.1/doc/PlotKit.Base.txt +0 -139
  208. data/public/javascripts/old_sql/plotkit-0.9.1/doc/PlotKit.Canvas.html +0 -172
  209. data/public/javascripts/old_sql/plotkit-0.9.1/doc/PlotKit.Canvas.txt +0 -81
  210. data/public/javascripts/old_sql/plotkit-0.9.1/doc/PlotKit.EasyPlot.html +0 -155
  211. data/public/javascripts/old_sql/plotkit-0.9.1/doc/PlotKit.EasyPlot.txt +0 -50
  212. data/public/javascripts/old_sql/plotkit-0.9.1/doc/PlotKit.Layout.html +0 -428
  213. data/public/javascripts/old_sql/plotkit-0.9.1/doc/PlotKit.Layout.txt +0 -330
  214. data/public/javascripts/old_sql/plotkit-0.9.1/doc/PlotKit.QuickStart.html +0 -368
  215. data/public/javascripts/old_sql/plotkit-0.9.1/doc/PlotKit.QuickStart.txt +0 -256
  216. data/public/javascripts/old_sql/plotkit-0.9.1/doc/PlotKit.Renderer.html +0 -436
  217. data/public/javascripts/old_sql/plotkit-0.9.1/doc/PlotKit.Renderer.txt +0 -299
  218. data/public/javascripts/old_sql/plotkit-0.9.1/doc/PlotKit.SVG.html +0 -159
  219. data/public/javascripts/old_sql/plotkit-0.9.1/doc/PlotKit.SVG.txt +0 -64
  220. data/public/javascripts/old_sql/plotkit-0.9.1/doc/PlotKit.SweetCanvas.html +0 -131
  221. data/public/javascripts/old_sql/plotkit-0.9.1/doc/PlotKit.SweetCanvas.txt +0 -34
  222. data/public/javascripts/old_sql/plotkit-0.9.1/doc/PlotKit.SweetSVG.html +0 -131
  223. data/public/javascripts/old_sql/plotkit-0.9.1/doc/PlotKit.SweetSVG.txt +0 -34
  224. data/public/javascripts/old_sql/plotkit-0.9.1/doc/PlotKit.html +0 -334
  225. data/public/javascripts/old_sql/plotkit-0.9.1/doc/PlotKit.txt +0 -151
  226. data/public/javascripts/old_sql/plotkit-0.9.1/doc/SVGCanvasCompat.html +0 -304
  227. data/public/javascripts/old_sql/plotkit-0.9.1/doc/SVGCanvasCompat.txt +0 -144
  228. data/public/javascripts/old_sql/plotkit-0.9.1/doc/barsample.png +0 -0
  229. data/public/javascripts/old_sql/plotkit-0.9.1/doc/black.png +0 -0
  230. data/public/javascripts/old_sql/plotkit-0.9.1/doc/blue.png +0 -0
  231. data/public/javascripts/old_sql/plotkit-0.9.1/doc/cyan.png +0 -0
  232. data/public/javascripts/old_sql/plotkit-0.9.1/doc/doc.css +0 -62
  233. data/public/javascripts/old_sql/plotkit-0.9.1/doc/generate.py +0 -37
  234. data/public/javascripts/old_sql/plotkit-0.9.1/doc/green.png +0 -0
  235. data/public/javascripts/old_sql/plotkit-0.9.1/doc/orange.png +0 -0
  236. data/public/javascripts/old_sql/plotkit-0.9.1/doc/piesample.png +0 -0
  237. data/public/javascripts/old_sql/plotkit-0.9.1/doc/purple.png +0 -0
  238. data/public/javascripts/old_sql/plotkit-0.9.1/doc/red.png +0 -0
  239. data/public/javascripts/old_sql/plotkit-0.9.1/scripts/custom_rhino.jar +0 -0
  240. data/public/javascripts/old_sql/plotkit-0.9.1/scripts/pack.py +0 -58
  241. data/public/javascripts/old_sql/plotkit-0.9.1/tests/axis.html +0 -31
  242. data/public/javascripts/old_sql/plotkit-0.9.1/tests/basic.html +0 -25
  243. data/public/javascripts/old_sql/plotkit-0.9.1/tests/basic.js +0 -143
  244. data/public/javascripts/old_sql/plotkit-0.9.1/tests/debug.html +0 -56
  245. data/public/javascripts/old_sql/plotkit-0.9.1/tests/demo-svg.html +0 -58
  246. data/public/javascripts/old_sql/plotkit-0.9.1/tests/demo-svg.js +0 -133
  247. data/public/javascripts/old_sql/plotkit-0.9.1/tests/demo.html +0 -57
  248. data/public/javascripts/old_sql/plotkit-0.9.1/tests/demo.js +0 -136
  249. data/public/javascripts/old_sql/plotkit-0.9.1/tests/dynamic.html +0 -161
  250. data/public/javascripts/old_sql/plotkit-0.9.1/tests/img/firefox.png +0 -0
  251. data/public/javascripts/old_sql/plotkit-0.9.1/tests/img/konqueror.png +0 -0
  252. data/public/javascripts/old_sql/plotkit-0.9.1/tests/img/mozilla.ico +0 -0
  253. data/public/javascripts/old_sql/plotkit-0.9.1/tests/img/msie.gif +0 -0
  254. data/public/javascripts/old_sql/plotkit-0.9.1/tests/img/opera.ico +0 -0
  255. data/public/javascripts/old_sql/plotkit-0.9.1/tests/img/safari.gif +0 -0
  256. data/public/javascripts/old_sql/plotkit-0.9.1/tests/labels-img.html +0 -38
  257. data/public/javascripts/old_sql/plotkit-0.9.1/tests/labels.html +0 -43
  258. data/public/javascripts/old_sql/plotkit-0.9.1/tests/prototype_compat.html +0 -28
  259. data/public/javascripts/old_sql/plotkit-0.9.1/tests/quickstart-easy.html +0 -29
  260. data/public/javascripts/old_sql/plotkit-0.9.1/tests/quickstart-horiz.html +0 -53
  261. data/public/javascripts/old_sql/plotkit-0.9.1/tests/quickstart-neg.html +0 -29
  262. data/public/javascripts/old_sql/plotkit-0.9.1/tests/quickstart-svg.html +0 -61
  263. data/public/javascripts/old_sql/plotkit-0.9.1/tests/quickstart.html +0 -57
  264. data/public/javascripts/old_sql/plotkit-0.9.1/tests/sample.txt +0 -6
  265. data/public/javascripts/old_sql/plotkit-0.9.1/tests/svg-sweet.html +0 -29
  266. data/public/javascripts/old_sql/plotkit-0.9.1/tests/svg-sweet.js +0 -141
  267. data/public/javascripts/old_sql/plotkit-0.9.1/tests/svg.html +0 -26
  268. data/public/javascripts/old_sql/plotkit-0.9.1/tests/svg.js +0 -147
  269. data/public/javascripts/old_sql/plotkit-0.9.1/tests/sweet.html +0 -24
  270. data/public/javascripts/old_sql/plotkit-0.9.1/tests/sweet.js +0 -89
  271. data/public/javascripts/old_sql/plotkit-0.9.1/tests/tests.css +0 -66
  272. data/public/javascripts/old_sql/plotkit-0.9.1/tests/testsvg.html +0 -20
  273. data/public/javascripts/old_sql/plotkit-0.9.1/tests/testsvg.js +0 -31
@@ -1,767 +0,0 @@
1
- .. title:: MochiKit.Async - manage asynchronous tasks
2
-
3
- Name
4
- ====
5
-
6
- MochiKit.Async - manage asynchronous tasks
7
-
8
-
9
- Synopsis
10
- ========
11
-
12
- ::
13
-
14
- var url = "/src/b/bo/bob/MochiKit.Async/META.json";
15
- /*
16
-
17
- META.json looks something like this:
18
-
19
- {"name": "MochiKit", "version": "0.5"}
20
-
21
- */
22
- var d = loadJSONDoc(url);
23
- var gotMetadata = function (meta) {
24
- if (MochiKit.Async.VERSION == meta.version) {
25
- alert("You have the newest MochiKit.Async!");
26
- } else {
27
- alert("MochiKit.Async "
28
- + meta.version
29
- + " is available, upgrade!");
30
- }
31
- };
32
- var metadataFetchFailed = function (err) {
33
- alert("The metadata for MochiKit.Async could not be fetched :(");
34
- };
35
- d.addCallbacks(gotMetadata, metadataFetchFailed);
36
-
37
-
38
- Description
39
- ===========
40
-
41
- MochiKit.Async provides facilities to manage asynchronous (as in AJAX
42
- [1]_) tasks. The model for asynchronous computation used in this
43
- module is heavily inspired by Twisted [2]_.
44
-
45
-
46
- Dependencies
47
- ============
48
-
49
- - :mochiref:`MochiKit.Base`
50
-
51
-
52
- Security Concerns
53
- =================
54
-
55
- The current implementation of evalJSONRequest does no input validation.
56
- Invalid JSON can execute arbitrary JavaScript code in the client. This isn't
57
- normally a concern because of the same-origin policy in web browsers; the
58
- server is already sending arbitrary code to the client (your program!).
59
-
60
- While this isn't directly relevant to MochiKit, server-side code that produces
61
- JSON should consider potential cross-site request forgery. Currently known
62
- exploits require a JSON array to be the outer-most object, and the data to be
63
- leaked must be known keys in objects contained by that array::
64
-
65
- [{"some_known_key": "this can be leaked"}, "but not this"]
66
-
67
- This exploit does not apply to the most common usage of JSON, sending an
68
- object::
69
-
70
- {"some_known_key": "this can't be leaked"}
71
-
72
- There are several ways to avoid this, here are a few:
73
-
74
- * Use some non-standard addition to JSON that adds constructs to prevent
75
- script tag parsing, such as wrapping the data in a comment or an infinite
76
- loop. MochiKit supports comment-wrapped JSON, but it's up to the server
77
- to send it that way.
78
- * Require some kind of authentication token in the URL.
79
- * Allow only POST requests to access sensitive JSON.
80
- * Only send JSON objects, not arrays. JSON objects aren't valid JavaScript
81
- syntax on their own without parentheses.
82
-
83
- Overview
84
- ========
85
-
86
- Deferred
87
- --------
88
-
89
- The Deferred constructor encapsulates a single value that is not
90
- available yet. The most important example of this in the context of a
91
- web browser would be an ``XMLHttpRequest`` to a server. The importance
92
- of the Deferred is that it allows a consistent API to be exposed for
93
- all asynchronous computations that occur exactly once.
94
-
95
- The producer of the Deferred is responsible for doing all of the
96
- complicated work behind the scenes. This often means waiting for a
97
- timer to fire, or waiting for an event (e.g. ``onreadystatechange`` of
98
- ``XMLHttpRequest``). It could also be coordinating several events
99
- (e.g. ``XMLHttpRequest`` with a timeout, or several Deferreds
100
- (e.g. fetching a set of XML documents that should be processed at the
101
- same time).
102
-
103
- Since these sorts of tasks do not respond immediately, the producer of
104
- the Deferred does the following steps before returning to the
105
- consumer:
106
-
107
- 1. Create a ``new`` :mochiref:`Deferred();` object and keep a
108
- reference to it, because it will be needed later when the value is
109
- ready.
110
- 2. Setup the conditions to create the value requested (e.g. create a
111
- new ``XMLHttpRequest``, set its ``onreadystatechange``).
112
- 3. Return the :mochiref:`Deferred` object.
113
-
114
- Since the value is not yet ready, the consumer attaches a function to
115
- the Deferred that will be called when the value is ready. This is not
116
- unlike ``setTimeout``, or other similar facilities you may already be
117
- familiar with. The consumer can also attach an "errback" to the
118
- :mochiref:`Deferred`, which is a callback for error handling.
119
-
120
- When the value is ready, the producer simply calls
121
- ``myDeferred.callback(theValue)``. If an error occurred, it should
122
- call ``myDeferred.errback(theValue)`` instead. As soon as this
123
- happens, the callback that the consumer attached to the
124
- :mochiref:`Deferred` is called with ``theValue`` as the only argument.
125
-
126
- There are quite a few additional "advanced" features baked into
127
- :mochiref:`Deferred`, such as cancellation and callback chains, so
128
- take a look at the API reference if you would like to know more!
129
-
130
- API Reference
131
- =============
132
-
133
- Errors
134
- ------
135
-
136
- :mochidef:`AlreadyCalledError`:
137
-
138
- Thrown by a :mochiref:`Deferred` if ``.callback`` or ``.errback``
139
- are called more than once.
140
-
141
- *Availability*:
142
- Available in MochiKit 1.3.1+
143
-
144
-
145
- :mochidef:`BrowserComplianceError`:
146
-
147
- Thrown when the JavaScript runtime is not capable of performing
148
- the given function. Currently, this happens if the browser does
149
- not support ``XMLHttpRequest``.
150
-
151
- *Availability*:
152
- Available in MochiKit 1.3.1+
153
-
154
-
155
- :mochidef:`CancelledError`:
156
-
157
- Thrown by a :mochiref:`Deferred` when it is cancelled, unless a
158
- canceller is present and throws something else.
159
-
160
- *Availability*:
161
- Available in MochiKit 1.3.1+
162
-
163
-
164
- :mochidef:`GenericError`:
165
-
166
- Results passed to ``.fail`` or ``.errback`` of a
167
- :mochiref:`Deferred` are wrapped by this ``Error`` if ``!(result
168
- instanceof Error)``.
169
-
170
- *Availability*:
171
- Available in MochiKit 1.3.1+
172
-
173
-
174
- :mochidef:`XMLHttpRequestError`:
175
-
176
- Thrown when an ``XMLHttpRequest`` does not complete successfully
177
- for any reason. The ``req`` property of the error is the failed
178
- ``XMLHttpRequest`` object, and for convenience the ``number``
179
- property corresponds to ``req.status``.
180
-
181
- *Availability*:
182
- Available in MochiKit 1.3.1+
183
-
184
-
185
- Constructors
186
- ------------
187
-
188
- :mochidef:`Deferred()`:
189
-
190
- Encapsulates a sequence of callbacks in response to a value that
191
- may not yet be available. This is modeled after the Deferred class
192
- from Twisted [3]_.
193
-
194
- .. _`Twisted`: http://twistedmatrix.com/
195
-
196
- Why do we want this? JavaScript has no threads, and even if it
197
- did, threads are hard. Deferreds are a way of abstracting
198
- non-blocking events, such as the final response to an
199
- ``XMLHttpRequest``.
200
-
201
- The sequence of callbacks is internally represented as a list of
202
- 2-tuples containing the callback/errback pair. For example, the
203
- following call sequence::
204
-
205
- var d = new Deferred();
206
- d.addCallback(myCallback);
207
- d.addErrback(myErrback);
208
- d.addBoth(myBoth);
209
- d.addCallbacks(myCallback, myErrback);
210
-
211
- is translated into a :mochiref:`Deferred` with the following
212
- internal representation::
213
-
214
- [
215
- [myCallback, null],
216
- [null, myErrback],
217
- [myBoth, myBoth],
218
- [myCallback, myErrback]
219
- ]
220
-
221
- The :mochiref:`Deferred` also keeps track of its current status
222
- (fired). Its status may be one of the following three values:
223
-
224
-
225
- ===== ================================
226
- Value Condition
227
- ===== ================================
228
- -1 no value yet (initial condition)
229
- 0 success
230
- 1 error
231
- ===== ================================
232
-
233
- A :mochiref:`Deferred` will be in the error state if one of the
234
- following conditions are met:
235
-
236
- 1. The result given to callback or errback is "``instanceof
237
- Error``"
238
- 2. The callback or errback threw while executing. If the thrown
239
- object is not ``instanceof Error``, it will be wrapped with
240
- :mochiref:`GenericError`.
241
-
242
- Otherwise, the :mochiref:`Deferred` will be in the success
243
- state. The state of the :mochiref:`Deferred` determines the next
244
- element in the callback sequence to run.
245
-
246
- When a callback or errback occurs with the example deferred chain,
247
- something equivalent to the following will happen (imagine that
248
- exceptions are caught and returned as-is)::
249
-
250
- // d.callback(result) or d.errback(result)
251
- if (!(result instanceof Error)) {
252
- result = myCallback(result);
253
- }
254
- if (result instanceof Error) {
255
- result = myErrback(result);
256
- }
257
- result = myBoth(result);
258
- if (result instanceof Error) {
259
- result = myErrback(result);
260
- } else {
261
- result = myCallback(result);
262
- }
263
-
264
- The result is then stored away in case another step is added to
265
- the callback sequence. Since the :mochiref:`Deferred` already has
266
- a value available, any new callbacks added will be called
267
- immediately.
268
-
269
- There are two other "advanced" details about this implementation
270
- that are useful:
271
-
272
- Callbacks are allowed to return :mochiref:`Deferred` instances, so
273
- you can build complicated sequences of events with (relative)
274
- ease.
275
-
276
- The creator of the :mochiref:`Deferred` may specify a
277
- canceller. The canceller is a function that will be called if
278
- :mochiref:`Deferred.prototype.cancel` is called before the
279
- :mochiref:`Deferred` fires. You can use this to allow an
280
- ``XMLHttpRequest`` to be cleanly cancelled, for example. Note that
281
- cancel will fire the :mochiref:`Deferred` with a
282
- :mochiref:`CancelledError` (unless your canceller throws or
283
- returns a different ``Error``), so errbacks should be prepared to
284
- handle that ``Error`` gracefully for cancellable
285
- :mochiref:`Deferred` instances.
286
-
287
- *Availability*:
288
- Available in MochiKit 1.3.1+
289
-
290
-
291
- :mochidef:`Deferred.prototype.addBoth(func)`:
292
-
293
- Add the same function as both a callback and an errback as the
294
- next element on the callback sequence. This is useful for code
295
- that you want to guarantee to run, e.g. a finalizer.
296
-
297
- If additional arguments are given, then ``func`` will be replaced
298
- with :mochiref:`MochiKit.Base.partial.apply(null,
299
- arguments)`. This differs from `Twisted`_, because the result of
300
- the callback or errback will be the *last* argument passed to
301
- ``func``.
302
-
303
- If ``func`` returns a :mochiref:`Deferred`, then it will be
304
- chained (its value or error will be passed to the next
305
- callback). Note that once the returned ``Deferred`` is chained, it
306
- can no longer accept new callbacks.
307
-
308
- *Availability*:
309
- Available in MochiKit 1.3.1+
310
-
311
-
312
- :mochidef:`Deferred.prototype.addCallback(func[, ...])`:
313
-
314
- Add a single callback to the end of the callback sequence.
315
-
316
- If additional arguments are given, then ``func`` will be replaced
317
- with :mochiref:`MochiKit.Base.partial.apply(null,
318
- arguments)`. This differs from `Twisted`_, because the result of
319
- the callback will be the *last* argument passed to ``func``.
320
-
321
- If ``func`` returns a :mochiref:`Deferred`, then it will be
322
- chained (its value or error will be passed to the next
323
- callback). Note that once the returned ``Deferred`` is chained, it
324
- can no longer accept new callbacks.
325
-
326
- *Availability*:
327
- Available in MochiKit 1.3.1+
328
-
329
-
330
- :mochidef:`Deferred.prototype.addCallbacks(callback, errback)`:
331
-
332
- Add separate callback and errback to the end of the callback
333
- sequence. Either callback or errback may be ``null``, but not
334
- both.
335
-
336
- If ``callback`` or ``errback`` returns a :mochiref:`Deferred`,
337
- then it will be chained (its value or error will be passed to the
338
- next callback). Note that once the returned ``Deferred`` is
339
- chained, it can no longer accept new callbacks.
340
-
341
- *Availability*:
342
- Available in MochiKit 1.3.1+
343
-
344
-
345
- :mochidef:`Deferred.prototype.addErrback(func)`:
346
-
347
- Add a single errback to the end of the callback sequence.
348
-
349
- If additional arguments are given, then ``func`` will be replaced
350
- with :mochiref:`MochiKit.Base.partial.apply(null,
351
- arguments)`. This differs from `Twisted`_, because the result of
352
- the errback will be the *last* argument passed to ``func``.
353
-
354
- If ``func`` returns a :mochiref:`Deferred`, then it will be
355
- chained (its value or error will be passed to the next
356
- callback). Note that once the returned ``Deferred`` is chained, it
357
- can no longer accept new callbacks.
358
-
359
- *Availability*:
360
- Available in MochiKit 1.3.1+
361
-
362
-
363
- :mochidef:`Deferred.prototype.callback([result])`:
364
-
365
- Begin the callback sequence with a non-``Error`` result. Result
366
- may be any value except for a :mochiref:`Deferred`.
367
-
368
- Either ``.callback`` or ``.errback`` should be called exactly once
369
- on a :mochiref:`Deferred`.
370
-
371
- *Availability*:
372
- Available in MochiKit 1.3.1+
373
-
374
-
375
- :mochidef:`Deferred.prototype.cancel()`:
376
-
377
- Cancels a :mochiref:`Deferred` that has not yet received a value,
378
- or is waiting on another :mochiref:`Deferred` as its value.
379
-
380
- If a canceller is defined, the canceller is called. If the
381
- canceller did not return an ``Error``, or there was no canceller,
382
- then the errback chain is started with :mochiref:`CancelledError`.
383
-
384
- *Availability*:
385
- Available in MochiKit 1.3.1+
386
-
387
-
388
- :mochidef:`Deferred.prototype.errback([result])`:
389
-
390
- Begin the callback sequence with an error result. Result may be
391
- any value except for a :mochiref:`Deferred`, but if ``!(result
392
- instanceof Error)``, it will be wrapped with
393
- :mochiref:`GenericError`.
394
-
395
- Either ``.callback`` or ``.errback`` should be called exactly once
396
- on a :mochidef:`Deferred`.
397
-
398
- *Availability*:
399
- Available in MochiKit 1.3.1+
400
-
401
-
402
- :mochidef:`DeferredLock()`:
403
-
404
- A lock for asynchronous systems.
405
-
406
- The ``locked`` property of a :mochiref:`DeferredLock` will be
407
- ``true`` if it locked, ``false`` otherwise. Do not change this
408
- property.
409
-
410
- *Availability*:
411
- Available in MochiKit 1.3.1+
412
-
413
-
414
- :mochidef:`DeferredLock.prototype.acquire()`:
415
-
416
- Attempt to acquire the lock. Returns a :mochiref:`Deferred` that
417
- fires on lock acquisition with the :mochiref:`DeferredLock` as the
418
- value. If the lock is locked, then the :mochiref:`Deferred` goes
419
- into a waiting list.
420
-
421
- *Availability*:
422
- Available in MochiKit 1.3.1+
423
-
424
-
425
- :mochidef:`DeferredLock.prototype.release()`:
426
-
427
- Release the lock. If there is a waiting list, then the first
428
- :mochiref:`Deferred` in that waiting list will be called back.
429
-
430
- *Availability*:
431
- Available in MochiKit 1.3.1+
432
-
433
-
434
- :mochidef:`DeferredList(list, [fireOnOneCallback, fireOnOneErrback, consumeErrors, canceller])`:
435
-
436
- Combine a list of :mochiref:`Deferred` into one. Track the
437
- callbacks and return a list of (success, result) tuples, 'success'
438
- being a boolean indicating whether result is a normal result or an
439
- error.
440
-
441
- Once created, you have access to all :mochiref:`Deferred` methods,
442
- like addCallback, addErrback, addBoth. The behaviour can be
443
- changed by the following options:
444
-
445
- ``fireOnOneCallback``:
446
- Flag for launching the callback once the first Deferred of the
447
- list has returned.
448
-
449
- ``fireOnOneErrback``:
450
- Flag for calling the errback at the first error of a Deferred.
451
-
452
- ``consumeErrors``:
453
- Flag indicating that any errors raised in the Deferreds should
454
- be consumed by the DeferredList.
455
-
456
- Example::
457
-
458
- // We need to fetch data from 2 different urls
459
- var d1 = loadJSONDoc(url1);
460
- var d2 = loadJSONDoc(url2);
461
- var l1 = new DeferredList([d1, d2], false, false, true);
462
- l1.addCallback(function (resultList) {
463
- MochiKit.Base.map(function (result) {
464
- if (result[0]) {
465
- alert("Data is here: " + result[1]);
466
- } else {
467
- alert("Got an error: " + result[1]);
468
- }
469
- }, resultList);
470
- });
471
-
472
- *Availability*:
473
- Available in MochiKit 1.3.1+
474
-
475
-
476
- Functions
477
- ---------
478
-
479
- :mochidef:`callLater(seconds, func[, args...])`:
480
-
481
- Call ``func(args...)`` after at least ``seconds`` seconds have
482
- elapsed. This is a convenience method for::
483
-
484
- func = partial.apply(extend(null, arguments, 1));
485
- return wait(seconds).addCallback(function (res) { return func() });
486
-
487
- Returns a cancellable :mochiref:`Deferred`.
488
-
489
- *Availability*:
490
- Available in MochiKit 1.3.1+
491
-
492
-
493
- :mochidef:`doXHR(url[, {option: value, ...}])`:
494
-
495
- Perform a customized ``XMLHttpRequest`` and wrap it with a
496
- :mochiref:`Deferred` that may be cancelled.
497
-
498
- Note that only ``200`` (OK), ``201`` (CREATED),
499
- ``204`` (NO CONTENT) and ``304`` (NOT MODIFIED) are considered
500
- success codes. All other status codes will
501
- result in an errback with an ``XMLHttpRequestError``.
502
-
503
- ``url``:
504
- The URL for this request.
505
-
506
- The following options are currently accepted:
507
-
508
- ``method``:
509
- The HTTP method. Default is ``'GET'``.
510
-
511
- ``sendContent``:
512
- The content to send (e.g. with POST). Default is no content.
513
-
514
- ``queryString``:
515
- If present it will be used to build a query string to append to
516
- the url using :mochiref:`MochiKit.Base.queryString`. Default is
517
- no query string.
518
-
519
- ``username``:
520
- The username for the request. Default is no username.
521
-
522
- ``password``:
523
- The password for the request. Default is no password.
524
-
525
- ``headers``:
526
- Additional headers to set in the request, either as an object
527
- such as ``{'Accept': 'text/xml'}`` or as an Array of 2-Arrays
528
- ``[['Accept', 'text/xml']]``. Default is no additional headers.
529
-
530
- ``mimeType``:
531
- An override mime type. The typical use of this is to pass
532
- 'text/xml' to force XMLHttpRequest to attempt to parse responseXML.
533
- Default is no override.
534
-
535
- *returns*:
536
- :mochiref:`Deferred` that will callback with the
537
- ``XMLHttpRequest`` instance on success
538
-
539
- *Availability*:
540
- Available in MochiKit 1.4+.
541
-
542
-
543
- :mochidef:`doSimpleXMLHttpRequest(url[, queryArguments...])`:
544
-
545
- Perform a simple ``XMLHttpRequest`` and wrap it with a
546
- :mochiref:`Deferred` that may be cancelled.
547
-
548
- Note that only ``200`` (OK), ``201`` (CREATED),
549
- ``204`` (NO CONTENT) and ``304`` (NOT MODIFIED) are considered
550
- success codes. All other status codes will
551
- result in an errback with an ``XMLHttpRequestError``.
552
-
553
- ``url``:
554
- The URL to GET
555
-
556
- ``queryArguments``:
557
- If this function is called with more than one argument, a
558
- ``"?"`` and the result of
559
- :mochiref:`MochiKit.Base.queryString` with the rest of the
560
- arguments are appended to the URL.
561
-
562
- For example, this will do a GET request to the URL
563
- ``http://example.com?bar=baz``::
564
-
565
- doSimpleXMLHttpRequest("http://example.com", {bar: "baz"});
566
-
567
- *returns*:
568
- :mochiref:`Deferred` that will callback with the
569
- ``XMLHttpRequest`` instance on success
570
-
571
- *Availability*:
572
- Available in MochiKit 1.3.1+. Support for 201 and 204 were added in
573
- MochiKit 1.4.
574
-
575
-
576
- :mochidef:`evalJSONRequest(req)`:
577
-
578
- Evaluate a JSON [4]_ ``XMLHttpRequest``
579
-
580
- ``req``:
581
- The request whose ``.responseText`` property is to be
582
- evaluated. If the JSON is wrapped in a comment, the comment will
583
- be stripped before evaluation.
584
-
585
- *returns*:
586
- A JavaScript object
587
-
588
- *Availability*:
589
- Available in MochiKit 1.3.1+
590
-
591
-
592
- :mochidef:`fail([result])`:
593
-
594
- Return a :mochiref:`Deferred` that has already had
595
- ``.errback(result)`` called.
596
-
597
- See ``succeed`` documentation for rationale.
598
-
599
- ``result``:
600
- The result to give to
601
- :mochiref:`Deferred.prototype.errback(result)`.
602
-
603
- *returns*:
604
- A ``new`` :mochiref:`Deferred()`
605
-
606
- *Availability*:
607
- Available in MochiKit 1.3.1+
608
-
609
-
610
- :mochidef:`gatherResults(deferreds)`:
611
-
612
- A convenience function that returns a :mochiref:`DeferredList`
613
- from the given ``Array`` of :mochiref:`Deferred` instances that
614
- will callback with an ``Array`` of just results when they're
615
- available, or errback on the first array.
616
-
617
- *Availability*:
618
- Available in MochiKit 1.3.1+
619
-
620
-
621
- :mochidef:`getXMLHttpRequest()`:
622
-
623
- Return an ``XMLHttpRequest`` compliant object for the current
624
- platform.
625
-
626
- In order of preference:
627
-
628
- - ``new XMLHttpRequest()``
629
- - ``new ActiveXObject('Msxml2.XMLHTTP')``
630
- - ``new ActiveXObject('Microsoft.XMLHTTP')``
631
- - ``new ActiveXObject('Msxml2.XMLHTTP.4.0')``
632
-
633
- *Availability*:
634
- Available in MochiKit 1.3.1+
635
-
636
-
637
- :mochidef:`maybeDeferred(func[, argument...])`:
638
-
639
- Call a ``func`` with the given arguments and ensure the result is
640
- a :mochiref:`Deferred`.
641
-
642
- ``func``:
643
- The function to call.
644
-
645
- *returns*:
646
- A new :mochiref:`Deferred` based on the call to ``func``. If
647
- ``func`` does not naturally return a :mochiref:`Deferred`, its
648
- result or error value will be wrapped by one.
649
-
650
- *Availability*:
651
- Available in MochiKit 1.3.1+
652
-
653
-
654
- :mochidef:`loadJSONDoc(url[, queryArguments...])`:
655
-
656
- Do a simple ``XMLHttpRequest`` to a URL and get the response as a
657
- JSON [4]_ document.
658
-
659
- ``url``:
660
- The URL to GET
661
-
662
- ``queryArguments``:
663
- If this function is called with more than one argument, a
664
- ``"?"`` and the result of
665
- :mochiref:`MochiKit.Base.queryString` with the rest of the
666
- arguments are appended to the URL.
667
-
668
- For example, this will do a GET request to the URL
669
- ``http://example.com?bar=baz``::
670
-
671
- loadJSONDoc("http://example.com", {bar: "baz"});
672
-
673
- *returns*:
674
- :mochiref:`Deferred` that will callback with the evaluated
675
- JSON [4]_ response upon successful ``XMLHttpRequest``
676
-
677
- *Availability*:
678
- Available in MochiKit 1.3.1+
679
-
680
-
681
- :mochidef:`sendXMLHttpRequest(req[, sendContent])`:
682
-
683
- Set an ``onreadystatechange`` handler on an ``XMLHttpRequest``
684
- object and send it off. Will return a cancellable
685
- :mochiref:`Deferred` that will callback on success.
686
-
687
- Note that only ``200`` (OK), ``201`` (CREATED),
688
- ``204`` (NO CONTENT) and ``304`` (NOT MODIFIED) are considered
689
- success codes. All other status codes will
690
- result in an errback with an ``XMLHttpRequestError``.
691
-
692
- ``req``:
693
- An preconfigured ``XMLHttpRequest`` object (open has been
694
- called).
695
-
696
- ``sendContent``:
697
- Optional string or DOM content to send over the
698
- ``XMLHttpRequest``.
699
-
700
- *returns*:
701
- :mochiref:`Deferred` that will callback with the
702
- ``XMLHttpRequest`` instance on success.
703
-
704
- *Availability*:
705
- Available in MochiKit 1.3.1+. Support for 201 and 204 were added in
706
- MochiKit 1.4.
707
-
708
-
709
- :mochidef:`succeed([result])`:
710
-
711
- Return a :mochiref:`Deferred` that has already had
712
- ``.callback(result)`` called.
713
-
714
- This is useful when you're writing synchronous code to an
715
- asynchronous interface: i.e., some code is calling you expecting a
716
- :mochiref:`Deferred` result, but you don't actually need to do
717
- anything asynchronous. Just return ``succeed(theResult)``.
718
-
719
- See ``fail`` for a version of this function that uses a failing
720
- :mochiref:`Deferred` rather than a successful one.
721
-
722
- ``result``:
723
- The result to give to
724
- :mochiref:`Deferred.prototype.callback(result)`
725
-
726
- *returns*:
727
- a ``new`` :mochiref:`Deferred`
728
-
729
- *Availability*:
730
- Available in MochiKit 1.3.1+
731
-
732
-
733
- :mochidef:`wait(seconds[, res])`:
734
-
735
- Return a new cancellable :mochiref:`Deferred` that will
736
- ``.callback(res)`` after at least ``seconds`` seconds have
737
- elapsed.
738
-
739
- *Availability*:
740
- Available in MochiKit 1.3.1+
741
-
742
-
743
- See Also
744
- ========
745
-
746
- .. [1] AJAX, Asynchronous JavaScript and XML: http://en.wikipedia.org/wiki/AJAX
747
- .. [2] Twisted, an event-driven networking framework written in Python: http://twistedmatrix.com/
748
- .. [3] Twisted Deferred Reference: http://twistedmatrix.com/projects/core/documentation/howto/defer.html
749
- .. [4] JSON, JavaScript Object Notation: http://json.org/
750
-
751
-
752
- Authors
753
- =======
754
-
755
- - Bob Ippolito <bob@redivi.com>
756
-
757
-
758
- Copyright
759
- =========
760
-
761
- Copyright 2005 Bob Ippolito <bob@redivi.com>. This program is
762
- dual-licensed free software; you can redistribute it and/or modify it
763
- under the terms of the `MIT License`_ or the `Academic Free License
764
- v2.1`_.
765
-
766
- .. _`MIT License`: http://www.opensource.org/licenses/mit-license.php
767
- .. _`Academic Free License v2.1`: http://www.opensource.org/licenses/afl-2.1.php