chaskiq 0.0.2 → 0.0.3

Sign up to get free protection for your applications and to get access to all the features.
Files changed (365) hide show
  1. checksums.yaml +4 -4
  2. data/README.md +34 -0
  3. data/lib/chaskiq/version.rb +1 -1
  4. data/vendor/assets/images/animated-overlay.gif +0 -0
  5. data/vendor/assets/images/blueimp/img/error.png +0 -0
  6. data/vendor/assets/images/blueimp/img/error.svg +5 -0
  7. data/vendor/assets/images/blueimp/img/loading.gif +0 -0
  8. data/vendor/assets/images/blueimp/img/play-pause.png +0 -0
  9. data/vendor/assets/images/blueimp/img/play-pause.svg +6 -0
  10. data/vendor/assets/images/blueimp/img/video-play.png +0 -0
  11. data/vendor/assets/images/blueimp/img/video-play.svg +5 -0
  12. data/vendor/assets/images/bootstrap-colorpicker/alpha-horizontal.png +0 -0
  13. data/vendor/assets/images/bootstrap-colorpicker/alpha.png +0 -0
  14. data/vendor/assets/images/bootstrap-colorpicker/hue-horizontal.png +0 -0
  15. data/vendor/assets/images/bootstrap-colorpicker/hue.png +0 -0
  16. data/vendor/assets/images/bootstrap-colorpicker/saturation.png +0 -0
  17. data/vendor/assets/images/chosen-sprite.png +0 -0
  18. data/vendor/assets/images/chosen-sprite@2x.png +0 -0
  19. data/vendor/assets/images/green.png +0 -0
  20. data/vendor/assets/images/green@2x.png +0 -0
  21. data/vendor/assets/images/images/animated-overlay.gif +0 -0
  22. data/vendor/assets/images/images/ui-bg_flat_0_aaaaaa_40x100.png +0 -0
  23. data/vendor/assets/images/images/ui-bg_flat_75_ffffff_40x100.png +0 -0
  24. data/vendor/assets/images/images/ui-bg_glass_55_fbf9ee_1x400.png +0 -0
  25. data/vendor/assets/images/images/ui-bg_glass_65_ffffff_1x400.png +0 -0
  26. data/vendor/assets/images/images/ui-bg_glass_75_dadada_1x400.png +0 -0
  27. data/vendor/assets/images/images/ui-bg_glass_75_e6e6e6_1x400.png +0 -0
  28. data/vendor/assets/images/images/ui-bg_glass_95_fef1ec_1x400.png +0 -0
  29. data/vendor/assets/images/images/ui-bg_highlight-soft_75_cccccc_1x100.png +0 -0
  30. data/vendor/assets/images/images/ui-icons_222222_256x240.png +0 -0
  31. data/vendor/assets/images/images/ui-icons_2e83ff_256x240.png +0 -0
  32. data/vendor/assets/images/images/ui-icons_454545_256x240.png +0 -0
  33. data/vendor/assets/images/images/ui-icons_888888_256x240.png +0 -0
  34. data/vendor/assets/images/images/ui-icons_cd0a0a_256x240.png +0 -0
  35. data/vendor/assets/images/sort.png +0 -0
  36. data/vendor/assets/images/sort_asc.png +0 -0
  37. data/vendor/assets/images/sort_desc.png +0 -0
  38. data/vendor/assets/images/sprite-skin-flat.png +0 -0
  39. data/vendor/assets/images/sprite-skin-flat2.png +0 -0
  40. data/vendor/assets/images/sprite-skin-nice.png +0 -0
  41. data/vendor/assets/images/sprite-skin-simple.png +0 -0
  42. data/vendor/assets/images/spritemap.png +0 -0
  43. data/vendor/assets/images/spritemap@2x.png +0 -0
  44. data/vendor/assets/javascripts/backbone/backbone.min.js +2 -0
  45. data/vendor/assets/javascripts/backbone/underscore.min.js +6 -0
  46. data/vendor/assets/javascripts/chartjs/Chart.min.js +11 -0
  47. data/vendor/assets/javascripts/codemirror/codemirror.js +7830 -0
  48. data/vendor/assets/javascripts/codemirror/mode/apl/apl.js +175 -0
  49. data/vendor/assets/javascripts/codemirror/mode/apl/index.html +72 -0
  50. data/vendor/assets/javascripts/codemirror/mode/asterisk/asterisk.js +198 -0
  51. data/vendor/assets/javascripts/codemirror/mode/asterisk/index.html +154 -0
  52. data/vendor/assets/javascripts/codemirror/mode/clike/clike.js +474 -0
  53. data/vendor/assets/javascripts/codemirror/mode/clike/index.html +225 -0
  54. data/vendor/assets/javascripts/codemirror/mode/clike/scala.html +767 -0
  55. data/vendor/assets/javascripts/codemirror/mode/clojure/clojure.js +243 -0
  56. data/vendor/assets/javascripts/codemirror/mode/clojure/index.html +88 -0
  57. data/vendor/assets/javascripts/codemirror/mode/cobol/cobol.js +255 -0
  58. data/vendor/assets/javascripts/codemirror/mode/cobol/index.html +210 -0
  59. data/vendor/assets/javascripts/codemirror/mode/coffeescript/coffeescript.js +369 -0
  60. data/vendor/assets/javascripts/codemirror/mode/coffeescript/index.html +740 -0
  61. data/vendor/assets/javascripts/codemirror/mode/commonlisp/commonlisp.js +120 -0
  62. data/vendor/assets/javascripts/codemirror/mode/commonlisp/index.html +177 -0
  63. data/vendor/assets/javascripts/codemirror/mode/css/css.js +717 -0
  64. data/vendor/assets/javascripts/codemirror/mode/css/index.html +70 -0
  65. data/vendor/assets/javascripts/codemirror/mode/css/less.html +152 -0
  66. data/vendor/assets/javascripts/codemirror/mode/css/less_test.js +51 -0
  67. data/vendor/assets/javascripts/codemirror/mode/css/scss.html +157 -0
  68. data/vendor/assets/javascripts/codemirror/mode/css/scss_test.js +110 -0
  69. data/vendor/assets/javascripts/codemirror/mode/css/test.js +135 -0
  70. data/vendor/assets/javascripts/codemirror/mode/cypher/cypher.js +146 -0
  71. data/vendor/assets/javascripts/codemirror/mode/cypher/index.html +63 -0
  72. data/vendor/assets/javascripts/codemirror/mode/d/d.js +218 -0
  73. data/vendor/assets/javascripts/codemirror/mode/d/index.html +273 -0
  74. data/vendor/assets/javascripts/codemirror/mode/diff/diff.js +47 -0
  75. data/vendor/assets/javascripts/codemirror/mode/diff/index.html +117 -0
  76. data/vendor/assets/javascripts/codemirror/mode/django/django.js +67 -0
  77. data/vendor/assets/javascripts/codemirror/mode/django/index.html +63 -0
  78. data/vendor/assets/javascripts/codemirror/mode/dtd/dtd.js +142 -0
  79. data/vendor/assets/javascripts/codemirror/mode/dtd/index.html +89 -0
  80. data/vendor/assets/javascripts/codemirror/mode/dylan/dylan.js +299 -0
  81. data/vendor/assets/javascripts/codemirror/mode/dylan/index.html +407 -0
  82. data/vendor/assets/javascripts/codemirror/mode/ecl/ecl.js +207 -0
  83. data/vendor/assets/javascripts/codemirror/mode/ecl/index.html +52 -0
  84. data/vendor/assets/javascripts/codemirror/mode/eiffel/eiffel.js +162 -0
  85. data/vendor/assets/javascripts/codemirror/mode/eiffel/index.html +429 -0
  86. data/vendor/assets/javascripts/codemirror/mode/erlang/erlang.js +622 -0
  87. data/vendor/assets/javascripts/codemirror/mode/erlang/index.html +76 -0
  88. data/vendor/assets/javascripts/codemirror/mode/fortran/fortran.js +188 -0
  89. data/vendor/assets/javascripts/codemirror/mode/fortran/index.html +81 -0
  90. data/vendor/assets/javascripts/codemirror/mode/gas/gas.js +345 -0
  91. data/vendor/assets/javascripts/codemirror/mode/gas/index.html +68 -0
  92. data/vendor/assets/javascripts/codemirror/mode/gfm/gfm.js +122 -0
  93. data/vendor/assets/javascripts/codemirror/mode/gfm/index.html +82 -0
  94. data/vendor/assets/javascripts/codemirror/mode/gfm/test.js +164 -0
  95. data/vendor/assets/javascripts/codemirror/mode/gherkin/gherkin.js +178 -0
  96. data/vendor/assets/javascripts/codemirror/mode/gherkin/index.html +48 -0
  97. data/vendor/assets/javascripts/codemirror/mode/go/go.js +184 -0
  98. data/vendor/assets/javascripts/codemirror/mode/go/index.html +85 -0
  99. data/vendor/assets/javascripts/codemirror/mode/groovy/groovy.js +226 -0
  100. data/vendor/assets/javascripts/codemirror/mode/groovy/index.html +84 -0
  101. data/vendor/assets/javascripts/codemirror/mode/haml/haml.js +159 -0
  102. data/vendor/assets/javascripts/codemirror/mode/haml/index.html +79 -0
  103. data/vendor/assets/javascripts/codemirror/mode/haml/test.js +97 -0
  104. data/vendor/assets/javascripts/codemirror/mode/haskell/haskell.js +267 -0
  105. data/vendor/assets/javascripts/codemirror/mode/haskell/index.html +73 -0
  106. data/vendor/assets/javascripts/codemirror/mode/haxe/haxe.js +518 -0
  107. data/vendor/assets/javascripts/codemirror/mode/haxe/index.html +124 -0
  108. data/vendor/assets/javascripts/codemirror/mode/htmlembedded/htmlembedded.js +86 -0
  109. data/vendor/assets/javascripts/codemirror/mode/htmlembedded/index.html +58 -0
  110. data/vendor/assets/javascripts/codemirror/mode/htmlmixed/htmlmixed.js +121 -0
  111. data/vendor/assets/javascripts/codemirror/mode/htmlmixed/index.html +85 -0
  112. data/vendor/assets/javascripts/codemirror/mode/http/http.js +113 -0
  113. data/vendor/assets/javascripts/codemirror/mode/http/index.html +45 -0
  114. data/vendor/assets/javascripts/codemirror/mode/index.html +125 -0
  115. data/vendor/assets/javascripts/codemirror/mode/jade/index.html +70 -0
  116. data/vendor/assets/javascripts/codemirror/mode/jade/jade.js +590 -0
  117. data/vendor/assets/javascripts/codemirror/mode/javascript/index.html +114 -0
  118. data/vendor/assets/javascripts/codemirror/mode/javascript/javascript.js +684 -0
  119. data/vendor/assets/javascripts/codemirror/mode/javascript/json-ld.html +72 -0
  120. data/vendor/assets/javascripts/codemirror/mode/javascript/test.js +194 -0
  121. data/vendor/assets/javascripts/codemirror/mode/javascript/typescript.html +61 -0
  122. data/vendor/assets/javascripts/codemirror/mode/jinja2/index.html +54 -0
  123. data/vendor/assets/javascripts/codemirror/mode/jinja2/jinja2.js +142 -0
  124. data/vendor/assets/javascripts/codemirror/mode/julia/index.html +195 -0
  125. data/vendor/assets/javascripts/codemirror/mode/julia/julia.js +301 -0
  126. data/vendor/assets/javascripts/codemirror/mode/kotlin/index.html +89 -0
  127. data/vendor/assets/javascripts/codemirror/mode/kotlin/kotlin.js +280 -0
  128. data/vendor/assets/javascripts/codemirror/mode/livescript/index.html +459 -0
  129. data/vendor/assets/javascripts/codemirror/mode/livescript/livescript.js +280 -0
  130. data/vendor/assets/javascripts/codemirror/mode/lua/index.html +85 -0
  131. data/vendor/assets/javascripts/codemirror/mode/lua/lua.js +159 -0
  132. data/vendor/assets/javascripts/codemirror/mode/markdown/index.html +359 -0
  133. data/vendor/assets/javascripts/codemirror/mode/markdown/markdown.js +758 -0
  134. data/vendor/assets/javascripts/codemirror/mode/markdown/test.js +754 -0
  135. data/vendor/assets/javascripts/codemirror/mode/meta.js +144 -0
  136. data/vendor/assets/javascripts/codemirror/mode/mirc/index.html +160 -0
  137. data/vendor/assets/javascripts/codemirror/mode/mirc/mirc.js +193 -0
  138. data/vendor/assets/javascripts/codemirror/mode/mllike/index.html +179 -0
  139. data/vendor/assets/javascripts/codemirror/mode/mllike/mllike.js +205 -0
  140. data/vendor/assets/javascripts/codemirror/mode/modelica/index.html +67 -0
  141. data/vendor/assets/javascripts/codemirror/mode/modelica/modelica.js +245 -0
  142. data/vendor/assets/javascripts/codemirror/mode/nginx/index.html +181 -0
  143. data/vendor/assets/javascripts/codemirror/mode/nginx/nginx.js +178 -0
  144. data/vendor/assets/javascripts/codemirror/mode/ntriples/index.html +45 -0
  145. data/vendor/assets/javascripts/codemirror/mode/ntriples/ntriples.js +186 -0
  146. data/vendor/assets/javascripts/codemirror/mode/octave/index.html +83 -0
  147. data/vendor/assets/javascripts/codemirror/mode/octave/octave.js +135 -0
  148. data/vendor/assets/javascripts/codemirror/mode/pascal/index.html +61 -0
  149. data/vendor/assets/javascripts/codemirror/mode/pascal/pascal.js +109 -0
  150. data/vendor/assets/javascripts/codemirror/mode/pegjs/index.html +66 -0
  151. data/vendor/assets/javascripts/codemirror/mode/pegjs/pegjs.js +114 -0
  152. data/vendor/assets/javascripts/codemirror/mode/perl/index.html +75 -0
  153. data/vendor/assets/javascripts/codemirror/mode/perl/perl.js +832 -0
  154. data/vendor/assets/javascripts/codemirror/mode/php/index.html +64 -0
  155. data/vendor/assets/javascripts/codemirror/mode/php/php.js +226 -0
  156. data/vendor/assets/javascripts/codemirror/mode/php/test.js +154 -0
  157. data/vendor/assets/javascripts/codemirror/mode/pig/index.html +55 -0
  158. data/vendor/assets/javascripts/codemirror/mode/pig/pig.js +188 -0
  159. data/vendor/assets/javascripts/codemirror/mode/properties/index.html +53 -0
  160. data/vendor/assets/javascripts/codemirror/mode/properties/properties.js +78 -0
  161. data/vendor/assets/javascripts/codemirror/mode/puppet/index.html +121 -0
  162. data/vendor/assets/javascripts/codemirror/mode/puppet/puppet.js +220 -0
  163. data/vendor/assets/javascripts/codemirror/mode/python/index.html +198 -0
  164. data/vendor/assets/javascripts/codemirror/mode/python/python.js +359 -0
  165. data/vendor/assets/javascripts/codemirror/mode/q/index.html +144 -0
  166. data/vendor/assets/javascripts/codemirror/mode/q/q.js +139 -0
  167. data/vendor/assets/javascripts/codemirror/mode/r/index.html +85 -0
  168. data/vendor/assets/javascripts/codemirror/mode/r/r.js +162 -0
  169. data/vendor/assets/javascripts/codemirror/mode/rpm/changes/index.html +66 -0
  170. data/vendor/assets/javascripts/codemirror/mode/rpm/index.html +149 -0
  171. data/vendor/assets/javascripts/codemirror/mode/rpm/rpm.js +101 -0
  172. data/vendor/assets/javascripts/codemirror/mode/rst/index.html +535 -0
  173. data/vendor/assets/javascripts/codemirror/mode/rst/rst.js +557 -0
  174. data/vendor/assets/javascripts/codemirror/mode/ruby/index.html +184 -0
  175. data/vendor/assets/javascripts/codemirror/mode/ruby/ruby.js +285 -0
  176. data/vendor/assets/javascripts/codemirror/mode/ruby/test.js +14 -0
  177. data/vendor/assets/javascripts/codemirror/mode/rust/index.html +60 -0
  178. data/vendor/assets/javascripts/codemirror/mode/rust/rust.js +451 -0
  179. data/vendor/assets/javascripts/codemirror/mode/sass/index.html +66 -0
  180. data/vendor/assets/javascripts/codemirror/mode/sass/sass.js +327 -0
  181. data/vendor/assets/javascripts/codemirror/mode/scheme/index.html +77 -0
  182. data/vendor/assets/javascripts/codemirror/mode/scheme/scheme.js +248 -0
  183. data/vendor/assets/javascripts/codemirror/mode/shell/index.html +66 -0
  184. data/vendor/assets/javascripts/codemirror/mode/shell/shell.js +138 -0
  185. data/vendor/assets/javascripts/codemirror/mode/shell/test.js +58 -0
  186. data/vendor/assets/javascripts/codemirror/mode/sieve/index.html +93 -0
  187. data/vendor/assets/javascripts/codemirror/mode/sieve/sieve.js +193 -0
  188. data/vendor/assets/javascripts/codemirror/mode/slim/index.html +96 -0
  189. data/vendor/assets/javascripts/codemirror/mode/slim/slim.js +575 -0
  190. data/vendor/assets/javascripts/codemirror/mode/slim/test.js +96 -0
  191. data/vendor/assets/javascripts/codemirror/mode/smalltalk/index.html +68 -0
  192. data/vendor/assets/javascripts/codemirror/mode/smalltalk/smalltalk.js +168 -0
  193. data/vendor/assets/javascripts/codemirror/mode/smarty/index.html +136 -0
  194. data/vendor/assets/javascripts/codemirror/mode/smarty/smarty.js +221 -0
  195. data/vendor/assets/javascripts/codemirror/mode/smartymixed/index.html +114 -0
  196. data/vendor/assets/javascripts/codemirror/mode/smartymixed/smartymixed.js +197 -0
  197. data/vendor/assets/javascripts/codemirror/mode/solr/index.html +57 -0
  198. data/vendor/assets/javascripts/codemirror/mode/solr/solr.js +104 -0
  199. data/vendor/assets/javascripts/codemirror/mode/sparql/index.html +53 -0
  200. data/vendor/assets/javascripts/codemirror/mode/sparql/sparql.js +160 -0
  201. data/vendor/assets/javascripts/codemirror/mode/sql/index.html +84 -0
  202. data/vendor/assets/javascripts/codemirror/mode/sql/sql.js +393 -0
  203. data/vendor/assets/javascripts/codemirror/mode/stex/index.html +110 -0
  204. data/vendor/assets/javascripts/codemirror/mode/stex/stex.js +262 -0
  205. data/vendor/assets/javascripts/codemirror/mode/stex/test.js +123 -0
  206. data/vendor/assets/javascripts/codemirror/mode/tcl/index.html +142 -0
  207. data/vendor/assets/javascripts/codemirror/mode/tcl/tcl.js +147 -0
  208. data/vendor/assets/javascripts/codemirror/mode/textile/index.html +191 -0
  209. data/vendor/assets/javascripts/codemirror/mode/textile/test.js +406 -0
  210. data/vendor/assets/javascripts/codemirror/mode/textile/textile.js +553 -0
  211. data/vendor/assets/javascripts/codemirror/mode/tiddlywiki/index.html +154 -0
  212. data/vendor/assets/javascripts/codemirror/mode/tiddlywiki/tiddlywiki.css +14 -0
  213. data/vendor/assets/javascripts/codemirror/mode/tiddlywiki/tiddlywiki.js +369 -0
  214. data/vendor/assets/javascripts/codemirror/mode/tiki/index.html +95 -0
  215. data/vendor/assets/javascripts/codemirror/mode/tiki/tiki.css +26 -0
  216. data/vendor/assets/javascripts/codemirror/mode/tiki/tiki.js +323 -0
  217. data/vendor/assets/javascripts/codemirror/mode/toml/index.html +73 -0
  218. data/vendor/assets/javascripts/codemirror/mode/toml/toml.js +88 -0
  219. data/vendor/assets/javascripts/codemirror/mode/tornado/index.html +63 -0
  220. data/vendor/assets/javascripts/codemirror/mode/tornado/tornado.js +68 -0
  221. data/vendor/assets/javascripts/codemirror/mode/turtle/index.html +50 -0
  222. data/vendor/assets/javascripts/codemirror/mode/turtle/turtle.js +160 -0
  223. data/vendor/assets/javascripts/codemirror/mode/vb/index.html +102 -0
  224. data/vendor/assets/javascripts/codemirror/mode/vb/vb.js +274 -0
  225. data/vendor/assets/javascripts/codemirror/mode/vbscript/index.html +55 -0
  226. data/vendor/assets/javascripts/codemirror/mode/vbscript/vbscript.js +350 -0
  227. data/vendor/assets/javascripts/codemirror/mode/velocity/index.html +118 -0
  228. data/vendor/assets/javascripts/codemirror/mode/velocity/velocity.js +201 -0
  229. data/vendor/assets/javascripts/codemirror/mode/verilog/index.html +120 -0
  230. data/vendor/assets/javascripts/codemirror/mode/verilog/test.js +273 -0
  231. data/vendor/assets/javascripts/codemirror/mode/verilog/verilog.js +364 -0
  232. data/vendor/assets/javascripts/codemirror/mode/xml/index.html +57 -0
  233. data/vendor/assets/javascripts/codemirror/mode/xml/test.js +51 -0
  234. data/vendor/assets/javascripts/codemirror/mode/xml/xml.js +384 -0
  235. data/vendor/assets/javascripts/codemirror/mode/xquery/index.html +210 -0
  236. data/vendor/assets/javascripts/codemirror/mode/xquery/test.js +67 -0
  237. data/vendor/assets/javascripts/codemirror/mode/xquery/xquery.js +447 -0
  238. data/vendor/assets/javascripts/codemirror/mode/yaml/index.html +80 -0
  239. data/vendor/assets/javascripts/codemirror/mode/yaml/yaml.js +112 -0
  240. data/vendor/assets/javascripts/codemirror/mode/z80/index.html +52 -0
  241. data/vendor/assets/javascripts/codemirror/mode/z80/z80.js +100 -0
  242. data/vendor/assets/javascripts/datapicker/bootstrap-datepicker.js +1671 -0
  243. data/vendor/assets/javascripts/flot/curvedLines.js +315 -0
  244. data/vendor/assets/javascripts/flot/excanvas.min.js +1 -0
  245. data/vendor/assets/javascripts/flot/jquery.flot.js +3168 -0
  246. data/vendor/assets/javascripts/flot/jquery.flot.pie.js +820 -0
  247. data/vendor/assets/javascripts/flot/jquery.flot.resize.js +59 -0
  248. data/vendor/assets/javascripts/flot/jquery.flot.spline.js +212 -0
  249. data/vendor/assets/javascripts/flot/jquery.flot.symbol.js +71 -0
  250. data/vendor/assets/javascripts/flot/jquery.flot.time.js +432 -0
  251. data/vendor/assets/javascripts/flot/jquery.flot.tooltip.min.js +12 -0
  252. data/vendor/assets/javascripts/jquery/jquery-2.1.1.js +4 -0
  253. data/vendor/assets/javascripts/jquery-ui/i18n/jquery-ui-i18n.min.js +6 -0
  254. data/vendor/assets/javascripts/jquery-ui/i18n/jquery.ui.datepicker-af.min.js +4 -0
  255. data/vendor/assets/javascripts/jquery-ui/i18n/jquery.ui.datepicker-ar-DZ.min.js +4 -0
  256. data/vendor/assets/javascripts/jquery-ui/i18n/jquery.ui.datepicker-ar.min.js +4 -0
  257. data/vendor/assets/javascripts/jquery-ui/i18n/jquery.ui.datepicker-az.min.js +4 -0
  258. data/vendor/assets/javascripts/jquery-ui/i18n/jquery.ui.datepicker-be.min.js +4 -0
  259. data/vendor/assets/javascripts/jquery-ui/i18n/jquery.ui.datepicker-bg.min.js +4 -0
  260. data/vendor/assets/javascripts/jquery-ui/i18n/jquery.ui.datepicker-bs.min.js +4 -0
  261. data/vendor/assets/javascripts/jquery-ui/i18n/jquery.ui.datepicker-ca.min.js +4 -0
  262. data/vendor/assets/javascripts/jquery-ui/i18n/jquery.ui.datepicker-cs.min.js +4 -0
  263. data/vendor/assets/javascripts/jquery-ui/i18n/jquery.ui.datepicker-cy-GB.min.js +4 -0
  264. data/vendor/assets/javascripts/jquery-ui/i18n/jquery.ui.datepicker-da.min.js +4 -0
  265. data/vendor/assets/javascripts/jquery-ui/i18n/jquery.ui.datepicker-de.min.js +4 -0
  266. data/vendor/assets/javascripts/jquery-ui/i18n/jquery.ui.datepicker-el.min.js +4 -0
  267. data/vendor/assets/javascripts/jquery-ui/i18n/jquery.ui.datepicker-en-AU.min.js +4 -0
  268. data/vendor/assets/javascripts/jquery-ui/i18n/jquery.ui.datepicker-en-GB.min.js +4 -0
  269. data/vendor/assets/javascripts/jquery-ui/i18n/jquery.ui.datepicker-en-NZ.min.js +4 -0
  270. data/vendor/assets/javascripts/jquery-ui/i18n/jquery.ui.datepicker-eo.min.js +4 -0
  271. data/vendor/assets/javascripts/jquery-ui/i18n/jquery.ui.datepicker-es.min.js +4 -0
  272. data/vendor/assets/javascripts/jquery-ui/i18n/jquery.ui.datepicker-et.min.js +4 -0
  273. data/vendor/assets/javascripts/jquery-ui/i18n/jquery.ui.datepicker-eu.min.js +4 -0
  274. data/vendor/assets/javascripts/jquery-ui/i18n/jquery.ui.datepicker-fa.min.js +4 -0
  275. data/vendor/assets/javascripts/jquery-ui/i18n/jquery.ui.datepicker-fi.min.js +4 -0
  276. data/vendor/assets/javascripts/jquery-ui/i18n/jquery.ui.datepicker-fo.min.js +4 -0
  277. data/vendor/assets/javascripts/jquery-ui/i18n/jquery.ui.datepicker-fr-CA.min.js +4 -0
  278. data/vendor/assets/javascripts/jquery-ui/i18n/jquery.ui.datepicker-fr-CH.min.js +4 -0
  279. data/vendor/assets/javascripts/jquery-ui/i18n/jquery.ui.datepicker-fr.min.js +4 -0
  280. data/vendor/assets/javascripts/jquery-ui/i18n/jquery.ui.datepicker-gl.min.js +4 -0
  281. data/vendor/assets/javascripts/jquery-ui/i18n/jquery.ui.datepicker-he.min.js +4 -0
  282. data/vendor/assets/javascripts/jquery-ui/i18n/jquery.ui.datepicker-hi.min.js +4 -0
  283. data/vendor/assets/javascripts/jquery-ui/i18n/jquery.ui.datepicker-hr.min.js +4 -0
  284. data/vendor/assets/javascripts/jquery-ui/i18n/jquery.ui.datepicker-hu.min.js +4 -0
  285. data/vendor/assets/javascripts/jquery-ui/i18n/jquery.ui.datepicker-hy.min.js +4 -0
  286. data/vendor/assets/javascripts/jquery-ui/i18n/jquery.ui.datepicker-id.min.js +4 -0
  287. data/vendor/assets/javascripts/jquery-ui/i18n/jquery.ui.datepicker-is.min.js +4 -0
  288. data/vendor/assets/javascripts/jquery-ui/i18n/jquery.ui.datepicker-it.min.js +4 -0
  289. data/vendor/assets/javascripts/jquery-ui/i18n/jquery.ui.datepicker-ja.min.js +4 -0
  290. data/vendor/assets/javascripts/jquery-ui/i18n/jquery.ui.datepicker-ka.min.js +4 -0
  291. data/vendor/assets/javascripts/jquery-ui/i18n/jquery.ui.datepicker-kk.min.js +4 -0
  292. data/vendor/assets/javascripts/jquery-ui/i18n/jquery.ui.datepicker-km.min.js +4 -0
  293. data/vendor/assets/javascripts/jquery-ui/i18n/jquery.ui.datepicker-ko.min.js +4 -0
  294. data/vendor/assets/javascripts/jquery-ui/i18n/jquery.ui.datepicker-ky.min.js +4 -0
  295. data/vendor/assets/javascripts/jquery-ui/i18n/jquery.ui.datepicker-lb.min.js +4 -0
  296. data/vendor/assets/javascripts/jquery-ui/i18n/jquery.ui.datepicker-lt.min.js +4 -0
  297. data/vendor/assets/javascripts/jquery-ui/i18n/jquery.ui.datepicker-lv.min.js +4 -0
  298. data/vendor/assets/javascripts/jquery-ui/i18n/jquery.ui.datepicker-mk.min.js +4 -0
  299. data/vendor/assets/javascripts/jquery-ui/i18n/jquery.ui.datepicker-ml.min.js +4 -0
  300. data/vendor/assets/javascripts/jquery-ui/i18n/jquery.ui.datepicker-ms.min.js +4 -0
  301. data/vendor/assets/javascripts/jquery-ui/i18n/jquery.ui.datepicker-nb.min.js +4 -0
  302. data/vendor/assets/javascripts/jquery-ui/i18n/jquery.ui.datepicker-nl-BE.min.js +4 -0
  303. data/vendor/assets/javascripts/jquery-ui/i18n/jquery.ui.datepicker-nl.min.js +4 -0
  304. data/vendor/assets/javascripts/jquery-ui/i18n/jquery.ui.datepicker-nn.min.js +4 -0
  305. data/vendor/assets/javascripts/jquery-ui/i18n/jquery.ui.datepicker-no.min.js +4 -0
  306. data/vendor/assets/javascripts/jquery-ui/i18n/jquery.ui.datepicker-pl.min.js +4 -0
  307. data/vendor/assets/javascripts/jquery-ui/i18n/jquery.ui.datepicker-pt-BR.min.js +4 -0
  308. data/vendor/assets/javascripts/jquery-ui/i18n/jquery.ui.datepicker-pt.min.js +4 -0
  309. data/vendor/assets/javascripts/jquery-ui/i18n/jquery.ui.datepicker-rm.min.js +4 -0
  310. data/vendor/assets/javascripts/jquery-ui/i18n/jquery.ui.datepicker-ro.min.js +4 -0
  311. data/vendor/assets/javascripts/jquery-ui/i18n/jquery.ui.datepicker-ru.min.js +4 -0
  312. data/vendor/assets/javascripts/jquery-ui/i18n/jquery.ui.datepicker-sk.min.js +4 -0
  313. data/vendor/assets/javascripts/jquery-ui/i18n/jquery.ui.datepicker-sl.min.js +4 -0
  314. data/vendor/assets/javascripts/jquery-ui/i18n/jquery.ui.datepicker-sq.min.js +4 -0
  315. data/vendor/assets/javascripts/jquery-ui/i18n/jquery.ui.datepicker-sr-SR.min.js +4 -0
  316. data/vendor/assets/javascripts/jquery-ui/i18n/jquery.ui.datepicker-sr.min.js +4 -0
  317. data/vendor/assets/javascripts/jquery-ui/i18n/jquery.ui.datepicker-sv.min.js +4 -0
  318. data/vendor/assets/javascripts/jquery-ui/i18n/jquery.ui.datepicker-ta.min.js +4 -0
  319. data/vendor/assets/javascripts/jquery-ui/i18n/jquery.ui.datepicker-th.min.js +4 -0
  320. data/vendor/assets/javascripts/jquery-ui/i18n/jquery.ui.datepicker-tj.min.js +4 -0
  321. data/vendor/assets/javascripts/jquery-ui/i18n/jquery.ui.datepicker-tr.min.js +4 -0
  322. data/vendor/assets/javascripts/jquery-ui/i18n/jquery.ui.datepicker-uk.min.js +4 -0
  323. data/vendor/assets/javascripts/jquery-ui/i18n/jquery.ui.datepicker-vi.min.js +4 -0
  324. data/vendor/assets/javascripts/jquery-ui/i18n/jquery.ui.datepicker-zh-CN.min.js +4 -0
  325. data/vendor/assets/javascripts/jquery-ui/i18n/jquery.ui.datepicker-zh-HK.min.js +4 -0
  326. data/vendor/assets/javascripts/jquery-ui/i18n/jquery.ui.datepicker-zh-TW.min.js +4 -0
  327. data/vendor/assets/javascripts/jquery-ui/images/animated-overlay.gif +0 -0
  328. data/vendor/assets/javascripts/jquery-ui/images/ui-bg_flat_0_aaaaaa_40x100.png +0 -0
  329. data/vendor/assets/javascripts/jquery-ui/images/ui-bg_flat_75_ffffff_40x100.png +0 -0
  330. data/vendor/assets/javascripts/jquery-ui/images/ui-bg_glass_55_fbf9ee_1x400.png +0 -0
  331. data/vendor/assets/javascripts/jquery-ui/images/ui-bg_glass_65_ffffff_1x400.png +0 -0
  332. data/vendor/assets/javascripts/jquery-ui/images/ui-bg_glass_75_dadada_1x400.png +0 -0
  333. data/vendor/assets/javascripts/jquery-ui/images/ui-bg_glass_75_e6e6e6_1x400.png +0 -0
  334. data/vendor/assets/javascripts/jquery-ui/images/ui-bg_glass_95_fef1ec_1x400.png +0 -0
  335. data/vendor/assets/javascripts/jquery-ui/images/ui-bg_highlight-soft_75_cccccc_1x100.png +0 -0
  336. data/vendor/assets/javascripts/jquery-ui/images/ui-icons_222222_256x240.png +0 -0
  337. data/vendor/assets/javascripts/jquery-ui/images/ui-icons_2e83ff_256x240.png +0 -0
  338. data/vendor/assets/javascripts/jquery-ui/images/ui-icons_454545_256x240.png +0 -0
  339. data/vendor/assets/javascripts/jquery-ui/images/ui-icons_888888_256x240.png +0 -0
  340. data/vendor/assets/javascripts/jquery-ui/images/ui-icons_cd0a0a_256x240.png +0 -0
  341. data/vendor/assets/javascripts/jquery-ui/jquery-ui-1.10.4.custom.min.css +7 -0
  342. data/vendor/assets/javascripts/jquery-ui/jquery-ui-1.10.4.min.js +7 -0
  343. data/vendor/assets/javascripts/jquery-ui/jquery-ui.css +1189 -0
  344. data/vendor/assets/javascripts/jquery-ui/jquery-ui.js +15040 -0
  345. data/vendor/assets/javascripts/jquery-ui/jquery-ui.min.css +4 -0
  346. data/vendor/assets/javascripts/jquery-ui/jquery-ui.min.js +12 -0
  347. data/vendor/assets/javascripts/metisMenu/jquery.metisMenu.js +120 -0
  348. data/vendor/assets/javascripts/morris/morris.js +1888 -0
  349. data/vendor/assets/javascripts/morris/raphael-2.1.0.min.js +10 -0
  350. data/vendor/assets/javascripts/pace/pace.min.js +2 -0
  351. data/vendor/assets/javascripts/peity/jquery.peity.min.js +13 -0
  352. data/vendor/assets/javascripts/radioactive/radioactive.min.js +1 -0
  353. data/vendor/assets/javascripts/rickshaw/rickshaw.min.js +3 -0
  354. data/vendor/assets/javascripts/rickshaw/vendor/d3.v3.js +5 -0
  355. data/vendor/assets/javascripts/sparkline/jquery.sparkline.min.js +5 -0
  356. data/vendor/assets/javascripts/summernote/summernote.min.js +6331 -0
  357. data/vendor/assets/javascripts/toastr/toastr.min.js +2 -0
  358. data/vendor/assets/stylesheets/codemirror/codemirror.css +309 -0
  359. data/vendor/assets/stylesheets/codemirror/elegant.css +13 -0
  360. data/vendor/assets/stylesheets/datapicker/datepicker3.css +789 -0
  361. data/vendor/assets/stylesheets/summernote/summernote-bs3.css +5970 -0
  362. data/vendor/assets/stylesheets/summernote/summernote.css +446 -0
  363. data/vendor/assets/stylesheets/toastr/toastr.css +222 -0
  364. metadata +362 -3
  365. data/spec/dummy/tmp/pids/server.pid +0 -1
@@ -0,0 +1,820 @@
1
+ /* Flot plugin for rendering pie charts.
2
+
3
+ Copyright (c) 2007-2014 IOLA and Ole Laursen.
4
+ Licensed under the MIT license.
5
+
6
+ The plugin assumes that each series has a single data value, and that each
7
+ value is a positive integer or zero. Negative numbers don't make sense for a
8
+ pie chart, and have unpredictable results. The values do NOT need to be
9
+ passed in as percentages; the plugin will calculate the total and per-slice
10
+ percentages internally.
11
+
12
+ * Created by Brian Medendorp
13
+
14
+ * Updated with contributions from btburnett3, Anthony Aragues and Xavi Ivars
15
+
16
+ The plugin supports these options:
17
+
18
+ series: {
19
+ pie: {
20
+ show: true/false
21
+ radius: 0-1 for percentage of fullsize, or a specified pixel length, or 'auto'
22
+ innerRadius: 0-1 for percentage of fullsize or a specified pixel length, for creating a donut effect
23
+ startAngle: 0-2 factor of PI used for starting angle (in radians) i.e 3/2 starts at the top, 0 and 2 have the same result
24
+ tilt: 0-1 for percentage to tilt the pie, where 1 is no tilt, and 0 is completely flat (nothing will show)
25
+ offset: {
26
+ top: integer value to move the pie up or down
27
+ left: integer value to move the pie left or right, or 'auto'
28
+ },
29
+ stroke: {
30
+ color: any hexidecimal color value (other formats may or may not work, so best to stick with something like '#FFF')
31
+ width: integer pixel width of the stroke
32
+ },
33
+ label: {
34
+ show: true/false, or 'auto'
35
+ formatter: a user-defined function that modifies the text/style of the label text
36
+ radius: 0-1 for percentage of fullsize, or a specified pixel length
37
+ background: {
38
+ color: any hexidecimal color value (other formats may or may not work, so best to stick with something like '#000')
39
+ opacity: 0-1
40
+ },
41
+ threshold: 0-1 for the percentage value at which to hide labels (if they're too small)
42
+ },
43
+ combine: {
44
+ threshold: 0-1 for the percentage value at which to combine slices (if they're too small)
45
+ color: any hexidecimal color value (other formats may or may not work, so best to stick with something like '#CCC'), if null, the plugin will automatically use the color of the first slice to be combined
46
+ label: any text value of what the combined slice should be labeled
47
+ }
48
+ highlight: {
49
+ opacity: 0-1
50
+ }
51
+ }
52
+ }
53
+
54
+ More detail and specific examples can be found in the included HTML file.
55
+
56
+ */
57
+
58
+ (function($) {
59
+
60
+ // Maximum redraw attempts when fitting labels within the plot
61
+
62
+ var REDRAW_ATTEMPTS = 10;
63
+
64
+ // Factor by which to shrink the pie when fitting labels within the plot
65
+
66
+ var REDRAW_SHRINK = 0.95;
67
+
68
+ function init(plot) {
69
+
70
+ var canvas = null,
71
+ target = null,
72
+ options = null,
73
+ maxRadius = null,
74
+ centerLeft = null,
75
+ centerTop = null,
76
+ processed = false,
77
+ ctx = null;
78
+
79
+ // interactive variables
80
+
81
+ var highlights = [];
82
+
83
+ // add hook to determine if pie plugin in enabled, and then perform necessary operations
84
+
85
+ plot.hooks.processOptions.push(function(plot, options) {
86
+ if (options.series.pie.show) {
87
+
88
+ options.grid.show = false;
89
+
90
+ // set labels.show
91
+
92
+ if (options.series.pie.label.show == "auto") {
93
+ if (options.legend.show) {
94
+ options.series.pie.label.show = false;
95
+ } else {
96
+ options.series.pie.label.show = true;
97
+ }
98
+ }
99
+
100
+ // set radius
101
+
102
+ if (options.series.pie.radius == "auto") {
103
+ if (options.series.pie.label.show) {
104
+ options.series.pie.radius = 3/4;
105
+ } else {
106
+ options.series.pie.radius = 1;
107
+ }
108
+ }
109
+
110
+ // ensure sane tilt
111
+
112
+ if (options.series.pie.tilt > 1) {
113
+ options.series.pie.tilt = 1;
114
+ } else if (options.series.pie.tilt < 0) {
115
+ options.series.pie.tilt = 0;
116
+ }
117
+ }
118
+ });
119
+
120
+ plot.hooks.bindEvents.push(function(plot, eventHolder) {
121
+ var options = plot.getOptions();
122
+ if (options.series.pie.show) {
123
+ if (options.grid.hoverable) {
124
+ eventHolder.unbind("mousemove").mousemove(onMouseMove);
125
+ }
126
+ if (options.grid.clickable) {
127
+ eventHolder.unbind("click").click(onClick);
128
+ }
129
+ }
130
+ });
131
+
132
+ plot.hooks.processDatapoints.push(function(plot, series, data, datapoints) {
133
+ var options = plot.getOptions();
134
+ if (options.series.pie.show) {
135
+ processDatapoints(plot, series, data, datapoints);
136
+ }
137
+ });
138
+
139
+ plot.hooks.drawOverlay.push(function(plot, octx) {
140
+ var options = plot.getOptions();
141
+ if (options.series.pie.show) {
142
+ drawOverlay(plot, octx);
143
+ }
144
+ });
145
+
146
+ plot.hooks.draw.push(function(plot, newCtx) {
147
+ var options = plot.getOptions();
148
+ if (options.series.pie.show) {
149
+ draw(plot, newCtx);
150
+ }
151
+ });
152
+
153
+ function processDatapoints(plot, series, datapoints) {
154
+ if (!processed) {
155
+ processed = true;
156
+ canvas = plot.getCanvas();
157
+ target = $(canvas).parent();
158
+ options = plot.getOptions();
159
+ plot.setData(combine(plot.getData()));
160
+ }
161
+ }
162
+
163
+ function combine(data) {
164
+
165
+ var total = 0,
166
+ combined = 0,
167
+ numCombined = 0,
168
+ color = options.series.pie.combine.color,
169
+ newdata = [];
170
+
171
+ // Fix up the raw data from Flot, ensuring the data is numeric
172
+
173
+ for (var i = 0; i < data.length; ++i) {
174
+
175
+ var value = data[i].data;
176
+
177
+ // If the data is an array, we'll assume that it's a standard
178
+ // Flot x-y pair, and are concerned only with the second value.
179
+
180
+ // Note how we use the original array, rather than creating a
181
+ // new one; this is more efficient and preserves any extra data
182
+ // that the user may have stored in higher indexes.
183
+
184
+ if ($.isArray(value) && value.length == 1) {
185
+ value = value[0];
186
+ }
187
+
188
+ if ($.isArray(value)) {
189
+ // Equivalent to $.isNumeric() but compatible with jQuery < 1.7
190
+ if (!isNaN(parseFloat(value[1])) && isFinite(value[1])) {
191
+ value[1] = +value[1];
192
+ } else {
193
+ value[1] = 0;
194
+ }
195
+ } else if (!isNaN(parseFloat(value)) && isFinite(value)) {
196
+ value = [1, +value];
197
+ } else {
198
+ value = [1, 0];
199
+ }
200
+
201
+ data[i].data = [value];
202
+ }
203
+
204
+ // Sum up all the slices, so we can calculate percentages for each
205
+
206
+ for (var i = 0; i < data.length; ++i) {
207
+ total += data[i].data[0][1];
208
+ }
209
+
210
+ // Count the number of slices with percentages below the combine
211
+ // threshold; if it turns out to be just one, we won't combine.
212
+
213
+ for (var i = 0; i < data.length; ++i) {
214
+ var value = data[i].data[0][1];
215
+ if (value / total <= options.series.pie.combine.threshold) {
216
+ combined += value;
217
+ numCombined++;
218
+ if (!color) {
219
+ color = data[i].color;
220
+ }
221
+ }
222
+ }
223
+
224
+ for (var i = 0; i < data.length; ++i) {
225
+ var value = data[i].data[0][1];
226
+ if (numCombined < 2 || value / total > options.series.pie.combine.threshold) {
227
+ newdata.push(
228
+ $.extend(data[i], { /* extend to allow keeping all other original data values
229
+ and using them e.g. in labelFormatter. */
230
+ data: [[1, value]],
231
+ color: data[i].color,
232
+ label: data[i].label,
233
+ angle: value * Math.PI * 2 / total,
234
+ percent: value / (total / 100)
235
+ })
236
+ );
237
+ }
238
+ }
239
+
240
+ if (numCombined > 1) {
241
+ newdata.push({
242
+ data: [[1, combined]],
243
+ color: color,
244
+ label: options.series.pie.combine.label,
245
+ angle: combined * Math.PI * 2 / total,
246
+ percent: combined / (total / 100)
247
+ });
248
+ }
249
+
250
+ return newdata;
251
+ }
252
+
253
+ function draw(plot, newCtx) {
254
+
255
+ if (!target) {
256
+ return; // if no series were passed
257
+ }
258
+
259
+ var canvasWidth = plot.getPlaceholder().width(),
260
+ canvasHeight = plot.getPlaceholder().height(),
261
+ legendWidth = target.children().filter(".legend").children().width() || 0;
262
+
263
+ ctx = newCtx;
264
+
265
+ // WARNING: HACK! REWRITE THIS CODE AS SOON AS POSSIBLE!
266
+
267
+ // When combining smaller slices into an 'other' slice, we need to
268
+ // add a new series. Since Flot gives plugins no way to modify the
269
+ // list of series, the pie plugin uses a hack where the first call
270
+ // to processDatapoints results in a call to setData with the new
271
+ // list of series, then subsequent processDatapoints do nothing.
272
+
273
+ // The plugin-global 'processed' flag is used to control this hack;
274
+ // it starts out false, and is set to true after the first call to
275
+ // processDatapoints.
276
+
277
+ // Unfortunately this turns future setData calls into no-ops; they
278
+ // call processDatapoints, the flag is true, and nothing happens.
279
+
280
+ // To fix this we'll set the flag back to false here in draw, when
281
+ // all series have been processed, so the next sequence of calls to
282
+ // processDatapoints once again starts out with a slice-combine.
283
+ // This is really a hack; in 0.9 we need to give plugins a proper
284
+ // way to modify series before any processing begins.
285
+
286
+ processed = false;
287
+
288
+ // calculate maximum radius and center point
289
+
290
+ maxRadius = Math.min(canvasWidth, canvasHeight / options.series.pie.tilt) / 2;
291
+ centerTop = canvasHeight / 2 + options.series.pie.offset.top;
292
+ centerLeft = canvasWidth / 2;
293
+
294
+ if (options.series.pie.offset.left == "auto") {
295
+ if (options.legend.position.match("w")) {
296
+ centerLeft += legendWidth / 2;
297
+ } else {
298
+ centerLeft -= legendWidth / 2;
299
+ }
300
+ if (centerLeft < maxRadius) {
301
+ centerLeft = maxRadius;
302
+ } else if (centerLeft > canvasWidth - maxRadius) {
303
+ centerLeft = canvasWidth - maxRadius;
304
+ }
305
+ } else {
306
+ centerLeft += options.series.pie.offset.left;
307
+ }
308
+
309
+ var slices = plot.getData(),
310
+ attempts = 0;
311
+
312
+ // Keep shrinking the pie's radius until drawPie returns true,
313
+ // indicating that all the labels fit, or we try too many times.
314
+
315
+ do {
316
+ if (attempts > 0) {
317
+ maxRadius *= REDRAW_SHRINK;
318
+ }
319
+ attempts += 1;
320
+ clear();
321
+ if (options.series.pie.tilt <= 0.8) {
322
+ drawShadow();
323
+ }
324
+ } while (!drawPie() && attempts < REDRAW_ATTEMPTS)
325
+
326
+ if (attempts >= REDRAW_ATTEMPTS) {
327
+ clear();
328
+ target.prepend("<div class='error'>Could not draw pie with labels contained inside canvas</div>");
329
+ }
330
+
331
+ if (plot.setSeries && plot.insertLegend) {
332
+ plot.setSeries(slices);
333
+ plot.insertLegend();
334
+ }
335
+
336
+ // we're actually done at this point, just defining internal functions at this point
337
+
338
+ function clear() {
339
+ ctx.clearRect(0, 0, canvasWidth, canvasHeight);
340
+ target.children().filter(".pieLabel, .pieLabelBackground").remove();
341
+ }
342
+
343
+ function drawShadow() {
344
+
345
+ var shadowLeft = options.series.pie.shadow.left;
346
+ var shadowTop = options.series.pie.shadow.top;
347
+ var edge = 10;
348
+ var alpha = options.series.pie.shadow.alpha;
349
+ var radius = options.series.pie.radius > 1 ? options.series.pie.radius : maxRadius * options.series.pie.radius;
350
+
351
+ if (radius >= canvasWidth / 2 - shadowLeft || radius * options.series.pie.tilt >= canvasHeight / 2 - shadowTop || radius <= edge) {
352
+ return; // shadow would be outside canvas, so don't draw it
353
+ }
354
+
355
+ ctx.save();
356
+ ctx.translate(shadowLeft,shadowTop);
357
+ ctx.globalAlpha = alpha;
358
+ ctx.fillStyle = "#000";
359
+
360
+ // center and rotate to starting position
361
+
362
+ ctx.translate(centerLeft,centerTop);
363
+ ctx.scale(1, options.series.pie.tilt);
364
+
365
+ //radius -= edge;
366
+
367
+ for (var i = 1; i <= edge; i++) {
368
+ ctx.beginPath();
369
+ ctx.arc(0, 0, radius, 0, Math.PI * 2, false);
370
+ ctx.fill();
371
+ radius -= i;
372
+ }
373
+
374
+ ctx.restore();
375
+ }
376
+
377
+ function drawPie() {
378
+
379
+ var startAngle = Math.PI * options.series.pie.startAngle;
380
+ var radius = options.series.pie.radius > 1 ? options.series.pie.radius : maxRadius * options.series.pie.radius;
381
+
382
+ // center and rotate to starting position
383
+
384
+ ctx.save();
385
+ ctx.translate(centerLeft,centerTop);
386
+ ctx.scale(1, options.series.pie.tilt);
387
+ //ctx.rotate(startAngle); // start at top; -- This doesn't work properly in Opera
388
+
389
+ // draw slices
390
+
391
+ ctx.save();
392
+ var currentAngle = startAngle;
393
+ for (var i = 0; i < slices.length; ++i) {
394
+ slices[i].startAngle = currentAngle;
395
+ drawSlice(slices[i].angle, slices[i].color, true);
396
+ }
397
+ ctx.restore();
398
+
399
+ // draw slice outlines
400
+
401
+ if (options.series.pie.stroke.width > 0) {
402
+ ctx.save();
403
+ ctx.lineWidth = options.series.pie.stroke.width;
404
+ currentAngle = startAngle;
405
+ for (var i = 0; i < slices.length; ++i) {
406
+ drawSlice(slices[i].angle, options.series.pie.stroke.color, false);
407
+ }
408
+ ctx.restore();
409
+ }
410
+
411
+ // draw donut hole
412
+
413
+ drawDonutHole(ctx);
414
+
415
+ ctx.restore();
416
+
417
+ // Draw the labels, returning true if they fit within the plot
418
+
419
+ if (options.series.pie.label.show) {
420
+ return drawLabels();
421
+ } else return true;
422
+
423
+ function drawSlice(angle, color, fill) {
424
+
425
+ if (angle <= 0 || isNaN(angle)) {
426
+ return;
427
+ }
428
+
429
+ if (fill) {
430
+ ctx.fillStyle = color;
431
+ } else {
432
+ ctx.strokeStyle = color;
433
+ ctx.lineJoin = "round";
434
+ }
435
+
436
+ ctx.beginPath();
437
+ if (Math.abs(angle - Math.PI * 2) > 0.000000001) {
438
+ ctx.moveTo(0, 0); // Center of the pie
439
+ }
440
+
441
+ //ctx.arc(0, 0, radius, 0, angle, false); // This doesn't work properly in Opera
442
+ ctx.arc(0, 0, radius,currentAngle, currentAngle + angle / 2, false);
443
+ ctx.arc(0, 0, radius,currentAngle + angle / 2, currentAngle + angle, false);
444
+ ctx.closePath();
445
+ //ctx.rotate(angle); // This doesn't work properly in Opera
446
+ currentAngle += angle;
447
+
448
+ if (fill) {
449
+ ctx.fill();
450
+ } else {
451
+ ctx.stroke();
452
+ }
453
+ }
454
+
455
+ function drawLabels() {
456
+
457
+ var currentAngle = startAngle;
458
+ var radius = options.series.pie.label.radius > 1 ? options.series.pie.label.radius : maxRadius * options.series.pie.label.radius;
459
+
460
+ for (var i = 0; i < slices.length; ++i) {
461
+ if (slices[i].percent >= options.series.pie.label.threshold * 100) {
462
+ if (!drawLabel(slices[i], currentAngle, i)) {
463
+ return false;
464
+ }
465
+ }
466
+ currentAngle += slices[i].angle;
467
+ }
468
+
469
+ return true;
470
+
471
+ function drawLabel(slice, startAngle, index) {
472
+
473
+ if (slice.data[0][1] == 0) {
474
+ return true;
475
+ }
476
+
477
+ // format label text
478
+
479
+ var lf = options.legend.labelFormatter, text, plf = options.series.pie.label.formatter;
480
+
481
+ if (lf) {
482
+ text = lf(slice.label, slice);
483
+ } else {
484
+ text = slice.label;
485
+ }
486
+
487
+ if (plf) {
488
+ text = plf(text, slice);
489
+ }
490
+
491
+ var halfAngle = ((startAngle + slice.angle) + startAngle) / 2;
492
+ var x = centerLeft + Math.round(Math.cos(halfAngle) * radius);
493
+ var y = centerTop + Math.round(Math.sin(halfAngle) * radius) * options.series.pie.tilt;
494
+
495
+ var html = "<span class='pieLabel' id='pieLabel" + index + "' style='position:absolute;top:" + y + "px;left:" + x + "px;'>" + text + "</span>";
496
+ target.append(html);
497
+
498
+ var label = target.children("#pieLabel" + index);
499
+ var labelTop = (y - label.height() / 2);
500
+ var labelLeft = (x - label.width() / 2);
501
+
502
+ label.css("top", labelTop);
503
+ label.css("left", labelLeft);
504
+
505
+ // check to make sure that the label is not outside the canvas
506
+
507
+ if (0 - labelTop > 0 || 0 - labelLeft > 0 || canvasHeight - (labelTop + label.height()) < 0 || canvasWidth - (labelLeft + label.width()) < 0) {
508
+ return false;
509
+ }
510
+
511
+ if (options.series.pie.label.background.opacity != 0) {
512
+
513
+ // put in the transparent background separately to avoid blended labels and label boxes
514
+
515
+ var c = options.series.pie.label.background.color;
516
+
517
+ if (c == null) {
518
+ c = slice.color;
519
+ }
520
+
521
+ var pos = "top:" + labelTop + "px;left:" + labelLeft + "px;";
522
+ $("<div class='pieLabelBackground' style='position:absolute;width:" + label.width() + "px;height:" + label.height() + "px;" + pos + "background-color:" + c + ";'></div>")
523
+ .css("opacity", options.series.pie.label.background.opacity)
524
+ .insertBefore(label);
525
+ }
526
+
527
+ return true;
528
+ } // end individual label function
529
+ } // end drawLabels function
530
+ } // end drawPie function
531
+ } // end draw function
532
+
533
+ // Placed here because it needs to be accessed from multiple locations
534
+
535
+ function drawDonutHole(layer) {
536
+ if (options.series.pie.innerRadius > 0) {
537
+
538
+ // subtract the center
539
+
540
+ layer.save();
541
+ var innerRadius = options.series.pie.innerRadius > 1 ? options.series.pie.innerRadius : maxRadius * options.series.pie.innerRadius;
542
+ layer.globalCompositeOperation = "destination-out"; // this does not work with excanvas, but it will fall back to using the stroke color
543
+ layer.beginPath();
544
+ layer.fillStyle = options.series.pie.stroke.color;
545
+ layer.arc(0, 0, innerRadius, 0, Math.PI * 2, false);
546
+ layer.fill();
547
+ layer.closePath();
548
+ layer.restore();
549
+
550
+ // add inner stroke
551
+
552
+ layer.save();
553
+ layer.beginPath();
554
+ layer.strokeStyle = options.series.pie.stroke.color;
555
+ layer.arc(0, 0, innerRadius, 0, Math.PI * 2, false);
556
+ layer.stroke();
557
+ layer.closePath();
558
+ layer.restore();
559
+
560
+ // TODO: add extra shadow inside hole (with a mask) if the pie is tilted.
561
+ }
562
+ }
563
+
564
+ //-- Additional Interactive related functions --
565
+
566
+ function isPointInPoly(poly, pt) {
567
+ for(var c = false, i = -1, l = poly.length, j = l - 1; ++i < l; j = i)
568
+ ((poly[i][1] <= pt[1] && pt[1] < poly[j][1]) || (poly[j][1] <= pt[1] && pt[1]< poly[i][1]))
569
+ && (pt[0] < (poly[j][0] - poly[i][0]) * (pt[1] - poly[i][1]) / (poly[j][1] - poly[i][1]) + poly[i][0])
570
+ && (c = !c);
571
+ return c;
572
+ }
573
+
574
+ function findNearbySlice(mouseX, mouseY) {
575
+
576
+ var slices = plot.getData(),
577
+ options = plot.getOptions(),
578
+ radius = options.series.pie.radius > 1 ? options.series.pie.radius : maxRadius * options.series.pie.radius,
579
+ x, y;
580
+
581
+ for (var i = 0; i < slices.length; ++i) {
582
+
583
+ var s = slices[i];
584
+
585
+ if (s.pie.show) {
586
+
587
+ ctx.save();
588
+ ctx.beginPath();
589
+ ctx.moveTo(0, 0); // Center of the pie
590
+ //ctx.scale(1, options.series.pie.tilt); // this actually seems to break everything when here.
591
+ ctx.arc(0, 0, radius, s.startAngle, s.startAngle + s.angle / 2, false);
592
+ ctx.arc(0, 0, radius, s.startAngle + s.angle / 2, s.startAngle + s.angle, false);
593
+ ctx.closePath();
594
+ x = mouseX - centerLeft;
595
+ y = mouseY - centerTop;
596
+
597
+ if (ctx.isPointInPath) {
598
+ if (ctx.isPointInPath(mouseX - centerLeft, mouseY - centerTop)) {
599
+ ctx.restore();
600
+ return {
601
+ datapoint: [s.percent, s.data],
602
+ dataIndex: 0,
603
+ series: s,
604
+ seriesIndex: i
605
+ };
606
+ }
607
+ } else {
608
+
609
+ // excanvas for IE doesn;t support isPointInPath, this is a workaround.
610
+
611
+ var p1X = radius * Math.cos(s.startAngle),
612
+ p1Y = radius * Math.sin(s.startAngle),
613
+ p2X = radius * Math.cos(s.startAngle + s.angle / 4),
614
+ p2Y = radius * Math.sin(s.startAngle + s.angle / 4),
615
+ p3X = radius * Math.cos(s.startAngle + s.angle / 2),
616
+ p3Y = radius * Math.sin(s.startAngle + s.angle / 2),
617
+ p4X = radius * Math.cos(s.startAngle + s.angle / 1.5),
618
+ p4Y = radius * Math.sin(s.startAngle + s.angle / 1.5),
619
+ p5X = radius * Math.cos(s.startAngle + s.angle),
620
+ p5Y = radius * Math.sin(s.startAngle + s.angle),
621
+ arrPoly = [[0, 0], [p1X, p1Y], [p2X, p2Y], [p3X, p3Y], [p4X, p4Y], [p5X, p5Y]],
622
+ arrPoint = [x, y];
623
+
624
+ // TODO: perhaps do some mathmatical trickery here with the Y-coordinate to compensate for pie tilt?
625
+
626
+ if (isPointInPoly(arrPoly, arrPoint)) {
627
+ ctx.restore();
628
+ return {
629
+ datapoint: [s.percent, s.data],
630
+ dataIndex: 0,
631
+ series: s,
632
+ seriesIndex: i
633
+ };
634
+ }
635
+ }
636
+
637
+ ctx.restore();
638
+ }
639
+ }
640
+
641
+ return null;
642
+ }
643
+
644
+ function onMouseMove(e) {
645
+ triggerClickHoverEvent("plothover", e);
646
+ }
647
+
648
+ function onClick(e) {
649
+ triggerClickHoverEvent("plotclick", e);
650
+ }
651
+
652
+ // trigger click or hover event (they send the same parameters so we share their code)
653
+
654
+ function triggerClickHoverEvent(eventname, e) {
655
+
656
+ var offset = plot.offset();
657
+ var canvasX = parseInt(e.pageX - offset.left);
658
+ var canvasY = parseInt(e.pageY - offset.top);
659
+ var item = findNearbySlice(canvasX, canvasY);
660
+
661
+ if (options.grid.autoHighlight) {
662
+
663
+ // clear auto-highlights
664
+
665
+ for (var i = 0; i < highlights.length; ++i) {
666
+ var h = highlights[i];
667
+ if (h.auto == eventname && !(item && h.series == item.series)) {
668
+ unhighlight(h.series);
669
+ }
670
+ }
671
+ }
672
+
673
+ // highlight the slice
674
+
675
+ if (item) {
676
+ highlight(item.series, eventname);
677
+ }
678
+
679
+ // trigger any hover bind events
680
+
681
+ var pos = { pageX: e.pageX, pageY: e.pageY };
682
+ target.trigger(eventname, [pos, item]);
683
+ }
684
+
685
+ function highlight(s, auto) {
686
+ //if (typeof s == "number") {
687
+ // s = series[s];
688
+ //}
689
+
690
+ var i = indexOfHighlight(s);
691
+
692
+ if (i == -1) {
693
+ highlights.push({ series: s, auto: auto });
694
+ plot.triggerRedrawOverlay();
695
+ } else if (!auto) {
696
+ highlights[i].auto = false;
697
+ }
698
+ }
699
+
700
+ function unhighlight(s) {
701
+ if (s == null) {
702
+ highlights = [];
703
+ plot.triggerRedrawOverlay();
704
+ }
705
+
706
+ //if (typeof s == "number") {
707
+ // s = series[s];
708
+ //}
709
+
710
+ var i = indexOfHighlight(s);
711
+
712
+ if (i != -1) {
713
+ highlights.splice(i, 1);
714
+ plot.triggerRedrawOverlay();
715
+ }
716
+ }
717
+
718
+ function indexOfHighlight(s) {
719
+ for (var i = 0; i < highlights.length; ++i) {
720
+ var h = highlights[i];
721
+ if (h.series == s)
722
+ return i;
723
+ }
724
+ return -1;
725
+ }
726
+
727
+ function drawOverlay(plot, octx) {
728
+
729
+ var options = plot.getOptions();
730
+
731
+ var radius = options.series.pie.radius > 1 ? options.series.pie.radius : maxRadius * options.series.pie.radius;
732
+
733
+ octx.save();
734
+ octx.translate(centerLeft, centerTop);
735
+ octx.scale(1, options.series.pie.tilt);
736
+
737
+ for (var i = 0; i < highlights.length; ++i) {
738
+ drawHighlight(highlights[i].series);
739
+ }
740
+
741
+ drawDonutHole(octx);
742
+
743
+ octx.restore();
744
+
745
+ function drawHighlight(series) {
746
+
747
+ if (series.angle <= 0 || isNaN(series.angle)) {
748
+ return;
749
+ }
750
+
751
+ //octx.fillStyle = parseColor(options.series.pie.highlight.color).scale(null, null, null, options.series.pie.highlight.opacity).toString();
752
+ octx.fillStyle = "rgba(255, 255, 255, " + options.series.pie.highlight.opacity + ")"; // this is temporary until we have access to parseColor
753
+ octx.beginPath();
754
+ if (Math.abs(series.angle - Math.PI * 2) > 0.000000001) {
755
+ octx.moveTo(0, 0); // Center of the pie
756
+ }
757
+ octx.arc(0, 0, radius, series.startAngle, series.startAngle + series.angle / 2, false);
758
+ octx.arc(0, 0, radius, series.startAngle + series.angle / 2, series.startAngle + series.angle, false);
759
+ octx.closePath();
760
+ octx.fill();
761
+ }
762
+ }
763
+ } // end init (plugin body)
764
+
765
+ // define pie specific options and their default values
766
+
767
+ var options = {
768
+ series: {
769
+ pie: {
770
+ show: false,
771
+ radius: "auto", // actual radius of the visible pie (based on full calculated radius if <=1, or hard pixel value)
772
+ innerRadius: 0, /* for donut */
773
+ startAngle: 3/2,
774
+ tilt: 1,
775
+ shadow: {
776
+ left: 5, // shadow left offset
777
+ top: 15, // shadow top offset
778
+ alpha: 0.02 // shadow alpha
779
+ },
780
+ offset: {
781
+ top: 0,
782
+ left: "auto"
783
+ },
784
+ stroke: {
785
+ color: "#fff",
786
+ width: 1
787
+ },
788
+ label: {
789
+ show: "auto",
790
+ formatter: function(label, slice) {
791
+ return "<div style='font-size:x-small;text-align:center;padding:2px;color:" + slice.color + ";'>" + label + "<br/>" + Math.round(slice.percent) + "%</div>";
792
+ }, // formatter function
793
+ radius: 1, // radius at which to place the labels (based on full calculated radius if <=1, or hard pixel value)
794
+ background: {
795
+ color: null,
796
+ opacity: 0
797
+ },
798
+ threshold: 0 // percentage at which to hide the label (i.e. the slice is too narrow)
799
+ },
800
+ combine: {
801
+ threshold: -1, // percentage at which to combine little slices into one larger slice
802
+ color: null, // color to give the new slice (auto-generated if null)
803
+ label: "Other" // label to give the new slice
804
+ },
805
+ highlight: {
806
+ //color: "#fff", // will add this functionality once parseColor is available
807
+ opacity: 0.5
808
+ }
809
+ }
810
+ }
811
+ };
812
+
813
+ $.plot.plugins.push({
814
+ init: init,
815
+ options: options,
816
+ name: "pie",
817
+ version: "1.1"
818
+ });
819
+
820
+ })(jQuery);