ziya 2.0.7 → 2.1.6

Sign up to get free protection for your applications and to get access to all the features.
Files changed (612) hide show
  1. data/Manifest.txt +561 -89
  2. data/README.txt +203 -108
  3. data/Rakefile +7 -6
  4. data/bin/ziyafy +38 -14
  5. data/docs/History.txt.html +50 -0
  6. data/docs/README.txt.html +403 -0
  7. data/docs/String.html +832 -0
  8. data/docs/Ziya.html +636 -0
  9. data/docs/Ziya/Charts.html +909 -0
  10. data/docs/Ziya/Charts/Area.html +672 -0
  11. data/docs/Ziya/Charts/AreaThreed.html +672 -0
  12. data/docs/Ziya/Charts/Bar.html +672 -0
  13. data/docs/Ziya/Charts/Base.html +1101 -0
  14. data/docs/Ziya/Charts/Bubble.html +672 -0
  15. data/docs/Ziya/Charts/CandleStick.html +672 -0
  16. data/docs/Ziya/Charts/Column.html +672 -0
  17. data/docs/Ziya/Charts/ColumnThreed.html +672 -0
  18. data/docs/Ziya/Charts/Custom.html +672 -0
  19. data/docs/Ziya/Charts/Donut.html +672 -0
  20. data/docs/Ziya/Charts/FloatingBar.html +672 -0
  21. data/docs/Ziya/Charts/FloatingColumn.html +672 -0
  22. data/docs/Ziya/Charts/ImageColumn.html +672 -0
  23. data/docs/Ziya/Charts/ImagePie.html +672 -0
  24. data/docs/Ziya/Charts/Line.html +672 -0
  25. data/docs/Ziya/Charts/Mixed.html +672 -0
  26. data/docs/Ziya/Charts/ParallelThreedColumn.html +672 -0
  27. data/docs/Ziya/Charts/Pie.html +672 -0
  28. data/docs/Ziya/Charts/PieThreed.html +672 -0
  29. data/docs/Ziya/Charts/Polar.html +672 -0
  30. data/docs/Ziya/Charts/Scatter.html +672 -0
  31. data/docs/Ziya/Charts/StackedArea.html +672 -0
  32. data/docs/Ziya/Charts/StackedBar.html +672 -0
  33. data/docs/Ziya/Charts/StackedColumn.html +672 -0
  34. data/docs/Ziya/Charts/StackedThreedArea.html +672 -0
  35. data/docs/Ziya/Charts/StackedThreedColumn.html +672 -0
  36. data/docs/Ziya/Charts/Support.html +1245 -0
  37. data/docs/Ziya/Charts/Support/Area.html +582 -0
  38. data/docs/Ziya/Charts/Support/AxisCategory.html +583 -0
  39. data/docs/Ziya/Charts/Support/AxisTicks.html +644 -0
  40. data/docs/Ziya/Charts/Support/AxisValue.html +583 -0
  41. data/docs/Ziya/Charts/Support/Base.html +577 -0
  42. data/docs/Ziya/Charts/Support/Bevel.html +583 -0
  43. data/docs/Ziya/Charts/Support/Blur.html +583 -0
  44. data/docs/Ziya/Charts/Support/Button.html +583 -0
  45. data/docs/Ziya/Charts/Support/ChartBorder.html +582 -0
  46. data/docs/Ziya/Charts/Support/ChartGridH.html +616 -0
  47. data/docs/Ziya/Charts/Support/ChartGridV.html +616 -0
  48. data/docs/Ziya/Charts/Support/ChartGuide.html +582 -0
  49. data/docs/Ziya/Charts/Support/ChartLabel.html +583 -0
  50. data/docs/Ziya/Charts/Support/ChartNote.html +582 -0
  51. data/docs/Ziya/Charts/Support/ChartPref.html +589 -0
  52. data/docs/Ziya/Charts/Support/ChartRect.html +632 -0
  53. data/docs/Ziya/Charts/Support/ChartTransition.html +613 -0
  54. data/docs/Ziya/Charts/Support/Circle.html +583 -0
  55. data/docs/Ziya/Charts/Support/ContextMenu.html +583 -0
  56. data/docs/Ziya/Charts/Support/Draw.html +886 -0
  57. data/docs/Ziya/Charts/Support/DrawBase.html +577 -0
  58. data/docs/Ziya/Charts/Support/Filter.html +668 -0
  59. data/docs/Ziya/Charts/Support/FlashToJavascript.html +596 -0
  60. data/docs/Ziya/Charts/Support/Glow.html +583 -0
  61. data/docs/Ziya/Charts/Support/Image.html +583 -0
  62. data/docs/Ziya/Charts/Support/Legend.html +582 -0
  63. data/docs/Ziya/Charts/Support/Line.html +583 -0
  64. data/docs/Ziya/Charts/Support/Link.html +734 -0
  65. data/docs/Ziya/Charts/Support/LinkData.html +589 -0
  66. data/docs/Ziya/Charts/Support/Rect.html +583 -0
  67. data/docs/Ziya/Charts/Support/Scroll.html +583 -0
  68. data/docs/Ziya/Charts/Support/Series.html +583 -0
  69. data/docs/Ziya/Charts/Support/SeriesColor.html +676 -0
  70. data/docs/Ziya/Charts/Support/SeriesExplode.html +676 -0
  71. data/docs/Ziya/Charts/Support/Shadow.html +583 -0
  72. data/docs/Ziya/Charts/Support/Text.html +664 -0
  73. data/docs/Ziya/Charts/Support/Tooltip.html +583 -0
  74. data/docs/Ziya/Charts/Support/Update.html +590 -0
  75. data/docs/Ziya/Gauges.html +644 -0
  76. data/docs/Ziya/Gauges/Base.html +1052 -0
  77. data/docs/Ziya/Gauges/Radial.html +654 -0
  78. data/docs/Ziya/Gauges/Signal.html +794 -0
  79. data/docs/Ziya/Gauges/Support.html +726 -0
  80. data/docs/Ziya/Gauges/Support/Area.html +577 -0
  81. data/docs/Ziya/Gauges/Support/Base.html +690 -0
  82. data/docs/Ziya/Gauges/Support/Circle.html +577 -0
  83. data/docs/Ziya/Gauges/Support/Design.html +577 -0
  84. data/docs/Ziya/Gauges/Support/Image.html +577 -0
  85. data/docs/Ziya/Gauges/Support/Line.html +577 -0
  86. data/docs/Ziya/Gauges/Support/Link.html +577 -0
  87. data/docs/Ziya/Gauges/Support/Move.html +577 -0
  88. data/docs/Ziya/Gauges/Support/Point.html +577 -0
  89. data/docs/Ziya/Gauges/Support/Polygon.html +577 -0
  90. data/docs/Ziya/Gauges/Support/RadialBase.html +654 -0
  91. data/docs/Ziya/Gauges/Support/RadialNumbers.html +694 -0
  92. data/docs/Ziya/Gauges/Support/RadialTicks.html +676 -0
  93. data/docs/Ziya/Gauges/Support/Rect.html +577 -0
  94. data/docs/Ziya/Gauges/Support/Rotate.html +577 -0
  95. data/docs/Ziya/Gauges/Support/Scale.html +577 -0
  96. data/docs/Ziya/Gauges/Support/Text.html +656 -0
  97. data/docs/Ziya/Gauges/Support/Update.html +577 -0
  98. data/docs/Ziya/Gauges/Thermo.html +826 -0
  99. data/docs/Ziya/HtmlHelpers.html +597 -0
  100. data/docs/Ziya/HtmlHelpers/Charts.html +1399 -0
  101. data/docs/Ziya/HtmlHelpers/Gauges.html +987 -0
  102. data/docs/Ziya/HtmlHelpers/Maps.html +950 -0
  103. data/docs/Ziya/Maps.html +713 -0
  104. data/docs/Ziya/Maps/Australia.html +648 -0
  105. data/docs/Ziya/Maps/Base.html +1099 -0
  106. data/docs/Ziya/Maps/Belgium.html +648 -0
  107. data/docs/Ziya/Maps/Brazil.html +648 -0
  108. data/docs/Ziya/Maps/Canada.html +648 -0
  109. data/docs/Ziya/Maps/Europe.html +648 -0
  110. data/docs/Ziya/Maps/France.html +648 -0
  111. data/docs/Ziya/Maps/Geocode.html +752 -0
  112. data/docs/Ziya/Maps/Germany.html +648 -0
  113. data/docs/Ziya/Maps/Italy.html +648 -0
  114. data/docs/Ziya/Maps/Mexico.html +648 -0
  115. data/docs/Ziya/Maps/Support.html +798 -0
  116. data/docs/Ziya/Maps/Support/Arc.html +577 -0
  117. data/docs/Ziya/Maps/Support/ArcColor.html +577 -0
  118. data/docs/Ziya/Maps/Support/ArcRange.html +577 -0
  119. data/docs/Ziya/Maps/Support/BackgroundColor.html +577 -0
  120. data/docs/Ziya/Maps/Support/Base.html +792 -0
  121. data/docs/Ziya/Maps/Support/DefaultColor.html +577 -0
  122. data/docs/Ziya/Maps/Support/DefaultPoint.html +577 -0
  123. data/docs/Ziya/Maps/Support/FirstZoom.html +577 -0
  124. data/docs/Ziya/Maps/Support/HeatRange.html +658 -0
  125. data/docs/Ziya/Maps/Support/Hover.html +577 -0
  126. data/docs/Ziya/Maps/Support/Line.html +577 -0
  127. data/docs/Ziya/Maps/Support/LineColor.html +577 -0
  128. data/docs/Ziya/Maps/Support/LineRange.html +577 -0
  129. data/docs/Ziya/Maps/Support/OutlineColor.html +577 -0
  130. data/docs/Ziya/Maps/Support/Point.html +577 -0
  131. data/docs/Ziya/Maps/Support/PointRange.html +577 -0
  132. data/docs/Ziya/Maps/Support/Range.html +753 -0
  133. data/docs/Ziya/Maps/Support/Ranges.html +658 -0
  134. data/docs/Ziya/Maps/Support/Region.html +577 -0
  135. data/docs/Ziya/Maps/Support/ScalePoints.html +577 -0
  136. data/docs/Ziya/Maps/Support/ShowName.html +577 -0
  137. data/docs/Ziya/Maps/Support/State.html +577 -0
  138. data/docs/Ziya/Maps/Support/StateInfoIcon.html +577 -0
  139. data/docs/Ziya/Maps/Support/ZoomMode.html +577 -0
  140. data/docs/Ziya/Maps/Support/ZoomOutButton.html +577 -0
  141. data/docs/Ziya/Maps/Support/ZoomOutScale.html +577 -0
  142. data/docs/Ziya/Maps/Sweden.html +648 -0
  143. data/docs/Ziya/Maps/Uk.html +648 -0
  144. data/docs/Ziya/Maps/Us.html +648 -0
  145. data/docs/Ziya/Maps/World.html +648 -0
  146. data/docs/Ziya/YamlHelpers.html +592 -0
  147. data/docs/Ziya/YamlHelpers/Gauges.html +848 -0
  148. data/docs/Ziya/YamlHelpers/Maps.html +750 -0
  149. data/docs/Ziya/Ziyafy.html +735 -0
  150. data/docs/bin/ziyafy.html +52 -0
  151. data/docs/created.rid +1 -0
  152. data/docs/examples/charts/public/charts/themes/readme.txt.html +61 -0
  153. data/docs/examples/maps/public/maps/themes/readme.txt.html +61 -0
  154. data/docs/images/brick.png +0 -0
  155. data/docs/images/brick_link.png +0 -0
  156. data/docs/images/bullet_black.png +0 -0
  157. data/docs/images/date.png +0 -0
  158. data/docs/images/macFFBgHack.png +0 -0
  159. data/docs/images/package.png +0 -0
  160. data/docs/images/page_green.png +0 -0
  161. data/docs/images/page_white_width.png +0 -0
  162. data/docs/images/plugin.png +0 -0
  163. data/docs/images/ruby.png +0 -0
  164. data/docs/images/tag_green.png +0 -0
  165. data/docs/images/wrench.png +0 -0
  166. data/docs/images/wrench_orange.png +0 -0
  167. data/docs/images/zoom.png +0 -0
  168. data/docs/index.html +978 -0
  169. data/docs/js/darkfish.js +91 -0
  170. data/docs/js/jquery.js +32 -0
  171. data/docs/js/quicksearch.js +135 -0
  172. data/docs/js/thickbox-compressed.js +10 -0
  173. data/docs/lib/ziya.rb.html +43 -0
  174. data/docs/lib/ziya/charts/area.rb.html +54 -0
  175. data/docs/lib/ziya/charts/area_threed.rb.html +153 -0
  176. data/docs/lib/ziya/charts/bar.rb.html +45 -0
  177. data/docs/lib/ziya/charts/base.rb.html +71 -0
  178. data/docs/lib/ziya/charts/bubble.rb.html +54 -0
  179. data/docs/lib/ziya/charts/candle_stick.rb.html +45 -0
  180. data/docs/lib/ziya/charts/column.rb.html +45 -0
  181. data/docs/lib/ziya/charts/column_threed.rb.html +45 -0
  182. data/docs/lib/ziya/charts/custom.rb.html +54 -0
  183. data/docs/lib/ziya/charts/donut.rb.html +54 -0
  184. data/docs/lib/ziya/charts/floating_bar.rb.html +45 -0
  185. data/docs/lib/ziya/charts/floating_column.rb.html +45 -0
  186. data/docs/lib/ziya/charts/image_column.rb.html +54 -0
  187. data/docs/lib/ziya/charts/image_pie.rb.html +54 -0
  188. data/docs/lib/ziya/charts/line.rb.html +45 -0
  189. data/docs/lib/ziya/charts/mixed.rb.html +45 -0
  190. data/docs/lib/ziya/charts/parallel_threed_column.rb.html +45 -0
  191. data/docs/lib/ziya/charts/pie.rb.html +45 -0
  192. data/docs/lib/ziya/charts/pie_threed.rb.html +45 -0
  193. data/docs/lib/ziya/charts/polar.rb.html +45 -0
  194. data/docs/lib/ziya/charts/scatter.rb.html +45 -0
  195. data/docs/lib/ziya/charts/stacked_area.rb.html +45 -0
  196. data/docs/lib/ziya/charts/stacked_bar.rb.html +45 -0
  197. data/docs/lib/ziya/charts/stacked_column.rb.html +45 -0
  198. data/docs/lib/ziya/charts/stacked_threed_area.rb.html +45 -0
  199. data/docs/lib/ziya/charts/stacked_threed_column.rb.html +45 -0
  200. data/docs/lib/ziya/charts/support/area.rb.html +56 -0
  201. data/docs/lib/ziya/charts/support/axis_category.rb.html +407 -0
  202. data/docs/lib/ziya/charts/support/axis_ticks.rb.html +48 -0
  203. data/docs/lib/ziya/charts/support/axis_value.rb.html +48 -0
  204. data/docs/lib/ziya/charts/support/base.rb.html +64 -0
  205. data/docs/lib/ziya/charts/support/bevel.rb.html +48 -0
  206. data/docs/lib/ziya/charts/support/blur.rb.html +48 -0
  207. data/docs/lib/ziya/charts/support/button.rb.html +48 -0
  208. data/docs/lib/ziya/charts/support/chart_border.rb.html +48 -0
  209. data/docs/lib/ziya/charts/support/chart_grid_h.rb.html +48 -0
  210. data/docs/lib/ziya/charts/support/chart_grid_v.rb.html +48 -0
  211. data/docs/lib/ziya/charts/support/chart_guide.rb.html +48 -0
  212. data/docs/lib/ziya/charts/support/chart_label.rb.html +49 -0
  213. data/docs/lib/ziya/charts/support/chart_note.rb.html +53 -0
  214. data/docs/lib/ziya/charts/support/chart_pref.rb.html +48 -0
  215. data/docs/lib/ziya/charts/support/chart_rect.rb.html +48 -0
  216. data/docs/lib/ziya/charts/support/chart_transition.rb.html +48 -0
  217. data/docs/lib/ziya/charts/support/circle.rb.html +48 -0
  218. data/docs/lib/ziya/charts/support/context_menu.rb.html +47 -0
  219. data/docs/lib/ziya/charts/support/draw.rb.html +57 -0
  220. data/docs/lib/ziya/charts/support/draw_base.rb.html +48 -0
  221. data/docs/lib/ziya/charts/support/filter.rb.html +52 -0
  222. data/docs/lib/ziya/charts/support/flash_to_javascript.rb.html +48 -0
  223. data/docs/lib/ziya/charts/support/glow.rb.html +48 -0
  224. data/docs/lib/ziya/charts/support/image.rb.html +52 -0
  225. data/docs/lib/ziya/charts/support/legend.rb.html +48 -0
  226. data/docs/lib/ziya/charts/support/line.rb.html +48 -0
  227. data/docs/lib/ziya/charts/support/link.rb.html +48 -0
  228. data/docs/lib/ziya/charts/support/link_data.rb.html +48 -0
  229. data/docs/lib/ziya/charts/support/rect.rb.html +48 -0
  230. data/docs/lib/ziya/charts/support/scroll.rb.html +50 -0
  231. data/docs/lib/ziya/charts/support/series.rb.html +47 -0
  232. data/docs/lib/ziya/charts/support/series_color.rb.html +62 -0
  233. data/docs/lib/ziya/charts/support/series_explode.rb.html +65 -0
  234. data/docs/lib/ziya/charts/support/shadow.rb.html +48 -0
  235. data/docs/lib/ziya/charts/support/text.rb.html +51 -0
  236. data/docs/lib/ziya/charts/support/tooltip.rb.html +53 -0
  237. data/docs/lib/ziya/charts/support/update.rb.html +49 -0
  238. data/docs/lib/ziya/core_ext/string.rb.html +50 -0
  239. data/docs/lib/ziya/gauges/base.rb.html +54 -0
  240. data/docs/lib/ziya/gauges/radial.rb.html +64 -0
  241. data/docs/lib/ziya/gauges/signal.rb.html +49 -0
  242. data/docs/lib/ziya/gauges/support/area.rb.html +57 -0
  243. data/docs/lib/ziya/gauges/support/base.rb.html +39 -0
  244. data/docs/lib/ziya/gauges/support/circle.rb.html +57 -0
  245. data/docs/lib/ziya/gauges/support/design.rb.html +39 -0
  246. data/docs/lib/ziya/gauges/support/image.rb.html +57 -0
  247. data/docs/lib/ziya/gauges/support/line.rb.html +57 -0
  248. data/docs/lib/ziya/gauges/support/link.rb.html +57 -0
  249. data/docs/lib/ziya/gauges/support/move.rb.html +57 -0
  250. data/docs/lib/ziya/gauges/support/point.rb.html +57 -0
  251. data/docs/lib/ziya/gauges/support/polygon.rb.html +57 -0
  252. data/docs/lib/ziya/gauges/support/radial_base.rb.html +58 -0
  253. data/docs/lib/ziya/gauges/support/radial_numbers.rb.html +60 -0
  254. data/docs/lib/ziya/gauges/support/radial_ticks.rb.html +57 -0
  255. data/docs/lib/ziya/gauges/support/rect.rb.html +57 -0
  256. data/docs/lib/ziya/gauges/support/rotate.rb.html +57 -0
  257. data/docs/lib/ziya/gauges/support/scale.rb.html +57 -0
  258. data/docs/lib/ziya/gauges/support/text.rb.html +57 -0
  259. data/docs/lib/ziya/gauges/support/update.rb.html +57 -0
  260. data/docs/lib/ziya/gauges/thermo.rb.html +48 -0
  261. data/docs/lib/ziya/html_helpers.rb.html +39 -0
  262. data/docs/lib/ziya/html_helpers/base.rb.html +48 -0
  263. data/docs/lib/ziya/html_helpers/charts.rb.html +48 -0
  264. data/docs/lib/ziya/html_helpers/gauges.rb.html +48 -0
  265. data/docs/lib/ziya/html_helpers/maps.rb.html +39 -0
  266. data/docs/lib/ziya/maps/australia.rb.html +48 -0
  267. data/docs/lib/ziya/maps/base.rb.html +62 -0
  268. data/docs/lib/ziya/maps/belgium.rb.html +39 -0
  269. data/docs/lib/ziya/maps/brazil.rb.html +39 -0
  270. data/docs/lib/ziya/maps/canada.rb.html +39 -0
  271. data/docs/lib/ziya/maps/europe.rb.html +39 -0
  272. data/docs/lib/ziya/maps/france.rb.html +39 -0
  273. data/docs/lib/ziya/maps/geocode.rb.html +45 -0
  274. data/docs/lib/ziya/maps/germany.rb.html +39 -0
  275. data/docs/lib/ziya/maps/italy.rb.html +39 -0
  276. data/docs/lib/ziya/maps/mexico.rb.html +39 -0
  277. data/docs/lib/ziya/maps/support/arc.rb.html +48 -0
  278. data/docs/lib/ziya/maps/support/arc_color.rb.html +48 -0
  279. data/docs/lib/ziya/maps/support/arc_range.rb.html +48 -0
  280. data/docs/lib/ziya/maps/support/background_color.rb.html +48 -0
  281. data/docs/lib/ziya/maps/support/base.rb.html +48 -0
  282. data/docs/lib/ziya/maps/support/default_color.rb.html +48 -0
  283. data/docs/lib/ziya/maps/support/default_point.rb.html +48 -0
  284. data/docs/lib/ziya/maps/support/first_zoom.rb.html +48 -0
  285. data/docs/lib/ziya/maps/support/heat_range.rb.html +50 -0
  286. data/docs/lib/ziya/maps/support/hover.rb.html +48 -0
  287. data/docs/lib/ziya/maps/support/line.rb.html +48 -0
  288. data/docs/lib/ziya/maps/support/line_color.rb.html +48 -0
  289. data/docs/lib/ziya/maps/support/line_range.rb.html +48 -0
  290. data/docs/lib/ziya/maps/support/outline_color.rb.html +48 -0
  291. data/docs/lib/ziya/maps/support/point.rb.html +48 -0
  292. data/docs/lib/ziya/maps/support/point_range.rb.html +48 -0
  293. data/docs/lib/ziya/maps/support/range.rb.html +48 -0
  294. data/docs/lib/ziya/maps/support/ranges.rb.html +47 -0
  295. data/docs/lib/ziya/maps/support/region.rb.html +48 -0
  296. data/docs/lib/ziya/maps/support/scale_points.rb.html +48 -0
  297. data/docs/lib/ziya/maps/support/show_name.rb.html +48 -0
  298. data/docs/lib/ziya/maps/support/state.rb.html +48 -0
  299. data/docs/lib/ziya/maps/support/state_info_icon.rb.html +48 -0
  300. data/docs/lib/ziya/maps/support/zoom_mode.rb.html +48 -0
  301. data/docs/lib/ziya/maps/support/zoom_out_button.rb.html +48 -0
  302. data/docs/lib/ziya/maps/support/zoom_out_scale.rb.html +48 -0
  303. data/docs/lib/ziya/maps/sweden.rb.html +39 -0
  304. data/docs/lib/ziya/maps/uk.rb.html +39 -0
  305. data/docs/lib/ziya/maps/us.rb.html +39 -0
  306. data/docs/lib/ziya/maps/world.rb.html +39 -0
  307. data/docs/lib/ziya/utils/logger.rb.html +53 -0
  308. data/docs/lib/ziya/version.rb.html +39 -0
  309. data/docs/lib/ziya/yaml_helpers.rb.html +39 -0
  310. data/docs/lib/ziya/yaml_helpers/base.rb.html +48 -0
  311. data/docs/lib/ziya/yaml_helpers/charts.rb.html +50 -0
  312. data/docs/lib/ziya/yaml_helpers/gauges.rb.html +39 -0
  313. data/docs/lib/ziya/yaml_helpers/maps.rb.html +39 -0
  314. data/docs/rdoc.css +664 -0
  315. data/docs/release_notes.txt.html +51 -0
  316. data/docs/resources/charts/themes/readme.txt.html +61 -0
  317. data/docs/resources/maps/themes/readme.txt.html +61 -0
  318. data/examples/charts/basic_chart.rb +55 -0
  319. data/{charts → examples/charts/public/charts}/AC_RunActiveContent.js +0 -0
  320. data/examples/charts/public/charts/charts.swf +0 -0
  321. data/examples/charts/public/charts/charts_library/ar3d.swf +0 -0
  322. data/examples/charts/public/charts/charts_library/arno.swf +0 -0
  323. data/examples/charts/public/charts/charts_library/ars3.swf +0 -0
  324. data/examples/charts/public/charts/charts_library/arst.swf +0 -0
  325. data/examples/charts/public/charts/charts_library/brfl.swf +0 -0
  326. data/examples/charts/public/charts/charts_library/brno.swf +0 -0
  327. data/examples/charts/public/charts/charts_library/brst.swf +0 -0
  328. data/examples/charts/public/charts/charts_library/buno.swf +0 -0
  329. data/examples/charts/public/charts/charts_library/cl3d.swf +0 -0
  330. data/examples/charts/public/charts/charts_library/clfl.swf +0 -0
  331. data/examples/charts/public/charts/charts_library/clim.swf +0 -0
  332. data/examples/charts/public/charts/charts_library/clno.swf +0 -0
  333. data/examples/charts/public/charts/charts_library/clp3.swf +0 -0
  334. data/examples/charts/public/charts/charts_library/cls3.swf +0 -0
  335. data/examples/charts/public/charts/charts_library/clst.swf +0 -0
  336. data/examples/charts/public/charts/charts_library/cnno.swf +0 -0
  337. data/{charts → examples/charts/public/charts}/charts_library/dollar.jpg +0 -0
  338. data/examples/charts/public/charts/charts_library/dono.swf +0 -0
  339. data/examples/charts/public/charts/charts_library/lnno.swf +0 -0
  340. data/examples/charts/public/charts/charts_library/mxno.swf +0 -0
  341. data/examples/charts/public/charts/charts_library/pi3d.swf +0 -0
  342. data/{charts → examples/charts/public/charts}/charts_library/pie.jpg +0 -0
  343. data/examples/charts/public/charts/charts_library/piim.swf +0 -0
  344. data/examples/charts/public/charts/charts_library/pino.swf +0 -0
  345. data/examples/charts/public/charts/charts_library/pono.swf +0 -0
  346. data/examples/charts/public/charts/charts_library/scno.swf +0 -0
  347. data/examples/charts/public/charts/full_screen.fla +0 -0
  348. data/{charts → examples/charts/public/charts}/full_screen.swf +0 -0
  349. data/{charts → examples/charts/public/charts}/scripts/output_jpg.php +0 -0
  350. data/{charts → examples/charts/public/charts}/sliders/black.swf +0 -0
  351. data/{charts → examples/charts/public/charts}/sliders/preview_handle_1.swf +0 -0
  352. data/{charts → examples/charts/public/charts}/sliders/preview_handle_2.swf +0 -0
  353. data/examples/charts/public/charts/themes/cool_theme/column_chart.yml +150 -0
  354. data/examples/charts/public/charts/themes/cool_theme/line_chart.yml +5 -0
  355. data/examples/charts/public/charts/themes/readme.txt +13 -0
  356. data/examples/charts/public/fred.xml +21 -0
  357. data/examples/charts/views/index.erb +17 -0
  358. data/examples/maps/basic_map.rb +63 -0
  359. data/examples/maps/helpers/map_helper.rb +15 -0
  360. data/examples/maps/models/confidential_herpes_report.rb +78 -0
  361. data/examples/maps/public/javascripts/jquery-1.3.2.js +4376 -0
  362. data/examples/maps/public/map.xml +336 -0
  363. data/examples/maps/public/maps/js/Exception.js +45 -0
  364. data/examples/maps/public/maps/js/FlashProxy.js +72 -0
  365. data/examples/maps/public/maps/js/FlashSerializer.js +165 -0
  366. data/examples/maps/public/maps/js/FlashTag.js +111 -0
  367. data/examples/maps/public/maps/js/JavaScriptFlashGateway.js +455 -0
  368. data/examples/maps/public/maps/js/JavaScriptFlashGateway.swf +0 -0
  369. data/examples/maps/public/maps/map_library/australia.swf +0 -0
  370. data/examples/maps/public/maps/map_library/belgium.swf +0 -0
  371. data/examples/maps/public/maps/map_library/brazil.swf +0 -0
  372. data/examples/maps/public/maps/map_library/canada.swf +0 -0
  373. data/examples/maps/public/maps/map_library/europe.swf +0 -0
  374. data/examples/maps/public/maps/map_library/france.swf +0 -0
  375. data/examples/maps/public/maps/map_library/germany.swf +0 -0
  376. data/examples/maps/public/maps/map_library/italy.swf +0 -0
  377. data/examples/maps/public/maps/map_library/mexico.swf +0 -0
  378. data/examples/maps/public/maps/map_library/sweden.swf +0 -0
  379. data/examples/maps/public/maps/map_library/uk_ireland.swf +0 -0
  380. data/examples/maps/public/maps/map_library/us.swf +0 -0
  381. data/examples/maps/public/maps/map_library/us_canada.swf +0 -0
  382. data/examples/maps/public/maps/map_library/world.swf +0 -0
  383. data/examples/maps/public/maps/themes/default/base_map.yml +27 -0
  384. data/examples/maps/public/maps/themes/default/us_map.yml +20 -0
  385. data/examples/maps/public/maps/themes/default/us_map_2.yml +17 -0
  386. data/examples/maps/public/maps/themes/readme.txt +13 -0
  387. data/examples/maps/public/stylesheets/map.css +16 -0
  388. data/examples/maps/views/index.erb +26 -0
  389. data/examples/maps/views/layout.erb +21 -0
  390. data/gem_script.rb +5 -0
  391. data/lib/ziya.rb +20 -11
  392. data/lib/ziya/charts/base.rb +114 -90
  393. data/lib/ziya/{components → charts/support}/area.rb +2 -2
  394. data/lib/ziya/{components → charts/support}/axis_category.rb +1 -1
  395. data/lib/ziya/{components → charts/support}/axis_ticks.rb +1 -1
  396. data/lib/ziya/{components → charts/support}/axis_value.rb +1 -1
  397. data/lib/ziya/{components → charts/support}/base.rb +9 -21
  398. data/lib/ziya/{components → charts/support}/bevel.rb +1 -1
  399. data/lib/ziya/{components → charts/support}/blur.rb +1 -1
  400. data/lib/ziya/{components → charts/support}/button.rb +1 -1
  401. data/lib/ziya/{components → charts/support}/chart_border.rb +1 -1
  402. data/lib/ziya/{components → charts/support}/chart_grid_h.rb +1 -1
  403. data/lib/ziya/{components → charts/support}/chart_grid_v.rb +1 -1
  404. data/lib/ziya/{components → charts/support}/chart_guide.rb +1 -1
  405. data/lib/ziya/{components → charts/support}/chart_label.rb +1 -1
  406. data/lib/ziya/{components → charts/support}/chart_note.rb +1 -1
  407. data/lib/ziya/{components → charts/support}/chart_pref.rb +3 -2
  408. data/lib/ziya/{components → charts/support}/chart_rect.rb +1 -1
  409. data/lib/ziya/{components → charts/support}/chart_transition.rb +1 -1
  410. data/lib/ziya/{components → charts/support}/circle.rb +1 -1
  411. data/lib/ziya/{components → charts/support}/context_menu.rb +1 -3
  412. data/lib/ziya/charts/support/draw.rb +76 -0
  413. data/lib/ziya/{components → charts/support}/draw_base.rb +1 -1
  414. data/lib/ziya/{components → charts/support}/filter.rb +1 -1
  415. data/lib/ziya/charts/support/flash_to_javascript.rb +23 -0
  416. data/lib/ziya/{components → charts/support}/glow.rb +1 -1
  417. data/lib/ziya/{components → charts/support}/image.rb +1 -1
  418. data/lib/ziya/{components → charts/support}/legend.rb +1 -1
  419. data/lib/ziya/{components → charts/support}/line.rb +1 -1
  420. data/lib/ziya/{components → charts/support}/link.rb +9 -1
  421. data/lib/ziya/{components → charts/support}/link_data.rb +1 -1
  422. data/lib/ziya/{components → charts/support}/rect.rb +1 -1
  423. data/lib/ziya/{components → charts/support}/scroll.rb +1 -3
  424. data/lib/ziya/{components → charts/support}/series.rb +1 -3
  425. data/lib/ziya/{components → charts/support}/series_color.rb +1 -1
  426. data/lib/ziya/{components → charts/support}/series_explode.rb +1 -1
  427. data/lib/ziya/{components → charts/support}/shadow.rb +1 -1
  428. data/lib/ziya/{components → charts/support}/text.rb +9 -1
  429. data/lib/ziya/{components → charts/support}/tooltip.rb +1 -1
  430. data/lib/ziya/{components → charts/support}/update.rb +1 -1
  431. data/lib/ziya/core_ext/string.rb +31 -0
  432. data/lib/ziya/gauges/base.rb +17 -12
  433. data/lib/ziya/gauges/support/base.rb +4 -12
  434. data/lib/ziya/gauges/support/radial_numbers.rb +1 -1
  435. data/lib/ziya/html_helpers.rb +1 -0
  436. data/lib/ziya/html_helpers/base.rb +91 -0
  437. data/lib/ziya/html_helpers/charts.rb +200 -0
  438. data/lib/ziya/html_helpers/gauges.rb +90 -0
  439. data/lib/ziya/html_helpers/maps.rb +74 -0
  440. data/lib/ziya/maps/australia.rb +9 -0
  441. data/lib/ziya/maps/base.rb +409 -0
  442. data/lib/ziya/maps/belgium.rb +7 -0
  443. data/lib/ziya/maps/brazil.rb +7 -0
  444. data/lib/ziya/maps/canada.rb +7 -0
  445. data/lib/ziya/maps/europe.rb +7 -0
  446. data/lib/ziya/maps/france.rb +7 -0
  447. data/lib/ziya/maps/geocode.rb +18 -0
  448. data/lib/ziya/maps/germany.rb +7 -0
  449. data/lib/ziya/maps/italy.rb +7 -0
  450. data/lib/ziya/maps/mexico.rb +7 -0
  451. data/lib/ziya/maps/support/arc.rb +7 -0
  452. data/lib/ziya/maps/support/arc_color.rb +7 -0
  453. data/lib/ziya/maps/support/arc_range.rb +7 -0
  454. data/lib/ziya/maps/support/background_color.rb +7 -0
  455. data/lib/ziya/maps/support/base.rb +34 -0
  456. data/lib/ziya/maps/support/default_color.rb +7 -0
  457. data/lib/ziya/maps/support/default_point.rb +7 -0
  458. data/lib/ziya/maps/support/first_zoom.rb +7 -0
  459. data/lib/ziya/maps/support/heat_range.rb +35 -0
  460. data/lib/ziya/maps/support/hover.rb +7 -0
  461. data/lib/ziya/maps/support/line.rb +7 -0
  462. data/lib/ziya/maps/support/line_color.rb +7 -0
  463. data/lib/ziya/maps/support/line_range.rb +7 -0
  464. data/lib/ziya/maps/support/outline_color.rb +7 -0
  465. data/lib/ziya/maps/support/point.rb +8 -0
  466. data/lib/ziya/maps/support/point_range.rb +7 -0
  467. data/lib/ziya/maps/support/range.rb +31 -0
  468. data/lib/ziya/maps/support/ranges.rb +18 -0
  469. data/lib/ziya/maps/support/region.rb +7 -0
  470. data/lib/ziya/maps/support/scale_points.rb +7 -0
  471. data/lib/ziya/maps/support/show_name.rb +7 -0
  472. data/lib/ziya/maps/support/state.rb +7 -0
  473. data/lib/ziya/maps/support/state_info_icon.rb +7 -0
  474. data/lib/ziya/maps/support/zoom_mode.rb +7 -0
  475. data/lib/ziya/maps/support/zoom_out_button.rb +7 -0
  476. data/lib/ziya/maps/support/zoom_out_scale.rb +7 -0
  477. data/lib/ziya/maps/sweden.rb +7 -0
  478. data/lib/ziya/maps/uk.rb +7 -0
  479. data/lib/ziya/maps/us.rb +7 -0
  480. data/lib/ziya/maps/world.rb +7 -0
  481. data/lib/ziya/version.rb +3 -3
  482. data/lib/ziya/yaml_helpers.rb +1 -0
  483. data/lib/ziya/yaml_helpers/base.rb +20 -0
  484. data/lib/ziya/yaml_helpers/charts.rb +49 -0
  485. data/lib/ziya/yaml_helpers/gauges.rb +33 -0
  486. data/lib/ziya/yaml_helpers/maps.rb +17 -0
  487. data/resources/charts/AC_RunActiveContent.js +292 -0
  488. data/resources/charts/charts.swf +0 -0
  489. data/resources/charts/charts_library/ar3d.swf +0 -0
  490. data/resources/charts/charts_library/arno.swf +0 -0
  491. data/resources/charts/charts_library/ars3.swf +0 -0
  492. data/resources/charts/charts_library/arst.swf +0 -0
  493. data/resources/charts/charts_library/brfl.swf +0 -0
  494. data/resources/charts/charts_library/brno.swf +0 -0
  495. data/resources/charts/charts_library/brst.swf +0 -0
  496. data/resources/charts/charts_library/buno.swf +0 -0
  497. data/resources/charts/charts_library/cl3d.swf +0 -0
  498. data/resources/charts/charts_library/clfl.swf +0 -0
  499. data/resources/charts/charts_library/clim.swf +0 -0
  500. data/resources/charts/charts_library/clno.swf +0 -0
  501. data/resources/charts/charts_library/clp3.swf +0 -0
  502. data/resources/charts/charts_library/cls3.swf +0 -0
  503. data/resources/charts/charts_library/clst.swf +0 -0
  504. data/resources/charts/charts_library/cnno.swf +0 -0
  505. data/resources/charts/charts_library/dono.swf +0 -0
  506. data/resources/charts/charts_library/lnno.swf +0 -0
  507. data/resources/charts/charts_library/mxno.swf +0 -0
  508. data/resources/charts/charts_library/pi3d.swf +0 -0
  509. data/resources/charts/charts_library/piim.swf +0 -0
  510. data/resources/charts/charts_library/pino.swf +0 -0
  511. data/resources/charts/charts_library/pono.swf +0 -0
  512. data/resources/charts/charts_library/scno.swf +0 -0
  513. data/resources/charts/full_screen.fla +0 -0
  514. data/resources/charts/full_screen.swf +0 -0
  515. data/resources/charts/scripts/output_jpg.php +23 -0
  516. data/resources/charts/sliders/black.swf +0 -0
  517. data/resources/charts/sliders/preview_handle_1.swf +0 -0
  518. data/resources/charts/sliders/preview_handle_2.swf +0 -0
  519. data/resources/charts/themes/readme.txt +13 -0
  520. data/{gauges → resources/gauges}/designs/circle.yml +0 -0
  521. data/{gauges → resources/gauges}/designs/signal.yml +0 -0
  522. data/{gauges → resources/gauges}/designs/thermo.yml +0 -0
  523. data/{gauges → resources/gauges}/designs/title.yml +0 -0
  524. data/{gauges → resources/gauges}/gauge.swf +0 -0
  525. data/resources/maps/js/Exception.js +45 -0
  526. data/resources/maps/js/FlashProxy.js +72 -0
  527. data/resources/maps/js/FlashSerializer.js +165 -0
  528. data/resources/maps/js/FlashTag.js +111 -0
  529. data/resources/maps/js/JavaScriptFlashGateway.js +455 -0
  530. data/resources/maps/js/JavaScriptFlashGateway.swf +0 -0
  531. data/resources/maps/map_library/australia.swf +0 -0
  532. data/resources/maps/map_library/belgium.swf +0 -0
  533. data/resources/maps/map_library/brazil.swf +0 -0
  534. data/resources/maps/map_library/canada.swf +0 -0
  535. data/resources/maps/map_library/europe.swf +0 -0
  536. data/resources/maps/map_library/france.swf +0 -0
  537. data/resources/maps/map_library/germany.swf +0 -0
  538. data/resources/maps/map_library/italy.swf +0 -0
  539. data/resources/maps/map_library/mexico.swf +0 -0
  540. data/resources/maps/map_library/sweden.swf +0 -0
  541. data/resources/maps/map_library/uk_ireland.swf +0 -0
  542. data/resources/maps/map_library/us.swf +0 -0
  543. data/resources/maps/map_library/us_canada.swf +0 -0
  544. data/resources/maps/map_library/world.swf +0 -0
  545. data/resources/maps/themes/readme.txt +13 -0
  546. data/spec/charts/base_spec.rb +7 -6
  547. data/spec/charts/chart_type_spec.rb +11 -4
  548. data/spec/{components → charts/support}/area_spec.rb +8 -8
  549. data/spec/charts/support/chart_pref_spec.rb +36 -0
  550. data/spec/charts/support/draw_spec.rb +41 -0
  551. data/spec/{components → charts/support}/filter_spec.rb +6 -6
  552. data/spec/{components → charts/support}/link_spec.rb +6 -6
  553. data/spec/{components → charts/support}/series.rb +4 -4
  554. data/spec/{components → charts/support}/series_color_spec.rb +4 -4
  555. data/spec/{components → charts/support}/series_explode.rb +4 -4
  556. data/spec/{components → charts/support}/series_explode_spec.rb +4 -4
  557. data/spec/core_ext/string_spec.rb +40 -0
  558. data/spec/gauges/base_spec.rb +1 -1
  559. data/spec/html_helpers/base_spec.rb +50 -0
  560. data/spec/html_helpers/charts_spec.rb +23 -0
  561. data/spec/html_helpers/gauges_spec.rb +16 -0
  562. data/spec/html_helpers/maps_spec.rb +20 -0
  563. data/spec/maps/base_spec.rb +82 -0
  564. data/spec/maps/support/default_color_spec.rb +29 -0
  565. data/spec/maps/support/heat_range_spec.rb +29 -0
  566. data/spec/maps/us_spec.rb +12 -0
  567. data/spec/maps/world_spec.rb +18 -0
  568. data/spec/spec_helper.rb +5 -4
  569. data/spec/themes/maps/base_map.yml +81 -0
  570. data/spec/themes/maps/us_map.yml +6 -0
  571. data/spec/themes/maps/world_map.yml +6 -0
  572. data/spec/themes/maps/world_ov_map.yml +6 -0
  573. data/spec/{helpers/base_helper_spec.rb → yaml_helpers/charts_spec.rb} +10 -13
  574. data/spec/yaml_helpers/gauges_spec.rb +15 -0
  575. data/spec/ziya_helper_spec.rb +118 -116
  576. data/tasks/doc.rake +12 -7
  577. data/tasks/gem.rake +1 -1
  578. data/tasks/setup.rb +1 -1
  579. data/ziya.gemspec +40 -0
  580. metadata +582 -94
  581. data/charts/charts.swf +0 -0
  582. data/charts/charts_library/ar3d.swf +0 -0
  583. data/charts/charts_library/arno.swf +0 -0
  584. data/charts/charts_library/ars3.swf +0 -0
  585. data/charts/charts_library/arst.swf +0 -0
  586. data/charts/charts_library/brfl.swf +0 -0
  587. data/charts/charts_library/brno.swf +0 -0
  588. data/charts/charts_library/brst.swf +0 -0
  589. data/charts/charts_library/buno.swf +0 -0
  590. data/charts/charts_library/cl3d.swf +0 -0
  591. data/charts/charts_library/clfl.swf +0 -0
  592. data/charts/charts_library/clim.swf +0 -0
  593. data/charts/charts_library/clno.swf +0 -0
  594. data/charts/charts_library/clp3.swf +0 -0
  595. data/charts/charts_library/cls3.swf +0 -0
  596. data/charts/charts_library/clst.swf +0 -0
  597. data/charts/charts_library/cnno.swf +0 -0
  598. data/charts/charts_library/dono.swf +0 -0
  599. data/charts/charts_library/lnno.swf +0 -0
  600. data/charts/charts_library/mxno.swf +0 -0
  601. data/charts/charts_library/pi3d.swf +0 -0
  602. data/charts/charts_library/piim.swf +0 -0
  603. data/charts/charts_library/pino.swf +0 -0
  604. data/charts/charts_library/pono.swf +0 -0
  605. data/charts/charts_library/scno.swf +0 -0
  606. data/charts/ziya.js +0 -66
  607. data/lib/ziya/components/draw.rb +0 -47
  608. data/lib/ziya/helpers/base_helper.rb +0 -91
  609. data/lib/ziya/utils/text.rb +0 -39
  610. data/lib/ziya/ziya_helper.rb +0 -354
  611. data/spec/components/draw_spec.rb +0 -32
  612. data/spec/utils/text_spec.rb +0 -33
@@ -0,0 +1,165 @@
1
+ /**
2
+ * The FlashSerializer serializes JavaScript variables of types object, array, string,
3
+ * number, date, boolean, null or undefined into XML.
4
+ */
5
+
6
+ /**
7
+ * Create a new instance of the FlashSerializer.
8
+ * useCdata: Whether strings should be treated as character data. If false, strings are simply XML encoded.
9
+ */
10
+ function FlashSerializer(useCdata)
11
+ {
12
+ this.useCdata = useCdata;
13
+ }
14
+
15
+ /**
16
+ * Serialize an array into a format that can be deserialized in Flash. Supported data types are object,
17
+ * array, string, number, date, boolean, null, and undefined. Returns a string of serialized data.
18
+ */
19
+ FlashSerializer.prototype.serialize = function(args)
20
+ {
21
+ var qs = new String();
22
+
23
+ for (var i = 0; i < args.length; ++i)
24
+ {
25
+ switch(typeof(args[i]))
26
+ {
27
+ case 'undefined':
28
+ qs += 't'+(i)+'=undf';
29
+ break;
30
+ case 'string':
31
+ qs += 't'+(i)+'=str&d'+(i)+'='+escape(args[i]);
32
+ break;
33
+ case 'number':
34
+ qs += 't'+(i)+'=num&d'+(i)+'='+escape(args[i]);
35
+ break;
36
+ case 'boolean':
37
+ qs += 't'+(i)+'=bool&d'+(i)+'='+escape(args[i]);
38
+ break;
39
+ case 'object':
40
+ if (args[i] == null)
41
+ {
42
+ qs += 't'+(i)+'=null';
43
+ }
44
+ else if (args[i] instanceof Date)
45
+ {
46
+ qs += 't'+(i)+'=date&d'+(i)+'='+escape(args[i].getTime());
47
+ }
48
+ else // array or object
49
+ {
50
+ try
51
+ {
52
+ qs += 't'+(i)+'=xser&d'+(i)+'='+escape(this._serializeXML(args[i]));
53
+ }
54
+ catch (exception)
55
+ {
56
+ throw new Exception("FlashSerializationException",
57
+ "The following error occurred during complex object serialization: " + exception.getMessage());
58
+ }
59
+ }
60
+ break;
61
+ default:
62
+ throw new Exception("FlashSerializationException",
63
+ "You can only serialize strings, numbers, booleans, dates, objects, arrays, nulls, and undefined.");
64
+ }
65
+
66
+ if (i != (args.length - 1))
67
+ {
68
+ qs += '&';
69
+ }
70
+ }
71
+
72
+ return qs;
73
+ }
74
+
75
+ /**
76
+ * Private
77
+ */
78
+ FlashSerializer.prototype._serializeXML = function(obj)
79
+ {
80
+ var doc = new Object();
81
+ doc.xml = '<fp>';
82
+ this._serializeNode(obj, doc, null);
83
+ doc.xml += '</fp>';
84
+ return doc.xml;
85
+ }
86
+
87
+ /**
88
+ * Private
89
+ */
90
+ FlashSerializer.prototype._serializeNode = function(obj, doc, name)
91
+ {
92
+ switch(typeof(obj))
93
+ {
94
+ case 'undefined':
95
+ doc.xml += '<undf'+this._addName(name)+'/>';
96
+ break;
97
+ case 'string':
98
+ doc.xml += '<str'+this._addName(name)+'>'+this._escapeXml(obj)+'</str>';
99
+ break;
100
+ case 'number':
101
+ doc.xml += '<num'+this._addName(name)+'>'+obj+'</num>';
102
+ break;
103
+ case 'boolean':
104
+ doc.xml += '<bool'+this._addName(name)+' val="'+obj+'"/>';
105
+ break;
106
+ case 'object':
107
+ if (obj == null)
108
+ {
109
+ doc.xml += '<null'+this._addName(name)+'/>';
110
+ }
111
+ else if (obj instanceof Date)
112
+ {
113
+ doc.xml += '<date'+this._addName(name)+'>'+obj.getTime()+'</date>';
114
+ }
115
+ else if (obj instanceof Array)
116
+ {
117
+ doc.xml += '<array'+this._addName(name)+'>';
118
+ for (var i = 0; i < obj.length; ++i)
119
+ {
120
+ this._serializeNode(obj[i], doc, null);
121
+ }
122
+ doc.xml += '</array>';
123
+ }
124
+ else
125
+ {
126
+ doc.xml += '<obj'+this._addName(name)+'>';
127
+ for (var n in obj)
128
+ {
129
+ if (typeof(obj[n]) == 'function')
130
+ continue;
131
+ this._serializeNode(obj[n], doc, n);
132
+ }
133
+ doc.xml += '</obj>';
134
+ }
135
+ break;
136
+ default:
137
+ throw new Exception("FlashSerializationException",
138
+ "You can only serialize strings, numbers, booleans, objects, dates, arrays, nulls and undefined");
139
+ break;
140
+ }
141
+ }
142
+
143
+ /**
144
+ * Private
145
+ */
146
+ FlashSerializer.prototype._addName= function(name)
147
+ {
148
+ if (name != null)
149
+ {
150
+ return ' name="'+name+'"';
151
+ }
152
+ return '';
153
+ }
154
+
155
+ /**
156
+ * Private
157
+ */
158
+ FlashSerializer.prototype._escapeXml = function(str)
159
+ {
160
+ if (this.useCdata)
161
+ return '<![CDATA['+str+']]>';
162
+ else
163
+ return str.replace(/&/g,'&amp;').replace(/</g,'&lt;');
164
+ }
165
+
@@ -0,0 +1,111 @@
1
+ /**
2
+ * Generates a browser-specific Flash tag. Create a new instance, set whatever
3
+ * properties you need, then call either toString() to get the tag as a string, or
4
+ * call write() to write the tag out.
5
+ */
6
+
7
+ /**
8
+ * Creates a new instance of the FlashTag.
9
+ * src: The path to the SWF file.
10
+ * width: The width of your Flash content.
11
+ * height: the height of your Flash content.
12
+ */
13
+ function FlashTag(src, width, height)
14
+ {
15
+ this.src = src;
16
+ this.width = width;
17
+ this.height = height;
18
+ this.version = '7,0,14,0';
19
+ this.id = null;
20
+ this.bgcolor = 'ffffff';
21
+ this.flashVars = null;
22
+ }
23
+
24
+ /**
25
+ * Sets the Flash version used in the Flash tag.
26
+ */
27
+ FlashTag.prototype.setVersion = function(v)
28
+ {
29
+ this.version = v;
30
+ }
31
+
32
+ /**
33
+ * Sets the ID used in the Flash tag.
34
+ */
35
+ FlashTag.prototype.setId = function(id)
36
+ {
37
+ this.id = id;
38
+ }
39
+
40
+ /**
41
+ * Sets the background color used in the Flash tag.
42
+ */
43
+ FlashTag.prototype.setBgcolor = function(bgc)
44
+ {
45
+ this.bgcolor = bgc;
46
+ }
47
+
48
+ /**
49
+ * Sets any variables to be passed into the Flash content.
50
+ */
51
+ FlashTag.prototype.setFlashvars = function(fv)
52
+ {
53
+ this.flashVars = fv;
54
+ }
55
+
56
+ /**
57
+ * Get the Flash tag as a string.
58
+ */
59
+ FlashTag.prototype.toString = function()
60
+ {
61
+ var ie = (navigator.appName.indexOf ("Microsoft") != -1) ? 1 : 0;
62
+ var flashTag = new String();
63
+ if (ie)
64
+ {
65
+ flashTag += '<object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" ';
66
+ if (this.id != null)
67
+ {
68
+ flashTag += 'id="'+this.id+'" ';
69
+ }
70
+ flashTag += 'codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version='+this.version+'" ';
71
+ flashTag += 'width="'+this.width+'" ';
72
+ flashTag += 'height="'+this.height+'">';
73
+ flashTag += '<param name="movie" value="'+this.src+'"/>';
74
+ flashTag += '<param name="quality" value="high"/>';
75
+ flashTag += '<param name="bgcolor" value="#'+this.bgcolor+'"/>';
76
+ if (this.flashVars != null)
77
+ {
78
+ flashTag += '<param name="flashvars" value="'+this.flashVars+'"/>';
79
+ }
80
+ flashTag += '</object>';
81
+ }
82
+ else
83
+ {
84
+ flashTag += '<embed src="'+this.src+'" ';
85
+ flashTag += 'quality="high" ';
86
+ flashTag += 'bgcolor="#'+this.bgcolor+'" ';
87
+ flashTag += 'width="'+this.width+'" ';
88
+ flashTag += 'height="'+this.height+'" ';
89
+ flashTag += 'type="application/x-shockwave-flash" ';
90
+ if (this.flashVars != null)
91
+ {
92
+ flashTag += 'flashvars="'+this.flashVars+'" ';
93
+ }
94
+ if (this.id != null)
95
+ {
96
+ flashTag += 'name="'+this.id+'" ';
97
+ }
98
+ flashTag += 'pluginspage="http://www.macromedia.com/go/getflashplayer">';
99
+ flashTag += '</embed>';
100
+ }
101
+ return flashTag;
102
+ }
103
+
104
+ /**
105
+ * Write the Flash tag out. Pass in a reference to the document to write to.
106
+ */
107
+ FlashTag.prototype.write = function(doc)
108
+ {
109
+ doc.write(this.toString());
110
+ }
111
+
@@ -0,0 +1,455 @@
1
+ /*
2
+ Macromedia(r) Flash(r) JavaScript Integration Kit License
3
+
4
+
5
+ Copyright (c) 2005 Macromedia, inc. All rights reserved.
6
+
7
+ Redistribution and use in source and binary forms, with or without modification,
8
+ are permitted provided that the following conditions are met:
9
+
10
+ 1. Redistributions of source code must retain the above copyright notice, this
11
+ list of conditions and the following disclaimer.
12
+
13
+ 2. Redistributions in binary form must reproduce the above copyright notice,
14
+ this list of conditions and the following disclaimer in the documentation and/or
15
+ other materials provided with the distribution.
16
+
17
+ 3. The end-user documentation included with the redistribution, if any, must
18
+ include the following acknowledgment:
19
+
20
+ "This product includes software developed by Macromedia, Inc.
21
+ (http://www.macromedia.com)."
22
+
23
+ Alternately, this acknowledgment may appear in the software itself, if and
24
+ wherever such third-party acknowledgments normally appear.
25
+
26
+ 4. The name Macromedia must not be used to endorse or promote products derived
27
+ from this software without prior written permission. For written permission,
28
+ please contact devrelations@macromedia.com.
29
+
30
+ 5. Products derived from this software may not be called "Macromedia" or
31
+ "Macromedia Flash", nor may "Macromedia" or "Macromedia Flash" appear in their
32
+ name.
33
+
34
+ THIS SOFTWARE IS PROVIDED "AS IS" AND ANY EXPRESSED OR IMPLIED WARRANTIES,
35
+ INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND
36
+ FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL MACROMEDIA OR
37
+ ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
38
+ EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT
39
+ OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
40
+ INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
41
+ STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
42
+ OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH
43
+ DAMAGE.
44
+
45
+ --
46
+
47
+ This code is part of the Flash / JavaScript Integration Kit:
48
+ http://www.macromedia.com/go/flashjavascript/
49
+
50
+ Created by:
51
+
52
+ Christian Cantrell
53
+ http://weblogs.macromedia.com/cantrell/
54
+ mailto:cantrell@macromedia.com
55
+
56
+ Mike Chambers
57
+ http://weblogs.macromedia.com/mesh/
58
+ mailto:mesh@macromedia.com
59
+
60
+ Macromedia
61
+ */
62
+
63
+ /**
64
+ * Create a new Exception object.
65
+ * name: The name of the exception.
66
+ * message: The exception message.
67
+ */
68
+ function Exception(name, message)
69
+ {
70
+ if (name)
71
+ this.name = name;
72
+ if (message)
73
+ this.message = message;
74
+ }
75
+
76
+ /**
77
+ * Set the name of the exception.
78
+ */
79
+ Exception.prototype.setName = function(name)
80
+ {
81
+ this.name = name;
82
+ }
83
+
84
+ /**
85
+ * Get the exception's name.
86
+ */
87
+ Exception.prototype.getName = function()
88
+ {
89
+ return this.name;
90
+ }
91
+
92
+ /**
93
+ * Set a message on the exception.
94
+ */
95
+ Exception.prototype.setMessage = function(msg)
96
+ {
97
+ this.message = msg;
98
+ }
99
+
100
+ /**
101
+ * Get the exception message.
102
+ */
103
+ Exception.prototype.getMessage = function()
104
+ {
105
+ return this.message;
106
+ }
107
+
108
+ /**
109
+ * Generates a browser-specific Flash tag. Create a new instance, set whatever
110
+ * properties you need, then call either toString() to get the tag as a string, or
111
+ * call write() to write the tag out.
112
+ */
113
+
114
+ /**
115
+ * Creates a new instance of the FlashTag.
116
+ * src: The path to the SWF file.
117
+ * width: The width of your Flash content.
118
+ * height: the height of your Flash content.
119
+ */
120
+ function FlashTag(src, width, height)
121
+ {
122
+ this.src = src;
123
+ this.width = width;
124
+ this.height = height;
125
+ this.version = '7,0,14,0';
126
+ this.id = null;
127
+ this.bgcolor = 'ffffff';
128
+ this.flashVars = null;
129
+ }
130
+
131
+ /**
132
+ * Sets the Flash version used in the Flash tag.
133
+ */
134
+ FlashTag.prototype.setVersion = function(v)
135
+ {
136
+ this.version = v;
137
+ }
138
+
139
+ /**
140
+ * Sets the ID used in the Flash tag.
141
+ */
142
+ FlashTag.prototype.setId = function(id)
143
+ {
144
+ this.id = id;
145
+ }
146
+
147
+ /**
148
+ * Sets the background color used in the Flash tag.
149
+ */
150
+ FlashTag.prototype.setBgcolor = function(bgc)
151
+ {
152
+ this.bgcolor = bgc;
153
+ }
154
+
155
+ /**
156
+ * Sets any variables to be passed into the Flash content.
157
+ */
158
+ FlashTag.prototype.setFlashvars = function(fv)
159
+ {
160
+ this.flashVars = fv;
161
+ }
162
+
163
+ /**
164
+ * Get the Flash tag as a string.
165
+ */
166
+ FlashTag.prototype.toString = function()
167
+ {
168
+ var ie = (navigator.appName.indexOf ("Microsoft") != -1) ? 1 : 0;
169
+ var flashTag = new String();
170
+ if (ie)
171
+ {
172
+ flashTag += '<object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" ';
173
+ if (this.id != null)
174
+ {
175
+ flashTag += 'id="'+this.id+'" ';
176
+ }
177
+ flashTag += 'codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version='+this.version+'" ';
178
+ flashTag += 'width="'+this.width+'" ';
179
+ flashTag += 'height="'+this.height+'">';
180
+ flashTag += '<param name="movie" value="'+this.src+'"/>';
181
+ flashTag += '<param name="quality" value="high"/>';
182
+ flashTag += '<param name="bgcolor" value="#'+this.bgcolor+'"/>';
183
+ if (this.flashVars != null)
184
+ {
185
+ flashTag += '<param name="flashvars" value="'+this.flashVars+'"/>';
186
+ }
187
+ flashTag += '</object>';
188
+ }
189
+ else
190
+ {
191
+ flashTag += '<embed src="'+this.src+'" ';
192
+ flashTag += 'quality="high" ';
193
+ flashTag += 'bgcolor="#'+this.bgcolor+'" ';
194
+ flashTag += 'width="'+this.width+'" ';
195
+ flashTag += 'height="'+this.height+'" ';
196
+ flashTag += 'type="application/x-shockwave-flash" ';
197
+ if (this.flashVars != null)
198
+ {
199
+ flashTag += 'flashvars="'+this.flashVars+'" ';
200
+ }
201
+ if (this.id != null)
202
+ {
203
+ flashTag += 'name="'+this.id+'" ';
204
+ }
205
+ flashTag += 'pluginspage="http://www.macromedia.com/go/getflashplayer">';
206
+ flashTag += '</embed>';
207
+ }
208
+ return flashTag;
209
+ }
210
+
211
+ /**
212
+ * Write the Flash tag out. Pass in a reference to the document to write to.
213
+ */
214
+ FlashTag.prototype.write = function(doc)
215
+ {
216
+ doc.write(this.toString());
217
+ }
218
+
219
+ /**
220
+ * The FlashSerializer serializes JavaScript variables of types object, array, string,
221
+ * number, date, boolean, null or undefined into XML.
222
+ */
223
+
224
+ /**
225
+ * Create a new instance of the FlashSerializer.
226
+ * useCdata: Whether strings should be treated as character data. If false, strings are simply XML encoded.
227
+ */
228
+ function FlashSerializer(useCdata)
229
+ {
230
+ this.useCdata = useCdata;
231
+ }
232
+
233
+ /**
234
+ * Serialize an array into a format that can be deserialized in Flash. Supported data types are object,
235
+ * array, string, number, date, boolean, null, and undefined. Returns a string of serialized data.
236
+ */
237
+ FlashSerializer.prototype.serialize = function(args)
238
+ {
239
+ var qs = new String();
240
+
241
+ for (var i = 0; i < args.length; ++i)
242
+ {
243
+ switch(typeof(args[i]))
244
+ {
245
+ case 'undefined':
246
+ qs += 't'+(i)+'=undf';
247
+ break;
248
+ case 'string':
249
+ qs += 't'+(i)+'=str&d'+(i)+'='+escape(args[i]);
250
+ break;
251
+ case 'number':
252
+ qs += 't'+(i)+'=num&d'+(i)+'='+escape(args[i]);
253
+ break;
254
+ case 'boolean':
255
+ qs += 't'+(i)+'=bool&d'+(i)+'='+escape(args[i]);
256
+ break;
257
+ case 'object':
258
+ if (args[i] == null)
259
+ {
260
+ qs += 't'+(i)+'=null';
261
+ }
262
+ else if (args[i] instanceof Date)
263
+ {
264
+ qs += 't'+(i)+'=date&d'+(i)+'='+escape(args[i].getTime());
265
+ }
266
+ else // array or object
267
+ {
268
+ try
269
+ {
270
+ qs += 't'+(i)+'=xser&d'+(i)+'='+escape(this._serializeXML(args[i]));
271
+ }
272
+ catch (exception)
273
+ {
274
+ throw new Exception("FlashSerializationException",
275
+ "The following error occurred during complex object serialization: " + exception.getMessage());
276
+ }
277
+ }
278
+ break;
279
+ default:
280
+ throw new Exception("FlashSerializationException",
281
+ "You can only serialize strings, numbers, booleans, dates, objects, arrays, nulls, and undefined.");
282
+ }
283
+
284
+ if (i != (args.length - 1))
285
+ {
286
+ qs += '&';
287
+ }
288
+ }
289
+
290
+ return qs;
291
+ }
292
+
293
+ /**
294
+ * Private
295
+ */
296
+ FlashSerializer.prototype._serializeXML = function(obj)
297
+ {
298
+ var doc = new Object();
299
+ doc.xml = '<fp>';
300
+ this._serializeNode(obj, doc, null);
301
+ doc.xml += '</fp>';
302
+ return doc.xml;
303
+ }
304
+
305
+ /**
306
+ * Private
307
+ */
308
+ FlashSerializer.prototype._serializeNode = function(obj, doc, name)
309
+ {
310
+ switch(typeof(obj))
311
+ {
312
+ case 'undefined':
313
+ doc.xml += '<undf'+this._addName(name)+'/>';
314
+ break;
315
+ case 'string':
316
+ doc.xml += '<str'+this._addName(name)+'>'+this._escapeXml(obj)+'</str>';
317
+ break;
318
+ case 'number':
319
+ doc.xml += '<num'+this._addName(name)+'>'+obj+'</num>';
320
+ break;
321
+ case 'boolean':
322
+ doc.xml += '<bool'+this._addName(name)+' val="'+obj+'"/>';
323
+ break;
324
+ case 'object':
325
+ if (obj == null)
326
+ {
327
+ doc.xml += '<null'+this._addName(name)+'/>';
328
+ }
329
+ else if (obj instanceof Date)
330
+ {
331
+ doc.xml += '<date'+this._addName(name)+'>'+obj.getTime()+'</date>';
332
+ }
333
+ else if (obj instanceof Array)
334
+ {
335
+ doc.xml += '<array'+this._addName(name)+'>';
336
+ for (var i = 0; i < obj.length; ++i)
337
+ {
338
+ this._serializeNode(obj[i], doc, null);
339
+ }
340
+ doc.xml += '</array>';
341
+ }
342
+ else
343
+ {
344
+ doc.xml += '<obj'+this._addName(name)+'>';
345
+ for (var n in obj)
346
+ {
347
+ if (typeof(obj[n]) == 'function')
348
+ continue;
349
+ this._serializeNode(obj[n], doc, n);
350
+ }
351
+ doc.xml += '</obj>';
352
+ }
353
+ break;
354
+ default:
355
+ throw new Exception("FlashSerializationException",
356
+ "You can only serialize strings, numbers, booleans, objects, dates, arrays, nulls and undefined");
357
+ break;
358
+ }
359
+ }
360
+
361
+ /**
362
+ * Private
363
+ */
364
+ FlashSerializer.prototype._addName= function(name)
365
+ {
366
+ if (name != null)
367
+ {
368
+ return ' name="'+name+'"';
369
+ }
370
+ return '';
371
+ }
372
+
373
+ /**
374
+ * Private
375
+ */
376
+ FlashSerializer.prototype._escapeXml = function(str)
377
+ {
378
+ if (this.useCdata)
379
+ return '<![CDATA['+str+']]>';
380
+ else
381
+ return str.replace(/&/g,'&amp;').replace(/</g,'&lt;');
382
+ }
383
+
384
+ /**
385
+ * The FlashProxy object is what proxies function calls between JavaScript and Flash.
386
+ * It handles all argument serialization issues.
387
+ */
388
+
389
+ /**
390
+ * Instantiates a new FlashProxy object. Pass in a uniqueID and the name (including the path)
391
+ * of the Flash proxy SWF. The ID is the same ID that needs to be passed into your Flash content as lcId.
392
+ */
393
+ function FlashProxy(uid, proxySwfName)
394
+ {
395
+ this.uid = uid;
396
+ this.proxySwfName = proxySwfName;
397
+ this.flashSerializer = new FlashSerializer(false);
398
+ }
399
+
400
+ /**
401
+ * Call a function in your Flash content. Arguments should be:
402
+ * 1. ActionScript function name to call,
403
+ * 2. any number of additional arguments of type object,
404
+ * array, string, number, boolean, date, null, or undefined.
405
+ */
406
+ FlashProxy.prototype.call = function()
407
+ {
408
+
409
+ if (arguments.length == 0)
410
+ {
411
+ throw new Exception("Flash Proxy Exception",
412
+ "The first argument should be the function name followed by any number of additional arguments.");
413
+ }
414
+
415
+ var qs = 'lcId=' + escape(this.uid) + '&functionName=' + escape(arguments[0]);
416
+
417
+ if (arguments.length > 1)
418
+ {
419
+ var justArgs = new Array();
420
+ for (var i = 1; i < arguments.length; ++i)
421
+ {
422
+ justArgs.push(arguments[i]);
423
+ }
424
+ qs += ('&' + this.flashSerializer.serialize(justArgs));
425
+ }
426
+
427
+ var divName = '_flash_proxy_' + this.uid;
428
+ if(!document.getElementById(divName))
429
+ {
430
+ var newTarget = document.createElement("div");
431
+ newTarget.id = divName;
432
+ document.body.appendChild(newTarget);
433
+ }
434
+ var target = document.getElementById(divName);
435
+ var ft = new FlashTag(this.proxySwfName, 1, 1);
436
+ ft.setVersion('6,0,65,0');
437
+ ft.setFlashvars(qs);
438
+ target.innerHTML = ft.toString();
439
+ }
440
+
441
+ /**
442
+ * This is the function that proxies function calls from Flash to JavaScript.
443
+ * It is called implicitly.
444
+ */
445
+ FlashProxy.callJS = function()
446
+ {
447
+ var functionToCall = eval(arguments[0]);
448
+ var argArray = new Array();
449
+ for (var i = 1; i < arguments.length; ++i)
450
+ {
451
+ argArray.push(arguments[i]);
452
+ }
453
+ functionToCall.apply(functionToCall, argArray);
454
+ }
455
+