wbase 0.0.14 → 0.0.15

Sign up to get free protection for your applications and to get access to all the features.
Files changed (875) hide show
  1. checksums.yaml +4 -4
  2. data/app/assets/fonts/FontAwesome.otf +0 -0
  3. data/app/assets/fonts/Material-Design-Iconic-Font.eot +0 -0
  4. data/app/assets/fonts/Material-Design-Iconic-Font.svg +773 -0
  5. data/app/assets/fonts/Material-Design-Iconic-Font.ttf +0 -0
  6. data/app/assets/fonts/Material-Design-Iconic-Font.woff +0 -0
  7. data/app/assets/fonts/Simple-Line-Icons.eot +0 -0
  8. data/app/assets/fonts/Simple-Line-Icons.svg +211 -0
  9. data/app/assets/fonts/Simple-Line-Icons.ttf +0 -0
  10. data/app/assets/fonts/Simple-Line-Icons.woff +0 -0
  11. data/app/assets/fonts/Simple-Line-Icons.woff2 +0 -0
  12. data/app/assets/fonts/et-line.eot +0 -0
  13. data/app/assets/fonts/et-line.svg +1 -1
  14. data/app/assets/fonts/et-line.ttf +0 -0
  15. data/app/assets/fonts/et-line.woff +0 -0
  16. data/app/assets/fonts/fontawesome-webfont.eot +0 -0
  17. data/app/assets/fonts/fontawesome-webfont.svg +685 -0
  18. data/app/assets/fonts/fontawesome-webfont.ttf +0 -0
  19. data/app/assets/fonts/fontawesome-webfont.woff +0 -0
  20. data/app/assets/fonts/fontawesome-webfont.woff2 +0 -0
  21. data/app/assets/fonts/glyphicons-halflings-regular.eot +0 -0
  22. data/app/assets/fonts/glyphicons-halflings-regular.svg +1 -1
  23. data/app/assets/fonts/glyphicons-halflings-regular.ttf +0 -0
  24. data/app/assets/fonts/glyphicons-halflings-regular.woff +0 -0
  25. data/app/assets/fonts/glyphicons-halflings-regular.woff2 +0 -0
  26. data/app/assets/fonts/ionicons.eot +0 -0
  27. data/app/assets/fonts/ionicons.svg +1899 -0
  28. data/app/assets/fonts/ionicons.ttf +0 -0
  29. data/app/assets/fonts/ionicons.woff +0 -0
  30. data/app/assets/fonts/themify.eot +0 -0
  31. data/app/assets/fonts/themify.svg +362 -0
  32. data/app/assets/fonts/themify.ttf +0 -0
  33. data/app/assets/fonts/themify.woff +0 -0
  34. data/app/assets/fonts/typicons.eot +0 -0
  35. data/app/assets/fonts/typicons.less +1040 -0
  36. data/app/assets/fonts/typicons.svg +1180 -0
  37. data/app/assets/fonts/typicons.ttf +0 -0
  38. data/app/assets/fonts/typicons.woff +0 -0
  39. data/app/assets/fonts/weathericons-regular-webfont.eot +0 -0
  40. data/app/assets/fonts/weathericons-regular-webfont.svg +257 -0
  41. data/app/assets/fonts/weathericons-regular-webfont.ttf +0 -0
  42. data/app/assets/fonts/weathericons-regular-webfont.woff +0 -0
  43. data/app/assets/fonts/weathericons-regular-webfont.woff2 +0 -0
  44. data/app/assets/javascripts/wbase/admin/animate/animate.min.css +11 -0
  45. data/app/assets/javascripts/wbase/admin/autoNumeric/autoNumeric.js +1465 -0
  46. data/app/assets/javascripts/wbase/admin/autocomplete/autocomplete.zip +0 -0
  47. data/app/assets/javascripts/wbase/admin/autocomplete/countries.js +267 -0
  48. data/app/assets/javascripts/wbase/admin/autocomplete/demo.js +77 -0
  49. data/app/assets/javascripts/wbase/admin/autocomplete/jquery.autocomplete.min.js +8 -0
  50. data/app/assets/javascripts/wbase/admin/autocomplete/jquery.mockjax.js +601 -0
  51. data/app/assets/javascripts/wbase/admin/autocomplete.js +77 -0
  52. data/app/assets/javascripts/wbase/admin/bootstrap-colorpicker/css/bootstrap-colorpicker.css +222 -0
  53. data/app/assets/javascripts/wbase/admin/bootstrap-colorpicker/css/bootstrap-colorpicker.css.map +1 -0
  54. data/app/assets/javascripts/wbase/admin/bootstrap-colorpicker/css/bootstrap-colorpicker.min.css +10 -0
  55. data/app/assets/javascripts/wbase/admin/bootstrap-colorpicker/css/bootstrap-colorpicker.min.css.map +1 -0
  56. data/app/assets/javascripts/wbase/admin/bootstrap-colorpicker/img/bootstrap-colorpicker/alpha-horizontal.png +0 -0
  57. data/app/assets/javascripts/wbase/admin/bootstrap-colorpicker/img/bootstrap-colorpicker/alpha.png +0 -0
  58. data/app/assets/javascripts/wbase/admin/bootstrap-colorpicker/img/bootstrap-colorpicker/hue-horizontal.png +0 -0
  59. data/app/assets/javascripts/wbase/admin/bootstrap-colorpicker/img/bootstrap-colorpicker/hue.png +0 -0
  60. data/app/assets/javascripts/wbase/admin/bootstrap-colorpicker/img/bootstrap-colorpicker/saturation.png +0 -0
  61. data/app/assets/javascripts/wbase/admin/bootstrap-colorpicker/js/bootstrap-colorpicker.js +1106 -0
  62. data/app/assets/javascripts/wbase/admin/bootstrap-colorpicker/js/bootstrap-colorpicker.min.js +5 -0
  63. data/app/assets/javascripts/wbase/admin/bootstrap-datepicker/css/bootstrap-datepicker.min.css +9 -0
  64. data/app/assets/javascripts/wbase/admin/bootstrap-datepicker/js/bootstrap-datepicker.min.js +10 -0
  65. data/app/assets/javascripts/wbase/admin/bootstrap-daterangepicker/daterangepicker.css +269 -0
  66. data/app/assets/javascripts/wbase/admin/bootstrap-daterangepicker/daterangepicker.js +1618 -0
  67. data/app/assets/javascripts/wbase/admin/bootstrap-daterangepicker/drp.png +0 -0
  68. data/app/assets/javascripts/wbase/admin/bootstrap-filestyle/js/bootstrap-filestyle.js +351 -0
  69. data/app/assets/javascripts/wbase/admin/bootstrap-filestyle/js/bootstrap-filestyle.min.js +1 -0
  70. data/app/assets/javascripts/wbase/admin/bootstrap-inputmask/bootstrap-inputmask.min.js +7 -0
  71. data/app/assets/javascripts/wbase/admin/bootstrap-markdown/css/bootstrap-markdown.min.css +1 -0
  72. data/app/assets/javascripts/wbase/admin/bootstrap-markdown/js/bootstrap-markdown.js +1362 -0
  73. data/app/assets/javascripts/wbase/admin/bootstrap-maxlength/bootstrap-maxlength.js +501 -0
  74. data/app/assets/javascripts/wbase/admin/bootstrap-maxlength/bootstrap-maxlength.min.js +10 -0
  75. data/app/assets/javascripts/wbase/admin/bootstrap-maxlength/src/bootstrap-maxlength.js +501 -0
  76. data/app/assets/javascripts/wbase/admin/bootstrap-select/css/bootstrap-select.min.css +6 -0
  77. data/app/assets/javascripts/wbase/admin/bootstrap-select/js/bootstrap-select.js +1735 -0
  78. data/app/assets/javascripts/wbase/admin/bootstrap-select/js/bootstrap-select.js.map +1 -0
  79. data/app/assets/javascripts/wbase/admin/bootstrap-select/js/bootstrap-select.min.js +8 -0
  80. data/app/assets/javascripts/wbase/admin/bootstrap-select/js/i18n/defaults-ar_AR.js +49 -0
  81. data/app/assets/javascripts/wbase/admin/bootstrap-select/js/i18n/defaults-ar_AR.min.js +12 -0
  82. data/app/assets/javascripts/wbase/admin/bootstrap-select/js/i18n/defaults-bg_BG.js +44 -0
  83. data/app/assets/javascripts/wbase/admin/bootstrap-select/js/i18n/defaults-bg_BG.min.js +7 -0
  84. data/app/assets/javascripts/wbase/admin/bootstrap-select/js/i18n/defaults-cro_CRO.js +44 -0
  85. data/app/assets/javascripts/wbase/admin/bootstrap-select/js/i18n/defaults-cro_CRO.min.js +7 -0
  86. data/app/assets/javascripts/wbase/admin/bootstrap-select/js/i18n/defaults-cs_CZ.js +35 -0
  87. data/app/assets/javascripts/wbase/admin/bootstrap-select/js/i18n/defaults-cs_CZ.min.js +7 -0
  88. data/app/assets/javascripts/wbase/admin/bootstrap-select/js/i18n/defaults-da_DK.js +44 -0
  89. data/app/assets/javascripts/wbase/admin/bootstrap-select/js/i18n/defaults-da_DK.min.js +7 -0
  90. data/app/assets/javascripts/wbase/admin/bootstrap-select/js/i18n/defaults-de_DE.js +35 -0
  91. data/app/assets/javascripts/wbase/admin/bootstrap-select/js/i18n/defaults-de_DE.min.js +7 -0
  92. data/app/assets/javascripts/wbase/admin/bootstrap-select/js/i18n/defaults-en_US.js +44 -0
  93. data/app/assets/javascripts/wbase/admin/bootstrap-select/js/i18n/defaults-en_US.min.js +7 -0
  94. data/app/assets/javascripts/wbase/admin/bootstrap-select/js/i18n/defaults-es_CL.js +35 -0
  95. data/app/assets/javascripts/wbase/admin/bootstrap-select/js/i18n/defaults-es_CL.min.js +7 -0
  96. data/app/assets/javascripts/wbase/admin/bootstrap-select/js/i18n/defaults-eu.js +35 -0
  97. data/app/assets/javascripts/wbase/admin/bootstrap-select/js/i18n/defaults-eu.min.js +7 -0
  98. data/app/assets/javascripts/wbase/admin/bootstrap-select/js/i18n/defaults-fa_IR.js +37 -0
  99. data/app/assets/javascripts/wbase/admin/bootstrap-select/js/i18n/defaults-fa_IR.min.js +7 -0
  100. data/app/assets/javascripts/wbase/admin/bootstrap-select/js/i18n/defaults-fi_FI.js +44 -0
  101. data/app/assets/javascripts/wbase/admin/bootstrap-select/js/i18n/defaults-fi_FI.min.js +7 -0
  102. data/app/assets/javascripts/wbase/admin/bootstrap-select/js/i18n/defaults-fr_FR.js +44 -0
  103. data/app/assets/javascripts/wbase/admin/bootstrap-select/js/i18n/defaults-fr_FR.min.js +7 -0
  104. data/app/assets/javascripts/wbase/admin/bootstrap-select/js/i18n/defaults-hu_HU.js +44 -0
  105. data/app/assets/javascripts/wbase/admin/bootstrap-select/js/i18n/defaults-hu_HU.min.js +7 -0
  106. data/app/assets/javascripts/wbase/admin/bootstrap-select/js/i18n/defaults-id_ID.js +37 -0
  107. data/app/assets/javascripts/wbase/admin/bootstrap-select/js/i18n/defaults-id_ID.min.js +7 -0
  108. data/app/assets/javascripts/wbase/admin/bootstrap-select/js/i18n/defaults-it_IT.js +35 -0
  109. data/app/assets/javascripts/wbase/admin/bootstrap-select/js/i18n/defaults-it_IT.min.js +7 -0
  110. data/app/assets/javascripts/wbase/admin/bootstrap-select/js/i18n/defaults-ko_KR.js +44 -0
  111. data/app/assets/javascripts/wbase/admin/bootstrap-select/js/i18n/defaults-ko_KR.min.js +7 -0
  112. data/app/assets/javascripts/wbase/admin/bootstrap-select/js/i18n/defaults-lt_LT.js +44 -0
  113. data/app/assets/javascripts/wbase/admin/bootstrap-select/js/i18n/defaults-lt_LT.min.js +7 -0
  114. data/app/assets/javascripts/wbase/admin/bootstrap-select/js/i18n/defaults-nb_NO.js +70 -0
  115. data/app/assets/javascripts/wbase/admin/bootstrap-select/js/i18n/defaults-nb_NO.min.js +13 -0
  116. data/app/assets/javascripts/wbase/admin/bootstrap-select/js/i18n/defaults-nl_NL.js +35 -0
  117. data/app/assets/javascripts/wbase/admin/bootstrap-select/js/i18n/defaults-nl_NL.min.js +7 -0
  118. data/app/assets/javascripts/wbase/admin/bootstrap-select/js/i18n/defaults-pl_PL.js +37 -0
  119. data/app/assets/javascripts/wbase/admin/bootstrap-select/js/i18n/defaults-pl_PL.min.js +7 -0
  120. data/app/assets/javascripts/wbase/admin/bootstrap-select/js/i18n/defaults-pt_BR.js +35 -0
  121. data/app/assets/javascripts/wbase/admin/bootstrap-select/js/i18n/defaults-pt_BR.min.js +7 -0
  122. data/app/assets/javascripts/wbase/admin/bootstrap-select/js/i18n/defaults-pt_PT.js +35 -0
  123. data/app/assets/javascripts/wbase/admin/bootstrap-select/js/i18n/defaults-pt_PT.min.js +7 -0
  124. data/app/assets/javascripts/wbase/admin/bootstrap-select/js/i18n/defaults-ro_RO.js +35 -0
  125. data/app/assets/javascripts/wbase/admin/bootstrap-select/js/i18n/defaults-ro_RO.min.js +7 -0
  126. data/app/assets/javascripts/wbase/admin/bootstrap-select/js/i18n/defaults-ru_RU.js +36 -0
  127. data/app/assets/javascripts/wbase/admin/bootstrap-select/js/i18n/defaults-ru_RU.min.js +7 -0
  128. data/app/assets/javascripts/wbase/admin/bootstrap-select/js/i18n/defaults-sk_SK.js +37 -0
  129. data/app/assets/javascripts/wbase/admin/bootstrap-select/js/i18n/defaults-sk_SK.min.js +7 -0
  130. data/app/assets/javascripts/wbase/admin/bootstrap-select/js/i18n/defaults-sl_SI.js +44 -0
  131. data/app/assets/javascripts/wbase/admin/bootstrap-select/js/i18n/defaults-sl_SI.min.js +7 -0
  132. data/app/assets/javascripts/wbase/admin/bootstrap-select/js/i18n/defaults-sv_SE.js +44 -0
  133. data/app/assets/javascripts/wbase/admin/bootstrap-select/js/i18n/defaults-sv_SE.min.js +7 -0
  134. data/app/assets/javascripts/wbase/admin/bootstrap-select/js/i18n/defaults-tr_TR.js +44 -0
  135. data/app/assets/javascripts/wbase/admin/bootstrap-select/js/i18n/defaults-tr_TR.min.js +7 -0
  136. data/app/assets/javascripts/wbase/admin/bootstrap-select/js/i18n/defaults-ua_UA.js +35 -0
  137. data/app/assets/javascripts/wbase/admin/bootstrap-select/js/i18n/defaults-ua_UA.min.js +7 -0
  138. data/app/assets/javascripts/wbase/admin/bootstrap-select/js/i18n/defaults-zh_CN.js +35 -0
  139. data/app/assets/javascripts/wbase/admin/bootstrap-select/js/i18n/defaults-zh_CN.min.js +7 -0
  140. data/app/assets/javascripts/wbase/admin/bootstrap-select/js/i18n/defaults-zh_TW.js +37 -0
  141. data/app/assets/javascripts/wbase/admin/bootstrap-select/js/i18n/defaults-zh_TW.min.js +7 -0
  142. data/app/assets/javascripts/wbase/admin/bootstrap-slider/css/bootstrap-slider.min.css +28 -0
  143. data/app/assets/javascripts/wbase/admin/bootstrap-slider/js/bootstrap-slider.min.js +29 -0
  144. data/app/assets/javascripts/wbase/admin/bootstrap-sweetalert/sweet-alert.css +564 -0
  145. data/app/assets/javascripts/wbase/admin/bootstrap-sweetalert/sweet-alert.js +745 -0
  146. data/app/assets/javascripts/wbase/admin/bootstrap-sweetalert/sweet-alert.min.js +1 -0
  147. data/app/assets/javascripts/wbase/admin/bootstrap-sweetalert/thumbs-up.jpg +0 -0
  148. data/app/assets/javascripts/wbase/admin/bootstrap-table/css/bootstrap-table.min.css +1 -0
  149. data/app/assets/javascripts/wbase/admin/bootstrap-table/js/bootstrap-table.min.js +8 -0
  150. data/app/assets/javascripts/wbase/admin/bootstrap-tagsinput/css/bootstrap-tagsinput.css +60 -0
  151. data/app/assets/javascripts/wbase/admin/bootstrap-tagsinput/js/bootstrap-tagsinput.min.js +7 -0
  152. data/app/assets/javascripts/wbase/admin/bootstrap-touchspin/css/jquery.bootstrap-touchspin.min.css +10 -0
  153. data/app/assets/javascripts/wbase/admin/bootstrap-touchspin/js/jquery.bootstrap-touchspin.min.js +9 -0
  154. data/app/assets/javascripts/wbase/admin/bootstrap.min.js +7 -0
  155. data/app/assets/javascripts/wbase/admin/c3/c3.css +158 -0
  156. data/app/assets/javascripts/wbase/admin/c3/c3.js +7049 -0
  157. data/app/assets/javascripts/wbase/admin/c3/c3.min.css +1 -0
  158. data/app/assets/javascripts/wbase/admin/c3/c3.min.js +5 -0
  159. data/app/assets/javascripts/wbase/admin/chart.js/chart.min.js +14 -0
  160. data/app/assets/javascripts/wbase/admin/chartist/css/chartist.min.css +1 -0
  161. data/app/assets/javascripts/wbase/admin/chartist/js/chartist-plugin-tooltip.min.js +8 -0
  162. data/app/assets/javascripts/wbase/admin/chartist/js/chartist.min.js +10 -0
  163. data/app/assets/javascripts/wbase/admin/clockpicker/css/bootstrap-clockpicker.min.css +5 -0
  164. data/app/assets/javascripts/wbase/admin/clockpicker/js/bootstrap-clockpicker.min.js +6 -0
  165. data/app/assets/javascripts/wbase/admin/codemirror/css/ambiance.css +74 -0
  166. data/app/assets/javascripts/wbase/admin/codemirror/css/codemirror.css +347 -0
  167. data/app/assets/javascripts/wbase/admin/codemirror/js/codemirror.js +8935 -0
  168. data/app/assets/javascripts/wbase/admin/codemirror/js/formatting.js +108 -0
  169. data/app/assets/javascripts/wbase/admin/codemirror/js/javascript.js +638 -0
  170. data/app/assets/javascripts/wbase/admin/codemirror/js/xml.js +333 -0
  171. data/app/assets/javascripts/wbase/admin/countdown/dest/countdown.js +195 -0
  172. data/app/assets/javascripts/wbase/admin/countdown/dest/countdown.min.js +1 -0
  173. data/app/assets/javascripts/wbase/admin/countdown/dest/jquery.countdown.js +215 -0
  174. data/app/assets/javascripts/wbase/admin/countdown/dest/jquery.countdown.min.js +1 -0
  175. data/app/assets/javascripts/wbase/admin/countdown/src/countdown.js +191 -0
  176. data/app/assets/javascripts/wbase/admin/countdown/src/jquery-wrapper.js +18 -0
  177. data/app/assets/javascripts/wbase/admin/counterup/jquery.counterup.min.js +8 -0
  178. data/app/assets/javascripts/wbase/admin/cropper/cropper.css +315 -0
  179. data/app/assets/javascripts/wbase/admin/cropper/cropper.js +2457 -0
  180. data/app/assets/javascripts/wbase/admin/cropper/cropper.min.css +9 -0
  181. data/app/assets/javascripts/wbase/admin/cropper/cropper.min.js +9 -0
  182. data/app/assets/javascripts/wbase/admin/custombox/css/custombox.css +872 -0
  183. data/app/assets/javascripts/wbase/admin/custombox/js/custombox.min.js +10 -0
  184. data/app/assets/javascripts/wbase/admin/custombox/js/legacy.min.js +18 -0
  185. data/app/assets/javascripts/wbase/admin/d3/d3.js +9426 -0
  186. data/app/assets/javascripts/wbase/admin/d3/d3.min.js +5 -0
  187. data/app/assets/javascripts/wbase/admin/datatables/buttons.bootstrap.min.js +6 -0
  188. data/app/assets/javascripts/wbase/admin/datatables/buttons.html5.min.js +20 -0
  189. data/app/assets/javascripts/wbase/admin/datatables/buttons.print.min.js +4 -0
  190. data/app/assets/javascripts/wbase/admin/datatables/dataTables.bootstrap.js +186 -0
  191. data/app/assets/javascripts/wbase/admin/datatables/dataTables.buttons.min.js +35 -0
  192. data/app/assets/javascripts/wbase/admin/datatables/dataTables.colVis.js +1107 -0
  193. data/app/assets/javascripts/wbase/admin/datatables/dataTables.fixedColumns.min.js +35 -0
  194. data/app/assets/javascripts/wbase/admin/datatables/dataTables.fixedHeader.min.js +16 -0
  195. data/app/assets/javascripts/wbase/admin/datatables/dataTables.keyTable.min.js +18 -0
  196. data/app/assets/javascripts/wbase/admin/datatables/dataTables.responsive.min.js +23 -0
  197. data/app/assets/javascripts/wbase/admin/datatables/dataTables.scroller.min.js +25 -0
  198. data/app/assets/javascripts/wbase/admin/datatables/jquery.dataTables.min.js +163 -0
  199. data/app/assets/javascripts/wbase/admin/datatables/json/scroller-demo.json +2502 -0
  200. data/app/assets/javascripts/wbase/admin/datatables/jszip.min.js +14 -0
  201. data/app/assets/javascripts/wbase/admin/datatables/pdfmake.min.js +22 -0
  202. data/app/assets/javascripts/wbase/admin/datatables/responsive.bootstrap.min.js +7 -0
  203. data/app/assets/javascripts/wbase/admin/datatables/vfs_fonts.js +1 -0
  204. data/app/assets/javascripts/wbase/admin/datatables.editable.init.js +244 -0
  205. data/app/assets/javascripts/wbase/admin/datatables.init.js +37 -0
  206. data/app/assets/javascripts/wbase/admin/detect.js +7 -0
  207. data/app/assets/javascripts/wbase/admin/doc-ready/README.md +23 -0
  208. data/app/assets/javascripts/wbase/admin/doc-ready/bower.json +35 -0
  209. data/app/assets/javascripts/wbase/admin/doc-ready/doc-ready.js +80 -0
  210. data/app/assets/javascripts/wbase/admin/dropzone/basic.css +39 -0
  211. data/app/assets/javascripts/wbase/admin/dropzone/dropzone-amd-module.js +1743 -0
  212. data/app/assets/javascripts/wbase/admin/dropzone/dropzone.css +388 -0
  213. data/app/assets/javascripts/wbase/admin/dropzone/dropzone.js +1728 -0
  214. data/app/assets/javascripts/wbase/admin/dropzone/readme.md +10 -0
  215. data/app/assets/javascripts/wbase/admin/easy-pie-chart.init.js +63 -0
  216. data/app/assets/javascripts/wbase/admin/eventEmitter/EventEmitter.js +472 -0
  217. data/app/assets/javascripts/wbase/admin/eventEmitter/EventEmitter.min.js +7 -0
  218. data/app/assets/javascripts/wbase/admin/eventie/eventie.js +82 -0
  219. data/app/assets/javascripts/wbase/admin/fastclick.js +841 -0
  220. data/app/assets/javascripts/wbase/admin/fizzy-ui-utils/utils.js +270 -0
  221. data/app/assets/javascripts/wbase/admin/flot-chart/jquery.flot.crosshair.js +176 -0
  222. data/app/assets/javascripts/wbase/admin/flot-chart/jquery.flot.min.js +8 -0
  223. data/app/assets/javascripts/wbase/admin/flot-chart/jquery.flot.orderBars.min.js +186 -0
  224. data/app/assets/javascripts/wbase/admin/flot-chart/jquery.flot.pie.js +820 -0
  225. data/app/assets/javascripts/wbase/admin/flot-chart/jquery.flot.resize.js +59 -0
  226. data/app/assets/javascripts/wbase/admin/flot-chart/jquery.flot.selection.js +360 -0
  227. data/app/assets/javascripts/wbase/admin/flot-chart/jquery.flot.stack.js +188 -0
  228. data/app/assets/javascripts/wbase/admin/flot-chart/jquery.flot.time.js +432 -0
  229. data/app/assets/javascripts/wbase/admin/flot-chart/jquery.flot.tooltip.min.js +12 -0
  230. data/app/assets/javascripts/wbase/admin/footable/css/fonts/footable.eot +0 -0
  231. data/app/assets/javascripts/wbase/admin/footable/css/fonts/footable.svg +78 -0
  232. data/app/assets/javascripts/wbase/admin/footable/css/fonts/footable.ttf +0 -0
  233. data/app/assets/javascripts/wbase/admin/footable/css/fonts/footable.woff +0 -0
  234. data/app/assets/javascripts/wbase/admin/footable/css/footable.core.css +181 -0
  235. data/app/assets/javascripts/wbase/admin/footable/js/footable.all.min.js +14 -0
  236. data/app/assets/javascripts/wbase/admin/form-validation-init.js +106 -0
  237. data/app/assets/javascripts/wbase/admin/fullcalendar/css/fullcalendar.min.css +5 -0
  238. data/app/assets/javascripts/wbase/admin/fullcalendar/js/fullcalendar.min.js +9 -0
  239. data/app/assets/javascripts/wbase/admin/get-size/get-size.js +250 -0
  240. data/app/assets/javascripts/wbase/admin/get-style-property/get-style-property.js +55 -0
  241. data/app/assets/javascripts/wbase/admin/gmaps/gmaps.js +2204 -0
  242. data/app/assets/javascripts/wbase/admin/gmaps/gmaps.min.js +2 -0
  243. data/app/assets/javascripts/wbase/admin/gmaps/gmaps.min.js.map +1 -0
  244. data/app/assets/javascripts/wbase/admin/gmaps/lib/gmaps.controls.js +83 -0
  245. data/app/assets/javascripts/wbase/admin/gmaps/lib/gmaps.core.js +488 -0
  246. data/app/assets/javascripts/wbase/admin/gmaps/lib/gmaps.events.js +54 -0
  247. data/app/assets/javascripts/wbase/admin/gmaps/lib/gmaps.geofences.js +14 -0
  248. data/app/assets/javascripts/wbase/admin/gmaps/lib/gmaps.geometry.js +205 -0
  249. data/app/assets/javascripts/wbase/admin/gmaps/lib/gmaps.layers.js +158 -0
  250. data/app/assets/javascripts/wbase/admin/gmaps/lib/gmaps.map_types.js +29 -0
  251. data/app/assets/javascripts/wbase/admin/gmaps/lib/gmaps.markers.js +210 -0
  252. data/app/assets/javascripts/wbase/admin/gmaps/lib/gmaps.native_extensions.js +121 -0
  253. data/app/assets/javascripts/wbase/admin/gmaps/lib/gmaps.overlays.js +134 -0
  254. data/app/assets/javascripts/wbase/admin/gmaps/lib/gmaps.routes.js +330 -0
  255. data/app/assets/javascripts/wbase/admin/gmaps/lib/gmaps.static.js +245 -0
  256. data/app/assets/javascripts/wbase/admin/gmaps/lib/gmaps.streetview.js +44 -0
  257. data/app/assets/javascripts/wbase/admin/gmaps/lib/gmaps.styles.js +9 -0
  258. data/app/assets/javascripts/wbase/admin/gmaps/lib/gmaps.utils.js +42 -0
  259. data/app/assets/javascripts/wbase/admin/hopscotch/css/hopscotch.css +519 -0
  260. data/app/assets/javascripts/wbase/admin/hopscotch/css/hopscotch.min.css +17 -0
  261. data/app/assets/javascripts/wbase/admin/hopscotch/img/sprite-green.png +0 -0
  262. data/app/assets/javascripts/wbase/admin/hopscotch/img/sprite-orange.png +0 -0
  263. data/app/assets/javascripts/wbase/admin/hopscotch/js/hopscotch.js +2536 -0
  264. data/app/assets/javascripts/wbase/admin/hopscotch/js/hopscotch.min.js +17 -0
  265. data/app/assets/javascripts/wbase/admin/ion-rangeslider/ion.rangeSlider.css +150 -0
  266. data/app/assets/javascripts/wbase/admin/ion-rangeslider/ion.rangeSlider.min.js +76 -0
  267. data/app/assets/javascripts/wbase/admin/ion-rangeslider/ion.rangeSlider.skinFlat.css +106 -0
  268. data/app/assets/javascripts/wbase/admin/ion-rangeslider/sprite-skin-flat.png +0 -0
  269. data/app/assets/javascripts/wbase/admin/isotope/js/isotope.pkgd.min.js +12 -0
  270. data/app/assets/javascripts/wbase/admin/jquery-circliful/css/jquery.circliful.css +20 -0
  271. data/app/assets/javascripts/wbase/admin/jquery-circliful/js/jquery.circliful.js +262 -0
  272. data/app/assets/javascripts/wbase/admin/jquery-circliful/js/jquery.circliful.min.js +1 -0
  273. data/app/assets/javascripts/wbase/admin/jquery-datatables-editable/dataTables.bootstrap.js +186 -0
  274. data/app/assets/javascripts/wbase/admin/jquery-datatables-editable/datatables.css +333 -0
  275. data/app/assets/javascripts/wbase/admin/jquery-datatables-editable/jquery.dataTables.js +14951 -0
  276. data/app/assets/javascripts/wbase/admin/jquery-knob/excanvas.js +924 -0
  277. data/app/assets/javascripts/wbase/admin/jquery-knob/jquery.knob.js +805 -0
  278. data/app/assets/javascripts/wbase/admin/jquery-quicksearch/jquery.quicksearch.js +181 -0
  279. data/app/assets/javascripts/wbase/admin/jquery-sparkline/jquery.sparkline.min.js +5 -0
  280. data/app/assets/javascripts/wbase/admin/jquery-ui/external/jquery/jquery.js +9789 -0
  281. data/app/assets/javascripts/wbase/admin/jquery-ui/images/ui-bg_diagonals-thick_18_b81900_40x40.png +0 -0
  282. data/app/assets/javascripts/wbase/admin/jquery-ui/images/ui-bg_diagonals-thick_20_666666_40x40.png +0 -0
  283. data/app/assets/javascripts/wbase/admin/jquery-ui/images/ui-bg_flat_10_000000_40x100.png +0 -0
  284. data/app/assets/javascripts/wbase/admin/jquery-ui/images/ui-bg_glass_100_f6f6f6_1x400.png +0 -0
  285. data/app/assets/javascripts/wbase/admin/jquery-ui/images/ui-bg_glass_100_fdf5ce_1x400.png +0 -0
  286. data/app/assets/javascripts/wbase/admin/jquery-ui/images/ui-bg_glass_65_ffffff_1x400.png +0 -0
  287. data/app/assets/javascripts/wbase/admin/jquery-ui/images/ui-bg_gloss-wave_35_f6a828_500x100.png +0 -0
  288. data/app/assets/javascripts/wbase/admin/jquery-ui/images/ui-bg_highlight-soft_100_eeeeee_1x100.png +0 -0
  289. data/app/assets/javascripts/wbase/admin/jquery-ui/images/ui-bg_highlight-soft_75_ffe45c_1x100.png +0 -0
  290. data/app/assets/javascripts/wbase/admin/jquery-ui/images/ui-icons_222222_256x240.png +0 -0
  291. data/app/assets/javascripts/wbase/admin/jquery-ui/images/ui-icons_228ef1_256x240.png +0 -0
  292. data/app/assets/javascripts/wbase/admin/jquery-ui/images/ui-icons_ef8c08_256x240.png +0 -0
  293. data/app/assets/javascripts/wbase/admin/jquery-ui/images/ui-icons_ffd27a_256x240.png +0 -0
  294. data/app/assets/javascripts/wbase/admin/jquery-ui/images/ui-icons_ffffff_256x240.png +0 -0
  295. data/app/assets/javascripts/wbase/admin/jquery-ui/index.html +513 -0
  296. data/app/assets/javascripts/wbase/admin/jquery-ui/jquery-ui.css +1225 -0
  297. data/app/assets/javascripts/wbase/admin/jquery-ui/jquery-ui.js +16617 -0
  298. data/app/assets/javascripts/wbase/admin/jquery-ui/jquery-ui.min.css +7 -0
  299. data/app/assets/javascripts/wbase/admin/jquery-ui/jquery-ui.min.js +13 -0
  300. data/app/assets/javascripts/wbase/admin/jquery-ui/jquery-ui.structure.css +833 -0
  301. data/app/assets/javascripts/wbase/admin/jquery-ui/jquery-ui.structure.min.css +5 -0
  302. data/app/assets/javascripts/wbase/admin/jquery-ui/jquery-ui.theme.css +410 -0
  303. data/app/assets/javascripts/wbase/admin/jquery-ui/jquery-ui.theme.min.css +5 -0
  304. data/app/assets/javascripts/wbase/admin/jquery-validation/js/jquery.validate.min.js +4 -0
  305. data/app/assets/javascripts/wbase/admin/jquery.app.js +318 -0
  306. data/app/assets/javascripts/wbase/admin/jquery.blockUI.js +620 -0
  307. data/app/assets/javascripts/wbase/admin/jquery.bs-table.js +93 -0
  308. data/app/assets/javascripts/wbase/admin/jquery.c3-chart.init.js +225 -0
  309. data/app/assets/javascripts/wbase/admin/jquery.chartist.init.js +860 -0
  310. data/app/assets/javascripts/wbase/admin/jquery.chartjs.init.js +231 -0
  311. data/app/assets/javascripts/wbase/admin/jquery.charts-sparkline.js +149 -0
  312. data/app/assets/javascripts/wbase/admin/jquery.chat.js +60 -0
  313. data/app/assets/javascripts/wbase/admin/jquery.codemirror.init.js +66 -0
  314. data/app/assets/javascripts/wbase/admin/jquery.core.js +323 -0
  315. data/app/assets/javascripts/wbase/admin/jquery.dashboard.js +91 -0
  316. data/app/assets/javascripts/wbase/admin/jquery.dashboard_2.js +57 -0
  317. data/app/assets/javascripts/wbase/admin/jquery.dashboard_3.js +64 -0
  318. data/app/assets/javascripts/wbase/admin/jquery.dashboard_4.js +81 -0
  319. data/app/assets/javascripts/wbase/admin/jquery.dashboard_crm.js +104 -0
  320. data/app/assets/javascripts/wbase/admin/jquery.dashboard_ecommerce.js +57 -0
  321. data/app/assets/javascripts/wbase/admin/jquery.easy-pie-chart/dist/angular.easypiechart.js +397 -0
  322. data/app/assets/javascripts/wbase/admin/jquery.easy-pie-chart/dist/angular.easypiechart.min.js +9 -0
  323. data/app/assets/javascripts/wbase/admin/jquery.easy-pie-chart/dist/easypiechart.js +351 -0
  324. data/app/assets/javascripts/wbase/admin/jquery.easy-pie-chart/dist/easypiechart.min.js +9 -0
  325. data/app/assets/javascripts/wbase/admin/jquery.easy-pie-chart/dist/jquery.easypiechart.js +360 -0
  326. data/app/assets/javascripts/wbase/admin/jquery.easy-pie-chart/dist/jquery.easypiechart.min.js +9 -0
  327. data/app/assets/javascripts/wbase/admin/jquery.easy-pie-chart/src/angular.directive.js +48 -0
  328. data/app/assets/javascripts/wbase/admin/jquery.easy-pie-chart/src/easypiechart.js +134 -0
  329. data/app/assets/javascripts/wbase/admin/jquery.easy-pie-chart/src/jquery.plugin.js +10 -0
  330. data/app/assets/javascripts/wbase/admin/jquery.easy-pie-chart/src/renderer/canvas.js +190 -0
  331. data/app/assets/javascripts/wbase/admin/jquery.flot.init.js +500 -0
  332. data/app/assets/javascripts/wbase/admin/jquery.footable.js +86 -0
  333. data/app/assets/javascripts/wbase/admin/jquery.form-advanced.init.js +126 -0
  334. data/app/assets/javascripts/wbase/admin/jquery.form-pickers.init.js +130 -0
  335. data/app/assets/javascripts/wbase/admin/jquery.fullcalendar.js +202 -0
  336. data/app/assets/javascripts/wbase/admin/jquery.gmaps.js +226 -0
  337. data/app/assets/javascripts/wbase/admin/jquery.jsgrid.init.js +123 -0
  338. data/app/assets/javascripts/wbase/admin/jquery.leads.init.js +53 -0
  339. data/app/assets/javascripts/wbase/admin/jquery.min.js +5 -0
  340. data/app/assets/javascripts/wbase/admin/jquery.nicescroll.js +113 -0
  341. data/app/assets/javascripts/wbase/admin/jquery.nvd3.init.js +297 -0
  342. data/app/assets/javascripts/wbase/admin/jquery.opportunities.init.js +49 -0
  343. data/app/assets/javascripts/wbase/admin/jquery.peity.init.js +49 -0
  344. data/app/assets/javascripts/wbase/admin/jquery.rickshaw.chart.init.js +288 -0
  345. data/app/assets/javascripts/wbase/admin/jquery.scrollTo.min.js +7 -0
  346. data/app/assets/javascripts/wbase/admin/jquery.slimscroll.js +474 -0
  347. data/app/assets/javascripts/wbase/admin/jquery.steps/css/jquery.steps.css +382 -0
  348. data/app/assets/javascripts/wbase/admin/jquery.steps/js/jquery.steps.min.js +6 -0
  349. data/app/assets/javascripts/wbase/admin/jquery.sweet-alert.init.js +162 -0
  350. data/app/assets/javascripts/wbase/admin/jquery.todo.js +153 -0
  351. data/app/assets/javascripts/wbase/admin/jquery.tree.js +89 -0
  352. data/app/assets/javascripts/wbase/admin/jquery.ui-sliders.js +66 -0
  353. data/app/assets/javascripts/wbase/admin/jquery.widgets.js +149 -0
  354. data/app/assets/javascripts/wbase/admin/jquery.wizard-init.js +87 -0
  355. data/app/assets/javascripts/wbase/admin/jquery.xeditable.js +117 -0
  356. data/app/assets/javascripts/wbase/admin/jsgrid/css/jsgrid-theme.css +258 -0
  357. data/app/assets/javascripts/wbase/admin/jsgrid/css/jsgrid-theme.min.css +7 -0
  358. data/app/assets/javascripts/wbase/admin/jsgrid/css/jsgrid.css +126 -0
  359. data/app/assets/javascripts/wbase/admin/jsgrid/css/jsgrid.min.css +7 -0
  360. data/app/assets/javascripts/wbase/admin/jsgrid/js/jsgrid.js +2508 -0
  361. data/app/assets/javascripts/wbase/admin/jsgrid/js/jsgrid.min.js +8 -0
  362. data/app/assets/javascripts/wbase/admin/jstree/32px.png +0 -0
  363. data/app/assets/javascripts/wbase/admin/jstree/40px.png +0 -0
  364. data/app/assets/javascripts/wbase/admin/jstree/ajax_children.json +1 -0
  365. data/app/assets/javascripts/wbase/admin/jstree/ajax_roots.json +8 -0
  366. data/app/assets/javascripts/wbase/admin/jstree/jstree.js +7988 -0
  367. data/app/assets/javascripts/wbase/admin/jstree/jstree.min.js +6 -0
  368. data/app/assets/javascripts/wbase/admin/jstree/style.css +1066 -0
  369. data/app/assets/javascripts/wbase/admin/jstree/style.min.css +1 -0
  370. data/app/assets/javascripts/wbase/admin/jstree/themes/dark/32px.png +0 -0
  371. data/app/assets/javascripts/wbase/admin/jstree/themes/dark/40px.png +0 -0
  372. data/app/assets/javascripts/wbase/admin/jstree/themes/dark/style.css +1110 -0
  373. data/app/assets/javascripts/wbase/admin/jstree/themes/dark/style.min.css +1 -0
  374. data/app/assets/javascripts/wbase/admin/jstree/themes/dark/throbber.gif +0 -0
  375. data/app/assets/javascripts/wbase/admin/jstree/throbber.gif +0 -0
  376. data/app/assets/javascripts/wbase/admin/justgage-toorshia/justgage.js +1051 -0
  377. data/app/assets/javascripts/wbase/admin/jvectormap/gdp-data.js +185 -0
  378. data/app/assets/javascripts/wbase/admin/jvectormap/jquery-jvectormap-2.0.2.css +130 -0
  379. data/app/assets/javascripts/wbase/admin/jvectormap/jquery-jvectormap-2.0.2.min.js +3328 -0
  380. data/app/assets/javascripts/wbase/admin/jvectormap/jquery-jvectormap-asia-mill.js +1 -0
  381. data/app/assets/javascripts/wbase/admin/jvectormap/jquery-jvectormap-au-mill.js +1 -0
  382. data/app/assets/javascripts/wbase/admin/jvectormap/jquery-jvectormap-ca-lcc.js +1 -0
  383. data/app/assets/javascripts/wbase/admin/jvectormap/jquery-jvectormap-de-mill.js +1 -0
  384. data/app/assets/javascripts/wbase/admin/jvectormap/jquery-jvectormap-europe-mill-en.js +1 -0
  385. data/app/assets/javascripts/wbase/admin/jvectormap/jquery-jvectormap-in-mill.js +1 -0
  386. data/app/assets/javascripts/wbase/admin/jvectormap/jquery-jvectormap-uk-mill-en.js +1 -0
  387. data/app/assets/javascripts/wbase/admin/jvectormap/jquery-jvectormap-us-aea-en.js +1 -0
  388. data/app/assets/javascripts/wbase/admin/jvectormap/jquery-jvectormap-us-il-chicago-mill-en.js +1 -0
  389. data/app/assets/javascripts/wbase/admin/jvectormap/jquery-jvectormap-world-mill-en.js +1 -0
  390. data/app/assets/javascripts/wbase/admin/jvectormap.init.js +215 -0
  391. data/app/assets/javascripts/wbase/admin/ladda-buttons/css/ladda-themeless.min.css +7 -0
  392. data/app/assets/javascripts/wbase/admin/ladda-buttons/js/ladda.jquery.min.js +8 -0
  393. data/app/assets/javascripts/wbase/admin/ladda-buttons/js/ladda.min.js +8 -0
  394. data/app/assets/javascripts/wbase/admin/ladda-buttons/js/spin.min.js +1 -0
  395. data/app/assets/javascripts/wbase/admin/magnific-popup/css/magnific-popup.css +369 -0
  396. data/app/assets/javascripts/wbase/admin/magnific-popup/js/jquery.magnific-popup.min.js +4 -0
  397. data/app/assets/javascripts/wbase/admin/masonry/dist/masonry.pkgd.js +3189 -0
  398. data/app/assets/javascripts/wbase/admin/masonry/dist/masonry.pkgd.min.js +9 -0
  399. data/app/assets/javascripts/wbase/admin/masonry/masonry.js +203 -0
  400. data/app/assets/javascripts/wbase/admin/masonry/sandbox/basic.html +62 -0
  401. data/app/assets/javascripts/wbase/admin/masonry/sandbox/bottom-up.html +119 -0
  402. data/app/assets/javascripts/wbase/admin/masonry/sandbox/browserify/index.html +42 -0
  403. data/app/assets/javascripts/wbase/admin/masonry/sandbox/browserify/main.js +19 -0
  404. data/app/assets/javascripts/wbase/admin/masonry/sandbox/element-sizing.html +69 -0
  405. data/app/assets/javascripts/wbase/admin/masonry/sandbox/fit-width.html +68 -0
  406. data/app/assets/javascripts/wbase/admin/masonry/sandbox/fluid.html +89 -0
  407. data/app/assets/javascripts/wbase/admin/masonry/sandbox/jquery.html +64 -0
  408. data/app/assets/javascripts/wbase/admin/masonry/sandbox/require-js/index.html +41 -0
  409. data/app/assets/javascripts/wbase/admin/masonry/sandbox/require-js/main.js +69 -0
  410. data/app/assets/javascripts/wbase/admin/masonry/sandbox/right-to-left.html +120 -0
  411. data/app/assets/javascripts/wbase/admin/masonry/sandbox/sandbox.css +33 -0
  412. data/app/assets/javascripts/wbase/admin/masonry/sandbox/stamps.html +124 -0
  413. data/app/assets/javascripts/wbase/admin/matches-selector/matches-selector.js +107 -0
  414. data/app/assets/javascripts/wbase/admin/mjolnic-bootstrap-colorpicker/dist/css/bootstrap-colorpicker.css +251 -0
  415. data/app/assets/javascripts/wbase/admin/mjolnic-bootstrap-colorpicker/dist/css/bootstrap-colorpicker.min.css +9 -0
  416. data/app/assets/javascripts/wbase/admin/mjolnic-bootstrap-colorpicker/dist/img/bootstrap-colorpicker/alpha-horizontal.png +0 -0
  417. data/app/assets/javascripts/wbase/admin/mjolnic-bootstrap-colorpicker/dist/img/bootstrap-colorpicker/alpha.png +0 -0
  418. data/app/assets/javascripts/wbase/admin/mjolnic-bootstrap-colorpicker/dist/img/bootstrap-colorpicker/hue-horizontal.png +0 -0
  419. data/app/assets/javascripts/wbase/admin/mjolnic-bootstrap-colorpicker/dist/img/bootstrap-colorpicker/hue.png +0 -0
  420. data/app/assets/javascripts/wbase/admin/mjolnic-bootstrap-colorpicker/dist/img/bootstrap-colorpicker/saturation.png +0 -0
  421. data/app/assets/javascripts/wbase/admin/mjolnic-bootstrap-colorpicker/dist/js/bootstrap-colorpicker.js +1079 -0
  422. data/app/assets/javascripts/wbase/admin/mjolnic-bootstrap-colorpicker/dist/js/bootstrap-colorpicker.min.js +1 -0
  423. data/app/assets/javascripts/wbase/admin/mocha/media/logo.svg +8 -0
  424. data/app/assets/javascripts/wbase/admin/mocha/mocha.css +270 -0
  425. data/app/assets/javascripts/wbase/admin/mocha/mocha.js +5812 -0
  426. data/app/assets/javascripts/wbase/admin/modal-effect/css/component.css +743 -0
  427. data/app/assets/javascripts/wbase/admin/modal-effect/js/classie.js +80 -0
  428. data/app/assets/javascripts/wbase/admin/modal-effect/js/modalEffects.js +57 -0
  429. data/app/assets/javascripts/wbase/admin/modernizr.min.js +1 -0
  430. data/app/assets/javascripts/wbase/admin/moment/moment.js +4195 -0
  431. data/app/assets/javascripts/wbase/admin/morris/morris.css +2 -0
  432. data/app/assets/javascripts/wbase/admin/morris/morris.min.js +7 -0
  433. data/app/assets/javascripts/wbase/admin/morris.init.js +184 -0
  434. data/app/assets/javascripts/wbase/admin/morris.min.js +7 -0
  435. data/app/assets/javascripts/wbase/admin/multiselect/css/multi-select.css +93 -0
  436. data/app/assets/javascripts/wbase/admin/multiselect/img/switch.png +0 -0
  437. data/app/assets/javascripts/wbase/admin/multiselect/js/jquery.multi-select.js +528 -0
  438. data/app/assets/javascripts/wbase/admin/nestable/jquery.nestable.css +74 -0
  439. data/app/assets/javascripts/wbase/admin/nestable/jquery.nestable.js +485 -0
  440. data/app/assets/javascripts/wbase/admin/nestable.js +59 -0
  441. data/app/assets/javascripts/wbase/admin/notifications/notification.css +56 -0
  442. data/app/assets/javascripts/wbase/admin/notifications/notify-metro.js +51 -0
  443. data/app/assets/javascripts/wbase/admin/notifications/notify.min.js +5 -0
  444. data/app/assets/javascripts/wbase/admin/notifyjs/js/notify.js +625 -0
  445. data/app/assets/javascripts/wbase/admin/nvd3/nv.d3.min.css +1 -0
  446. data/app/assets/javascripts/wbase/admin/nvd3/nv.d3.min.js +8 -0
  447. data/app/assets/javascripts/wbase/admin/outlayer/item.js +586 -0
  448. data/app/assets/javascripts/wbase/admin/outlayer/outlayer.js +926 -0
  449. data/app/assets/javascripts/wbase/admin/owl.carousel/dist/LICENSE +22 -0
  450. data/app/assets/javascripts/wbase/admin/owl.carousel/dist/README.md +158 -0
  451. data/app/assets/javascripts/wbase/admin/owl.carousel/dist/assets/ajax-loader.gif +0 -0
  452. data/app/assets/javascripts/wbase/admin/owl.carousel/dist/assets/owl.carousel.css +179 -0
  453. data/app/assets/javascripts/wbase/admin/owl.carousel/dist/assets/owl.carousel.min.css +1 -0
  454. data/app/assets/javascripts/wbase/admin/owl.carousel/dist/assets/owl.theme.default.css +51 -0
  455. data/app/assets/javascripts/wbase/admin/owl.carousel/dist/assets/owl.theme.default.min.css +1 -0
  456. data/app/assets/javascripts/wbase/admin/owl.carousel/dist/assets/owl.theme.green.css +51 -0
  457. data/app/assets/javascripts/wbase/admin/owl.carousel/dist/assets/owl.theme.green.min.css +1 -0
  458. data/app/assets/javascripts/wbase/admin/owl.carousel/dist/assets/owl.video.play.png +0 -0
  459. data/app/assets/javascripts/wbase/admin/owl.carousel/dist/owl.carousel.js +3148 -0
  460. data/app/assets/javascripts/wbase/admin/owl.carousel/dist/owl.carousel.min.js +2 -0
  461. data/app/assets/javascripts/wbase/admin/owl.carousel/src/css/owl.animate.css +29 -0
  462. data/app/assets/javascripts/wbase/admin/owl.carousel/src/css/owl.autoheight.css +9 -0
  463. data/app/assets/javascripts/wbase/admin/owl.carousel/src/css/owl.carousel.css +74 -0
  464. data/app/assets/javascripts/wbase/admin/owl.carousel/src/css/owl.lazyload.css +12 -0
  465. data/app/assets/javascripts/wbase/admin/owl.carousel/src/css/owl.theme.default.css +51 -0
  466. data/app/assets/javascripts/wbase/admin/owl.carousel/src/css/owl.theme.green.css +51 -0
  467. data/app/assets/javascripts/wbase/admin/owl.carousel/src/css/owl.video.css +51 -0
  468. data/app/assets/javascripts/wbase/admin/owl.carousel/src/img/ajax-loader.gif +0 -0
  469. data/app/assets/javascripts/wbase/admin/owl.carousel/src/img/owl.video.play.png +0 -0
  470. data/app/assets/javascripts/wbase/admin/owl.carousel/src/js/owl.animate.js +120 -0
  471. data/app/assets/javascripts/wbase/admin/owl.carousel/src/js/owl.autoheight.js +96 -0
  472. data/app/assets/javascripts/wbase/admin/owl.carousel/src/js/owl.autoplay.js +161 -0
  473. data/app/assets/javascripts/wbase/admin/owl.carousel/src/js/owl.autorefresh.js +110 -0
  474. data/app/assets/javascripts/wbase/admin/owl.carousel/src/js/owl.carousel.js +1654 -0
  475. data/app/assets/javascripts/wbase/admin/owl.carousel/src/js/owl.hash.js +121 -0
  476. data/app/assets/javascripts/wbase/admin/owl.carousel/src/js/owl.lazyload.js +134 -0
  477. data/app/assets/javascripts/wbase/admin/owl.carousel/src/js/owl.navigation.js +381 -0
  478. data/app/assets/javascripts/wbase/admin/owl.carousel/src/js/owl.support.js +82 -0
  479. data/app/assets/javascripts/wbase/admin/owl.carousel/src/js/owl.support.modernizr.js +57 -0
  480. data/app/assets/javascripts/wbase/admin/owl.carousel/src/js/owl.video.js +280 -0
  481. data/app/assets/javascripts/wbase/admin/owl.carousel/src/scss/_mixins.scss +21 -0
  482. data/app/assets/javascripts/wbase/admin/owl.carousel/src/scss/_theme.scss +63 -0
  483. data/app/assets/javascripts/wbase/admin/owl.carousel/src/scss/owl.animate.scss +40 -0
  484. data/app/assets/javascripts/wbase/admin/owl.carousel/src/scss/owl.autoheight.scss +9 -0
  485. data/app/assets/javascripts/wbase/admin/owl.carousel/src/scss/owl.carousel.scss +108 -0
  486. data/app/assets/javascripts/wbase/admin/owl.carousel/src/scss/owl.lazyload.scss +18 -0
  487. data/app/assets/javascripts/wbase/admin/owl.carousel/src/scss/owl.theme.default.scss +31 -0
  488. data/app/assets/javascripts/wbase/admin/owl.carousel/src/scss/owl.theme.green.scss +31 -0
  489. data/app/assets/javascripts/wbase/admin/owl.carousel/src/scss/owl.video.scss +51 -0
  490. data/app/assets/javascripts/wbase/admin/pace.min.js +2 -0
  491. data/app/assets/javascripts/wbase/admin/parsleyjs/parsley.min.js +18 -0
  492. data/app/assets/javascripts/wbase/admin/peity/jquery.peity.js +383 -0
  493. data/app/assets/javascripts/wbase/admin/peity/jquery.peity.min.js +13 -0
  494. data/app/assets/javascripts/wbase/admin/radial/radial.css +736 -0
  495. data/app/assets/javascripts/wbase/admin/raphael/raphael-min.js +11 -0
  496. data/app/assets/javascripts/wbase/admin/requirejs/require.js +2103 -0
  497. data/app/assets/javascripts/wbase/admin/responsive-table/css/rwd-table.min.css +7 -0
  498. data/app/assets/javascripts/wbase/admin/responsive-table/js/rwd-table.min.js +7 -0
  499. data/app/assets/javascripts/wbase/admin/rickshaw-chart/data/data.json +14 -0
  500. data/app/assets/javascripts/wbase/admin/rickshaw-chart/data/data.jsonp +14 -0
  501. data/app/assets/javascripts/wbase/admin/rickshaw-chart/data/data2.json +14 -0
  502. data/app/assets/javascripts/wbase/admin/rickshaw-chart/data/status.json +1 -0
  503. data/app/assets/javascripts/wbase/admin/rickshaw-chart/rickshaw.min.css +1 -0
  504. data/app/assets/javascripts/wbase/admin/rickshaw-chart/rickshaw.min.js +3 -0
  505. data/app/assets/javascripts/wbase/admin/rickshaw-chart/vendor/d3.layout.min.js +1 -0
  506. data/app/assets/javascripts/wbase/admin/rickshaw-chart/vendor/d3.min.js +2 -0
  507. data/app/assets/javascripts/wbase/admin/select2/css/select2.css +484 -0
  508. data/app/assets/javascripts/wbase/admin/select2/css/select2.min.css +1 -0
  509. data/app/assets/javascripts/wbase/admin/select2/js/i18n/ar.js +3 -0
  510. data/app/assets/javascripts/wbase/admin/select2/js/i18n/az.js +3 -0
  511. data/app/assets/javascripts/wbase/admin/select2/js/i18n/bg.js +3 -0
  512. data/app/assets/javascripts/wbase/admin/select2/js/i18n/ca.js +3 -0
  513. data/app/assets/javascripts/wbase/admin/select2/js/i18n/cs.js +3 -0
  514. data/app/assets/javascripts/wbase/admin/select2/js/i18n/da.js +3 -0
  515. data/app/assets/javascripts/wbase/admin/select2/js/i18n/de.js +3 -0
  516. data/app/assets/javascripts/wbase/admin/select2/js/i18n/el.js +3 -0
  517. data/app/assets/javascripts/wbase/admin/select2/js/i18n/en.js +3 -0
  518. data/app/assets/javascripts/wbase/admin/select2/js/i18n/es.js +3 -0
  519. data/app/assets/javascripts/wbase/admin/select2/js/i18n/et.js +3 -0
  520. data/app/assets/javascripts/wbase/admin/select2/js/i18n/eu.js +3 -0
  521. data/app/assets/javascripts/wbase/admin/select2/js/i18n/fa.js +3 -0
  522. data/app/assets/javascripts/wbase/admin/select2/js/i18n/fi.js +3 -0
  523. data/app/assets/javascripts/wbase/admin/select2/js/i18n/fr.js +3 -0
  524. data/app/assets/javascripts/wbase/admin/select2/js/i18n/gl.js +3 -0
  525. data/app/assets/javascripts/wbase/admin/select2/js/i18n/he.js +3 -0
  526. data/app/assets/javascripts/wbase/admin/select2/js/i18n/hi.js +3 -0
  527. data/app/assets/javascripts/wbase/admin/select2/js/i18n/hr.js +3 -0
  528. data/app/assets/javascripts/wbase/admin/select2/js/i18n/hu.js +3 -0
  529. data/app/assets/javascripts/wbase/admin/select2/js/i18n/id.js +3 -0
  530. data/app/assets/javascripts/wbase/admin/select2/js/i18n/is.js +3 -0
  531. data/app/assets/javascripts/wbase/admin/select2/js/i18n/it.js +3 -0
  532. data/app/assets/javascripts/wbase/admin/select2/js/i18n/ja.js +3 -0
  533. data/app/assets/javascripts/wbase/admin/select2/js/i18n/km.js +3 -0
  534. data/app/assets/javascripts/wbase/admin/select2/js/i18n/ko.js +3 -0
  535. data/app/assets/javascripts/wbase/admin/select2/js/i18n/lt.js +3 -0
  536. data/app/assets/javascripts/wbase/admin/select2/js/i18n/lv.js +3 -0
  537. data/app/assets/javascripts/wbase/admin/select2/js/i18n/mk.js +3 -0
  538. data/app/assets/javascripts/wbase/admin/select2/js/i18n/ms.js +3 -0
  539. data/app/assets/javascripts/wbase/admin/select2/js/i18n/nb.js +3 -0
  540. data/app/assets/javascripts/wbase/admin/select2/js/i18n/nl.js +3 -0
  541. data/app/assets/javascripts/wbase/admin/select2/js/i18n/pl.js +3 -0
  542. data/app/assets/javascripts/wbase/admin/select2/js/i18n/pt-BR.js +3 -0
  543. data/app/assets/javascripts/wbase/admin/select2/js/i18n/pt.js +3 -0
  544. data/app/assets/javascripts/wbase/admin/select2/js/i18n/ro.js +3 -0
  545. data/app/assets/javascripts/wbase/admin/select2/js/i18n/ru.js +3 -0
  546. data/app/assets/javascripts/wbase/admin/select2/js/i18n/sk.js +3 -0
  547. data/app/assets/javascripts/wbase/admin/select2/js/i18n/sr-Cyrl.js +3 -0
  548. data/app/assets/javascripts/wbase/admin/select2/js/i18n/sr.js +3 -0
  549. data/app/assets/javascripts/wbase/admin/select2/js/i18n/sv.js +3 -0
  550. data/app/assets/javascripts/wbase/admin/select2/js/i18n/th.js +3 -0
  551. data/app/assets/javascripts/wbase/admin/select2/js/i18n/tr.js +3 -0
  552. data/app/assets/javascripts/wbase/admin/select2/js/i18n/uk.js +3 -0
  553. data/app/assets/javascripts/wbase/admin/select2/js/i18n/vi.js +3 -0
  554. data/app/assets/javascripts/wbase/admin/select2/js/i18n/zh-CN.js +3 -0
  555. data/app/assets/javascripts/wbase/admin/select2/js/i18n/zh-TW.js +3 -0
  556. data/app/assets/javascripts/wbase/admin/select2/js/select2.full.js +6436 -0
  557. data/app/assets/javascripts/wbase/admin/select2/js/select2.full.min.js +3 -0
  558. data/app/assets/javascripts/wbase/admin/select2/js/select2.js +5725 -0
  559. data/app/assets/javascripts/wbase/admin/select2/js/select2.min.js +3 -0
  560. data/app/assets/javascripts/wbase/admin/simple-text-rotator/jquery.simple-text-rotator.min.js +1 -0
  561. data/app/assets/javascripts/wbase/admin/skyicons/skycons.min.js +1 -0
  562. data/app/assets/javascripts/wbase/admin/smoothproducts/css/smoothproducts.css +174 -0
  563. data/app/assets/javascripts/wbase/admin/smoothproducts/js/jquery-2.1.3.min.js +4 -0
  564. data/app/assets/javascripts/wbase/admin/smoothproducts/js/smoothproducts.js +265 -0
  565. data/app/assets/javascripts/wbase/admin/smoothproducts/js/smoothproducts.min.js +1 -0
  566. data/app/assets/javascripts/wbase/admin/summernote/font/summernote.eot +0 -0
  567. data/app/assets/javascripts/wbase/admin/summernote/font/summernote.ttf +0 -0
  568. data/app/assets/javascripts/wbase/admin/summernote/font/summernote.woff +0 -0
  569. data/app/assets/javascripts/wbase/admin/summernote/lang/summernote-ar-AR.js +104 -0
  570. data/app/assets/javascripts/wbase/admin/summernote/lang/summernote-ar-AR.min.js +2 -0
  571. data/app/assets/javascripts/wbase/admin/summernote/lang/summernote-bg-BG.js +99 -0
  572. data/app/assets/javascripts/wbase/admin/summernote/lang/summernote-bg-BG.min.js +2 -0
  573. data/app/assets/javascripts/wbase/admin/summernote/lang/summernote-ca-ES.js +147 -0
  574. data/app/assets/javascripts/wbase/admin/summernote/lang/summernote-ca-ES.min.js +2 -0
  575. data/app/assets/javascripts/wbase/admin/summernote/lang/summernote-cs-CZ.js +103 -0
  576. data/app/assets/javascripts/wbase/admin/summernote/lang/summernote-cs-CZ.min.js +2 -0
  577. data/app/assets/javascripts/wbase/admin/summernote/lang/summernote-da-DK.js +114 -0
  578. data/app/assets/javascripts/wbase/admin/summernote/lang/summernote-da-DK.min.js +2 -0
  579. data/app/assets/javascripts/wbase/admin/summernote/lang/summernote-de-DE.js +110 -0
  580. data/app/assets/javascripts/wbase/admin/summernote/lang/summernote-de-DE.min.js +2 -0
  581. data/app/assets/javascripts/wbase/admin/summernote/lang/summernote-es-ES.js +147 -0
  582. data/app/assets/javascripts/wbase/admin/summernote/lang/summernote-es-ES.min.js +2 -0
  583. data/app/assets/javascripts/wbase/admin/summernote/lang/summernote-es-EU.js +103 -0
  584. data/app/assets/javascripts/wbase/admin/summernote/lang/summernote-es-EU.min.js +2 -0
  585. data/app/assets/javascripts/wbase/admin/summernote/lang/summernote-fa-IR.js +105 -0
  586. data/app/assets/javascripts/wbase/admin/summernote/lang/summernote-fa-IR.min.js +2 -0
  587. data/app/assets/javascripts/wbase/admin/summernote/lang/summernote-fi-FI.js +104 -0
  588. data/app/assets/javascripts/wbase/admin/summernote/lang/summernote-fi-FI.min.js +2 -0
  589. data/app/assets/javascripts/wbase/admin/summernote/lang/summernote-fr-FR.js +115 -0
  590. data/app/assets/javascripts/wbase/admin/summernote/lang/summernote-fr-FR.min.js +2 -0
  591. data/app/assets/javascripts/wbase/admin/summernote/lang/summernote-gl-ES.js +147 -0
  592. data/app/assets/javascripts/wbase/admin/summernote/lang/summernote-gl-ES.min.js +2 -0
  593. data/app/assets/javascripts/wbase/admin/summernote/lang/summernote-he-IL.js +107 -0
  594. data/app/assets/javascripts/wbase/admin/summernote/lang/summernote-he-IL.min.js +2 -0
  595. data/app/assets/javascripts/wbase/admin/summernote/lang/summernote-hr-HR.js +104 -0
  596. data/app/assets/javascripts/wbase/admin/summernote/lang/summernote-hr-HR.min.js +2 -0
  597. data/app/assets/javascripts/wbase/admin/summernote/lang/summernote-hu-HU.js +135 -0
  598. data/app/assets/javascripts/wbase/admin/summernote/lang/summernote-hu-HU.min.js +2 -0
  599. data/app/assets/javascripts/wbase/admin/summernote/lang/summernote-id-ID.js +103 -0
  600. data/app/assets/javascripts/wbase/admin/summernote/lang/summernote-id-ID.min.js +2 -0
  601. data/app/assets/javascripts/wbase/admin/summernote/lang/summernote-it-IT.js +104 -0
  602. data/app/assets/javascripts/wbase/admin/summernote/lang/summernote-it-IT.min.js +2 -0
  603. data/app/assets/javascripts/wbase/admin/summernote/lang/summernote-ja-JP.js +133 -0
  604. data/app/assets/javascripts/wbase/admin/summernote/lang/summernote-ja-JP.min.js +2 -0
  605. data/app/assets/javascripts/wbase/admin/summernote/lang/summernote-ko-KR.js +115 -0
  606. data/app/assets/javascripts/wbase/admin/summernote/lang/summernote-ko-KR.min.js +2 -0
  607. data/app/assets/javascripts/wbase/admin/summernote/lang/summernote-lt-LT.js +107 -0
  608. data/app/assets/javascripts/wbase/admin/summernote/lang/summernote-lt-LT.min.js +2 -0
  609. data/app/assets/javascripts/wbase/admin/summernote/lang/summernote-lt-LV.js +135 -0
  610. data/app/assets/javascripts/wbase/admin/summernote/lang/summernote-lt-LV.min.js +2 -0
  611. data/app/assets/javascripts/wbase/admin/summernote/lang/summernote-nb-NO.js +104 -0
  612. data/app/assets/javascripts/wbase/admin/summernote/lang/summernote-nb-NO.min.js +2 -0
  613. data/app/assets/javascripts/wbase/admin/summernote/lang/summernote-nl-NL.js +104 -0
  614. data/app/assets/javascripts/wbase/admin/summernote/lang/summernote-nl-NL.min.js +2 -0
  615. data/app/assets/javascripts/wbase/admin/summernote/lang/summernote-pl-PL.js +112 -0
  616. data/app/assets/javascripts/wbase/admin/summernote/lang/summernote-pl-PL.min.js +2 -0
  617. data/app/assets/javascripts/wbase/admin/summernote/lang/summernote-pt-BR.js +132 -0
  618. data/app/assets/javascripts/wbase/admin/summernote/lang/summernote-pt-BR.min.js +2 -0
  619. data/app/assets/javascripts/wbase/admin/summernote/lang/summernote-pt-PT.js +103 -0
  620. data/app/assets/javascripts/wbase/admin/summernote/lang/summernote-pt-PT.min.js +2 -0
  621. data/app/assets/javascripts/wbase/admin/summernote/lang/summernote-ro-RO.js +102 -0
  622. data/app/assets/javascripts/wbase/admin/summernote/lang/summernote-ro-RO.min.js +2 -0
  623. data/app/assets/javascripts/wbase/admin/summernote/lang/summernote-ru-RU.js +112 -0
  624. data/app/assets/javascripts/wbase/admin/summernote/lang/summernote-ru-RU.min.js +2 -0
  625. data/app/assets/javascripts/wbase/admin/summernote/lang/summernote-sk-SK.js +102 -0
  626. data/app/assets/javascripts/wbase/admin/summernote/lang/summernote-sk-SK.min.js +2 -0
  627. data/app/assets/javascripts/wbase/admin/summernote/lang/summernote-sl-SI.js +106 -0
  628. data/app/assets/javascripts/wbase/admin/summernote/lang/summernote-sl-SI.min.js +2 -0
  629. data/app/assets/javascripts/wbase/admin/summernote/lang/summernote-sr-RS-Latin.js +104 -0
  630. data/app/assets/javascripts/wbase/admin/summernote/lang/summernote-sr-RS-Latin.min.js +2 -0
  631. data/app/assets/javascripts/wbase/admin/summernote/lang/summernote-sr-RS.js +104 -0
  632. data/app/assets/javascripts/wbase/admin/summernote/lang/summernote-sr-RS.min.js +2 -0
  633. data/app/assets/javascripts/wbase/admin/summernote/lang/summernote-sv-SE.js +104 -0
  634. data/app/assets/javascripts/wbase/admin/summernote/lang/summernote-sv-SE.min.js +2 -0
  635. data/app/assets/javascripts/wbase/admin/summernote/lang/summernote-th-TH.js +106 -0
  636. data/app/assets/javascripts/wbase/admin/summernote/lang/summernote-th-TH.min.js +2 -0
  637. data/app/assets/javascripts/wbase/admin/summernote/lang/summernote-tr-TR.js +147 -0
  638. data/app/assets/javascripts/wbase/admin/summernote/lang/summernote-tr-TR.min.js +2 -0
  639. data/app/assets/javascripts/wbase/admin/summernote/lang/summernote-uk-UA.js +111 -0
  640. data/app/assets/javascripts/wbase/admin/summernote/lang/summernote-uk-UA.min.js +2 -0
  641. data/app/assets/javascripts/wbase/admin/summernote/lang/summernote-vi-VN.js +104 -0
  642. data/app/assets/javascripts/wbase/admin/summernote/lang/summernote-vi-VN.min.js +2 -0
  643. data/app/assets/javascripts/wbase/admin/summernote/lang/summernote-zh-CN.js +113 -0
  644. data/app/assets/javascripts/wbase/admin/summernote/lang/summernote-zh-CN.min.js +2 -0
  645. data/app/assets/javascripts/wbase/admin/summernote/lang/summernote-zh-TW.js +113 -0
  646. data/app/assets/javascripts/wbase/admin/summernote/lang/summernote-zh-TW.min.js +2 -0
  647. data/app/assets/javascripts/wbase/admin/summernote/plugin/databasic/summernote-ext-databasic.css +16 -0
  648. data/app/assets/javascripts/wbase/admin/summernote/plugin/databasic/summernote-ext-databasic.js +303 -0
  649. data/app/assets/javascripts/wbase/admin/summernote/plugin/databasic/summernote-ext-databasic.min.css +1 -0
  650. data/app/assets/javascripts/wbase/admin/summernote/plugin/databasic/summernote-ext-databasic.min.js +2 -0
  651. data/app/assets/javascripts/wbase/admin/summernote/plugin/hello/summernote-ext-hello.js +82 -0
  652. data/app/assets/javascripts/wbase/admin/summernote/plugin/hello/summernote-ext-hello.min.js +2 -0
  653. data/app/assets/javascripts/wbase/admin/summernote/plugin/specialchars/summernote-ext-specialchars.js +315 -0
  654. data/app/assets/javascripts/wbase/admin/summernote/plugin/specialchars/summernote-ext-specialchars.min.js +2 -0
  655. data/app/assets/javascripts/wbase/admin/summernote/summernote.css +1 -0
  656. data/app/assets/javascripts/wbase/admin/summernote/summernote.js +7016 -0
  657. data/app/assets/javascripts/wbase/admin/summernote/summernote.min.js +4 -0
  658. data/app/assets/javascripts/wbase/admin/switchery/css/switchery.min.css +1 -0
  659. data/app/assets/javascripts/wbase/admin/switchery/js/switchery.min.js +1 -0
  660. data/app/assets/javascripts/wbase/admin/tablesaw/css/tablesaw.css +833 -0
  661. data/app/assets/javascripts/wbase/admin/tablesaw/js/tablesaw-init.js +12 -0
  662. data/app/assets/javascripts/wbase/admin/tablesaw/js/tablesaw.js +1266 -0
  663. data/app/assets/javascripts/wbase/admin/timepicker/bootstrap-timepicker.js +1177 -0
  664. data/app/assets/javascripts/wbase/admin/timepicker/bootstrap-timepicker.min.css +148 -0
  665. data/app/assets/javascripts/wbase/admin/tiny-editable/mindmup-editabletable.js +131 -0
  666. data/app/assets/javascripts/wbase/admin/tiny-editable/numeric-input-example.js +48 -0
  667. data/app/assets/javascripts/wbase/admin/tinymce/jquery.tinymce.min.js +1 -0
  668. data/app/assets/javascripts/wbase/admin/tinymce/langs/readme.md +3 -0
  669. data/app/assets/javascripts/wbase/admin/tinymce/license.txt +504 -0
  670. data/app/assets/javascripts/wbase/admin/tinymce/plugins/advlist/plugin.min.js +1 -0
  671. data/app/assets/javascripts/wbase/admin/tinymce/plugins/anchor/plugin.min.js +1 -0
  672. data/app/assets/javascripts/wbase/admin/tinymce/plugins/autolink/plugin.min.js +1 -0
  673. data/app/assets/javascripts/wbase/admin/tinymce/plugins/autoresize/plugin.min.js +1 -0
  674. data/app/assets/javascripts/wbase/admin/tinymce/plugins/autosave/plugin.min.js +1 -0
  675. data/app/assets/javascripts/wbase/admin/tinymce/plugins/bbcode/plugin.min.js +1 -0
  676. data/app/assets/javascripts/wbase/admin/tinymce/plugins/charmap/plugin.min.js +1 -0
  677. data/app/assets/javascripts/wbase/admin/tinymce/plugins/code/plugin.min.js +1 -0
  678. data/app/assets/javascripts/wbase/admin/tinymce/plugins/codesample/css/prism.css +138 -0
  679. data/app/assets/javascripts/wbase/admin/tinymce/plugins/codesample/plugin.min.js +1 -0
  680. data/app/assets/javascripts/wbase/admin/tinymce/plugins/colorpicker/plugin.min.js +1 -0
  681. data/app/assets/javascripts/wbase/admin/tinymce/plugins/contextmenu/plugin.min.js +1 -0
  682. data/app/assets/javascripts/wbase/admin/tinymce/plugins/directionality/plugin.min.js +1 -0
  683. data/app/assets/javascripts/wbase/admin/tinymce/plugins/emoticons/img/smiley-cool.gif +0 -0
  684. data/app/assets/javascripts/wbase/admin/tinymce/plugins/emoticons/img/smiley-cry.gif +0 -0
  685. data/app/assets/javascripts/wbase/admin/tinymce/plugins/emoticons/img/smiley-embarassed.gif +0 -0
  686. data/app/assets/javascripts/wbase/admin/tinymce/plugins/emoticons/img/smiley-foot-in-mouth.gif +0 -0
  687. data/app/assets/javascripts/wbase/admin/tinymce/plugins/emoticons/img/smiley-frown.gif +0 -0
  688. data/app/assets/javascripts/wbase/admin/tinymce/plugins/emoticons/img/smiley-innocent.gif +0 -0
  689. data/app/assets/javascripts/wbase/admin/tinymce/plugins/emoticons/img/smiley-kiss.gif +0 -0
  690. data/app/assets/javascripts/wbase/admin/tinymce/plugins/emoticons/img/smiley-laughing.gif +0 -0
  691. data/app/assets/javascripts/wbase/admin/tinymce/plugins/emoticons/img/smiley-money-mouth.gif +0 -0
  692. data/app/assets/javascripts/wbase/admin/tinymce/plugins/emoticons/img/smiley-sealed.gif +0 -0
  693. data/app/assets/javascripts/wbase/admin/tinymce/plugins/emoticons/img/smiley-smile.gif +0 -0
  694. data/app/assets/javascripts/wbase/admin/tinymce/plugins/emoticons/img/smiley-surprised.gif +0 -0
  695. data/app/assets/javascripts/wbase/admin/tinymce/plugins/emoticons/img/smiley-tongue-out.gif +0 -0
  696. data/app/assets/javascripts/wbase/admin/tinymce/plugins/emoticons/img/smiley-undecided.gif +0 -0
  697. data/app/assets/javascripts/wbase/admin/tinymce/plugins/emoticons/img/smiley-wink.gif +0 -0
  698. data/app/assets/javascripts/wbase/admin/tinymce/plugins/emoticons/img/smiley-yell.gif +0 -0
  699. data/app/assets/javascripts/wbase/admin/tinymce/plugins/emoticons/plugin.min.js +1 -0
  700. data/app/assets/javascripts/wbase/admin/tinymce/plugins/example/dialog.html +8 -0
  701. data/app/assets/javascripts/wbase/admin/tinymce/plugins/example/plugin.min.js +1 -0
  702. data/app/assets/javascripts/wbase/admin/tinymce/plugins/example_dependency/plugin.min.js +1 -0
  703. data/app/assets/javascripts/wbase/admin/tinymce/plugins/fullpage/plugin.min.js +1 -0
  704. data/app/assets/javascripts/wbase/admin/tinymce/plugins/fullscreen/plugin.min.js +1 -0
  705. data/app/assets/javascripts/wbase/admin/tinymce/plugins/hr/plugin.min.js +1 -0
  706. data/app/assets/javascripts/wbase/admin/tinymce/plugins/image/plugin.min.js +1 -0
  707. data/app/assets/javascripts/wbase/admin/tinymce/plugins/imagetools/plugin.min.js +1 -0
  708. data/app/assets/javascripts/wbase/admin/tinymce/plugins/importcss/plugin.min.js +1 -0
  709. data/app/assets/javascripts/wbase/admin/tinymce/plugins/insertdatetime/plugin.min.js +1 -0
  710. data/app/assets/javascripts/wbase/admin/tinymce/plugins/layer/plugin.min.js +1 -0
  711. data/app/assets/javascripts/wbase/admin/tinymce/plugins/legacyoutput/plugin.min.js +1 -0
  712. data/app/assets/javascripts/wbase/admin/tinymce/plugins/link/plugin.min.js +1 -0
  713. data/app/assets/javascripts/wbase/admin/tinymce/plugins/lists/plugin.min.js +1 -0
  714. data/app/assets/javascripts/wbase/admin/tinymce/plugins/media/moxieplayer.swf +0 -0
  715. data/app/assets/javascripts/wbase/admin/tinymce/plugins/media/plugin.min.js +1 -0
  716. data/app/assets/javascripts/wbase/admin/tinymce/plugins/nonbreaking/plugin.min.js +1 -0
  717. data/app/assets/javascripts/wbase/admin/tinymce/plugins/noneditable/plugin.min.js +1 -0
  718. data/app/assets/javascripts/wbase/admin/tinymce/plugins/pagebreak/plugin.min.js +1 -0
  719. data/app/assets/javascripts/wbase/admin/tinymce/plugins/paste/plugin.min.js +1 -0
  720. data/app/assets/javascripts/wbase/admin/tinymce/plugins/preview/plugin.min.js +1 -0
  721. data/app/assets/javascripts/wbase/admin/tinymce/plugins/print/plugin.min.js +1 -0
  722. data/app/assets/javascripts/wbase/admin/tinymce/plugins/save/plugin.min.js +1 -0
  723. data/app/assets/javascripts/wbase/admin/tinymce/plugins/searchreplace/plugin.min.js +1 -0
  724. data/app/assets/javascripts/wbase/admin/tinymce/plugins/spellchecker/plugin.min.js +1 -0
  725. data/app/assets/javascripts/wbase/admin/tinymce/plugins/tabfocus/plugin.min.js +1 -0
  726. data/app/assets/javascripts/wbase/admin/tinymce/plugins/table/plugin.min.js +2 -0
  727. data/app/assets/javascripts/wbase/admin/tinymce/plugins/template/plugin.min.js +1 -0
  728. data/app/assets/javascripts/wbase/admin/tinymce/plugins/textcolor/plugin.min.js +1 -0
  729. data/app/assets/javascripts/wbase/admin/tinymce/plugins/textpattern/plugin.min.js +1 -0
  730. data/app/assets/javascripts/wbase/admin/tinymce/plugins/visualblocks/css/visualblocks.css +135 -0
  731. data/app/assets/javascripts/wbase/admin/tinymce/plugins/visualblocks/plugin.min.js +1 -0
  732. data/app/assets/javascripts/wbase/admin/tinymce/plugins/visualchars/plugin.min.js +1 -0
  733. data/app/assets/javascripts/wbase/admin/tinymce/plugins/wordcount/plugin.min.js +1 -0
  734. data/app/assets/javascripts/wbase/admin/tinymce/skins/lightgray/content.inline.min.css +1 -0
  735. data/app/assets/javascripts/wbase/admin/tinymce/skins/lightgray/content.min.css +1 -0
  736. data/app/assets/javascripts/wbase/admin/tinymce/skins/lightgray/fonts/tinymce-small.eot +0 -0
  737. data/app/assets/javascripts/wbase/admin/tinymce/skins/lightgray/fonts/tinymce-small.svg +63 -0
  738. data/app/assets/javascripts/wbase/admin/tinymce/skins/lightgray/fonts/tinymce-small.ttf +0 -0
  739. data/app/assets/javascripts/wbase/admin/tinymce/skins/lightgray/fonts/tinymce-small.woff +0 -0
  740. data/app/assets/javascripts/wbase/admin/tinymce/skins/lightgray/fonts/tinymce.eot +0 -0
  741. data/app/assets/javascripts/wbase/admin/tinymce/skins/lightgray/fonts/tinymce.svg +129 -0
  742. data/app/assets/javascripts/wbase/admin/tinymce/skins/lightgray/fonts/tinymce.ttf +0 -0
  743. data/app/assets/javascripts/wbase/admin/tinymce/skins/lightgray/fonts/tinymce.woff +0 -0
  744. data/app/assets/javascripts/wbase/admin/tinymce/skins/lightgray/img/anchor.gif +0 -0
  745. data/app/assets/javascripts/wbase/admin/tinymce/skins/lightgray/img/loader.gif +0 -0
  746. data/app/assets/javascripts/wbase/admin/tinymce/skins/lightgray/img/object.gif +0 -0
  747. data/app/assets/javascripts/wbase/admin/tinymce/skins/lightgray/img/trans.gif +0 -0
  748. data/app/assets/javascripts/wbase/admin/tinymce/skins/lightgray/skin.ie7.min.css +1 -0
  749. data/app/assets/javascripts/wbase/admin/tinymce/skins/lightgray/skin.min.css +1 -0
  750. data/app/assets/javascripts/wbase/admin/tinymce/themes/inlite/config/bolt/atomic.js +5 -0
  751. data/app/assets/javascripts/wbase/admin/tinymce/themes/inlite/config/bolt/bootstrap-atomic.js +1491 -0
  752. data/app/assets/javascripts/wbase/admin/tinymce/themes/inlite/config/bolt/bootstrap-browser.js +1491 -0
  753. data/app/assets/javascripts/wbase/admin/tinymce/themes/inlite/config/bolt/bootstrap-demo.js +1491 -0
  754. data/app/assets/javascripts/wbase/admin/tinymce/themes/inlite/config/bolt/bootstrap-prod.js +1491 -0
  755. data/app/assets/javascripts/wbase/admin/tinymce/themes/inlite/config/bolt/browser.js +10 -0
  756. data/app/assets/javascripts/wbase/admin/tinymce/themes/inlite/config/bolt/demo.js +8 -0
  757. data/app/assets/javascripts/wbase/admin/tinymce/themes/inlite/config/bolt/prod.js +5 -0
  758. data/app/assets/javascripts/wbase/admin/tinymce/themes/inlite/config/dent/depend.js +21 -0
  759. data/app/assets/javascripts/wbase/admin/tinymce/themes/inlite/scratch/compile/bootstrap.js +1526 -0
  760. data/app/assets/javascripts/wbase/admin/tinymce/themes/inlite/scratch/compile/theme.js +1594 -0
  761. data/app/assets/javascripts/wbase/admin/tinymce/themes/inlite/scratch/inline/theme.js +1679 -0
  762. data/app/assets/javascripts/wbase/admin/tinymce/themes/inlite/scratch/inline/theme.raw.js +1679 -0
  763. data/app/assets/javascripts/wbase/admin/tinymce/themes/inlite/src/demo/css/demo.css +25 -0
  764. data/app/assets/javascripts/wbase/admin/tinymce/themes/inlite/src/demo/html/demo.html +69 -0
  765. data/app/assets/javascripts/wbase/admin/tinymce/themes/inlite/src/demo/js/tinymce/inlite/Demo.js +28 -0
  766. data/app/assets/javascripts/wbase/admin/tinymce/themes/inlite/src/main/js/tinymce/inlite/Theme.js +150 -0
  767. data/app/assets/javascripts/wbase/admin/tinymce/themes/inlite/src/main/js/tinymce/inlite/alien/Arr.js +22 -0
  768. data/app/assets/javascripts/wbase/admin/tinymce/themes/inlite/src/main/js/tinymce/inlite/alien/Bookmark.js +130 -0
  769. data/app/assets/javascripts/wbase/admin/tinymce/themes/inlite/src/main/js/tinymce/inlite/alien/Unlink.js +84 -0
  770. data/app/assets/javascripts/wbase/admin/tinymce/themes/inlite/src/main/js/tinymce/inlite/alien/Uuid.js +34 -0
  771. data/app/assets/javascripts/wbase/admin/tinymce/themes/inlite/src/main/js/tinymce/inlite/core/Actions.js +106 -0
  772. data/app/assets/javascripts/wbase/admin/tinymce/themes/inlite/src/main/js/tinymce/inlite/core/Convert.js +37 -0
  773. data/app/assets/javascripts/wbase/admin/tinymce/themes/inlite/src/main/js/tinymce/inlite/core/ElementMatcher.js +47 -0
  774. data/app/assets/javascripts/wbase/admin/tinymce/themes/inlite/src/main/js/tinymce/inlite/core/Layout.js +95 -0
  775. data/app/assets/javascripts/wbase/admin/tinymce/themes/inlite/src/main/js/tinymce/inlite/core/Matcher.js +39 -0
  776. data/app/assets/javascripts/wbase/admin/tinymce/themes/inlite/src/main/js/tinymce/inlite/core/Measure.js +61 -0
  777. data/app/assets/javascripts/wbase/admin/tinymce/themes/inlite/src/main/js/tinymce/inlite/core/PredicateId.js +32 -0
  778. data/app/assets/javascripts/wbase/admin/tinymce/themes/inlite/src/main/js/tinymce/inlite/core/SelectionMatcher.js +55 -0
  779. data/app/assets/javascripts/wbase/admin/tinymce/themes/inlite/src/main/js/tinymce/inlite/core/SkinLoader.js +45 -0
  780. data/app/assets/javascripts/wbase/admin/tinymce/themes/inlite/src/main/js/tinymce/inlite/core/UrlType.js +27 -0
  781. data/app/assets/javascripts/wbase/admin/tinymce/themes/inlite/src/main/js/tinymce/inlite/file/Conversions.js +31 -0
  782. data/app/assets/javascripts/wbase/admin/tinymce/themes/inlite/src/main/js/tinymce/inlite/file/Picker.js +40 -0
  783. data/app/assets/javascripts/wbase/admin/tinymce/themes/inlite/src/main/js/tinymce/inlite/ui/Buttons.js +80 -0
  784. data/app/assets/javascripts/wbase/admin/tinymce/themes/inlite/src/main/js/tinymce/inlite/ui/Forms.js +102 -0
  785. data/app/assets/javascripts/wbase/admin/tinymce/themes/inlite/src/main/js/tinymce/inlite/ui/Panel.js +218 -0
  786. data/app/assets/javascripts/wbase/admin/tinymce/themes/inlite/src/main/js/tinymce/inlite/ui/Toolbar.js +126 -0
  787. data/app/assets/javascripts/wbase/admin/tinymce/themes/inlite/src/test/js/atomic/alien/ArrTest.js +9 -0
  788. data/app/assets/javascripts/wbase/admin/tinymce/themes/inlite/src/test/js/atomic/alien/UuidTest.js +10 -0
  789. data/app/assets/javascripts/wbase/admin/tinymce/themes/inlite/src/test/js/atomic/core/ConvertTest.js +12 -0
  790. data/app/assets/javascripts/wbase/admin/tinymce/themes/inlite/src/test/js/atomic/core/MatcherTest.js +51 -0
  791. data/app/assets/javascripts/wbase/admin/tinymce/themes/inlite/src/test/js/atomic/core/UrlTypeTest.js +33 -0
  792. data/app/assets/javascripts/wbase/admin/tinymce/themes/inlite/src/test/js/browser/ThemeTest.js +202 -0
  793. data/app/assets/javascripts/wbase/admin/tinymce/themes/inlite/src/test/js/browser/alien/BookmarkTest.js +65 -0
  794. data/app/assets/javascripts/wbase/admin/tinymce/themes/inlite/src/test/js/browser/alien/UnlinkTest.js +38 -0
  795. data/app/assets/javascripts/wbase/admin/tinymce/themes/inlite/src/test/js/browser/core/ActionsTest.js +177 -0
  796. data/app/assets/javascripts/wbase/admin/tinymce/themes/inlite/src/test/js/browser/core/ElementMatcher.js +69 -0
  797. data/app/assets/javascripts/wbase/admin/tinymce/themes/inlite/src/test/js/browser/core/LayoutTest.js +118 -0
  798. data/app/assets/javascripts/wbase/admin/tinymce/themes/inlite/src/test/js/browser/core/MeasureTest.js +62 -0
  799. data/app/assets/javascripts/wbase/admin/tinymce/themes/inlite/src/test/js/browser/core/PredicateIdTest.js +26 -0
  800. data/app/assets/javascripts/wbase/admin/tinymce/themes/inlite/src/test/js/browser/core/SelectionMatcherTest.js +76 -0
  801. data/app/assets/javascripts/wbase/admin/tinymce/themes/inlite/src/test/js/browser/file/ConversionsTest.js +41 -0
  802. data/app/assets/javascripts/wbase/admin/tinymce/themes/inlite/src/test/js/browser/file/SelectionMatcher.js +55 -0
  803. data/app/assets/javascripts/wbase/admin/tinymce/themes/inlite/theme.min.js +1 -0
  804. data/app/assets/javascripts/wbase/admin/tinymce/themes/modern/theme.min.js +1 -0
  805. data/app/assets/javascripts/wbase/admin/tinymce/tinymce.min.js +13 -0
  806. data/app/assets/javascripts/wbase/admin/transitionize/dist/transitionize.js +275 -0
  807. data/app/assets/javascripts/wbase/admin/transitionize/dist/transitionize.min.js +1 -0
  808. data/app/assets/javascripts/wbase/admin/transitionize/examples/browserify.js +46 -0
  809. data/app/assets/javascripts/wbase/admin/transitionize/examples/example.html +31 -0
  810. data/app/assets/javascripts/wbase/admin/transitionize/transitionize.js +64 -0
  811. data/app/assets/javascripts/wbase/admin/waves.js +498 -0
  812. data/app/assets/javascripts/wbase/admin/waypoints/lib/jquery.waypoints.js +647 -0
  813. data/app/assets/javascripts/wbase/admin/waypoints/lib/jquery.waypoints.min.js +7 -0
  814. data/app/assets/javascripts/wbase/admin/waypoints/lib/noframework.waypoints.js +743 -0
  815. data/app/assets/javascripts/wbase/admin/waypoints/lib/noframework.waypoints.min.js +7 -0
  816. data/app/assets/javascripts/wbase/admin/waypoints/lib/shortcuts/infinite.js +84 -0
  817. data/app/assets/javascripts/wbase/admin/waypoints/lib/shortcuts/infinite.min.js +7 -0
  818. data/app/assets/javascripts/wbase/admin/waypoints/lib/shortcuts/inview.js +103 -0
  819. data/app/assets/javascripts/wbase/admin/waypoints/lib/shortcuts/inview.min.js +7 -0
  820. data/app/assets/javascripts/wbase/admin/waypoints/lib/shortcuts/sticky.js +65 -0
  821. data/app/assets/javascripts/wbase/admin/waypoints/lib/shortcuts/sticky.min.js +7 -0
  822. data/app/assets/javascripts/wbase/admin/waypoints/lib/waypoints.debug.js +46 -0
  823. data/app/assets/javascripts/wbase/admin/waypoints/lib/zepto.waypoints.js +690 -0
  824. data/app/assets/javascripts/wbase/admin/waypoints/lib/zepto.waypoints.min.js +7 -0
  825. data/app/assets/javascripts/wbase/admin/wow.min.js +2 -0
  826. data/app/assets/javascripts/wbase/admin/x-editable/css/bootstrap-editable.css +663 -0
  827. data/app/assets/javascripts/wbase/admin/x-editable/img/clear.png +0 -0
  828. data/app/assets/javascripts/wbase/admin/x-editable/img/loading.gif +0 -0
  829. data/app/assets/javascripts/wbase/admin/x-editable/js/bootstrap-editable.js +6807 -0
  830. data/app/assets/javascripts/wbase/admin/x-editable/js/bootstrap-editable.min.js +7 -0
  831. data/app/assets/javascripts/wbase/admin.js +50 -0
  832. data/app/assets/javascripts/wbase/auth/bootstrap.min.js +1 -1
  833. data/app/assets/javascripts/wbase/auth/detect.js +1 -1
  834. data/app/assets/javascripts/wbase/auth/jquery.min.js +1 -1
  835. data/app/assets/javascripts/wbase/auth/jquery.scrollTo.min.js +1 -1
  836. data/app/assets/javascripts/wbase/auth/modernizr.min.js +1 -1
  837. data/app/assets/javascripts/wbase/auth/pace.min.js +1 -1
  838. data/app/assets/javascripts/wbase/auth/wow.min.js +1 -1
  839. data/app/assets/javascripts/wbase/landing/bootstrap.min.js +1 -1
  840. data/app/assets/javascripts/wbase/landing/validator.min.js +1 -1
  841. data/app/assets/stylesheets/wbase/admin/components.scss +2362 -0
  842. data/app/assets/stylesheets/wbase/admin/core.scss +2190 -0
  843. data/app/assets/stylesheets/wbase/admin/datatables/buttons.bootstrap.min.css +1 -0
  844. data/app/assets/stylesheets/wbase/admin/datatables/dataTables.bootstrap.min.css +1 -0
  845. data/app/assets/stylesheets/wbase/admin/datatables/dataTables.colVis.css +185 -0
  846. data/app/assets/stylesheets/wbase/admin/datatables/fixedColumns.dataTables.min.css +1 -0
  847. data/app/assets/stylesheets/wbase/admin/datatables/fixedHeader.bootstrap.min.css +1 -0
  848. data/app/assets/stylesheets/wbase/admin/datatables/jquery.dataTables.min.css +333 -0
  849. data/app/assets/stylesheets/wbase/admin/datatables/responsive.bootstrap.min.css +1 -0
  850. data/app/assets/stylesheets/wbase/admin/datatables/scroller.bootstrap.min.css +1 -0
  851. data/app/assets/stylesheets/wbase/admin/icons.scss +9884 -0
  852. data/app/assets/stylesheets/wbase/admin/morris.scss +25 -0
  853. data/app/assets/stylesheets/wbase/admin/pages.scss +2039 -0
  854. data/app/assets/stylesheets/wbase/admin/responsive.scss +162 -0
  855. data/app/assets/stylesheets/wbase/admin/typicons.scss +1370 -0
  856. data/app/assets/stylesheets/wbase/admin.scss +20 -0
  857. data/app/assets/stylesheets/wbase/auth/components.css +77 -77
  858. data/app/assets/stylesheets/wbase/auth/core.css +41 -41
  859. data/app/assets/stylesheets/wbase/auth/pages.css +43 -43
  860. data/app/views/layouts/wbase/_common_foot.html.erb +42 -0
  861. data/app/views/layouts/wbase/_common_head.html.erb +2 -1
  862. data/app/views/layouts/wbase/_olark.html.erb +34 -0
  863. data/app/views/layouts/wbase/_sidebar.html.erb +22 -0
  864. data/app/views/layouts/wbase/_topbar.html.erb +48 -0
  865. data/app/views/layouts/wbase/admin.html.erb +42 -0
  866. data/app/views/layouts/wbase/auth.html.erb +2 -1
  867. data/app/views/layouts/wbase/landing.html.erb +1 -0
  868. data/app/views/shared/{_errors.html.erb → wbase/_errors.html.erb} +0 -0
  869. data/app/views/shared/wbase/_page_title.html.erb +26 -0
  870. data/config/initializers/assets.rb +1 -1
  871. data/lib/wbase/engine.rb +6 -1
  872. data/lib/wbase/version.rb +1 -1
  873. data/test/dummy/db/development.sqlite3 +0 -0
  874. metadata +846 -4
  875. data/app/views/layouts/wbase/application.html.erb +0 -14
@@ -0,0 +1,2536 @@
1
+ /**! hopscotch - v0.2.5
2
+ *
3
+ * Copyright 2015 LinkedIn Corp. All rights reserved.
4
+ *
5
+ * Licensed under the Apache License, Version 2.0 (the "License");
6
+ * you may not use this file except in compliance with the License.
7
+ * You may obtain a copy of the License at
8
+ *
9
+ * http://www.apache.org/licenses/LICENSE-2.0
10
+ *
11
+ * Unless required by applicable law or agreed to in writing, software
12
+ * distributed under the License is distributed on an "AS IS" BASIS,
13
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14
+ * See the License for the specific language governing permissions and
15
+ * limitations under the License.
16
+ */
17
+ (function(context, factory) {
18
+ 'use strict';
19
+
20
+ if (typeof define === 'function' && define.amd) {
21
+ // AMD. Register as an anonymous module.
22
+ define([], factory);
23
+ } else if (typeof exports === 'object') {
24
+ // Node/CommonJS
25
+ module.exports = factory();
26
+ } else {
27
+ var namespace = 'hopscotch';
28
+ // Browser globals
29
+ if (context[namespace]) {
30
+ // Hopscotch already exists.
31
+ return;
32
+ }
33
+ context[namespace] = factory();
34
+ }
35
+ }(this, (function() {
36
+ var Hopscotch,
37
+ HopscotchBubble,
38
+ HopscotchCalloutManager,
39
+ HopscotchI18N,
40
+ customI18N,
41
+ customRenderer,
42
+ customEscape,
43
+ templateToUse = 'bubble_default',
44
+ Sizzle = window.Sizzle || null,
45
+ utils,
46
+ callbacks,
47
+ helpers,
48
+ winLoadHandler,
49
+ defaultOpts,
50
+ winHopscotch,
51
+ undefinedStr = 'undefined',
52
+ waitingToStart = false, // is a tour waiting for the document to finish
53
+ // loading so that it can start?
54
+ hasJquery = (typeof jQuery !== undefinedStr),
55
+ hasSessionStorage = false,
56
+ isStorageWritable = false,
57
+ document = window.document,
58
+ validIdRegEx = /^[a-zA-Z]+[a-zA-Z0-9_-]*$/,
59
+ rtlMatches = {
60
+ left: 'right',
61
+ right: 'left'
62
+ };
63
+
64
+ // If cookies are disabled, accessing sessionStorage can throw an error.
65
+ // sessionStorage could also throw an error in Safari on write (even though it exists).
66
+ // So, we'll try writing to sessionStorage to verify it's available.
67
+ try {
68
+ if(typeof window.sessionStorage !== undefinedStr){
69
+ hasSessionStorage = true;
70
+ sessionStorage.setItem('hopscotch.test.storage', 'ok');
71
+ sessionStorage.removeItem('hopscotch.test.storage');
72
+ isStorageWritable = true;
73
+ }
74
+ } catch (err) {}
75
+
76
+ defaultOpts = {
77
+ smoothScroll: true,
78
+ scrollDuration: 1000,
79
+ scrollTopMargin: 200,
80
+ showCloseButton: true,
81
+ showPrevButton: false,
82
+ showNextButton: true,
83
+ bubbleWidth: 280,
84
+ bubblePadding: 15,
85
+ arrowWidth: 20,
86
+ skipIfNoElement: true,
87
+ isRtl: false,
88
+ cookieName: 'hopscotch.tour.state'
89
+ };
90
+
91
+ if (!Array.isArray) {
92
+ Array.isArray = function(obj) {
93
+ return Object.prototype.toString.call(obj) === '[object Array]';
94
+ };
95
+ }
96
+
97
+ /**
98
+ * Called when the page is done loading.
99
+ *
100
+ * @private
101
+ */
102
+ winLoadHandler = function() {
103
+ if (waitingToStart) {
104
+ winHopscotch.startTour();
105
+ }
106
+ };
107
+
108
+ /**
109
+ * utils
110
+ * =====
111
+ * A set of utility functions, mostly for standardizing to manipulate
112
+ * and extract information from the DOM. Basically these are things I
113
+ * would normally use jQuery for, but I don't want to require it for
114
+ * this framework.
115
+ *
116
+ * @private
117
+ */
118
+ utils = {
119
+ /**
120
+ * addClass
121
+ * ========
122
+ * Adds one or more classes to a DOM element.
123
+ *
124
+ * @private
125
+ */
126
+ addClass: function(domEl, classToAdd) {
127
+ var domClasses,
128
+ classToAddArr,
129
+ setClass,
130
+ i,
131
+ len;
132
+
133
+ if (!domEl.className) {
134
+ domEl.className = classToAdd;
135
+ }
136
+ else {
137
+ classToAddArr = classToAdd.split(/\s+/);
138
+ domClasses = ' ' + domEl.className + ' ';
139
+ for (i = 0, len = classToAddArr.length; i < len; ++i) {
140
+ if (domClasses.indexOf(' ' + classToAddArr[i] + ' ') < 0) {
141
+ domClasses += classToAddArr[i] + ' ';
142
+ }
143
+ }
144
+ domEl.className = domClasses.replace(/^\s+|\s+$/g,'');
145
+ }
146
+ },
147
+
148
+ /**
149
+ * removeClass
150
+ * ===========
151
+ * Remove one or more classes from a DOM element.
152
+ *
153
+ * @private
154
+ */
155
+ removeClass: function(domEl, classToRemove) {
156
+ var domClasses,
157
+ classToRemoveArr,
158
+ currClass,
159
+ i,
160
+ len;
161
+
162
+ classToRemoveArr = classToRemove.split(/\s+/);
163
+ domClasses = ' ' + domEl.className + ' ';
164
+ for (i = 0, len = classToRemoveArr.length; i < len; ++i) {
165
+ domClasses = domClasses.replace(' ' + classToRemoveArr[i] + ' ', ' ');
166
+ }
167
+ domEl.className = domClasses.replace(/^\s+|\s+$/g,'');
168
+ },
169
+
170
+ /**
171
+ * hasClass
172
+ * ========
173
+ * Determine if a given DOM element has a class.
174
+ */
175
+ hasClass: function(domEl, classToCheck){
176
+ var classes;
177
+
178
+ if(!domEl.className){ return false; }
179
+ classes = ' ' + domEl.className + ' ';
180
+ return (classes.indexOf(' ' + classToCheck + ' ') !== -1);
181
+ },
182
+
183
+ /**
184
+ * @private
185
+ */
186
+ getPixelValue: function(val) {
187
+ var valType = typeof val;
188
+ if (valType === 'number') { return val; }
189
+ if (valType === 'string') { return parseInt(val, 10); }
190
+ return 0;
191
+ },
192
+
193
+ /**
194
+ * Inspired by Python... returns val if it's defined, otherwise returns the default.
195
+ *
196
+ * @private
197
+ */
198
+ valOrDefault: function(val, valDefault) {
199
+ return typeof val !== undefinedStr ? val : valDefault;
200
+ },
201
+
202
+ /**
203
+ * Invokes a single callback represented by an array.
204
+ * Example input: ["my_fn", "arg1", 2, "arg3"]
205
+ * @private
206
+ */
207
+ invokeCallbackArrayHelper: function(arr) {
208
+ // Logic for a single callback
209
+ var fn;
210
+ if (Array.isArray(arr)) {
211
+ fn = helpers[arr[0]];
212
+ if (typeof fn === 'function') {
213
+ return fn.apply(this, arr.slice(1));
214
+ }
215
+ }
216
+ },
217
+
218
+ /**
219
+ * Invokes one or more callbacks. Array should have at most one level of nesting.
220
+ * Example input:
221
+ * ["my_fn", "arg1", 2, "arg3"]
222
+ * [["my_fn_1", "arg1", "arg2"], ["my_fn_2", "arg2-1", "arg2-2"]]
223
+ * [["my_fn_1", "arg1", "arg2"], function() { ... }]
224
+ * @private
225
+ */
226
+ invokeCallbackArray: function(arr) {
227
+ var i, len;
228
+
229
+ if (Array.isArray(arr)) {
230
+ if (typeof arr[0] === 'string') {
231
+ // Assume there are no nested arrays. This is the one and only callback.
232
+ return utils.invokeCallbackArrayHelper(arr);
233
+ }
234
+ else { // assume an array
235
+ for (i = 0, len = arr.length; i < len; ++i) {
236
+ utils.invokeCallback(arr[i]);
237
+ }
238
+ }
239
+ }
240
+ },
241
+
242
+ /**
243
+ * Helper function for invoking a callback, whether defined as a function literal
244
+ * or an array that references a registered helper function.
245
+ * @private
246
+ */
247
+ invokeCallback: function(cb) {
248
+ if (typeof cb === 'function') {
249
+ return cb();
250
+ }
251
+ if (typeof cb === 'string' && helpers[cb]) { // name of a helper
252
+ return helpers[cb]();
253
+ }
254
+ else { // assuming array
255
+ return utils.invokeCallbackArray(cb);
256
+ }
257
+ },
258
+
259
+ /**
260
+ * If stepCb (the step-specific helper callback) is passed in, then invoke
261
+ * it first. Then invoke tour-wide helper.
262
+ *
263
+ * @private
264
+ */
265
+ invokeEventCallbacks: function(evtType, stepCb) {
266
+ var cbArr = callbacks[evtType],
267
+ callback,
268
+ fn,
269
+ i,
270
+ len;
271
+
272
+ if (stepCb) {
273
+ return this.invokeCallback(stepCb);
274
+ }
275
+
276
+ for (i=0, len=cbArr.length; i<len; ++i) {
277
+ this.invokeCallback(cbArr[i].cb);
278
+ }
279
+ },
280
+
281
+ /**
282
+ * @private
283
+ */
284
+ getScrollTop: function() {
285
+ var scrollTop;
286
+ if (typeof window.pageYOffset !== undefinedStr) {
287
+ scrollTop = window.pageYOffset;
288
+ }
289
+ else {
290
+ // Most likely IE <=8, which doesn't support pageYOffset
291
+ scrollTop = document.documentElement.scrollTop;
292
+ }
293
+ return scrollTop;
294
+ },
295
+
296
+ /**
297
+ * @private
298
+ */
299
+ getScrollLeft: function() {
300
+ var scrollLeft;
301
+ if (typeof window.pageXOffset !== undefinedStr) {
302
+ scrollLeft = window.pageXOffset;
303
+ }
304
+ else {
305
+ // Most likely IE <=8, which doesn't support pageXOffset
306
+ scrollLeft = document.documentElement.scrollLeft;
307
+ }
308
+ return scrollLeft;
309
+ },
310
+
311
+ /**
312
+ * @private
313
+ */
314
+ getWindowHeight: function() {
315
+ return window.innerHeight || document.documentElement.clientHeight;
316
+ },
317
+
318
+ /**
319
+ * @private
320
+ */
321
+ addEvtListener: function(el, evtName, fn) {
322
+ if(el) {
323
+ return el.addEventListener ? el.addEventListener(evtName, fn, false) : el.attachEvent('on' + evtName, fn);
324
+ }
325
+ },
326
+
327
+ /**
328
+ * @private
329
+ */
330
+ removeEvtListener: function(el, evtName, fn) {
331
+ if(el) {
332
+ return el.removeEventListener ? el.removeEventListener(evtName, fn, false) : el.detachEvent('on' + evtName, fn);
333
+ }
334
+ },
335
+
336
+ documentIsReady: function() {
337
+ return document.readyState === 'complete';
338
+ },
339
+
340
+ /**
341
+ * @private
342
+ */
343
+ evtPreventDefault: function(evt) {
344
+ if (evt.preventDefault) {
345
+ evt.preventDefault();
346
+ }
347
+ else if (event) {
348
+ event.returnValue = false;
349
+ }
350
+ },
351
+
352
+ /**
353
+ * @private
354
+ */
355
+ extend: function(obj1, obj2) {
356
+ var prop;
357
+ for (prop in obj2) {
358
+ if (obj2.hasOwnProperty(prop)) {
359
+ obj1[prop] = obj2[prop];
360
+ }
361
+ }
362
+ },
363
+
364
+ /**
365
+ * Helper function to get a single target DOM element. We will try to
366
+ * locate the DOM element through several ways, in the following order:
367
+ *
368
+ * 1) Passing the string into document.querySelector
369
+ * 2) Passing the string to jQuery, if it exists
370
+ * 3) Passing the string to Sizzle, if it exists
371
+ * 4) Calling document.getElementById if it is a plain id
372
+ *
373
+ * Default case is to assume the string is a plain id and call
374
+ * document.getElementById on it.
375
+ *
376
+ * @private
377
+ */
378
+ getStepTargetHelper: function(target){
379
+ var result = document.getElementById(target);
380
+
381
+ //Backwards compatibility: assume the string is an id
382
+ if (result) {
383
+ return result;
384
+ }
385
+ if (hasJquery) {
386
+ result = jQuery(target);
387
+ return result.length ? result[0] : null;
388
+ }
389
+ if (Sizzle) {
390
+ result = new Sizzle(target);
391
+ return result.length ? result[0] : null;
392
+ }
393
+ if (document.querySelector) {
394
+ try {
395
+ return document.querySelector(target);
396
+ } catch (err) {}
397
+ }
398
+ // Regex test for id. Following the HTML 4 spec for valid id formats.
399
+ // (http://www.w3.org/TR/html4/types.html#type-id)
400
+ if (/^#[a-zA-Z][\w-_:.]*$/.test(target)) {
401
+ return document.getElementById(target.substring(1));
402
+ }
403
+
404
+ return null;
405
+ },
406
+
407
+ /**
408
+ * Given a step, returns the target DOM element associated with it. It is
409
+ * recommended to only assign one target per step. However, there are
410
+ * some use cases which require multiple step targets to be supplied. In
411
+ * this event, we will use the first target in the array that we can
412
+ * locate on the page. See the comments for getStepTargetHelper for more
413
+ * information.
414
+ *
415
+ * @private
416
+ */
417
+ getStepTarget: function(step) {
418
+ var queriedTarget;
419
+
420
+ if (!step || !step.target) {
421
+ return null;
422
+ }
423
+
424
+ if (typeof step.target === 'string') {
425
+ //Just one target to test. Check and return its results.
426
+ return utils.getStepTargetHelper(step.target);
427
+ }
428
+ else if (Array.isArray(step.target)) {
429
+ // Multiple items to check. Check each and return the first success.
430
+ // Assuming they are all strings.
431
+ var i,
432
+ len;
433
+
434
+ for (i = 0, len = step.target.length; i < len; i++){
435
+ if (typeof step.target[i] === 'string') {
436
+ queriedTarget = utils.getStepTargetHelper(step.target[i]);
437
+
438
+ if (queriedTarget) {
439
+ return queriedTarget;
440
+ }
441
+ }
442
+ }
443
+ return null;
444
+ }
445
+
446
+ // Assume that the step.target is a DOM element
447
+ return step.target;
448
+ },
449
+
450
+ /**
451
+ * Convenience method for getting an i18n string. Returns custom i18n value
452
+ * or the default i18n value if no custom value exists.
453
+ *
454
+ * @private
455
+ */
456
+ getI18NString: function(key) {
457
+ return customI18N[key] || HopscotchI18N[key];
458
+ },
459
+
460
+ // Tour session persistence for multi-page tours. Uses HTML5 sessionStorage if available, then
461
+ // falls back to using cookies.
462
+ //
463
+ // The following cookie-related logic is borrowed from:
464
+ // http://www.quirksmode.org/js/cookies.html
465
+
466
+ /**
467
+ * @private
468
+ */
469
+ setState: function(name,value,days) {
470
+ var expires = '',
471
+ date;
472
+
473
+ if (hasSessionStorage && isStorageWritable) {
474
+ try{
475
+ sessionStorage.setItem(name, value);
476
+ }
477
+ catch(err){
478
+ isStorageWritable = false;
479
+ this.setState(name, value, days);
480
+ }
481
+ }
482
+ else {
483
+ if(hasSessionStorage){
484
+ //Clear out existing sessionStorage key so the new value we set to cookie gets read.
485
+ //(If we're here, we've run into an error while trying to write to sessionStorage).
486
+ sessionStorage.removeItem(name);
487
+ }
488
+ if (days) {
489
+ date = new Date();
490
+ date.setTime(date.getTime()+(days*24*60*60*1000));
491
+ expires = '; expires='+date.toGMTString();
492
+ }
493
+ document.cookie = name+'='+value+expires+'; path=/';
494
+ }
495
+ },
496
+
497
+ /**
498
+ * @private
499
+ */
500
+ getState: function(name) {
501
+ var nameEQ = name + '=',
502
+ ca = document.cookie.split(';'),
503
+ i,
504
+ c,
505
+ state;
506
+
507
+ //return value from session storage if we have it
508
+ if (hasSessionStorage) {
509
+ state = sessionStorage.getItem(name);
510
+ if(state){
511
+ return state;
512
+ }
513
+ }
514
+
515
+ //else, try cookies
516
+ for(i=0;i < ca.length;i++) {
517
+ c = ca[i];
518
+ while (c.charAt(0)===' ') {c = c.substring(1,c.length);}
519
+ if (c.indexOf(nameEQ) === 0) {
520
+ state = c.substring(nameEQ.length,c.length);
521
+ break;
522
+ }
523
+ }
524
+
525
+ return state;
526
+ },
527
+
528
+ /**
529
+ * @private
530
+ */
531
+ clearState: function(name) {
532
+ if (hasSessionStorage) {
533
+ sessionStorage.removeItem(name);
534
+ }
535
+ else {
536
+ this.setState(name,'',-1);
537
+ }
538
+ },
539
+
540
+ /**
541
+ * Originally called it orientation, but placement is more intuitive.
542
+ * Allowing both for now for backwards compatibility.
543
+ * @private
544
+ */
545
+ normalizePlacement: function(step) {
546
+ if (!step.placement && step.orientation) {
547
+ step.placement = step.orientation;
548
+ }
549
+ },
550
+
551
+ /**
552
+ * If step is right-to-left enabled, flip the placement and xOffset, but only once.
553
+ * @private
554
+ */
555
+ flipPlacement: function(step){
556
+ if(step.isRtl && !step._isFlipped){
557
+ var props = ['orientation', 'placement'], prop, i;
558
+ if(step.xOffset){
559
+ step.xOffset = -1 * this.getPixelValue(step.xOffset);
560
+ }
561
+ for(i in props){
562
+ prop = props[i];
563
+ if(step.hasOwnProperty(prop) && rtlMatches.hasOwnProperty(step[prop])) {
564
+ step[prop] = rtlMatches[step[prop]];
565
+ }
566
+ }
567
+ step._isFlipped = true;
568
+ }
569
+ }
570
+ };
571
+
572
+ utils.addEvtListener(window, 'load', winLoadHandler);
573
+
574
+ callbacks = {
575
+ next: [],
576
+ prev: [],
577
+ start: [],
578
+ end: [],
579
+ show: [],
580
+ error: [],
581
+ close: []
582
+ };
583
+
584
+ /**
585
+ * helpers
586
+ * =======
587
+ * A map of functions to be used as callback listeners. Functions are
588
+ * added to and removed from the map using the functions
589
+ * Hopscotch.registerHelper() and Hopscotch.unregisterHelper().
590
+ */
591
+ helpers = {};
592
+
593
+ HopscotchI18N = {
594
+ stepNums: null,
595
+ nextBtn: 'Next',
596
+ prevBtn: 'Back',
597
+ doneBtn: 'Done',
598
+ skipBtn: 'Skip',
599
+ closeTooltip: 'Close'
600
+ };
601
+
602
+ customI18N = {}; // Developer's custom i18n strings goes here.
603
+
604
+ /**
605
+ * HopscotchBubble
606
+ *
607
+ * @class The HopscotchBubble class represents the view of a bubble. This class is also used for Hopscotch callouts.
608
+ */
609
+ HopscotchBubble = function(opt) {
610
+ this.init(opt);
611
+ };
612
+
613
+ HopscotchBubble.prototype = {
614
+ isShowing: false,
615
+
616
+ currStep: undefined,
617
+
618
+ /**
619
+ * setPosition
620
+ *
621
+ * Sets the position of the bubble using the bounding rectangle of the
622
+ * target element and the orientation and offset information specified by
623
+ * the JSON.
624
+ */
625
+ setPosition: function(step) {
626
+ var bubbleBoundingHeight,
627
+ bubbleBoundingWidth,
628
+ boundingRect,
629
+ top,
630
+ left,
631
+ arrowOffset,
632
+ verticalLeftPosition,
633
+ targetEl = utils.getStepTarget(step),
634
+ el = this.element,
635
+ arrowEl = this.arrowEl,
636
+ arrowPos = step.isRtl ? 'right' : 'left';
637
+
638
+ utils.flipPlacement(step);
639
+ utils.normalizePlacement(step);
640
+
641
+ bubbleBoundingWidth = el.offsetWidth;
642
+ bubbleBoundingHeight = el.offsetHeight;
643
+ utils.removeClass(el, 'fade-in-down fade-in-up fade-in-left fade-in-right');
644
+
645
+ // SET POSITION
646
+ boundingRect = targetEl.getBoundingClientRect();
647
+
648
+ verticalLeftPosition = step.isRtl ? boundingRect.right - bubbleBoundingWidth : boundingRect.left;
649
+
650
+ if (step.placement === 'top') {
651
+ top = (boundingRect.top - bubbleBoundingHeight) - this.opt.arrowWidth;
652
+ left = verticalLeftPosition;
653
+ }
654
+ else if (step.placement === 'bottom') {
655
+ top = boundingRect.bottom + this.opt.arrowWidth;
656
+ left = verticalLeftPosition;
657
+ }
658
+ else if (step.placement === 'left') {
659
+ top = boundingRect.top;
660
+ left = boundingRect.left - bubbleBoundingWidth - this.opt.arrowWidth;
661
+ }
662
+ else if (step.placement === 'right') {
663
+ top = boundingRect.top;
664
+ left = boundingRect.right + this.opt.arrowWidth;
665
+ }
666
+ else {
667
+ throw new Error('Bubble placement failed because step.placement is invalid or undefined!');
668
+ }
669
+
670
+ // SET (OR RESET) ARROW OFFSETS
671
+ if (step.arrowOffset !== 'center') {
672
+ arrowOffset = utils.getPixelValue(step.arrowOffset);
673
+ }
674
+ else {
675
+ arrowOffset = step.arrowOffset;
676
+ }
677
+ if (!arrowOffset) {
678
+ arrowEl.style.top = '';
679
+ arrowEl.style[arrowPos] = '';
680
+ }
681
+ else if (step.placement === 'top' || step.placement === 'bottom') {
682
+ arrowEl.style.top = '';
683
+ if (arrowOffset === 'center') {
684
+ arrowEl.style[arrowPos] = Math.floor((bubbleBoundingWidth / 2) - arrowEl.offsetWidth/2) + 'px';
685
+ }
686
+ else {
687
+ // Numeric pixel value
688
+ arrowEl.style[arrowPos] = arrowOffset + 'px';
689
+ }
690
+ }
691
+ else if (step.placement === 'left' || step.placement === 'right') {
692
+ arrowEl.style[arrowPos] = '';
693
+ if (arrowOffset === 'center') {
694
+ arrowEl.style.top = Math.floor((bubbleBoundingHeight / 2) - arrowEl.offsetHeight/2) + 'px';
695
+ }
696
+ else {
697
+ // Numeric pixel value
698
+ arrowEl.style.top = arrowOffset + 'px';
699
+ }
700
+ }
701
+
702
+ // HORIZONTAL OFFSET
703
+ if (step.xOffset === 'center') {
704
+ left = (boundingRect.left + targetEl.offsetWidth/2) - (bubbleBoundingWidth / 2);
705
+ }
706
+ else {
707
+ left += utils.getPixelValue(step.xOffset);
708
+ }
709
+ // VERTICAL OFFSET
710
+ if (step.yOffset === 'center') {
711
+ top = (boundingRect.top + targetEl.offsetHeight/2) - (bubbleBoundingHeight / 2);
712
+ }
713
+ else {
714
+ top += utils.getPixelValue(step.yOffset);
715
+ }
716
+
717
+ // ADJUST TOP FOR SCROLL POSITION
718
+ if (!step.fixedElement) {
719
+ top += utils.getScrollTop();
720
+ left += utils.getScrollLeft();
721
+ }
722
+
723
+ // ACCOUNT FOR FIXED POSITION ELEMENTS
724
+ el.style.position = (step.fixedElement ? 'fixed' : 'absolute');
725
+
726
+ el.style.top = top + 'px';
727
+ el.style.left = left + 'px';
728
+ },
729
+
730
+ /**
731
+ * Renders the bubble according to the step JSON.
732
+ *
733
+ * @param {Object} step Information defining how the bubble should look.
734
+ * @param {Number} idx The index of the step in the tour. Not used for callouts.
735
+ * @param {Function} callback Function to be invoked after rendering is finished.
736
+ */
737
+ render: function(step, idx, callback) {
738
+ var el = this.element,
739
+ tourSpecificRenderer,
740
+ customTourData,
741
+ unsafe,
742
+ currTour,
743
+ totalSteps,
744
+ totalStepsI18n,
745
+ nextBtnText,
746
+ isLast,
747
+ opts;
748
+
749
+ // Cache current step information.
750
+ if (step) {
751
+ this.currStep = step;
752
+ }
753
+ else if (this.currStep) {
754
+ step = this.currStep;
755
+ }
756
+
757
+ // Check current tour for total number of steps and custom render data
758
+ if(this.opt.isTourBubble){
759
+ currTour = winHopscotch.getCurrTour();
760
+ if(currTour){
761
+ customTourData = currTour.customData;
762
+ tourSpecificRenderer = currTour.customRenderer;
763
+ step.isRtl = step.hasOwnProperty('isRtl') ? step.isRtl :
764
+ (currTour.hasOwnProperty('isRtl') ? currTour.isRtl : this.opt.isRtl);
765
+ unsafe = currTour.unsafe;
766
+ if(Array.isArray(currTour.steps)){
767
+ totalSteps = currTour.steps.length;
768
+ totalStepsI18n = this._getStepI18nNum(this._getStepNum(totalSteps - 1));
769
+ isLast = (this._getStepNum(idx) === this._getStepNum(totalSteps - 1));
770
+ }
771
+ }
772
+ }else{
773
+ customTourData = step.customData;
774
+ tourSpecificRenderer = step.customRenderer;
775
+ unsafe = step.unsafe;
776
+ step.isRtl = step.hasOwnProperty('isRtl') ? step.isRtl : this.opt.isRtl;
777
+ }
778
+
779
+ // Determine label for next button
780
+ if(isLast){
781
+ nextBtnText = utils.getI18NString('doneBtn');
782
+ } else if(step.showSkip) {
783
+ nextBtnText = utils.getI18NString('skipBtn');
784
+ } else {
785
+ nextBtnText = utils.getI18NString('nextBtn');
786
+ }
787
+
788
+ utils.flipPlacement(step);
789
+ utils.normalizePlacement(step);
790
+
791
+ this.placement = step.placement;
792
+
793
+ // Setup the configuration options we want to pass along to the template
794
+ opts = {
795
+ i18n: {
796
+ prevBtn: utils.getI18NString('prevBtn'),
797
+ nextBtn: nextBtnText,
798
+ closeTooltip: utils.getI18NString('closeTooltip'),
799
+ stepNum: this._getStepI18nNum(this._getStepNum(idx)),
800
+ numSteps: totalStepsI18n
801
+ },
802
+ buttons:{
803
+ showPrev: (utils.valOrDefault(step.showPrevButton, this.opt.showPrevButton) && (this._getStepNum(idx) > 0)),
804
+ showNext: utils.valOrDefault(step.showNextButton, this.opt.showNextButton),
805
+ showCTA: utils.valOrDefault((step.showCTAButton && step.ctaLabel), false),
806
+ ctaLabel: step.ctaLabel,
807
+ showClose: utils.valOrDefault(this.opt.showCloseButton, true)
808
+ },
809
+ step:{
810
+ num: idx,
811
+ isLast: utils.valOrDefault(isLast, false),
812
+ title: (step.title || ''),
813
+ content: (step.content || ''),
814
+ isRtl: step.isRtl,
815
+ placement: step.placement,
816
+ padding: utils.valOrDefault(step.padding, this.opt.bubblePadding),
817
+ width: utils.getPixelValue(step.width) || this.opt.bubbleWidth,
818
+ customData: (step.customData || {})
819
+ },
820
+ tour:{
821
+ isTour: this.opt.isTourBubble,
822
+ numSteps: totalSteps,
823
+ unsafe: utils.valOrDefault(unsafe, false),
824
+ customData: (customTourData || {})
825
+ }
826
+ };
827
+
828
+ // Render the bubble's content.
829
+ // Use tour renderer if available, then the global customRenderer if defined.
830
+ if(typeof tourSpecificRenderer === 'function'){
831
+ el.innerHTML = tourSpecificRenderer(opts);
832
+ }
833
+ else if(typeof tourSpecificRenderer === 'string'){
834
+ if(!winHopscotch.templates || (typeof winHopscotch.templates[tourSpecificRenderer] !== 'function')){
835
+ throw new Error('Bubble rendering failed - template "' + tourSpecificRenderer + '" is not a function.');
836
+ }
837
+ el.innerHTML = winHopscotch.templates[tourSpecificRenderer](opts);
838
+ }
839
+ else if(customRenderer){
840
+ el.innerHTML = customRenderer(opts);
841
+ }
842
+ else{
843
+ if(!winHopscotch.templates || (typeof winHopscotch.templates[templateToUse] !== 'function')){
844
+ throw new Error('Bubble rendering failed - template "' + templateToUse + '" is not a function.');
845
+ }
846
+ el.innerHTML = winHopscotch.templates[templateToUse](opts);
847
+ }
848
+
849
+ // Find arrow among new child elements.
850
+ children = el.children;
851
+ numChildren = children.length;
852
+ for (i = 0; i < numChildren; i++){
853
+ node = children[i];
854
+
855
+ if(utils.hasClass(node, 'hopscotch-arrow')){
856
+ this.arrowEl = node;
857
+ }
858
+ }
859
+
860
+ // Set z-index and arrow placement
861
+ el.style.zIndex = (typeof step.zindex === 'number') ? step.zindex : '';
862
+ this._setArrow(step.placement);
863
+
864
+ // Set bubble positioning
865
+ // Make sure we're using visibility:hidden instead of display:none for height/width calculations.
866
+ this.hide(false);
867
+ this.setPosition(step);
868
+
869
+ // only want to adjust window scroll for non-fixed elements
870
+ if (callback) {
871
+ callback(!step.fixedElement);
872
+ }
873
+
874
+ return this;
875
+ },
876
+ /**
877
+ * Get step number considering steps that were skipped because their target wasn't found
878
+ *
879
+ * @private
880
+ */
881
+ _getStepNum: function(idx) {
882
+ var skippedStepsCount = 0,
883
+ stepIdx,
884
+ skippedSteps = winHopscotch.getSkippedStepsIndexes(),
885
+ i,
886
+ len = skippedSteps.length;
887
+ //count number of steps skipped before current step
888
+ for(i = 0; i < len; i++) {
889
+ stepIdx = skippedSteps[i];
890
+ if(stepIdx<idx) {
891
+ skippedStepsCount++;
892
+ }
893
+ }
894
+ return idx - skippedStepsCount;
895
+ },
896
+ /**
897
+ * Get the I18N step number for the current step.
898
+ *
899
+ * @private
900
+ */
901
+ _getStepI18nNum: function(idx) {
902
+ var stepNumI18N = utils.getI18NString('stepNums');
903
+ if (stepNumI18N && idx < stepNumI18N.length) {
904
+ idx = stepNumI18N[idx];
905
+ }
906
+ else {
907
+ idx = idx + 1;
908
+ }
909
+ return idx;
910
+ },
911
+
912
+ /**
913
+ * Sets which side the arrow is on.
914
+ *
915
+ * @private
916
+ */
917
+ _setArrow: function(placement) {
918
+ utils.removeClass(this.arrowEl, 'down up right left');
919
+
920
+ // Whatever the orientation is, we want to arrow to appear
921
+ // "opposite" of the orientation. E.g., a top orientation
922
+ // requires a bottom arrow.
923
+ if (placement === 'top') {
924
+ utils.addClass(this.arrowEl, 'down');
925
+ }
926
+ else if (placement === 'bottom') {
927
+ utils.addClass(this.arrowEl, 'up');
928
+ }
929
+ else if (placement === 'left') {
930
+ utils.addClass(this.arrowEl, 'right');
931
+ }
932
+ else if (placement === 'right') {
933
+ utils.addClass(this.arrowEl, 'left');
934
+ }
935
+ },
936
+
937
+ /**
938
+ * @private
939
+ */
940
+ _getArrowDirection: function() {
941
+ if (this.placement === 'top') {
942
+ return 'down';
943
+ }
944
+ if (this.placement === 'bottom') {
945
+ return 'up';
946
+ }
947
+ if (this.placement === 'left') {
948
+ return 'right';
949
+ }
950
+ if (this.placement === 'right') {
951
+ return 'left';
952
+ }
953
+ },
954
+
955
+ show: function() {
956
+ var self = this,
957
+ fadeClass = 'fade-in-' + this._getArrowDirection(),
958
+ fadeDur = 1000;
959
+
960
+ utils.removeClass(this.element, 'hide');
961
+ utils.addClass(this.element, fadeClass);
962
+ setTimeout(function() {
963
+ utils.removeClass(self.element, 'invisible');
964
+ }, 50);
965
+ setTimeout(function() {
966
+ utils.removeClass(self.element, fadeClass);
967
+ }, fadeDur);
968
+ this.isShowing = true;
969
+ return this;
970
+ },
971
+
972
+ hide: function(remove) {
973
+ var el = this.element;
974
+
975
+ remove = utils.valOrDefault(remove, true);
976
+ el.style.top = '';
977
+ el.style.left = '';
978
+
979
+ // display: none
980
+ if (remove) {
981
+ utils.addClass(el, 'hide');
982
+ utils.removeClass(el, 'invisible');
983
+ }
984
+ // opacity: 0
985
+ else {
986
+ utils.removeClass(el, 'hide');
987
+ utils.addClass(el, 'invisible');
988
+ }
989
+ utils.removeClass(el, 'animate fade-in-up fade-in-down fade-in-right fade-in-left');
990
+ this.isShowing = false;
991
+ return this;
992
+ },
993
+
994
+ destroy: function() {
995
+ var el = this.element;
996
+
997
+ if (el) {
998
+ el.parentNode.removeChild(el);
999
+ }
1000
+ utils.removeEvtListener(el, 'click', this.clickCb);
1001
+ },
1002
+
1003
+ _handleBubbleClick: function(evt){
1004
+ var action;
1005
+
1006
+ // Override evt for IE8 as IE8 doesn't pass event but binds it to window
1007
+ evt = evt || window.event; // get window.event if argument is falsy (in IE)
1008
+
1009
+ // get srcElement if target is falsy (IE)
1010
+ var targetElement = evt.target || evt.srcElement;
1011
+
1012
+ //Recursively look up the parent tree until we find a match
1013
+ //with one of the classes we're looking for, or the triggering element.
1014
+ function findMatchRecur(el){
1015
+ /* We're going to make the assumption that we're not binding
1016
+ * multiple event classes to the same element.
1017
+ * (next + previous = wait... err... what?)
1018
+ *
1019
+ * In the odd event we end up with an element with multiple
1020
+ * possible matches, the following priority order is applied:
1021
+ * hopscotch-cta, hopscotch-next, hopscotch-prev, hopscotch-close
1022
+ */
1023
+ if(el === evt.currentTarget){ return null; }
1024
+ if(utils.hasClass(el, 'hopscotch-cta')){ return 'cta'; }
1025
+ if(utils.hasClass(el, 'hopscotch-next')){ return 'next'; }
1026
+ if(utils.hasClass(el, 'hopscotch-prev')){ return 'prev'; }
1027
+ if(utils.hasClass(el, 'hopscotch-close')){ return 'close'; }
1028
+ /*else*/ return findMatchRecur(el.parentElement);
1029
+ }
1030
+
1031
+ action = findMatchRecur(targetElement);
1032
+
1033
+ //Now that we know what action we should take, let's take it.
1034
+ if (action === 'cta'){
1035
+ if (!this.opt.isTourBubble) {
1036
+ // This is a callout. Close the callout when CTA is clicked.
1037
+ winHopscotch.getCalloutManager().removeCallout(this.currStep.id);
1038
+ }
1039
+ // Call onCTA callback if one is provided
1040
+ if (this.currStep.onCTA) {
1041
+ utils.invokeCallback(this.currStep.onCTA);
1042
+ }
1043
+ }
1044
+ else if (action === 'next'){
1045
+ winHopscotch.nextStep(true);
1046
+ }
1047
+ else if (action === 'prev'){
1048
+ winHopscotch.prevStep(true);
1049
+ }
1050
+ else if (action === 'close'){
1051
+ if (this.opt.isTourBubble){
1052
+ var currStepNum = winHopscotch.getCurrStepNum(),
1053
+ currTour = winHopscotch.getCurrTour(),
1054
+ doEndCallback = (currStepNum === currTour.steps.length-1);
1055
+
1056
+ utils.invokeEventCallbacks('close');
1057
+
1058
+ winHopscotch.endTour(true, doEndCallback);
1059
+ } else {
1060
+ if (this.opt.onClose) {
1061
+ utils.invokeCallback(this.opt.onClose);
1062
+ }
1063
+ if (this.opt.id && !this.opt.isTourBubble) {
1064
+ // Remove via the HopscotchCalloutManager.
1065
+ // removeCallout() calls HopscotchBubble.destroy internally.
1066
+ winHopscotch.getCalloutManager().removeCallout(this.opt.id);
1067
+ }
1068
+ else {
1069
+ this.destroy();
1070
+ }
1071
+ }
1072
+
1073
+ utils.evtPreventDefault(evt);
1074
+ }
1075
+ //Otherwise, do nothing. We didn't click on anything relevant.
1076
+ },
1077
+
1078
+ init: function(initOpt) {
1079
+ var el = document.createElement('div'),
1080
+ self = this,
1081
+ resizeCooldown = false, // for updating after window resize
1082
+ onWinResize,
1083
+ appendToBody,
1084
+ children,
1085
+ numChildren,
1086
+ node,
1087
+ i,
1088
+ currTour,
1089
+ opt;
1090
+
1091
+ //Register DOM element for this bubble.
1092
+ this.element = el;
1093
+
1094
+ //Merge bubble options with defaults.
1095
+ opt = {
1096
+ showPrevButton: defaultOpts.showPrevButton,
1097
+ showNextButton: defaultOpts.showNextButton,
1098
+ bubbleWidth: defaultOpts.bubbleWidth,
1099
+ bubblePadding: defaultOpts.bubblePadding,
1100
+ arrowWidth: defaultOpts.arrowWidth,
1101
+ isRtl: defaultOpts.isRtl,
1102
+ showNumber: true,
1103
+ isTourBubble: true
1104
+ };
1105
+ initOpt = (typeof initOpt === undefinedStr ? {} : initOpt);
1106
+ utils.extend(opt, initOpt);
1107
+ this.opt = opt;
1108
+
1109
+ //Apply classes to bubble. Add "animated" for fade css animation
1110
+ el.className = 'hopscotch-bubble animated';
1111
+ if (!opt.isTourBubble) {
1112
+ utils.addClass(el, 'hopscotch-callout no-number');
1113
+ } else {
1114
+ currTour = winHopscotch.getCurrTour();
1115
+ if(currTour){
1116
+ utils.addClass(el, 'tour-' + currTour.id);
1117
+ }
1118
+ }
1119
+
1120
+ /**
1121
+ * Not pretty, but IE8 doesn't support Function.bind(), so I'm
1122
+ * relying on closures to keep a handle of "this".
1123
+ * Reset position of bubble when window is resized
1124
+ *
1125
+ * @private
1126
+ */
1127
+ onWinResize = function() {
1128
+ if (resizeCooldown || !self.isShowing) {
1129
+ return;
1130
+ }
1131
+
1132
+ resizeCooldown = true;
1133
+ setTimeout(function() {
1134
+ self.setPosition(self.currStep);
1135
+ resizeCooldown = false;
1136
+ }, 100);
1137
+ };
1138
+
1139
+ //Add listener to reset bubble position on window resize
1140
+ utils.addEvtListener(window, 'resize', onWinResize);
1141
+
1142
+ //Create our click callback handler and keep a
1143
+ //reference to it for later.
1144
+ this.clickCb = function(evt){
1145
+ self._handleBubbleClick(evt);
1146
+ };
1147
+ utils.addEvtListener(el, 'click', this.clickCb);
1148
+
1149
+ //Hide the bubble by default
1150
+ this.hide();
1151
+
1152
+ //Finally, append our new bubble to body once the DOM is ready.
1153
+ if (utils.documentIsReady()) {
1154
+ document.body.appendChild(el);
1155
+ }
1156
+ else {
1157
+ // Moz, webkit, Opera
1158
+ if (document.addEventListener) {
1159
+ appendToBody = function() {
1160
+ document.removeEventListener('DOMContentLoaded', appendToBody);
1161
+ window.removeEventListener('load', appendToBody);
1162
+
1163
+ document.body.appendChild(el);
1164
+ };
1165
+
1166
+ document.addEventListener('DOMContentLoaded', appendToBody, false);
1167
+ }
1168
+ // IE
1169
+ else {
1170
+ appendToBody = function() {
1171
+ if (document.readyState === 'complete') {
1172
+ document.detachEvent('onreadystatechange', appendToBody);
1173
+ window.detachEvent('onload', appendToBody);
1174
+ document.body.appendChild(el);
1175
+ }
1176
+ };
1177
+
1178
+ document.attachEvent('onreadystatechange', appendToBody);
1179
+ }
1180
+ utils.addEvtListener(window, 'load', appendToBody);
1181
+ }
1182
+ }
1183
+ };
1184
+
1185
+ /**
1186
+ * HopscotchCalloutManager
1187
+ *
1188
+ * @class Manages the creation and destruction of single callouts.
1189
+ * @constructor
1190
+ */
1191
+ HopscotchCalloutManager = function() {
1192
+ var callouts = {},
1193
+ calloutOpts = {};
1194
+
1195
+ /**
1196
+ * createCallout
1197
+ *
1198
+ * Creates a standalone callout. This callout has the same API
1199
+ * as a Hopscotch tour bubble.
1200
+ *
1201
+ * @param {Object} opt The options for the callout. For the most
1202
+ * part, these are the same options as you would find in a tour
1203
+ * step.
1204
+ */
1205
+ this.createCallout = function(opt) {
1206
+ var callout;
1207
+
1208
+ if (opt.id) {
1209
+ if(!validIdRegEx.test(opt.id)) {
1210
+ throw new Error('Callout ID is using an invalid format. Use alphanumeric, underscores, and/or hyphens only. First character must be a letter.');
1211
+ }
1212
+ if (callouts[opt.id]) {
1213
+ throw new Error('Callout by that id already exists. Please choose a unique id.');
1214
+ }
1215
+ if (!utils.getStepTarget(opt)) {
1216
+ throw new Error('Must specify existing target element via \'target\' option.');
1217
+ }
1218
+ opt.showNextButton = opt.showPrevButton = false;
1219
+ opt.isTourBubble = false;
1220
+ callout = new HopscotchBubble(opt);
1221
+ callouts[opt.id] = callout;
1222
+ calloutOpts[opt.id] = opt;
1223
+ callout.render(opt, null, function() {
1224
+ callout.show();
1225
+ if (opt.onShow) {
1226
+ utils.invokeCallback(opt.onShow);
1227
+ }
1228
+ });
1229
+ }
1230
+ else {
1231
+ throw new Error('Must specify a callout id.');
1232
+ }
1233
+ return callout;
1234
+ };
1235
+
1236
+ /**
1237
+ * getCallout
1238
+ *
1239
+ * Returns a callout by its id.
1240
+ *
1241
+ * @param {String} id The id of the callout to fetch.
1242
+ * @returns {Object} HopscotchBubble
1243
+ */
1244
+ this.getCallout = function(id) {
1245
+ return callouts[id];
1246
+ };
1247
+
1248
+ /**
1249
+ * removeAllCallouts
1250
+ *
1251
+ * Removes all existing callouts.
1252
+ */
1253
+ this.removeAllCallouts = function() {
1254
+ var calloutId;
1255
+
1256
+ for (calloutId in callouts) {
1257
+ if (callouts.hasOwnProperty(calloutId)) {
1258
+ this.removeCallout(calloutId);
1259
+ }
1260
+ }
1261
+ };
1262
+
1263
+ /**
1264
+ * removeCallout
1265
+ *
1266
+ * Removes an existing callout by id.
1267
+ *
1268
+ * @param {String} id The id of the callout to remove.
1269
+ */
1270
+ this.removeCallout = function(id) {
1271
+ var callout = callouts[id];
1272
+
1273
+ callouts[id] = null;
1274
+ calloutOpts[id] = null;
1275
+ if (!callout) { return; }
1276
+
1277
+ callout.destroy();
1278
+ };
1279
+
1280
+ /**
1281
+ * refreshCalloutPositions
1282
+ *
1283
+ * Refresh the positions for all callouts known by the
1284
+ * callout manager. Typically you'll use
1285
+ * hopscotch.refreshBubblePosition() to refresh ALL
1286
+ * bubbles instead of calling this directly.
1287
+ */
1288
+ this.refreshCalloutPositions = function(){
1289
+ var calloutId,
1290
+ callout,
1291
+ opts;
1292
+
1293
+ for (calloutId in callouts) {
1294
+ if (callouts.hasOwnProperty(calloutId) && calloutOpts.hasOwnProperty(calloutId)) {
1295
+ callout = callouts[calloutId];
1296
+ opts = calloutOpts[calloutId];
1297
+ if(callout && opts){
1298
+ callout.setPosition(opts);
1299
+ }
1300
+ }
1301
+ }
1302
+ };
1303
+ };
1304
+
1305
+ /**
1306
+ * Hopscotch
1307
+ *
1308
+ * @class Creates the Hopscotch object. Used to manage tour progress and configurations.
1309
+ * @constructor
1310
+ * @param {Object} initOptions Options to be passed to `configure()`.
1311
+ */
1312
+ Hopscotch = function(initOptions) {
1313
+ var self = this, // for targetClickNextFn
1314
+ bubble,
1315
+ calloutMgr,
1316
+ opt,
1317
+ currTour,
1318
+ currStepNum,
1319
+ skippedSteps = {},
1320
+ cookieTourId,
1321
+ cookieTourStep,
1322
+ cookieSkippedSteps = [],
1323
+ _configure,
1324
+
1325
+ /**
1326
+ * getBubble
1327
+ *
1328
+ * Singleton accessor function for retrieving or creating bubble object.
1329
+ *
1330
+ * @private
1331
+ * @param setOptions {Boolean} when true, transfers configuration options to the bubble
1332
+ * @returns {Object} HopscotchBubble
1333
+ */
1334
+ getBubble = function(setOptions) {
1335
+ if (!bubble || !bubble.element || !bubble.element.parentNode) {
1336
+ bubble = new HopscotchBubble(opt);
1337
+ }
1338
+ if (setOptions) {
1339
+ utils.extend(bubble.opt, {
1340
+ bubblePadding: getOption('bubblePadding'),
1341
+ bubbleWidth: getOption('bubbleWidth'),
1342
+ showNextButton: getOption('showNextButton'),
1343
+ showPrevButton: getOption('showPrevButton'),
1344
+ showCloseButton: getOption('showCloseButton'),
1345
+ arrowWidth: getOption('arrowWidth'),
1346
+ isRtl: getOption('isRtl')
1347
+ });
1348
+ }
1349
+ return bubble;
1350
+ },
1351
+
1352
+ /**
1353
+ * Destroy the bubble currently associated with Hopscotch.
1354
+ * This is done when we end the current tour.
1355
+ *
1356
+ * @private
1357
+ */
1358
+ destroyBubble = function() {
1359
+ if(bubble){
1360
+ bubble.destroy();
1361
+ bubble = null;
1362
+ }
1363
+ },
1364
+
1365
+ /**
1366
+ * Convenience method for getting an option. Returns custom config option
1367
+ * or the default config option if no custom value exists.
1368
+ *
1369
+ * @private
1370
+ * @param name {String} config option name
1371
+ * @returns {Object} config option value
1372
+ */
1373
+ getOption = function(name) {
1374
+ if (typeof opt === 'undefined') {
1375
+ return defaultOpts[name];
1376
+ }
1377
+ return utils.valOrDefault(opt[name], defaultOpts[name]);
1378
+ },
1379
+
1380
+ /**
1381
+ * getCurrStep
1382
+ *
1383
+ * @private
1384
+ * @returns {Object} the step object corresponding to the current value of currStepNum
1385
+ */
1386
+ getCurrStep = function() {
1387
+ var step;
1388
+
1389
+ if (!currTour || currStepNum < 0 || currStepNum >= currTour.steps.length) {
1390
+ step = null;
1391
+ }
1392
+ else {
1393
+ step = currTour.steps[currStepNum];
1394
+ }
1395
+
1396
+ return step;
1397
+ },
1398
+
1399
+ /**
1400
+ * Used for nextOnTargetClick
1401
+ *
1402
+ * @private
1403
+ */
1404
+ targetClickNextFn = function() {
1405
+ self.nextStep();
1406
+ },
1407
+
1408
+ /**
1409
+ * adjustWindowScroll
1410
+ *
1411
+ * Checks if the bubble or target element is partially or completely
1412
+ * outside of the viewport. If it is, adjust the window scroll position
1413
+ * to bring it back into the viewport.
1414
+ *
1415
+ * @private
1416
+ * @param {Function} cb Callback to invoke after done scrolling.
1417
+ */
1418
+ adjustWindowScroll = function(cb) {
1419
+ var bubble = getBubble(),
1420
+
1421
+ // Calculate the bubble element top and bottom position
1422
+ bubbleEl = bubble.element,
1423
+ bubbleTop = utils.getPixelValue(bubbleEl.style.top),
1424
+ bubbleBottom = bubbleTop + utils.getPixelValue(bubbleEl.offsetHeight),
1425
+
1426
+ // Calculate the target element top and bottom position
1427
+ targetEl = utils.getStepTarget(getCurrStep()),
1428
+ targetBounds = targetEl.getBoundingClientRect(),
1429
+ targetElTop = targetBounds.top + utils.getScrollTop(),
1430
+ targetElBottom = targetBounds.bottom + utils.getScrollTop(),
1431
+
1432
+ // The higher of the two: bubble or target
1433
+ targetTop = (bubbleTop < targetElTop) ? bubbleTop : targetElTop,
1434
+ // The lower of the two: bubble or target
1435
+ targetBottom = (bubbleBottom > targetElBottom) ? bubbleBottom : targetElBottom,
1436
+
1437
+ // Calculate the current viewport top and bottom
1438
+ windowTop = utils.getScrollTop(),
1439
+ windowBottom = windowTop + utils.getWindowHeight(),
1440
+
1441
+ // This is our final target scroll value.
1442
+ scrollToVal = targetTop - getOption('scrollTopMargin'),
1443
+
1444
+ scrollEl,
1445
+ yuiAnim,
1446
+ yuiEase,
1447
+ direction,
1448
+ scrollIncr,
1449
+ scrollTimeout,
1450
+ scrollTimeoutFn;
1451
+
1452
+ // Target and bubble are both visible in viewport
1453
+ if (targetTop >= windowTop && (targetTop <= windowTop + getOption('scrollTopMargin') || targetBottom <= windowBottom)) {
1454
+ if (cb) { cb(); } // HopscotchBubble.show
1455
+ }
1456
+
1457
+ // Abrupt scroll to scroll target
1458
+ else if (!getOption('smoothScroll')) {
1459
+ window.scrollTo(0, scrollToVal);
1460
+
1461
+ if (cb) { cb(); } // HopscotchBubble.show
1462
+ }
1463
+
1464
+ // Smooth scroll to scroll target
1465
+ else {
1466
+ // Use YUI if it exists
1467
+ if (typeof YAHOO !== undefinedStr &&
1468
+ typeof YAHOO.env !== undefinedStr &&
1469
+ typeof YAHOO.env.ua !== undefinedStr &&
1470
+ typeof YAHOO.util !== undefinedStr &&
1471
+ typeof YAHOO.util.Scroll !== undefinedStr) {
1472
+ scrollEl = YAHOO.env.ua.webkit ? document.body : document.documentElement;
1473
+ yuiEase = YAHOO.util.Easing ? YAHOO.util.Easing.easeOut : undefined;
1474
+ yuiAnim = new YAHOO.util.Scroll(scrollEl, {
1475
+ scroll: { to: [0, scrollToVal] }
1476
+ }, getOption('scrollDuration')/1000, yuiEase);
1477
+ yuiAnim.onComplete.subscribe(cb);
1478
+ yuiAnim.animate();
1479
+ }
1480
+
1481
+ // Use jQuery if it exists
1482
+ else if (hasJquery) {
1483
+ jQuery('body, html').animate({ scrollTop: scrollToVal }, getOption('scrollDuration'), cb);
1484
+ }
1485
+
1486
+ // Use my crummy setInterval scroll solution if we're using plain, vanilla Javascript.
1487
+ else {
1488
+ if (scrollToVal < 0) {
1489
+ scrollToVal = 0;
1490
+ }
1491
+
1492
+ // 48 * 10 == 480ms scroll duration
1493
+ // make it slightly less than CSS transition duration because of
1494
+ // setInterval overhead.
1495
+ // To increase or decrease duration, change the divisor of scrollIncr.
1496
+ direction = (windowTop > targetTop) ? -1 : 1; // -1 means scrolling up, 1 means down
1497
+ scrollIncr = Math.abs(windowTop - scrollToVal) / (getOption('scrollDuration')/10);
1498
+ scrollTimeoutFn = function() {
1499
+ var scrollTop = utils.getScrollTop(),
1500
+ scrollTarget = scrollTop + (direction * scrollIncr);
1501
+
1502
+ if ((direction > 0 && scrollTarget >= scrollToVal) ||
1503
+ (direction < 0 && scrollTarget <= scrollToVal)) {
1504
+ // Overshot our target. Just manually set to equal the target
1505
+ // and clear the interval
1506
+ scrollTarget = scrollToVal;
1507
+ if (cb) { cb(); } // HopscotchBubble.show
1508
+ window.scrollTo(0, scrollTarget);
1509
+ return;
1510
+ }
1511
+
1512
+ window.scrollTo(0, scrollTarget);
1513
+
1514
+ if (utils.getScrollTop() === scrollTop) {
1515
+ // Couldn't scroll any further.
1516
+ if (cb) { cb(); } // HopscotchBubble.show
1517
+ return;
1518
+ }
1519
+
1520
+ // If we reached this point, that means there's still more to scroll.
1521
+ setTimeout(scrollTimeoutFn, 10);
1522
+ };
1523
+
1524
+ scrollTimeoutFn();
1525
+ }
1526
+ }
1527
+ },
1528
+
1529
+ /**
1530
+ * goToStepWithTarget
1531
+ *
1532
+ * Helper function to increment the step number until a step is found where
1533
+ * the step target exists or until we reach the end/beginning of the tour.
1534
+ *
1535
+ * @private
1536
+ * @param {Number} direction Either 1 for incrementing or -1 for decrementing
1537
+ * @param {Function} cb The callback function to be invoked when the step has been found
1538
+ */
1539
+ goToStepWithTarget = function(direction, cb) {
1540
+ var target,
1541
+ step,
1542
+ goToStepFn;
1543
+
1544
+ if (currStepNum + direction >= 0 &&
1545
+ currStepNum + direction < currTour.steps.length) {
1546
+
1547
+ currStepNum += direction;
1548
+ step = getCurrStep();
1549
+
1550
+ goToStepFn = function() {
1551
+ target = utils.getStepTarget(step);
1552
+
1553
+ if (target) {
1554
+ //this step was previously skipped, but now its target exists,
1555
+ //remove this step from skipped steps set
1556
+ if(skippedSteps[currStepNum]) {
1557
+ delete skippedSteps[currStepNum];
1558
+ }
1559
+ // We're done! Return the step number via the callback.
1560
+ cb(currStepNum);
1561
+ }
1562
+ else {
1563
+ //mark this step as skipped, since its target wasn't found
1564
+ skippedSteps[currStepNum] = true;
1565
+ // Haven't found a valid target yet. Recursively call
1566
+ // goToStepWithTarget.
1567
+ utils.invokeEventCallbacks('error');
1568
+ goToStepWithTarget(direction, cb);
1569
+ }
1570
+ };
1571
+
1572
+ if (step.delay) {
1573
+ setTimeout(goToStepFn, step.delay);
1574
+ }
1575
+ else {
1576
+ goToStepFn();
1577
+ }
1578
+ }
1579
+ else {
1580
+ cb(-1); // signal that we didn't find any step with a valid target
1581
+ }
1582
+ },
1583
+
1584
+ /**
1585
+ * changeStep
1586
+ *
1587
+ * Helper function to change step by going forwards or backwards 1.
1588
+ * nextStep and prevStep are publicly accessible wrappers for this function.
1589
+ *
1590
+ * @private
1591
+ * @param {Boolean} doCallbacks Flag for invoking onNext or onPrev callbacks
1592
+ * @param {Number} direction Either 1 for "next" or -1 for "prev"
1593
+ */
1594
+ changeStep = function(doCallbacks, direction) {
1595
+ var bubble = getBubble(),
1596
+ self = this,
1597
+ step,
1598
+ origStep,
1599
+ wasMultiPage,
1600
+ changeStepCb;
1601
+
1602
+ bubble.hide();
1603
+
1604
+ doCallbacks = utils.valOrDefault(doCallbacks, true);
1605
+
1606
+ step = getCurrStep();
1607
+
1608
+ if (step.nextOnTargetClick) {
1609
+ // Detach the listener when tour is moving to a different step
1610
+ utils.removeEvtListener(utils.getStepTarget(step), 'click', targetClickNextFn);
1611
+ }
1612
+
1613
+ origStep = step;
1614
+ if (direction > 0) {
1615
+ wasMultiPage = origStep.multipage;
1616
+ }
1617
+ else {
1618
+ wasMultiPage = (currStepNum > 0 && currTour.steps[currStepNum-1].multipage);
1619
+ }
1620
+
1621
+ /**
1622
+ * Callback for goToStepWithTarget
1623
+ *
1624
+ * @private
1625
+ */
1626
+ changeStepCb = function(stepNum) {
1627
+ var doShowFollowingStep;
1628
+
1629
+ if (stepNum === -1) {
1630
+ // Wasn't able to find a step with an existing element. End tour.
1631
+ return this.endTour(true);
1632
+ }
1633
+
1634
+ if (doCallbacks) {
1635
+ if (direction > 0) {
1636
+ doShowFollowingStep = utils.invokeEventCallbacks('next', origStep.onNext);
1637
+ }
1638
+ else {
1639
+ doShowFollowingStep = utils.invokeEventCallbacks('prev', origStep.onPrev);
1640
+ }
1641
+ }
1642
+
1643
+ // If the state of the tour is updated in a callback, assume the client
1644
+ // doesn't want to go to next step since they specifically updated.
1645
+ if (stepNum !== currStepNum) {
1646
+ return;
1647
+ }
1648
+
1649
+ if (wasMultiPage) {
1650
+ // Update state for the next page
1651
+ setStateHelper();
1652
+
1653
+ // Next step is on a different page, so no need to attempt to render it.
1654
+ return;
1655
+ }
1656
+
1657
+ doShowFollowingStep = utils.valOrDefault(doShowFollowingStep, true);
1658
+
1659
+ // If the onNext/onPrev callback returned false, halt the tour and
1660
+ // don't show the next step.
1661
+ if (doShowFollowingStep) {
1662
+ this.showStep(stepNum);
1663
+ }
1664
+ else {
1665
+ // Halt tour (but don't clear state)
1666
+ this.endTour(false);
1667
+ }
1668
+ };
1669
+
1670
+ if (!wasMultiPage && getOption('skipIfNoElement')) {
1671
+ goToStepWithTarget(direction, function(stepNum) {
1672
+ changeStepCb.call(self, stepNum);
1673
+ });
1674
+ }
1675
+ else if (currStepNum + direction >= 0 && currStepNum + direction < currTour.steps.length) {
1676
+ // only try incrementing once, and invoke error callback if no target is found
1677
+ currStepNum += direction;
1678
+ step = getCurrStep();
1679
+ if (!utils.getStepTarget(step) && !wasMultiPage) {
1680
+ utils.invokeEventCallbacks('error');
1681
+ return this.endTour(true, false);
1682
+ }
1683
+ changeStepCb.call(this, currStepNum);
1684
+ } else if (currStepNum + direction === currTour.steps.length) {
1685
+ return this.endTour();
1686
+ }
1687
+
1688
+ return this;
1689
+ },
1690
+
1691
+ /**
1692
+ * loadTour
1693
+ *
1694
+ * Loads, but does not display, tour.
1695
+ *
1696
+ * @private
1697
+ * @param tour The tour JSON object
1698
+ */
1699
+ loadTour = function(tour) {
1700
+ var tmpOpt = {},
1701
+ prop,
1702
+ tourState,
1703
+ tourStateValues;
1704
+
1705
+ // Set tour-specific configurations
1706
+ for (prop in tour) {
1707
+ if (tour.hasOwnProperty(prop) &&
1708
+ prop !== 'id' &&
1709
+ prop !== 'steps') {
1710
+ tmpOpt[prop] = tour[prop];
1711
+ }
1712
+ }
1713
+
1714
+ //this.resetDefaultOptions(); // reset all options so there are no surprises
1715
+ // TODO check number of config properties of tour
1716
+ _configure.call(this, tmpOpt, true);
1717
+
1718
+ // Get existing tour state, if it exists.
1719
+ tourState = utils.getState(getOption('cookieName'));
1720
+ if (tourState) {
1721
+ tourStateValues = tourState.split(':');
1722
+ cookieTourId = tourStateValues[0]; // selecting tour is not supported by this framework.
1723
+ cookieTourStep = tourStateValues[1];
1724
+
1725
+ if(tourStateValues.length > 2) {
1726
+ cookieSkippedSteps = tourStateValues[2].split(',');
1727
+ }
1728
+
1729
+ cookieTourStep = parseInt(cookieTourStep, 10);
1730
+ }
1731
+
1732
+ return this;
1733
+ },
1734
+
1735
+ /**
1736
+ * Find the first step to show for a tour. (What is the first step with a
1737
+ * target on the page?)
1738
+ */
1739
+ findStartingStep = function(startStepNum, savedSkippedSteps, cb) {
1740
+ var step,
1741
+ target;
1742
+
1743
+ currStepNum = startStepNum || 0;
1744
+ skippedSteps = savedSkippedSteps || {};
1745
+ step = getCurrStep();
1746
+ target = utils.getStepTarget(step);
1747
+
1748
+ if (target) {
1749
+ // First step had an existing target.
1750
+ cb(currStepNum);
1751
+ return;
1752
+ }
1753
+
1754
+ if (!target) {
1755
+ // Previous target doesn't exist either. The user may have just
1756
+ // clicked on a link that wasn't part of the tour. Another possibility is that
1757
+ // the user clicked on the correct link, but the target is just missing for
1758
+ // whatever reason. In either case, we should just advance until we find a step
1759
+ // that has a target on the page or end the tour if we can't find such a step.
1760
+ utils.invokeEventCallbacks('error');
1761
+
1762
+ //this step was skipped, since its target does not exist
1763
+ skippedSteps[currStepNum] = true;
1764
+
1765
+ if (getOption('skipIfNoElement')) {
1766
+ goToStepWithTarget(1, cb);
1767
+ return;
1768
+ }
1769
+ else {
1770
+ currStepNum = -1;
1771
+ cb(currStepNum);
1772
+ }
1773
+ }
1774
+ },
1775
+
1776
+ showStepHelper = function(stepNum) {
1777
+ var step = currTour.steps[stepNum],
1778
+ bubble = getBubble(),
1779
+ targetEl = utils.getStepTarget(step);
1780
+
1781
+ function showBubble() {
1782
+ bubble.show();
1783
+ utils.invokeEventCallbacks('show', step.onShow);
1784
+ }
1785
+
1786
+ if (currStepNum !== stepNum && getCurrStep().nextOnTargetClick) {
1787
+ // Detach the listener when tour is moving to a different step
1788
+ utils.removeEvtListener(utils.getStepTarget(getCurrStep()), 'click', targetClickNextFn);
1789
+ }
1790
+
1791
+ // Update bubble for current step
1792
+ currStepNum = stepNum;
1793
+
1794
+ bubble.hide(false);
1795
+
1796
+ bubble.render(step, stepNum, function(adjustScroll) {
1797
+ // when done adjusting window scroll, call showBubble helper fn
1798
+ if (adjustScroll) {
1799
+ adjustWindowScroll(showBubble);
1800
+ }
1801
+ else {
1802
+ showBubble();
1803
+ }
1804
+
1805
+ // If we want to advance to next step when user clicks on target.
1806
+ if (step.nextOnTargetClick) {
1807
+ utils.addEvtListener(targetEl, 'click', targetClickNextFn);
1808
+ }
1809
+ });
1810
+
1811
+ setStateHelper();
1812
+ },
1813
+
1814
+ setStateHelper = function() {
1815
+ var cookieVal = currTour.id + ':' + currStepNum,
1816
+ skipedStepIndexes = winHopscotch.getSkippedStepsIndexes();
1817
+
1818
+ if(skipedStepIndexes && skipedStepIndexes.length > 0) {
1819
+ cookieVal += ':' + skipedStepIndexes.join(',');
1820
+ }
1821
+
1822
+ utils.setState(getOption('cookieName'), cookieVal, 1);
1823
+ },
1824
+
1825
+ /**
1826
+ * init
1827
+ *
1828
+ * Initializes the Hopscotch object.
1829
+ *
1830
+ * @private
1831
+ */
1832
+ init = function(initOptions) {
1833
+ if (initOptions) {
1834
+ //initOptions.cookieName = initOptions.cookieName || 'hopscotch.tour.state';
1835
+ this.configure(initOptions);
1836
+ }
1837
+ };
1838
+
1839
+ /**
1840
+ * getCalloutManager
1841
+ *
1842
+ * Gets the callout manager.
1843
+ *
1844
+ * @returns {Object} HopscotchCalloutManager
1845
+ *
1846
+ */
1847
+ this.getCalloutManager = function() {
1848
+ if (typeof calloutMgr === undefinedStr) {
1849
+ calloutMgr = new HopscotchCalloutManager();
1850
+ }
1851
+
1852
+ return calloutMgr;
1853
+ };
1854
+
1855
+ /**
1856
+ * startTour
1857
+ *
1858
+ * Begins the tour.
1859
+ *
1860
+ * @param {Object} tour The tour JSON object
1861
+ * @stepNum {Number} stepNum __Optional__ The step number to start from
1862
+ * @returns {Object} Hopscotch
1863
+ *
1864
+ */
1865
+ this.startTour = function(tour, stepNum) {
1866
+ var bubble,
1867
+ currStepNum,
1868
+ skippedSteps = {},
1869
+ self = this;
1870
+
1871
+ // loadTour if we are calling startTour directly. (When we call startTour
1872
+ // from window onLoad handler, we'll use currTour)
1873
+ if (!currTour) {
1874
+
1875
+ // Sanity check! Is there a tour?
1876
+ if(!tour){
1877
+ throw new Error('Tour data is required for startTour.');
1878
+ }
1879
+
1880
+ // Check validity of tour ID. If invalid, throw an error.
1881
+ if(!tour.id || !validIdRegEx.test(tour.id)) {
1882
+ throw new Error('Tour ID is using an invalid format. Use alphanumeric, underscores, and/or hyphens only. First character must be a letter.');
1883
+ }
1884
+
1885
+ currTour = tour;
1886
+ loadTour.call(this, tour);
1887
+
1888
+ }
1889
+
1890
+ if (typeof stepNum !== undefinedStr) {
1891
+ if (stepNum >= currTour.steps.length) {
1892
+ throw new Error('Specified step number out of bounds.');
1893
+ }
1894
+ currStepNum = stepNum;
1895
+ }
1896
+
1897
+ // If document isn't ready, wait for it to finish loading.
1898
+ // (so that we can calculate positioning accurately)
1899
+ if (!utils.documentIsReady()) {
1900
+ waitingToStart = true;
1901
+ return this;
1902
+ }
1903
+
1904
+ if (typeof currStepNum === "undefined" && currTour.id === cookieTourId && typeof cookieTourStep !== undefinedStr) {
1905
+ currStepNum = cookieTourStep;
1906
+ if(cookieSkippedSteps.length > 0){
1907
+ for(var i = 0, len = cookieSkippedSteps.length; i < len; i++) {
1908
+ skippedSteps[cookieSkippedSteps[i]] = true;
1909
+ }
1910
+ }
1911
+ }
1912
+ else if (!currStepNum) {
1913
+ currStepNum = 0;
1914
+ }
1915
+
1916
+ // Find the current step we should begin the tour on, and then actually start the tour.
1917
+ findStartingStep(currStepNum, skippedSteps, function(stepNum) {
1918
+ var target = (stepNum !== -1) && utils.getStepTarget(currTour.steps[stepNum]);
1919
+
1920
+ if (!target) {
1921
+ // Should we trigger onEnd callback? Let's err on the side of caution
1922
+ // and not trigger it. Don't want weird stuff happening on a page that
1923
+ // wasn't meant for the tour. Up to the developer to fix their tour.
1924
+ self.endTour(false, false);
1925
+ return;
1926
+ }
1927
+
1928
+ utils.invokeEventCallbacks('start');
1929
+
1930
+ bubble = getBubble();
1931
+ // TODO: do we still need this call to .hide()? No longer using opt.animate...
1932
+ // Leaving it in for now to play it safe
1933
+ bubble.hide(false); // make invisible for boundingRect calculations when opt.animate == true
1934
+
1935
+ self.isActive = true;
1936
+
1937
+ if (!utils.getStepTarget(getCurrStep())) {
1938
+ // First step element doesn't exist
1939
+ utils.invokeEventCallbacks('error');
1940
+ if (getOption('skipIfNoElement')) {
1941
+ self.nextStep(false);
1942
+ }
1943
+ }
1944
+ else {
1945
+ self.showStep(stepNum);
1946
+ }
1947
+ });
1948
+
1949
+ return this;
1950
+ };
1951
+
1952
+ /**
1953
+ * showStep
1954
+ *
1955
+ * Skips to a specific step and renders the corresponding bubble.
1956
+ *
1957
+ * @stepNum {Number} stepNum The step number to show
1958
+ * @returns {Object} Hopscotch
1959
+ */
1960
+ this.showStep = function(stepNum) {
1961
+ var step = currTour.steps[stepNum];
1962
+ if(!utils.getStepTarget(step)) {
1963
+ return;
1964
+ }
1965
+
1966
+ if (step.delay) {
1967
+ setTimeout(function() {
1968
+ showStepHelper(stepNum);
1969
+ }, step.delay);
1970
+ }
1971
+ else {
1972
+ showStepHelper(stepNum);
1973
+ }
1974
+ return this;
1975
+ };
1976
+
1977
+ /**
1978
+ * prevStep
1979
+ *
1980
+ * Jump to the previous step.
1981
+ *
1982
+ * @param {Boolean} doCallbacks Flag for invoking onPrev callback. Defaults to true.
1983
+ * @returns {Object} Hopscotch
1984
+ */
1985
+ this.prevStep = function(doCallbacks) {
1986
+ changeStep.call(this, doCallbacks, -1);
1987
+ return this;
1988
+ };
1989
+
1990
+ /**
1991
+ * nextStep
1992
+ *
1993
+ * Jump to the next step.
1994
+ *
1995
+ * @param {Boolean} doCallbacks Flag for invoking onNext callback. Defaults to true.
1996
+ * @returns {Object} Hopscotch
1997
+ */
1998
+ this.nextStep = function(doCallbacks) {
1999
+ changeStep.call(this, doCallbacks, 1);
2000
+ return this;
2001
+ };
2002
+
2003
+ /**
2004
+ * endTour
2005
+ *
2006
+ * Cancels out of an active tour.
2007
+ *
2008
+ * @param {Boolean} clearState Flag for clearing state. Defaults to true.
2009
+ * @param {Boolean} doCallbacks Flag for invoking 'onEnd' callbacks. Defaults to true.
2010
+ * @returns {Object} Hopscotch
2011
+ */
2012
+ this.endTour = function(clearState, doCallbacks) {
2013
+ var bubble = getBubble(),
2014
+ currentStep;
2015
+
2016
+ clearState = utils.valOrDefault(clearState, true);
2017
+ doCallbacks = utils.valOrDefault(doCallbacks, true);
2018
+
2019
+ //remove event listener if current step had it added
2020
+ if(currTour) {
2021
+ currentStep = getCurrStep();
2022
+ if(currentStep && currentStep.nextOnTargetClick) {
2023
+ utils.removeEvtListener(utils.getStepTarget(currentStep), 'click', targetClickNextFn);
2024
+ }
2025
+ }
2026
+
2027
+ currStepNum = 0;
2028
+ cookieTourStep = undefined;
2029
+
2030
+ bubble.hide();
2031
+ if (clearState) {
2032
+ utils.clearState(getOption('cookieName'));
2033
+ }
2034
+ if (this.isActive) {
2035
+ this.isActive = false;
2036
+
2037
+ if (currTour && doCallbacks) {
2038
+ utils.invokeEventCallbacks('end');
2039
+ }
2040
+ }
2041
+
2042
+ this.removeCallbacks(null, true);
2043
+ this.resetDefaultOptions();
2044
+ destroyBubble();
2045
+
2046
+ currTour = null;
2047
+
2048
+ return this;
2049
+ };
2050
+
2051
+ /**
2052
+ * getCurrTour
2053
+ *
2054
+ * @return {Object} The currently loaded tour.
2055
+ */
2056
+ this.getCurrTour = function() {
2057
+ return currTour;
2058
+ };
2059
+
2060
+ /**
2061
+ * getCurrTarget
2062
+ *
2063
+ * @return {Object} The currently visible target.
2064
+ */
2065
+ this.getCurrTarget = function() {
2066
+ return utils.getStepTarget(getCurrStep());
2067
+ };
2068
+
2069
+ /**
2070
+ * getCurrStepNum
2071
+ *
2072
+ * @return {number} The current zero-based step number.
2073
+ */
2074
+ this.getCurrStepNum = function() {
2075
+ return currStepNum;
2076
+ };
2077
+
2078
+ /**
2079
+ * getSkippedStepsIndexes
2080
+ *
2081
+ * @return {Array} Array of skipped step indexes
2082
+ */
2083
+ this.getSkippedStepsIndexes = function() {
2084
+ var skippedStepsIdxArray = [],
2085
+ stepIds;
2086
+
2087
+ for(stepIds in skippedSteps){
2088
+ skippedStepsIdxArray.push(stepIds);
2089
+ }
2090
+
2091
+ return skippedStepsIdxArray;
2092
+ };
2093
+
2094
+ /**
2095
+ * refreshBubblePosition
2096
+ *
2097
+ * Tell hopscotch that the position of the current tour element changed
2098
+ * and the bubble therefore needs to be redrawn. Also refreshes position
2099
+ * of all Hopscotch Callouts on the page.
2100
+ *
2101
+ * @returns {Object} Hopscotch
2102
+ */
2103
+ this.refreshBubblePosition = function() {
2104
+ var currStep = getCurrStep();
2105
+ if(currStep){
2106
+ getBubble().setPosition(currStep);
2107
+ }
2108
+ this.getCalloutManager().refreshCalloutPositions();
2109
+ return this;
2110
+ };
2111
+
2112
+ /**
2113
+ * listen
2114
+ *
2115
+ * Adds a callback for one of the event types. Valid event types are:
2116
+ *
2117
+ * @param {string} evtType "start", "end", "next", "prev", "show", "close", or "error"
2118
+ * @param {Function} cb The callback to add.
2119
+ * @param {Boolean} isTourCb Flag indicating callback is from a tour definition.
2120
+ * For internal use only!
2121
+ * @returns {Object} Hopscotch
2122
+ */
2123
+ this.listen = function(evtType, cb, isTourCb) {
2124
+ if (evtType) {
2125
+ callbacks[evtType].push({ cb: cb, fromTour: isTourCb });
2126
+ }
2127
+ return this;
2128
+ };
2129
+
2130
+ /**
2131
+ * unlisten
2132
+ *
2133
+ * Removes a callback for one of the event types, e.g. 'start', 'next', etc.
2134
+ *
2135
+ * @param {string} evtType "start", "end", "next", "prev", "show", "close", or "error"
2136
+ * @param {Function} cb The callback to remove.
2137
+ * @returns {Object} Hopscotch
2138
+ */
2139
+ this.unlisten = function(evtType, cb) {
2140
+ var evtCallbacks = callbacks[evtType],
2141
+ i,
2142
+ len;
2143
+
2144
+ for (i = 0, len = evtCallbacks.length; i < len; ++i) {
2145
+ if (evtCallbacks[i] === cb) {
2146
+ evtCallbacks.splice(i, 1);
2147
+ }
2148
+ }
2149
+ return this;
2150
+ };
2151
+
2152
+ /**
2153
+ * removeCallbacks
2154
+ *
2155
+ * Remove callbacks for hopscotch events. If tourOnly is set to true, only
2156
+ * removes callbacks specified by a tour (callbacks set by external calls
2157
+ * to hopscotch.configure or hopscotch.listen will not be removed). If
2158
+ * evtName is null or undefined, callbacks for all events will be removed.
2159
+ *
2160
+ * @param {string} evtName Optional Event name for which we should remove callbacks
2161
+ * @param {boolean} tourOnly Optional flag to indicate we should only remove callbacks added
2162
+ * by a tour. Defaults to false.
2163
+ * @returns {Object} Hopscotch
2164
+ */
2165
+ this.removeCallbacks = function(evtName, tourOnly) {
2166
+ var cbArr,
2167
+ i,
2168
+ len,
2169
+ evt;
2170
+
2171
+ // If evtName is null or undefined, remove callbacks for all events.
2172
+ for (evt in callbacks) {
2173
+ if (!evtName || evtName === evt) {
2174
+ if (tourOnly) {
2175
+ cbArr = callbacks[evt];
2176
+ for (i=0, len=cbArr.length; i < len; ++i) {
2177
+ if (cbArr[i].fromTour) {
2178
+ cbArr.splice(i--, 1);
2179
+ --len;
2180
+ }
2181
+ }
2182
+ }
2183
+ else {
2184
+ callbacks[evt] = [];
2185
+ }
2186
+ }
2187
+ }
2188
+ return this;
2189
+ };
2190
+
2191
+ /**
2192
+ * registerHelper
2193
+ * ==============
2194
+ * Registers a helper function to be used as a callback function.
2195
+ *
2196
+ * @param {String} id The id of the function.
2197
+ * @param {Function} id The callback function.
2198
+ */
2199
+ this.registerHelper = function(id, fn) {
2200
+ if (typeof id === 'string' && typeof fn === 'function') {
2201
+ helpers[id] = fn;
2202
+ }
2203
+ };
2204
+
2205
+ this.unregisterHelper = function(id) {
2206
+ helpers[id] = null;
2207
+ };
2208
+
2209
+ this.invokeHelper = function(id) {
2210
+ var args = [],
2211
+ i,
2212
+ len;
2213
+
2214
+ for (i = 1, len = arguments.length; i < len; ++i) {
2215
+ args.push(arguments[i]);
2216
+ }
2217
+ if (helpers[id]) {
2218
+ helpers[id].call(null, args);
2219
+ }
2220
+ };
2221
+
2222
+ /**
2223
+ * setCookieName
2224
+ *
2225
+ * Sets the cookie name (or sessionStorage name, if supported) used for multi-page
2226
+ * tour persistence.
2227
+ *
2228
+ * @param {String} name The cookie name
2229
+ * @returns {Object} Hopscotch
2230
+ */
2231
+ this.setCookieName = function(name) {
2232
+ opt.cookieName = name;
2233
+ return this;
2234
+ };
2235
+
2236
+ /**
2237
+ * resetDefaultOptions
2238
+ *
2239
+ * Resets all configuration options to default.
2240
+ *
2241
+ * @returns {Object} Hopscotch
2242
+ */
2243
+ this.resetDefaultOptions = function() {
2244
+ opt = {};
2245
+ return this;
2246
+ };
2247
+
2248
+ /**
2249
+ * resetDefaultI18N
2250
+ *
2251
+ * Resets all i18n.
2252
+ *
2253
+ * @returns {Object} Hopscotch
2254
+ */
2255
+ this.resetDefaultI18N = function() {
2256
+ customI18N = {};
2257
+ return this;
2258
+ };
2259
+
2260
+ /**
2261
+ * hasState
2262
+ *
2263
+ * Returns state from a previous tour run, if it exists.
2264
+ *
2265
+ * @returns {String} State of previous tour run, or empty string if none exists.
2266
+ */
2267
+ this.getState = function() {
2268
+ return utils.getState(getOption('cookieName'));
2269
+ };
2270
+
2271
+ /**
2272
+ * _configure
2273
+ *
2274
+ * @see this.configure
2275
+ * @private
2276
+ * @param options
2277
+ * @param {Boolean} isTourOptions Should be set to true when setting options from a tour definition.
2278
+ */
2279
+ _configure = function(options, isTourOptions) {
2280
+ var bubble,
2281
+ events = ['next', 'prev', 'start', 'end', 'show', 'error', 'close'],
2282
+ eventPropName,
2283
+ callbackProp,
2284
+ i,
2285
+ len;
2286
+
2287
+ if (!opt) {
2288
+ this.resetDefaultOptions();
2289
+ }
2290
+
2291
+ utils.extend(opt, options);
2292
+
2293
+ if (options) {
2294
+ utils.extend(customI18N, options.i18n);
2295
+ }
2296
+
2297
+ for (i = 0, len = events.length; i < len; ++i) {
2298
+ // At this point, options[eventPropName] may have changed from an array
2299
+ // to a function.
2300
+ eventPropName = 'on' + events[i].charAt(0).toUpperCase() + events[i].substring(1);
2301
+ if (options[eventPropName]) {
2302
+ this.listen(events[i],
2303
+ options[eventPropName],
2304
+ isTourOptions);
2305
+ }
2306
+ }
2307
+
2308
+ bubble = getBubble(true);
2309
+
2310
+ return this;
2311
+ };
2312
+
2313
+ /**
2314
+ * configure
2315
+ *
2316
+ * <pre>
2317
+ * VALID OPTIONS INCLUDE...
2318
+ *
2319
+ * - bubbleWidth: Number - Default bubble width. Defaults to 280.
2320
+ * - bubblePadding: Number - DEPRECATED. Default bubble padding. Defaults to 15.
2321
+ * - smoothScroll: Boolean - should the page scroll smoothly to the next
2322
+ * step? Defaults to TRUE.
2323
+ * - scrollDuration: Number - Duration of page scroll. Only relevant when
2324
+ * smoothScroll is set to true. Defaults to
2325
+ * 1000ms.
2326
+ * - scrollTopMargin: NUMBER - When the page scrolls, how much space should there
2327
+ * be between the bubble/targetElement and the top
2328
+ * of the viewport? Defaults to 200.
2329
+ * - showCloseButton: Boolean - should the tour bubble show a close (X) button?
2330
+ * Defaults to TRUE.
2331
+ * - showPrevButton: Boolean - should the bubble have the Previous button?
2332
+ * Defaults to FALSE.
2333
+ * - showNextButton: Boolean - should the bubble have the Next button?
2334
+ * Defaults to TRUE.
2335
+ * - arrowWidth: Number - Default arrow width. (space between the bubble
2336
+ * and the targetEl) Used for bubble position
2337
+ * calculation. Only use this option if you are
2338
+ * using your own custom CSS. Defaults to 20.
2339
+ * - skipIfNoElement Boolean - If a specified target element is not found,
2340
+ * should we skip to the next step? Defaults to
2341
+ * TRUE.
2342
+ * - onNext: Function - A callback to be invoked after every click on
2343
+ * a "Next" button.
2344
+ * - isRtl: Boolean - Set to true when instantiating in a right-to-left
2345
+ * language environment, or if mirrored positioning is
2346
+ * needed.
2347
+ * Defaults to FALSE.
2348
+ *
2349
+ * - i18n: Object - For i18n purposes. Allows you to change the
2350
+ * text of button labels and step numbers.
2351
+ * - i18n.stepNums: Array\<String\> - Provide a list of strings to be shown as
2352
+ * the step number, based on index of array. Unicode
2353
+ * characters are supported. (e.g., ['&#x4e00;',
2354
+ * '&#x4e8c;', '&#x4e09;']) If there are more steps
2355
+ * than provided numbers, Arabic numerals
2356
+ * ('4', '5', '6', etc.) will be used as default.
2357
+ * // =========
2358
+ * // CALLBACKS
2359
+ * // =========
2360
+ * - onNext: Function - Invoked after every click on a "Next" button.
2361
+ * - onPrev: Function - Invoked after every click on a "Prev" button.
2362
+ * - onStart: Function - Invoked when the tour is started.
2363
+ * - onEnd: Function - Invoked when the tour ends.
2364
+ * - onClose: Function - Invoked when the user closes the tour before finishing.
2365
+ * - onError: Function - Invoked when the specified target element doesn't exist on the page.
2366
+ *
2367
+ * // ====
2368
+ * // I18N
2369
+ * // ====
2370
+ * i18n: OBJECT - For i18n purposes. Allows you to change the text
2371
+ * of button labels and step numbers.
2372
+ * i18n.nextBtn: STRING - Label for next button
2373
+ * i18n.prevBtn: STRING - Label for prev button
2374
+ * i18n.doneBtn: STRING - Label for done button
2375
+ * i18n.skipBtn: STRING - Label for skip button
2376
+ * i18n.closeTooltip: STRING - Text for close button tooltip
2377
+ * i18n.stepNums: ARRAY<STRING> - Provide a list of strings to be shown as
2378
+ * the step number, based on index of array. Unicode
2379
+ * characters are supported. (e.g., ['&#x4e00;',
2380
+ * '&#x4e8c;', '&#x4e09;']) If there are more steps
2381
+ * than provided numbers, Arabic numerals
2382
+ * ('4', '5', '6', etc.) will be used as default.
2383
+ * </pre>
2384
+ *
2385
+ * @example hopscotch.configure({ scrollDuration: 1000, scrollTopMargin: 150 });
2386
+ * @example
2387
+ * hopscotch.configure({
2388
+ * scrollTopMargin: 150,
2389
+ * onStart: function() {
2390
+ * alert("Have fun!");
2391
+ * },
2392
+ * i18n: {
2393
+ * nextBtn: 'Forward',
2394
+ * prevBtn: 'Previous'
2395
+ * closeTooltip: 'Quit'
2396
+ * }
2397
+ * });
2398
+ *
2399
+ * @param {Object} options A hash of configuration options.
2400
+ * @returns {Object} Hopscotch
2401
+ */
2402
+ this.configure = function(options) {
2403
+ return _configure.call(this, options, false);
2404
+ };
2405
+
2406
+ /**
2407
+ * Set the template that should be used for rendering Hopscotch bubbles.
2408
+ * If a string, it's assumed your template is available in the
2409
+ * hopscotch.templates namespace.
2410
+ *
2411
+ * @param {String|Function(obj)} The template to use for rendering.
2412
+ * @returns {Object} The Hopscotch object (for chaining).
2413
+ */
2414
+ this.setRenderer = function(render){
2415
+ var typeOfRender = typeof render;
2416
+
2417
+ if(typeOfRender === 'string'){
2418
+ templateToUse = render;
2419
+ customRenderer = undefined;
2420
+ }
2421
+ else if(typeOfRender === 'function'){
2422
+ customRenderer = render;
2423
+ }
2424
+ return this;
2425
+ };
2426
+
2427
+ /**
2428
+ * Sets the escaping method to be used by JST templates.
2429
+ *
2430
+ * @param {Function} - The escape method to use.
2431
+ * @returns {Object} The Hopscotch object (for chaining).
2432
+ */
2433
+ this.setEscaper = function(esc){
2434
+ if (typeof esc === 'function'){
2435
+ customEscape = esc;
2436
+ }
2437
+ return this;
2438
+ };
2439
+
2440
+ init.call(this, initOptions);
2441
+ };
2442
+
2443
+ winHopscotch = new Hopscotch();
2444
+
2445
+ // Template includes, placed inside a closure to ensure we don't
2446
+ // end up declaring our shim globally.
2447
+ (function(){
2448
+ var _ = {};
2449
+ /*
2450
+ * Adapted from the Underscore.js framework. Check it out at
2451
+ * https://github.com/jashkenas/underscore
2452
+ */
2453
+ _.escape = function(str){
2454
+ if(customEscape){ return customEscape(str); }
2455
+
2456
+ if(str == null) return '';
2457
+ return ('' + str).replace(new RegExp('[&<>"\']', 'g'), function(match){
2458
+ if(match == '&'){ return '&amp;' }
2459
+ if(match == '<'){ return '&lt;' }
2460
+ if(match == '>'){ return '&gt;' }
2461
+ if(match == '"'){ return '&quot;' }
2462
+ if(match == "'"){ return '&#x27;' }
2463
+ });
2464
+ }
2465
+ this["templates"] = this["templates"] || {};
2466
+
2467
+ this["templates"]["bubble_default"] = function(obj) {
2468
+ obj || (obj = {});
2469
+ var __t, __p = '', __e = _.escape, __j = Array.prototype.join;
2470
+ function print() { __p += __j.call(arguments, '') }
2471
+ with (obj) {
2472
+
2473
+
2474
+ function optEscape(str, unsafe){
2475
+ if(unsafe){
2476
+ return _.escape(str);
2477
+ }
2478
+ return str;
2479
+ }
2480
+ ;
2481
+ __p += '\n<div class="hopscotch-bubble-container" style="width: ' +
2482
+ ((__t = ( step.width )) == null ? '' : __t) +
2483
+ 'px; padding: ' +
2484
+ ((__t = ( step.padding )) == null ? '' : __t) +
2485
+ 'px;">\n ';
2486
+ if(tour.isTour){ ;
2487
+ __p += '<span class="hopscotch-bubble-number">' +
2488
+ ((__t = ( i18n.stepNum )) == null ? '' : __t) +
2489
+ '</span>';
2490
+ } ;
2491
+ __p += '\n <div class="hopscotch-bubble-content">\n ';
2492
+ if(step.title !== ''){ ;
2493
+ __p += '<h3 class="hopscotch-title">' +
2494
+ ((__t = ( optEscape(step.title, tour.unsafe) )) == null ? '' : __t) +
2495
+ '</h3>';
2496
+ } ;
2497
+ __p += '\n ';
2498
+ if(step.content !== ''){ ;
2499
+ __p += '<div class="hopscotch-content">' +
2500
+ ((__t = ( optEscape(step.content, tour.unsafe) )) == null ? '' : __t) +
2501
+ '</div>';
2502
+ } ;
2503
+ __p += '\n </div>\n <div class="hopscotch-actions">\n ';
2504
+ if(buttons.showPrev){ ;
2505
+ __p += '<button class="hopscotch-nav-button prev hopscotch-prev">' +
2506
+ ((__t = ( i18n.prevBtn )) == null ? '' : __t) +
2507
+ '</button>';
2508
+ } ;
2509
+ __p += '\n ';
2510
+ if(buttons.showCTA){ ;
2511
+ __p += '<button class="hopscotch-nav-button next hopscotch-cta">' +
2512
+ ((__t = ( buttons.ctaLabel )) == null ? '' : __t) +
2513
+ '</button>';
2514
+ } ;
2515
+ __p += '\n ';
2516
+ if(buttons.showNext){ ;
2517
+ __p += '<button class="hopscotch-nav-button next hopscotch-next">' +
2518
+ ((__t = ( i18n.nextBtn )) == null ? '' : __t) +
2519
+ '</button>';
2520
+ } ;
2521
+ __p += '\n </div>\n ';
2522
+ if(buttons.showClose){ ;
2523
+ __p += '<button class="hopscotch-bubble-close hopscotch-close">' +
2524
+ ((__t = ( i18n.closeTooltip )) == null ? '' : __t) +
2525
+ '</button>';
2526
+ } ;
2527
+ __p += '\n</div>\n<div class="hopscotch-bubble-arrow-container hopscotch-arrow">\n <div class="hopscotch-bubble-arrow-border"></div>\n <div class="hopscotch-bubble-arrow"></div>\n</div>';
2528
+
2529
+ }
2530
+ return __p
2531
+ };
2532
+ }.call(winHopscotch));
2533
+
2534
+ return winHopscotch;
2535
+
2536
+ })));