phcthemes_admin_panel_pack 4.0.7 → 4.1.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (313) hide show
  1. checksums.yaml +4 -4
  2. data/MIT-LICENSE +20 -20
  3. data/README.md +2 -0
  4. data/Rakefile +8 -8
  5. data/app/assets/config/phcthemes_admin_panel_pack_manifest.js +9 -9
  6. data/app/assets/javascripts/common/backstretch/jquery.backstretch.js +1602 -1602
  7. data/app/assets/javascripts/common/bootstrap/bootstrap.bundle.js +7023 -7023
  8. data/app/assets/javascripts/common/bootstrap/bootstrap.three.js +2377 -2377
  9. data/app/assets/javascripts/common/bootstrap-datepicker/bootstrap-datepicker.js +2039 -2039
  10. data/app/assets/javascripts/common/bootstrap-markdown/bootstrap-markdown.js +1390 -1390
  11. data/app/assets/javascripts/common/bootstrap-select/bootstrap-select.js +0 -0
  12. data/app/assets/javascripts/common/bootstrap-select/i18n/defaults-am_ET.js +0 -0
  13. data/app/assets/javascripts/common/bootstrap-select/i18n/defaults-am_ET.js.map +0 -0
  14. data/app/assets/javascripts/common/bootstrap-select/i18n/defaults-am_ET.min.js +7 -7
  15. data/app/assets/javascripts/common/bootstrap-select/i18n/defaults-ar_AR.js +0 -0
  16. data/app/assets/javascripts/common/bootstrap-select/i18n/defaults-ar_AR.js.map +0 -0
  17. data/app/assets/javascripts/common/bootstrap-select/i18n/defaults-ar_AR.min.js +7 -7
  18. data/app/assets/javascripts/common/bootstrap-select/i18n/defaults-bg_BG.js +0 -0
  19. data/app/assets/javascripts/common/bootstrap-select/i18n/defaults-bg_BG.js.map +0 -0
  20. data/app/assets/javascripts/common/bootstrap-select/i18n/defaults-bg_BG.min.js +7 -7
  21. data/app/assets/javascripts/common/bootstrap-select/i18n/defaults-cs_CZ.js +0 -0
  22. data/app/assets/javascripts/common/bootstrap-select/i18n/defaults-cs_CZ.js.map +0 -0
  23. data/app/assets/javascripts/common/bootstrap-select/i18n/defaults-cs_CZ.min.js +7 -7
  24. data/app/assets/javascripts/common/bootstrap-select/i18n/defaults-da_DK.js +0 -0
  25. data/app/assets/javascripts/common/bootstrap-select/i18n/defaults-da_DK.js.map +0 -0
  26. data/app/assets/javascripts/common/bootstrap-select/i18n/defaults-da_DK.min.js +7 -7
  27. data/app/assets/javascripts/common/bootstrap-select/i18n/defaults-de_DE.js +0 -0
  28. data/app/assets/javascripts/common/bootstrap-select/i18n/defaults-de_DE.js.map +0 -0
  29. data/app/assets/javascripts/common/bootstrap-select/i18n/defaults-de_DE.min.js +7 -7
  30. data/app/assets/javascripts/common/bootstrap-select/i18n/defaults-en_US.js +0 -0
  31. data/app/assets/javascripts/common/bootstrap-select/i18n/defaults-en_US.js.map +0 -0
  32. data/app/assets/javascripts/common/bootstrap-select/i18n/defaults-en_US.min.js +7 -7
  33. data/app/assets/javascripts/common/bootstrap-select/i18n/defaults-es_CL.js +0 -0
  34. data/app/assets/javascripts/common/bootstrap-select/i18n/defaults-es_CL.js.map +0 -0
  35. data/app/assets/javascripts/common/bootstrap-select/i18n/defaults-es_CL.min.js +7 -7
  36. data/app/assets/javascripts/common/bootstrap-select/i18n/defaults-es_ES.js +0 -0
  37. data/app/assets/javascripts/common/bootstrap-select/i18n/defaults-es_ES.js.map +0 -0
  38. data/app/assets/javascripts/common/bootstrap-select/i18n/defaults-es_ES.min.js +7 -7
  39. data/app/assets/javascripts/common/bootstrap-select/i18n/defaults-et_EE.js +0 -0
  40. data/app/assets/javascripts/common/bootstrap-select/i18n/defaults-et_EE.js.map +0 -0
  41. data/app/assets/javascripts/common/bootstrap-select/i18n/defaults-et_EE.min.js +7 -7
  42. data/app/assets/javascripts/common/bootstrap-select/i18n/defaults-eu.js +0 -0
  43. data/app/assets/javascripts/common/bootstrap-select/i18n/defaults-eu.js.map +0 -0
  44. data/app/assets/javascripts/common/bootstrap-select/i18n/defaults-eu.min.js +7 -7
  45. data/app/assets/javascripts/common/bootstrap-select/i18n/defaults-fa_IR.js +0 -0
  46. data/app/assets/javascripts/common/bootstrap-select/i18n/defaults-fa_IR.js.map +0 -0
  47. data/app/assets/javascripts/common/bootstrap-select/i18n/defaults-fa_IR.min.js +7 -7
  48. data/app/assets/javascripts/common/bootstrap-select/i18n/defaults-fi_FI.js +0 -0
  49. data/app/assets/javascripts/common/bootstrap-select/i18n/defaults-fi_FI.js.map +0 -0
  50. data/app/assets/javascripts/common/bootstrap-select/i18n/defaults-fi_FI.min.js +7 -7
  51. data/app/assets/javascripts/common/bootstrap-select/i18n/defaults-fr_FR.js +0 -0
  52. data/app/assets/javascripts/common/bootstrap-select/i18n/defaults-fr_FR.js.map +0 -0
  53. data/app/assets/javascripts/common/bootstrap-select/i18n/defaults-fr_FR.min.js +7 -7
  54. data/app/assets/javascripts/common/bootstrap-select/i18n/defaults-hr_HR.js +0 -0
  55. data/app/assets/javascripts/common/bootstrap-select/i18n/defaults-hr_HR.js.map +0 -0
  56. data/app/assets/javascripts/common/bootstrap-select/i18n/defaults-hr_HR.min.js +7 -7
  57. data/app/assets/javascripts/common/bootstrap-select/i18n/defaults-hu_HU.js +0 -0
  58. data/app/assets/javascripts/common/bootstrap-select/i18n/defaults-hu_HU.js.map +0 -0
  59. data/app/assets/javascripts/common/bootstrap-select/i18n/defaults-hu_HU.min.js +7 -7
  60. data/app/assets/javascripts/common/bootstrap-select/i18n/defaults-id_ID.js +0 -0
  61. data/app/assets/javascripts/common/bootstrap-select/i18n/defaults-id_ID.js.map +0 -0
  62. data/app/assets/javascripts/common/bootstrap-select/i18n/defaults-id_ID.min.js +7 -7
  63. data/app/assets/javascripts/common/bootstrap-select/i18n/defaults-it_IT.js +0 -0
  64. data/app/assets/javascripts/common/bootstrap-select/i18n/defaults-it_IT.js.map +0 -0
  65. data/app/assets/javascripts/common/bootstrap-select/i18n/defaults-it_IT.min.js +7 -7
  66. data/app/assets/javascripts/common/bootstrap-select/i18n/defaults-ja_JP.js +0 -0
  67. data/app/assets/javascripts/common/bootstrap-select/i18n/defaults-ja_JP.js.map +0 -0
  68. data/app/assets/javascripts/common/bootstrap-select/i18n/defaults-ja_JP.min.js +7 -7
  69. data/app/assets/javascripts/common/bootstrap-select/i18n/defaults-kh_KM.js +0 -0
  70. data/app/assets/javascripts/common/bootstrap-select/i18n/defaults-kh_KM.js.map +0 -0
  71. data/app/assets/javascripts/common/bootstrap-select/i18n/defaults-kh_KM.min.js +7 -7
  72. data/app/assets/javascripts/common/bootstrap-select/i18n/defaults-ko_KR.js +0 -0
  73. data/app/assets/javascripts/common/bootstrap-select/i18n/defaults-ko_KR.js.map +0 -0
  74. data/app/assets/javascripts/common/bootstrap-select/i18n/defaults-ko_KR.min.js +7 -7
  75. data/app/assets/javascripts/common/bootstrap-select/i18n/defaults-lt_LT.js +0 -0
  76. data/app/assets/javascripts/common/bootstrap-select/i18n/defaults-lt_LT.js.map +0 -0
  77. data/app/assets/javascripts/common/bootstrap-select/i18n/defaults-lt_LT.min.js +7 -7
  78. data/app/assets/javascripts/common/bootstrap-select/i18n/defaults-lv_LV.js +0 -0
  79. data/app/assets/javascripts/common/bootstrap-select/i18n/defaults-lv_LV.js.map +0 -0
  80. data/app/assets/javascripts/common/bootstrap-select/i18n/defaults-lv_LV.min.js +7 -7
  81. data/app/assets/javascripts/common/bootstrap-select/i18n/defaults-nb_NO.js +0 -0
  82. data/app/assets/javascripts/common/bootstrap-select/i18n/defaults-nb_NO.js.map +0 -0
  83. data/app/assets/javascripts/common/bootstrap-select/i18n/defaults-nb_NO.min.js +7 -7
  84. data/app/assets/javascripts/common/bootstrap-select/i18n/defaults-nl_NL.js +0 -0
  85. data/app/assets/javascripts/common/bootstrap-select/i18n/defaults-nl_NL.js.map +0 -0
  86. data/app/assets/javascripts/common/bootstrap-select/i18n/defaults-nl_NL.min.js +7 -7
  87. data/app/assets/javascripts/common/bootstrap-select/i18n/defaults-pl_PL.js +0 -0
  88. data/app/assets/javascripts/common/bootstrap-select/i18n/defaults-pl_PL.js.map +0 -0
  89. data/app/assets/javascripts/common/bootstrap-select/i18n/defaults-pl_PL.min.js +7 -7
  90. data/app/assets/javascripts/common/bootstrap-select/i18n/defaults-pt_BR.js +0 -0
  91. data/app/assets/javascripts/common/bootstrap-select/i18n/defaults-pt_BR.js.map +0 -0
  92. data/app/assets/javascripts/common/bootstrap-select/i18n/defaults-pt_BR.min.js +7 -7
  93. data/app/assets/javascripts/common/bootstrap-select/i18n/defaults-pt_PT.js +0 -0
  94. data/app/assets/javascripts/common/bootstrap-select/i18n/defaults-pt_PT.js.map +0 -0
  95. data/app/assets/javascripts/common/bootstrap-select/i18n/defaults-pt_PT.min.js +7 -7
  96. data/app/assets/javascripts/common/bootstrap-select/i18n/defaults-ro_RO.js +0 -0
  97. data/app/assets/javascripts/common/bootstrap-select/i18n/defaults-ro_RO.js.map +0 -0
  98. data/app/assets/javascripts/common/bootstrap-select/i18n/defaults-ro_RO.min.js +7 -7
  99. data/app/assets/javascripts/common/bootstrap-select/i18n/defaults-ru_RU.js +0 -0
  100. data/app/assets/javascripts/common/bootstrap-select/i18n/defaults-ru_RU.js.map +0 -0
  101. data/app/assets/javascripts/common/bootstrap-select/i18n/defaults-ru_RU.min.js +7 -7
  102. data/app/assets/javascripts/common/bootstrap-select/i18n/defaults-sk_SK.js +0 -0
  103. data/app/assets/javascripts/common/bootstrap-select/i18n/defaults-sk_SK.js.map +0 -0
  104. data/app/assets/javascripts/common/bootstrap-select/i18n/defaults-sk_SK.min.js +7 -7
  105. data/app/assets/javascripts/common/bootstrap-select/i18n/defaults-sl_SI.js +0 -0
  106. data/app/assets/javascripts/common/bootstrap-select/i18n/defaults-sl_SI.js.map +0 -0
  107. data/app/assets/javascripts/common/bootstrap-select/i18n/defaults-sl_SI.min.js +7 -7
  108. data/app/assets/javascripts/common/bootstrap-select/i18n/defaults-sv_SE.js +0 -0
  109. data/app/assets/javascripts/common/bootstrap-select/i18n/defaults-sv_SE.js.map +0 -0
  110. data/app/assets/javascripts/common/bootstrap-select/i18n/defaults-sv_SE.min.js +7 -7
  111. data/app/assets/javascripts/common/bootstrap-select/i18n/defaults-tr_TR.js +0 -0
  112. data/app/assets/javascripts/common/bootstrap-select/i18n/defaults-tr_TR.js.map +0 -0
  113. data/app/assets/javascripts/common/bootstrap-select/i18n/defaults-tr_TR.min.js +7 -7
  114. data/app/assets/javascripts/common/bootstrap-select/i18n/defaults-ua_UA.js +0 -0
  115. data/app/assets/javascripts/common/bootstrap-select/i18n/defaults-ua_UA.js.map +0 -0
  116. data/app/assets/javascripts/common/bootstrap-select/i18n/defaults-ua_UA.min.js +7 -7
  117. data/app/assets/javascripts/common/bootstrap-select/i18n/defaults-vi_VN.js +0 -0
  118. data/app/assets/javascripts/common/bootstrap-select/i18n/defaults-vi_VN.js.map +0 -0
  119. data/app/assets/javascripts/common/bootstrap-select/i18n/defaults-vi_VN.min.js +7 -7
  120. data/app/assets/javascripts/common/bootstrap-select/i18n/defaults-zh_CN.js +0 -0
  121. data/app/assets/javascripts/common/bootstrap-select/i18n/defaults-zh_CN.js.map +0 -0
  122. data/app/assets/javascripts/common/bootstrap-select/i18n/defaults-zh_CN.min.js +7 -7
  123. data/app/assets/javascripts/common/bootstrap-select/i18n/defaults-zh_TW.js +0 -0
  124. data/app/assets/javascripts/common/bootstrap-select/i18n/defaults-zh_TW.js.map +0 -0
  125. data/app/assets/javascripts/common/bootstrap-select/i18n/defaults-zh_TW.min.js +7 -7
  126. data/app/assets/javascripts/common/chartjs/chart.js +0 -0
  127. data/app/assets/javascripts/common/ckeditor/ckeditor.js +6 -6
  128. data/app/assets/javascripts/common/ckeditor/ckeditor.js.map +0 -0
  129. data/app/assets/javascripts/common/ckeditor/translations/af.js +0 -0
  130. data/app/assets/javascripts/common/ckeditor/translations/ar.js +0 -0
  131. data/app/assets/javascripts/common/ckeditor/translations/ast.js +0 -0
  132. data/app/assets/javascripts/common/ckeditor/translations/az.js +0 -0
  133. data/app/assets/javascripts/common/ckeditor/translations/bg.js +0 -0
  134. data/app/assets/javascripts/common/ckeditor/translations/ca.js +0 -0
  135. data/app/assets/javascripts/common/ckeditor/translations/cs.js +0 -0
  136. data/app/assets/javascripts/common/ckeditor/translations/da.js +0 -0
  137. data/app/assets/javascripts/common/ckeditor/translations/de-ch.js +0 -0
  138. data/app/assets/javascripts/common/ckeditor/translations/de.js +0 -0
  139. data/app/assets/javascripts/common/ckeditor/translations/el.js +0 -0
  140. data/app/assets/javascripts/common/ckeditor/translations/en-au.js +0 -0
  141. data/app/assets/javascripts/common/ckeditor/translations/en-gb.js +0 -0
  142. data/app/assets/javascripts/common/ckeditor/translations/eo.js +0 -0
  143. data/app/assets/javascripts/common/ckeditor/translations/es.js +0 -0
  144. data/app/assets/javascripts/common/ckeditor/translations/et.js +0 -0
  145. data/app/assets/javascripts/common/ckeditor/translations/eu.js +0 -0
  146. data/app/assets/javascripts/common/ckeditor/translations/fa.js +0 -0
  147. data/app/assets/javascripts/common/ckeditor/translations/fi.js +0 -0
  148. data/app/assets/javascripts/common/ckeditor/translations/fr.js +0 -0
  149. data/app/assets/javascripts/common/ckeditor/translations/gl.js +0 -0
  150. data/app/assets/javascripts/common/ckeditor/translations/gu.js +0 -0
  151. data/app/assets/javascripts/common/ckeditor/translations/he.js +0 -0
  152. data/app/assets/javascripts/common/ckeditor/translations/hr.js +0 -0
  153. data/app/assets/javascripts/common/ckeditor/translations/hu.js +0 -0
  154. data/app/assets/javascripts/common/ckeditor/translations/id.js +0 -0
  155. data/app/assets/javascripts/common/ckeditor/translations/it.js +0 -0
  156. data/app/assets/javascripts/common/ckeditor/translations/ja.js +0 -0
  157. data/app/assets/javascripts/common/ckeditor/translations/km.js +0 -0
  158. data/app/assets/javascripts/common/ckeditor/translations/kn.js +0 -0
  159. data/app/assets/javascripts/common/ckeditor/translations/ko.js +0 -0
  160. data/app/assets/javascripts/common/ckeditor/translations/ku.js +0 -0
  161. data/app/assets/javascripts/common/ckeditor/translations/lt.js +0 -0
  162. data/app/assets/javascripts/common/ckeditor/translations/lv.js +0 -0
  163. data/app/assets/javascripts/common/ckeditor/translations/nb.js +0 -0
  164. data/app/assets/javascripts/common/ckeditor/translations/ne.js +0 -0
  165. data/app/assets/javascripts/common/ckeditor/translations/nl.js +0 -0
  166. data/app/assets/javascripts/common/ckeditor/translations/no.js +0 -0
  167. data/app/assets/javascripts/common/ckeditor/translations/oc.js +0 -0
  168. data/app/assets/javascripts/common/ckeditor/translations/pl.js +0 -0
  169. data/app/assets/javascripts/common/ckeditor/translations/pt-br.js +0 -0
  170. data/app/assets/javascripts/common/ckeditor/translations/pt.js +0 -0
  171. data/app/assets/javascripts/common/ckeditor/translations/ro.js +0 -0
  172. data/app/assets/javascripts/common/ckeditor/translations/ru.js +0 -0
  173. data/app/assets/javascripts/common/ckeditor/translations/si.js +0 -0
  174. data/app/assets/javascripts/common/ckeditor/translations/sk.js +0 -0
  175. data/app/assets/javascripts/common/ckeditor/translations/sl.js +0 -0
  176. data/app/assets/javascripts/common/ckeditor/translations/sq.js +0 -0
  177. data/app/assets/javascripts/common/ckeditor/translations/sr-latn.js +0 -0
  178. data/app/assets/javascripts/common/ckeditor/translations/sr.js +0 -0
  179. data/app/assets/javascripts/common/ckeditor/translations/sv.js +0 -0
  180. data/app/assets/javascripts/common/ckeditor/translations/th.js +0 -0
  181. data/app/assets/javascripts/common/ckeditor/translations/tr.js +0 -0
  182. data/app/assets/javascripts/common/ckeditor/translations/tt.js +0 -0
  183. data/app/assets/javascripts/common/ckeditor/translations/ug.js +0 -0
  184. data/app/assets/javascripts/common/ckeditor/translations/uk.js +0 -0
  185. data/app/assets/javascripts/common/ckeditor/translations/vi.js +0 -0
  186. data/app/assets/javascripts/common/ckeditor/translations/zh-cn.js +0 -0
  187. data/app/assets/javascripts/common/ckeditor/translations/zh.js +0 -0
  188. data/app/assets/javascripts/common/clipboardjs/clipboard.js +977 -977
  189. data/app/assets/javascripts/common/covervid/covervid.js +94 -94
  190. data/app/assets/javascripts/common/custom/custom.js +0 -0
  191. data/app/assets/javascripts/common/datatables/datatables.js +15310 -15310
  192. data/app/assets/javascripts/common/daterangepicker/daterangepicker.js +1565 -1565
  193. data/app/assets/javascripts/common/fastclick/fastclick.js +841 -841
  194. data/app/assets/javascripts/common/flexslider/jquery.flexslider.js +1252 -1252
  195. data/app/assets/javascripts/common/greenstock/greensock.js +35 -35
  196. data/app/assets/javascripts/common/html5sortable/jquery.sortable.js +98 -98
  197. data/app/assets/javascripts/common/icheck/icheck.js +509 -509
  198. data/app/assets/javascripts/common/imagesloaded/imagesloaded.pkgd.js +497 -497
  199. data/app/assets/javascripts/common/isotope/isotope.pkgd.js +3563 -3563
  200. data/app/assets/javascripts/common/jquery/jquery-3.4.1.js +10598 -10598
  201. data/app/assets/javascripts/common/jquery-countdown/jquery.countdown.js +245 -245
  202. data/app/assets/javascripts/common/jquery-filterizer/jquery.filterizr.min.js +0 -0
  203. data/app/assets/javascripts/common/jquery-jeditable/jquery.jeditable.autogrow.js +37 -37
  204. data/app/assets/javascripts/common/jquery-jeditable/jquery.jeditable.charcounter.js +53 -53
  205. data/app/assets/javascripts/common/jquery-jeditable/jquery.jeditable.checkbox.js +54 -54
  206. data/app/assets/javascripts/common/jquery-jeditable/jquery.jeditable.datepicker.js +59 -59
  207. data/app/assets/javascripts/common/jquery-jeditable/jquery.jeditable.js +823 -823
  208. data/app/assets/javascripts/common/jquery-jeditable/jquery.jeditable.masked.js +46 -46
  209. data/app/assets/javascripts/common/jquery-jeditable/jquery.jeditable.time.js +71 -71
  210. data/app/assets/javascripts/common/jquery-jvectormap/jquery-jvectormap.js +44 -44
  211. data/app/assets/javascripts/common/jquery-placeholder/jquery.placeholder.js +281 -281
  212. data/app/assets/javascripts/common/jquery-slimscroll/jquery.slimscroll.js +474 -474
  213. data/app/assets/javascripts/common/jquery-sparkline/jquery.sparkline.js +3054 -3054
  214. data/app/assets/javascripts/common/jquery-ui/jquery-ui.js +18705 -18705
  215. data/app/assets/javascripts/common/jquery-validation/jquery.validate.js +0 -0
  216. data/app/assets/javascripts/common/jqvmap/jquery.vmap.js +1281 -1281
  217. data/app/assets/javascripts/common/jqvmap/jquery.vmap.min.js +9 -9
  218. data/app/assets/javascripts/common/jqvmap/maps/continents/jquery.vmap.africa.js +2 -2
  219. data/app/assets/javascripts/common/jqvmap/maps/continents/jquery.vmap.asia.js +2 -2
  220. data/app/assets/javascripts/common/jqvmap/maps/continents/jquery.vmap.australia.js +2 -2
  221. data/app/assets/javascripts/common/jqvmap/maps/continents/jquery.vmap.europe.js +2 -2
  222. data/app/assets/javascripts/common/jqvmap/maps/continents/jquery.vmap.north-america.js +2 -2
  223. data/app/assets/javascripts/common/jqvmap/maps/continents/jquery.vmap.south-america.js +2 -2
  224. data/app/assets/javascripts/common/jqvmap/maps/jquery.vmap.algeria.js +2 -2
  225. data/app/assets/javascripts/common/jqvmap/maps/jquery.vmap.argentina.js +1 -1
  226. data/app/assets/javascripts/common/jqvmap/maps/jquery.vmap.brazil.js +2 -2
  227. data/app/assets/javascripts/common/jqvmap/maps/jquery.vmap.canada.js +1 -1
  228. data/app/assets/javascripts/common/jqvmap/maps/jquery.vmap.europe.js +2 -2
  229. data/app/assets/javascripts/common/jqvmap/maps/jquery.vmap.france.js +1 -1
  230. data/app/assets/javascripts/common/jqvmap/maps/jquery.vmap.germany.js +2 -2
  231. data/app/assets/javascripts/common/jqvmap/maps/jquery.vmap.greece.js +1 -1
  232. data/app/assets/javascripts/common/jqvmap/maps/jquery.vmap.iran.js +6 -6
  233. data/app/assets/javascripts/common/jqvmap/maps/jquery.vmap.iraq.js +1 -1
  234. data/app/assets/javascripts/common/jqvmap/maps/jquery.vmap.russia.js +2 -2
  235. data/app/assets/javascripts/common/jqvmap/maps/jquery.vmap.tunisia.js +2 -2
  236. data/app/assets/javascripts/common/jqvmap/maps/jquery.vmap.turkey.js +11 -11
  237. data/app/assets/javascripts/common/jqvmap/maps/jquery.vmap.usa.js +2 -2
  238. data/app/assets/javascripts/common/jqvmap/maps/jquery.vmap.world.js +2 -2
  239. data/app/assets/javascripts/common/js-cookie/js.cookie.js +165 -165
  240. data/app/assets/javascripts/common/layerslider/layerslider.kreaturamedia.jquery.js +12 -12
  241. data/app/assets/javascripts/common/layerslider/layerslider.origami.js +12 -12
  242. data/app/assets/javascripts/common/layerslider/layerslider.timeline.js +12 -12
  243. data/app/assets/javascripts/common/layerslider/layerslider.transitions.js +12 -12
  244. data/app/assets/javascripts/common/lazysizes/lazysizes.js +754 -754
  245. data/app/assets/javascripts/common/leaflet/leaflet.js +4 -4
  246. data/app/assets/javascripts/common/magnific-popup/jquery.magnific-popup.js +1859 -1859
  247. data/app/assets/javascripts/common/mapbox/mapbox.js +51 -51
  248. data/app/assets/javascripts/common/metismenu/metisMenu.js +340 -340
  249. data/app/assets/javascripts/common/moderizer/modernizr.js +11 -11
  250. data/app/assets/javascripts/common/nouislider/nouislider.js +2637 -2637
  251. data/app/assets/javascripts/common/owl-carousel/owl.carousel.js +3448 -3448
  252. data/app/assets/javascripts/common/pace/pace.js +935 -935
  253. data/app/assets/javascripts/common/paroller/jquery.paroller.js +228 -228
  254. data/app/assets/javascripts/common/particlejs/particles.js +1540 -1540
  255. data/app/assets/javascripts/common/perfect-scrollbar/perfect-scrollbar.common.js +1318 -1318
  256. data/app/assets/javascripts/common/perfect-scrollbar/perfect-scrollbar.esm.js +1316 -1316
  257. data/app/assets/javascripts/common/perfect-scrollbar/perfect-scrollbar.js +1324 -1324
  258. data/app/assets/javascripts/common/plyr/plyr.js +9137 -9137
  259. data/app/assets/javascripts/common/rangeslider/rangeslider.js +498 -498
  260. data/app/assets/javascripts/common/retina/retina.js +100 -100
  261. data/app/assets/javascripts/common/rev-slider/extensions/revolution.extension.actions.js +0 -0
  262. data/app/assets/javascripts/common/rev-slider/extensions/revolution.extension.carousel.js +0 -0
  263. data/app/assets/javascripts/common/rev-slider/extensions/revolution.extension.kenburn.js +0 -0
  264. data/app/assets/javascripts/common/rev-slider/extensions/revolution.extension.layeranimation.js +0 -0
  265. data/app/assets/javascripts/common/rev-slider/extensions/revolution.extension.migration.js +0 -0
  266. data/app/assets/javascripts/common/rev-slider/extensions/revolution.extension.navigation.js +0 -0
  267. data/app/assets/javascripts/common/rev-slider/extensions/revolution.extension.parallax.js +0 -0
  268. data/app/assets/javascripts/common/rev-slider/extensions/revolution.extension.slideanims.js +0 -0
  269. data/app/assets/javascripts/common/rev-slider/extensions/revolution.extension.video.js +0 -0
  270. data/app/assets/javascripts/common/rev-slider/jquery.themepunch.revolution.js +0 -0
  271. data/app/assets/javascripts/common/rev-slider/jquery.themepunch.tools.min.js +0 -0
  272. data/app/assets/javascripts/common/scrollme/jquery.scrollme.js +455 -455
  273. data/app/assets/javascripts/common/scrollup/jquery.scrollUp.js +168 -168
  274. data/app/assets/javascripts/common/select2/select2.full.js +6597 -6597
  275. data/app/assets/javascripts/common/selectbox/jquery.selectBox.js +1091 -1091
  276. data/app/assets/javascripts/common/slick/slick.js +3004 -3004
  277. data/app/assets/javascripts/common/smooth-scroll/SmoothScroll.js +788 -788
  278. data/app/assets/javascripts/common/spectrum/spectrum.js +2323 -2323
  279. data/app/assets/javascripts/common/stepper/jquery.fs.stepper.js +339 -339
  280. data/app/assets/javascripts/common/swiper/swiper.js +8124 -8124
  281. data/app/assets/javascripts/common/toaster/toastr.js +476 -476
  282. data/app/assets/javascripts/common/typed/typed.js +1044 -1044
  283. data/app/assets/javascripts/common/visable/jquery.visible.js +68 -68
  284. data/app/assets/javascripts/common/waypoints/jquery.waypoints.js +661 -661
  285. data/app/assets/javascripts/common/wow/wow.js +508 -508
  286. data/app/assets/javascripts/phcthemes_admin_panel_pack_adminlte.js +12 -12
  287. data/app/assets/javascripts/phcthemes_admin_panel_pack_boomerang.js +0 -0
  288. data/app/assets/javascripts/phcthemes_admin_panel_pack_coloradmin.js +5 -5
  289. data/app/assets/javascripts/phcthemes_admin_panel_pack_inspinia.js +10 -10
  290. data/app/assets/javascripts/phcthemes_admin_panel_pack_metronic.js +6 -6
  291. data/app/assets/javascripts/phcthemes_admin_panel_pack_quilpro.js +5 -5
  292. data/app/assets/javascripts/phcthemes_admin_panel_pack_starlight.js +5 -5
  293. data/app/assets/javascripts/themes/adminlte/theme/adminlte.js +1141 -1141
  294. data/app/assets/javascripts/themes/coloradmin/theme/color_admin_app.min.js +0 -0
  295. data/app/assets/javascripts/themes/coloradmin/theme/color_admin_default.js +0 -0
  296. data/app/assets/javascripts/themes/inspinia/theme/inspinia.js +279 -279
  297. data/app/assets/javascripts/themes/metronic/theme/plugins.bundle.js +0 -0
  298. data/app/assets/javascripts/themes/metronic/theme/prismjs.bundle.js +1922 -1922
  299. data/app/assets/javascripts/themes/metronic/theme/scripts.bundle.js +0 -0
  300. data/app/assets/javascripts/themes/metronic/theme/widgets.js +0 -0
  301. data/app/assets/stylesheets/common/hanna_hearts/hanna_hearts.scss +0 -0
  302. data/app/assets/stylesheets/phcthemes_admin_panel_pack_adminlte.scss +16 -16
  303. data/app/assets/stylesheets/phcthemes_admin_panel_pack_boomerang.scss +27 -27
  304. data/app/assets/stylesheets/phcthemes_admin_panel_pack_coloradmin.scss +11 -11
  305. data/app/assets/stylesheets/phcthemes_admin_panel_pack_inspinia.scss +18 -18
  306. data/app/assets/stylesheets/phcthemes_admin_panel_pack_metronic.scss +15 -15
  307. data/app/assets/stylesheets/phcthemes_admin_panel_pack_quilpro.scss +19 -19
  308. data/app/assets/stylesheets/phcthemes_admin_panel_pack_starlight.scss +15 -15
  309. data/lib/phcthemes_admin_panel_pack/engine.rb +20 -20
  310. data/lib/phcthemes_admin_panel_pack/version.rb +3 -3
  311. data/lib/phcthemes_admin_panel_pack.rb +6 -6
  312. data/lib/tasks/phcthemes_admin_panel_pack_tasks.rake +4 -4
  313. metadata +3 -3
@@ -1,1281 +1,1281 @@
1
- /*!
2
- * JQVMap: jQuery Vector Map Library
3
- * @author JQVMap <me@peterschmalfeldt.com>
4
- * @version 1.5.1
5
- * @link http://jqvmap.com
6
- * @license https://github.com/manifestinteractive/jqvmap/blob/master/LICENSE
7
- * @builddate 2016/05/18
8
- */
9
-
10
- var VectorCanvas = function (width, height, params) {
11
- this.mode = window.SVGAngle ? 'svg' : 'vml';
12
- this.params = params;
13
-
14
- if (this.mode === 'svg') {
15
- this.createSvgNode = function (nodeName) {
16
- return document.createElementNS(this.svgns, nodeName);
17
- };
18
- } else {
19
- try {
20
- if (!document.namespaces.rvml) {
21
- document.namespaces.add('rvml', 'urn:schemas-microsoft-com:vml');
22
- }
23
- this.createVmlNode = function (tagName) {
24
- return document.createElement('<rvml:' + tagName + ' class="rvml">');
25
- };
26
- } catch (e) {
27
- this.createVmlNode = function (tagName) {
28
- return document.createElement('<' + tagName + ' xmlns="urn:schemas-microsoft.com:vml" class="rvml">');
29
- };
30
- }
31
-
32
- document.createStyleSheet().addRule('.rvml', 'behavior:url(#default#VML)');
33
- }
34
-
35
- if (this.mode === 'svg') {
36
- this.canvas = this.createSvgNode('svg');
37
- } else {
38
- this.canvas = this.createVmlNode('group');
39
- this.canvas.style.position = 'absolute';
40
- }
41
-
42
- this.setSize(width, height);
43
- };
44
-
45
- VectorCanvas.prototype = {
46
- svgns: 'http://www.w3.org/2000/svg',
47
- mode: 'svg',
48
- width: 0,
49
- height: 0,
50
- canvas: null
51
- };
52
-
53
- var ColorScale = function (colors, normalizeFunction, minValue, maxValue) {
54
- if (colors) {
55
- this.setColors(colors);
56
- }
57
- if (normalizeFunction) {
58
- this.setNormalizeFunction(normalizeFunction);
59
- }
60
- if (minValue) {
61
- this.setMin(minValue);
62
- }
63
- if (minValue) {
64
- this.setMax(maxValue);
65
- }
66
- };
67
-
68
- ColorScale.prototype = {
69
- colors: []
70
- };
71
-
72
- var JQVMap = function (params) {
73
- params = params || {};
74
- var map = this;
75
- var mapData = JQVMap.maps[params.map];
76
- var mapPins;
77
-
78
- if( !mapData){
79
- throw new Error('Invalid "' + params.map + '" map parameter. Please make sure you have loaded this map file in your HTML.');
80
- }
81
-
82
- this.selectedRegions = [];
83
- this.multiSelectRegion = params.multiSelectRegion;
84
-
85
- this.container = params.container;
86
-
87
- this.defaultWidth = mapData.width;
88
- this.defaultHeight = mapData.height;
89
-
90
- this.color = params.color;
91
- this.selectedColor = params.selectedColor;
92
- this.hoverColor = params.hoverColor;
93
- this.hoverColors = params.hoverColors;
94
- this.hoverOpacity = params.hoverOpacity;
95
- this.setBackgroundColor(params.backgroundColor);
96
-
97
- this.width = params.container.width();
98
- this.height = params.container.height();
99
-
100
- this.resize();
101
-
102
- jQuery(window).resize(function () {
103
- var newWidth = params.container.width();
104
- var newHeight = params.container.height();
105
-
106
- if(newWidth && newHeight){
107
- map.width = newWidth;
108
- map.height = newHeight;
109
- map.resize();
110
- map.canvas.setSize(map.width, map.height);
111
- map.applyTransform();
112
-
113
- var resizeEvent = jQuery.Event('resize.jqvmap');
114
- jQuery(params.container).trigger(resizeEvent, [newWidth, newHeight]);
115
-
116
- if(mapPins){
117
- jQuery('.jqvmap-pin').remove();
118
- map.pinHandlers = false;
119
- map.placePins(mapPins.pins, mapPins.mode);
120
- }
121
- }
122
- });
123
-
124
- this.canvas = new VectorCanvas(this.width, this.height, params);
125
- params.container.append(this.canvas.canvas);
126
-
127
- this.makeDraggable();
128
-
129
- this.rootGroup = this.canvas.createGroup(true);
130
-
131
- this.index = JQVMap.mapIndex;
132
- this.label = jQuery('<div/>').addClass('jqvmap-label').appendTo(jQuery('body')).hide();
133
-
134
- if (params.enableZoom) {
135
- jQuery('<div/>').addClass('jqvmap-zoomin').text('+').appendTo(params.container);
136
- jQuery('<div/>').addClass('jqvmap-zoomout').html('&#x2212;').appendTo(params.container);
137
- }
138
-
139
- map.countries = [];
140
-
141
- for (var key in mapData.paths) {
142
- var path = this.canvas.createPath({
143
- path: mapData.paths[key].path
144
- });
145
-
146
- path.setFill(this.color);
147
- path.id = map.getCountryId(key);
148
- map.countries[key] = path;
149
-
150
- if (this.canvas.mode === 'svg') {
151
- path.setAttribute('class', 'jqvmap-region');
152
- } else {
153
- jQuery(path).addClass('jqvmap-region');
154
- }
155
-
156
- jQuery(this.rootGroup).append(path);
157
- }
158
-
159
- jQuery(params.container).delegate(this.canvas.mode === 'svg' ? 'path' : 'shape', 'mouseover mouseout', function (e) {
160
- var containerPath = e.target,
161
- code = e.target.id.split('_').pop(),
162
- labelShowEvent = jQuery.Event('labelShow.jqvmap'),
163
- regionMouseOverEvent = jQuery.Event('regionMouseOver.jqvmap');
164
-
165
- code = code.toLowerCase();
166
-
167
- if (e.type === 'mouseover') {
168
- jQuery(params.container).trigger(regionMouseOverEvent, [code, mapData.paths[code].name]);
169
- if (!regionMouseOverEvent.isDefaultPrevented()) {
170
- map.highlight(code, containerPath);
171
- }
172
- if (params.showTooltip) {
173
- map.label.text(mapData.paths[code].name);
174
- jQuery(params.container).trigger(labelShowEvent, [map.label, code]);
175
-
176
- if (!labelShowEvent.isDefaultPrevented()) {
177
- map.label.show();
178
- map.labelWidth = map.label.width();
179
- map.labelHeight = map.label.height();
180
- }
181
- }
182
- } else {
183
- map.unhighlight(code, containerPath);
184
-
185
- map.label.hide();
186
- jQuery(params.container).trigger('regionMouseOut.jqvmap', [code, mapData.paths[code].name]);
187
- }
188
- });
189
-
190
- jQuery(params.container).delegate(this.canvas.mode === 'svg' ? 'path' : 'shape', 'click', function (regionClickEvent) {
191
-
192
- var targetPath = regionClickEvent.target;
193
- var code = regionClickEvent.target.id.split('_').pop();
194
- var mapClickEvent = jQuery.Event('regionClick.jqvmap');
195
-
196
- code = code.toLowerCase();
197
-
198
- jQuery(params.container).trigger(mapClickEvent, [code, mapData.paths[code].name]);
199
-
200
- if ( !params.multiSelectRegion && !mapClickEvent.isDefaultPrevented()) {
201
- for (var keyPath in mapData.paths) {
202
- map.countries[keyPath].currentFillColor = map.countries[keyPath].getOriginalFill();
203
- map.countries[keyPath].setFill(map.countries[keyPath].getOriginalFill());
204
- }
205
- }
206
-
207
- if ( !mapClickEvent.isDefaultPrevented()) {
208
- if (map.isSelected(code)) {
209
- map.deselect(code, targetPath);
210
- } else {
211
- map.select(code, targetPath);
212
- }
213
- }
214
- });
215
-
216
- if (params.showTooltip) {
217
- params.container.mousemove(function (e) {
218
- if (map.label.is(':visible')) {
219
- var left = e.pageX - 15 - map.labelWidth;
220
- var top = e.pageY - 15 - map.labelHeight;
221
-
222
- if(left < 0) {
223
- left = e.pageX + 15;
224
- }
225
- if(top < 0) {
226
- top = e.pageY + 15;
227
- }
228
-
229
- map.label.css({
230
- left: left,
231
- top: top
232
- });
233
- }
234
- });
235
- }
236
-
237
- this.setColors(params.colors);
238
-
239
- this.canvas.canvas.appendChild(this.rootGroup);
240
-
241
- this.applyTransform();
242
-
243
- this.colorScale = new ColorScale(params.scaleColors, params.normalizeFunction, params.valueMin, params.valueMax);
244
-
245
- if (params.values) {
246
- this.values = params.values;
247
- this.setValues(params.values);
248
- }
249
-
250
- if (params.selectedRegions) {
251
- if (params.selectedRegions instanceof Array) {
252
- for(var k in params.selectedRegions) {
253
- this.select(params.selectedRegions[k].toLowerCase());
254
- }
255
- } else {
256
- this.select(params.selectedRegions.toLowerCase());
257
- }
258
- }
259
-
260
- this.bindZoomButtons();
261
-
262
- if(params.pins) {
263
- mapPins = {
264
- pins: params.pins,
265
- mode: params.pinMode
266
- };
267
-
268
- this.pinHandlers = false;
269
- this.placePins(params.pins, params.pinMode);
270
- }
271
-
272
- if(params.showLabels){
273
- this.pinHandlers = false;
274
-
275
- var pins = {};
276
- for (key in map.countries){
277
- if (typeof map.countries[key] !== 'function') {
278
- if( !params.pins || !params.pins[key] ){
279
- pins[key] = key.toUpperCase();
280
- }
281
- }
282
- }
283
-
284
- mapPins = {
285
- pins: pins,
286
- mode: 'content'
287
- };
288
-
289
- this.placePins(pins, 'content');
290
- }
291
-
292
- JQVMap.mapIndex++;
293
- };
294
-
295
- JQVMap.prototype = {
296
- transX: 0,
297
- transY: 0,
298
- scale: 1,
299
- baseTransX: 0,
300
- baseTransY: 0,
301
- baseScale: 1,
302
- width: 0,
303
- height: 0,
304
- countries: {},
305
- countriesColors: {},
306
- countriesData: {},
307
- zoomStep: 1.4,
308
- zoomMaxStep: 4,
309
- zoomCurStep: 1
310
- };
311
-
312
- JQVMap.xlink = 'http://www.w3.org/1999/xlink';
313
- JQVMap.mapIndex = 1;
314
- JQVMap.maps = {};
315
-
316
- (function(){
317
-
318
- var apiParams = {
319
- colors: 1,
320
- values: 1,
321
- backgroundColor: 1,
322
- scaleColors: 1,
323
- normalizeFunction: 1,
324
- enableZoom: 1,
325
- showTooltip: 1,
326
- borderColor: 1,
327
- borderWidth: 1,
328
- borderOpacity: 1,
329
- selectedRegions: 1,
330
- multiSelectRegion: 1
331
- };
332
-
333
- var apiEvents = {
334
- onLabelShow: 'labelShow',
335
- onLoad: 'load',
336
- onRegionOver: 'regionMouseOver',
337
- onRegionOut: 'regionMouseOut',
338
- onRegionClick: 'regionClick',
339
- onRegionSelect: 'regionSelect',
340
- onRegionDeselect: 'regionDeselect',
341
- onResize: 'resize'
342
- };
343
-
344
- jQuery.fn.vectorMap = function (options) {
345
-
346
- var defaultParams = {
347
- map: 'world_en',
348
- backgroundColor: '#a5bfdd',
349
- color: '#f4f3f0',
350
- hoverColor: '#c9dfaf',
351
- hoverColors: {},
352
- selectedColor: '#c9dfaf',
353
- scaleColors: ['#b6d6ff', '#005ace'],
354
- normalizeFunction: 'linear',
355
- enableZoom: true,
356
- showTooltip: true,
357
- borderColor: '#818181',
358
- borderWidth: 1,
359
- borderOpacity: 0.25,
360
- selectedRegions: null,
361
- multiSelectRegion: false
362
- }, map = this.data('mapObject');
363
-
364
- if (options === 'addMap') {
365
- JQVMap.maps[arguments[1]] = arguments[2];
366
- } else if (options === 'set' && apiParams[arguments[1]]) {
367
- map['set' + arguments[1].charAt(0).toUpperCase() + arguments[1].substr(1)].apply(map, Array.prototype.slice.call(arguments, 2));
368
- } else if (typeof options === 'string' &&
369
- typeof map[options] === 'function') {
370
- return map[options].apply(map, Array.prototype.slice.call(arguments, 1));
371
- } else {
372
- jQuery.extend(defaultParams, options);
373
- defaultParams.container = this;
374
- this.css({ position: 'relative', overflow: 'hidden' });
375
-
376
- map = new JQVMap(defaultParams);
377
-
378
- this.data('mapObject', map);
379
-
380
- this.unbind('.jqvmap');
381
-
382
- for (var e in apiEvents) {
383
- if (defaultParams[e]) {
384
- this.bind(apiEvents[e] + '.jqvmap', defaultParams[e]);
385
- }
386
- }
387
-
388
- var loadEvent = jQuery.Event('load.jqvmap');
389
- jQuery(defaultParams.container).trigger(loadEvent, map);
390
-
391
- return map;
392
- }
393
- };
394
-
395
- })(jQuery);
396
-
397
- ColorScale.arrayToRgb = function (ar) {
398
- var rgb = '#';
399
- var d;
400
- for (var i = 0; i < ar.length; i++) {
401
- d = ar[i].toString(16);
402
- rgb += d.length === 1 ? '0' + d : d;
403
- }
404
- return rgb;
405
- };
406
-
407
- ColorScale.prototype.getColor = function (value) {
408
- if (typeof this.normalize === 'function') {
409
- value = this.normalize(value);
410
- }
411
-
412
- var lengthes = [];
413
- var fullLength = 0;
414
- var l;
415
-
416
- for (var i = 0; i < this.colors.length - 1; i++) {
417
- l = this.vectorLength(this.vectorSubtract(this.colors[i + 1], this.colors[i]));
418
- lengthes.push(l);
419
- fullLength += l;
420
- }
421
-
422
- var c = (this.maxValue - this.minValue) / fullLength;
423
-
424
- for (i = 0; i < lengthes.length; i++) {
425
- lengthes[i] *= c;
426
- }
427
-
428
- i = 0;
429
- value -= this.minValue;
430
-
431
- while (value - lengthes[i] >= 0) {
432
- value -= lengthes[i];
433
- i++;
434
- }
435
-
436
- var color;
437
- if (i === this.colors.length - 1) {
438
- color = this.vectorToNum(this.colors[i]).toString(16);
439
- } else {
440
- color = (this.vectorToNum(this.vectorAdd(this.colors[i], this.vectorMult(this.vectorSubtract(this.colors[i + 1], this.colors[i]), (value) / (lengthes[i]))))).toString(16);
441
- }
442
-
443
- while (color.length < 6) {
444
- color = '0' + color;
445
- }
446
- return '#' + color;
447
- };
448
-
449
- ColorScale.rgbToArray = function (rgb) {
450
- rgb = rgb.substr(1);
451
- return [parseInt(rgb.substr(0, 2), 16), parseInt(rgb.substr(2, 2), 16), parseInt(rgb.substr(4, 2), 16)];
452
- };
453
-
454
- ColorScale.prototype.setColors = function (colors) {
455
- for (var i = 0; i < colors.length; i++) {
456
- colors[i] = ColorScale.rgbToArray(colors[i]);
457
- }
458
- this.colors = colors;
459
- };
460
-
461
- ColorScale.prototype.setMax = function (max) {
462
- this.clearMaxValue = max;
463
- if (typeof this.normalize === 'function') {
464
- this.maxValue = this.normalize(max);
465
- } else {
466
- this.maxValue = max;
467
- }
468
- };
469
-
470
- ColorScale.prototype.setMin = function (min) {
471
- this.clearMinValue = min;
472
-
473
- if (typeof this.normalize === 'function') {
474
- this.minValue = this.normalize(min);
475
- } else {
476
- this.minValue = min;
477
- }
478
- };
479
-
480
- ColorScale.prototype.setNormalizeFunction = function (f) {
481
- if (f === 'polynomial') {
482
- this.normalize = function (value) {
483
- return Math.pow(value, 0.2);
484
- };
485
- } else if (f === 'linear') {
486
- delete this.normalize;
487
- } else {
488
- this.normalize = f;
489
- }
490
- this.setMin(this.clearMinValue);
491
- this.setMax(this.clearMaxValue);
492
- };
493
-
494
- ColorScale.prototype.vectorAdd = function (vector1, vector2) {
495
- var vector = [];
496
- for (var i = 0; i < vector1.length; i++) {
497
- vector[i] = vector1[i] + vector2[i];
498
- }
499
- return vector;
500
- };
501
-
502
- ColorScale.prototype.vectorLength = function (vector) {
503
- var result = 0;
504
- for (var i = 0; i < vector.length; i++) {
505
- result += vector[i] * vector[i];
506
- }
507
- return Math.sqrt(result);
508
- };
509
-
510
- ColorScale.prototype.vectorMult = function (vector, num) {
511
- var result = [];
512
- for (var i = 0; i < vector.length; i++) {
513
- result[i] = vector[i] * num;
514
- }
515
- return result;
516
- };
517
-
518
- ColorScale.prototype.vectorSubtract = function (vector1, vector2) {
519
- var vector = [];
520
- for (var i = 0; i < vector1.length; i++) {
521
- vector[i] = vector1[i] - vector2[i];
522
- }
523
- return vector;
524
- };
525
-
526
- ColorScale.prototype.vectorToNum = function (vector) {
527
- var num = 0;
528
- for (var i = 0; i < vector.length; i++) {
529
- num += Math.round(vector[i]) * Math.pow(256, vector.length - i - 1);
530
- }
531
- return num;
532
- };
533
-
534
- JQVMap.prototype.applyTransform = function () {
535
- var maxTransX, maxTransY, minTransX, minTransY;
536
- if (this.defaultWidth * this.scale <= this.width) {
537
- maxTransX = (this.width - this.defaultWidth * this.scale) / (2 * this.scale);
538
- minTransX = (this.width - this.defaultWidth * this.scale) / (2 * this.scale);
539
- } else {
540
- maxTransX = 0;
541
- minTransX = (this.width - this.defaultWidth * this.scale) / this.scale;
542
- }
543
-
544
- if (this.defaultHeight * this.scale <= this.height) {
545
- maxTransY = (this.height - this.defaultHeight * this.scale) / (2 * this.scale);
546
- minTransY = (this.height - this.defaultHeight * this.scale) / (2 * this.scale);
547
- } else {
548
- maxTransY = 0;
549
- minTransY = (this.height - this.defaultHeight * this.scale) / this.scale;
550
- }
551
-
552
- if (this.transY > maxTransY) {
553
- this.transY = maxTransY;
554
- } else if (this.transY < minTransY) {
555
- this.transY = minTransY;
556
- }
557
- if (this.transX > maxTransX) {
558
- this.transX = maxTransX;
559
- } else if (this.transX < minTransX) {
560
- this.transX = minTransX;
561
- }
562
-
563
- this.canvas.applyTransformParams(this.scale, this.transX, this.transY);
564
- };
565
-
566
- JQVMap.prototype.bindZoomButtons = function () {
567
- var map = this;
568
- this.container.find('.jqvmap-zoomin').click(function(){
569
- map.zoomIn();
570
- });
571
- this.container.find('.jqvmap-zoomout').click(function(){
572
- map.zoomOut();
573
- });
574
- };
575
-
576
- JQVMap.prototype.deselect = function (cc, path) {
577
- cc = cc.toLowerCase();
578
- path = path || jQuery('#' + this.getCountryId(cc))[0];
579
-
580
- if (this.isSelected(cc)) {
581
- this.selectedRegions.splice(this.selectIndex(cc), 1);
582
-
583
- jQuery(this.container).trigger('regionDeselect.jqvmap', [cc]);
584
- path.currentFillColor = path.getOriginalFill();
585
- path.setFill(path.getOriginalFill());
586
- } else {
587
- for (var key in this.countries) {
588
- this.selectedRegions.splice(this.selectedRegions.indexOf(key), 1);
589
- this.countries[key].currentFillColor = this.color;
590
- this.countries[key].setFill(this.color);
591
- }
592
- }
593
- };
594
-
595
- JQVMap.prototype.getCountryId = function (cc) {
596
- return 'jqvmap' + this.index + '_' + cc;
597
- };
598
-
599
- JQVMap.prototype.getPin = function(cc){
600
- var pinObj = jQuery('#' + this.getPinId(cc));
601
- return pinObj.html();
602
- };
603
-
604
- JQVMap.prototype.getPinId = function (cc) {
605
- return this.getCountryId(cc) + '_pin';
606
- };
607
-
608
- JQVMap.prototype.getPins = function(){
609
- var pins = this.container.find('.jqvmap-pin');
610
- var ret = {};
611
- jQuery.each(pins, function(index, pinObj){
612
- pinObj = jQuery(pinObj);
613
- var cc = pinObj.attr('for').toLowerCase();
614
- var pinContent = pinObj.html();
615
- ret[cc] = pinContent;
616
- });
617
- return JSON.stringify(ret);
618
- };
619
-
620
- JQVMap.prototype.highlight = function (cc, path) {
621
- path = path || jQuery('#' + this.getCountryId(cc))[0];
622
- if (this.hoverOpacity) {
623
- path.setOpacity(this.hoverOpacity);
624
- } else if (this.hoverColors && (cc in this.hoverColors)) {
625
- path.currentFillColor = path.getFill() + '';
626
- path.setFill(this.hoverColors[cc]);
627
- } else if (this.hoverColor) {
628
- path.currentFillColor = path.getFill() + '';
629
- path.setFill(this.hoverColor);
630
- }
631
- };
632
-
633
- JQVMap.prototype.isSelected = function(cc) {
634
- return this.selectIndex(cc) >= 0;
635
- };
636
-
637
- JQVMap.prototype.makeDraggable = function () {
638
- var mouseDown = false;
639
- var oldPageX, oldPageY;
640
- var self = this;
641
-
642
- self.isMoving = false;
643
- self.isMovingTimeout = false;
644
-
645
- var lastTouchCount;
646
- var touchCenterX;
647
- var touchCenterY;
648
- var touchStartDistance;
649
- var touchStartScale;
650
- var touchX;
651
- var touchY;
652
-
653
- this.container.mousemove(function (e) {
654
-
655
- if (mouseDown) {
656
- self.transX -= (oldPageX - e.pageX) / self.scale;
657
- self.transY -= (oldPageY - e.pageY) / self.scale;
658
-
659
- self.applyTransform();
660
-
661
- oldPageX = e.pageX;
662
- oldPageY = e.pageY;
663
-
664
- self.isMoving = true;
665
- if (self.isMovingTimeout) {
666
- clearTimeout(self.isMovingTimeout);
667
- }
668
-
669
- self.container.trigger('drag');
670
- }
671
-
672
- return false;
673
-
674
- }).mousedown(function (e) {
675
-
676
- mouseDown = true;
677
- oldPageX = e.pageX;
678
- oldPageY = e.pageY;
679
-
680
- return false;
681
-
682
- }).mouseup(function () {
683
-
684
- mouseDown = false;
685
-
686
- clearTimeout(self.isMovingTimeout);
687
- self.isMovingTimeout = setTimeout(function () {
688
- self.isMoving = false;
689
- }, 100);
690
-
691
- return false;
692
-
693
- }).mouseout(function () {
694
-
695
- if(mouseDown && self.isMoving){
696
-
697
- clearTimeout(self.isMovingTimeout);
698
- self.isMovingTimeout = setTimeout(function () {
699
- mouseDown = false;
700
- self.isMoving = false;
701
- }, 100);
702
-
703
- return false;
704
- }
705
- });
706
-
707
- jQuery(this.container).bind('touchmove', function (e) {
708
-
709
- var offset;
710
- var scale;
711
- var touches = e.originalEvent.touches;
712
- var transformXOld;
713
- var transformYOld;
714
-
715
- if (touches.length === 1) {
716
- if (lastTouchCount === 1) {
717
-
718
- if(touchX === touches[0].pageX && touchY === touches[0].pageY){
719
- return;
720
- }
721
-
722
- transformXOld = self.transX;
723
- transformYOld = self.transY;
724
-
725
- self.transX -= (touchX - touches[0].pageX) / self.scale;
726
- self.transY -= (touchY - touches[0].pageY) / self.scale;
727
-
728
- self.applyTransform();
729
-
730
- if (transformXOld !== self.transX || transformYOld !== self.transY) {
731
- e.preventDefault();
732
- }
733
-
734
- self.isMoving = true;
735
- if (self.isMovingTimeout) {
736
- clearTimeout(self.isMovingTimeout);
737
- }
738
- }
739
-
740
- touchX = touches[0].pageX;
741
- touchY = touches[0].pageY;
742
-
743
- } else if (touches.length === 2) {
744
-
745
- if (lastTouchCount === 2) {
746
- scale = Math.sqrt(
747
- Math.pow(touches[0].pageX - touches[1].pageX, 2) +
748
- Math.pow(touches[0].pageY - touches[1].pageY, 2)
749
- ) / touchStartDistance;
750
-
751
- self.setScale(
752
- touchStartScale * scale,
753
- touchCenterX,
754
- touchCenterY
755
- );
756
-
757
- e.preventDefault();
758
-
759
- } else {
760
-
761
- offset = jQuery(self.container).offset();
762
- if (touches[0].pageX > touches[1].pageX) {
763
- touchCenterX = touches[1].pageX + (touches[0].pageX - touches[1].pageX) / 2;
764
- } else {
765
- touchCenterX = touches[0].pageX + (touches[1].pageX - touches[0].pageX) / 2;
766
- }
767
-
768
- if (touches[0].pageY > touches[1].pageY) {
769
- touchCenterY = touches[1].pageY + (touches[0].pageY - touches[1].pageY) / 2;
770
- } else {
771
- touchCenterY = touches[0].pageY + (touches[1].pageY - touches[0].pageY) / 2;
772
- }
773
-
774
- touchCenterX -= offset.left;
775
- touchCenterY -= offset.top;
776
- touchStartScale = self.scale;
777
-
778
- touchStartDistance = Math.sqrt(
779
- Math.pow(touches[0].pageX - touches[1].pageX, 2) +
780
- Math.pow(touches[0].pageY - touches[1].pageY, 2)
781
- );
782
- }
783
- }
784
-
785
- lastTouchCount = touches.length;
786
- });
787
-
788
- jQuery(this.container).bind('touchstart', function () {
789
- lastTouchCount = 0;
790
- });
791
-
792
- jQuery(this.container).bind('touchend', function () {
793
- lastTouchCount = 0;
794
- });
795
- };
796
-
797
- JQVMap.prototype.placePins = function(pins, pinMode){
798
- var map = this;
799
-
800
- if(!pinMode || (pinMode !== 'content' && pinMode !== 'id')) {
801
- pinMode = 'content';
802
- }
803
-
804
- if(pinMode === 'content') {//treat pin as content
805
- jQuery.each(pins, function(index, pin){
806
- if(jQuery('#' + map.getCountryId(index)).length === 0){
807
- return;
808
- }
809
-
810
- var pinIndex = map.getPinId(index);
811
- var $pin = jQuery('#' + pinIndex);
812
- if($pin.length > 0){
813
- $pin.remove();
814
- }
815
- map.container.append('<div id="' + pinIndex + '" for="' + index + '" class="jqvmap-pin" style="position:absolute">' + pin + '</div>');
816
- });
817
- } else { //treat pin as id of an html content
818
- jQuery.each(pins, function(index, pin){
819
- if(jQuery('#' + map.getCountryId(index)).length === 0){
820
- return;
821
- }
822
- var pinIndex = map.getPinId(index);
823
- var $pin = jQuery('#' + pinIndex);
824
- if($pin.length > 0){
825
- $pin.remove();
826
- }
827
- map.container.append('<div id="' + pinIndex + '" for="' + index + '" class="jqvmap-pin" style="position:absolute"></div>');
828
- $pin.append(jQuery('#' + pin));
829
- });
830
- }
831
-
832
- this.positionPins();
833
- if(!this.pinHandlers){
834
- this.pinHandlers = true;
835
- var positionFix = function(){
836
- map.positionPins();
837
- };
838
- this.container.bind('zoomIn', positionFix)
839
- .bind('zoomOut', positionFix)
840
- .bind('drag', positionFix);
841
- }
842
- };
843
-
844
- JQVMap.prototype.positionPins = function(){
845
- var map = this;
846
- var pins = this.container.find('.jqvmap-pin');
847
- jQuery.each(pins, function(index, pinObj){
848
- pinObj = jQuery(pinObj);
849
- var countryId = map.getCountryId(pinObj.attr('for').toLowerCase());
850
- var countryObj = jQuery('#' + countryId);
851
-
852
- var bbox = document.getElementById(countryId).getBBox();
853
- var position = countryObj.position();
854
-
855
- var scale = map.scale;
856
-
857
- var left = position.left + (bbox.width / 2) * scale - pinObj.width() / 2,
858
- top = position.top + (bbox.height / 2) * scale - pinObj.height() / 2;
859
-
860
- pinObj.css('left', left).css('top', top);
861
- });
862
- };
863
-
864
- JQVMap.prototype.removePin = function(cc) {
865
- cc = cc.toLowerCase();
866
- jQuery('#' + this.getPinId(cc)).remove();
867
- };
868
-
869
- JQVMap.prototype.removePins = function(){
870
- this.container.find('.jqvmap-pin').remove();
871
- };
872
-
873
- JQVMap.prototype.reset = function () {
874
- for (var key in this.countries) {
875
- this.countries[key].setFill(this.color);
876
- }
877
- this.scale = this.baseScale;
878
- this.transX = this.baseTransX;
879
- this.transY = this.baseTransY;
880
- this.applyTransform();
881
- };
882
-
883
- JQVMap.prototype.resize = function () {
884
- var curBaseScale = this.baseScale;
885
- if (this.width / this.height > this.defaultWidth / this.defaultHeight) {
886
- this.baseScale = this.height / this.defaultHeight;
887
- this.baseTransX = Math.abs(this.width - this.defaultWidth * this.baseScale) / (2 * this.baseScale);
888
- } else {
889
- this.baseScale = this.width / this.defaultWidth;
890
- this.baseTransY = Math.abs(this.height - this.defaultHeight * this.baseScale) / (2 * this.baseScale);
891
- }
892
- this.scale *= this.baseScale / curBaseScale;
893
- this.transX *= this.baseScale / curBaseScale;
894
- this.transY *= this.baseScale / curBaseScale;
895
- };
896
-
897
- JQVMap.prototype.select = function (cc, path) {
898
- cc = cc.toLowerCase();
899
- path = path || jQuery('#' + this.getCountryId(cc))[0];
900
-
901
- if (!this.isSelected(cc)) {
902
- if (this.multiSelectRegion) {
903
- this.selectedRegions.push(cc);
904
- } else {
905
- this.selectedRegions = [cc];
906
- }
907
-
908
- jQuery(this.container).trigger('regionSelect.jqvmap', [cc]);
909
- if (this.selectedColor && path) {
910
- path.currentFillColor = this.selectedColor;
911
- path.setFill(this.selectedColor);
912
- }
913
- }
914
- };
915
-
916
- JQVMap.prototype.selectIndex = function (cc) {
917
- cc = cc.toLowerCase();
918
- for (var i = 0; i < this.selectedRegions.length; i++) {
919
- if (cc === this.selectedRegions[i]) {
920
- return i;
921
- }
922
- }
923
- return -1;
924
- };
925
-
926
- JQVMap.prototype.setBackgroundColor = function (backgroundColor) {
927
- this.container.css('background-color', backgroundColor);
928
- };
929
-
930
- JQVMap.prototype.setColors = function (key, color) {
931
- if (typeof key === 'string') {
932
- this.countries[key].setFill(color);
933
- this.countries[key].setAttribute('original', color);
934
- } else {
935
- var colors = key;
936
-
937
- for (var code in colors) {
938
- if (this.countries[code]) {
939
- this.countries[code].setFill(colors[code]);
940
- this.countries[code].setAttribute('original', colors[code]);
941
- }
942
- }
943
- }
944
- };
945
-
946
- JQVMap.prototype.setNormalizeFunction = function (f) {
947
- this.colorScale.setNormalizeFunction(f);
948
-
949
- if (this.values) {
950
- this.setValues(this.values);
951
- }
952
- };
953
-
954
- JQVMap.prototype.setScale = function (scale) {
955
- this.scale = scale;
956
- this.applyTransform();
957
- };
958
-
959
- JQVMap.prototype.setScaleColors = function (colors) {
960
- this.colorScale.setColors(colors);
961
-
962
- if (this.values) {
963
- this.setValues(this.values);
964
- }
965
- };
966
-
967
- JQVMap.prototype.setValues = function (values) {
968
- var max = 0,
969
- min = Number.MAX_VALUE,
970
- val;
971
-
972
- for (var cc in values) {
973
- cc = cc.toLowerCase();
974
- val = parseFloat(values[cc]);
975
-
976
- if (isNaN(val)) {
977
- continue;
978
- }
979
- if (val > max) {
980
- max = values[cc];
981
- }
982
- if (val < min) {
983
- min = val;
984
- }
985
- }
986
-
987
- if (min === max) {
988
- max++;
989
- }
990
-
991
- this.colorScale.setMin(min);
992
- this.colorScale.setMax(max);
993
-
994
- var colors = {};
995
- for (cc in values) {
996
- cc = cc.toLowerCase();
997
- val = parseFloat(values[cc]);
998
- colors[cc] = isNaN(val) ? this.color : this.colorScale.getColor(val);
999
- }
1000
- this.setColors(colors);
1001
- this.values = values;
1002
- };
1003
-
1004
- JQVMap.prototype.unhighlight = function (cc, path) {
1005
- cc = cc.toLowerCase();
1006
- path = path || jQuery('#' + this.getCountryId(cc))[0];
1007
- path.setOpacity(1);
1008
- if (path.currentFillColor) {
1009
- path.setFill(path.currentFillColor);
1010
- }
1011
- };
1012
-
1013
- JQVMap.prototype.zoomIn = function () {
1014
- var map = this;
1015
- var sliderDelta = (jQuery('#zoom').innerHeight() - 6 * 2 - 15 * 2 - 3 * 2 - 7 - 6) / (this.zoomMaxStep - this.zoomCurStep);
1016
-
1017
- if (map.zoomCurStep < map.zoomMaxStep) {
1018
- map.transX -= (map.width / map.scale - map.width / (map.scale * map.zoomStep)) / 2;
1019
- map.transY -= (map.height / map.scale - map.height / (map.scale * map.zoomStep)) / 2;
1020
- map.setScale(map.scale * map.zoomStep);
1021
- map.zoomCurStep++;
1022
-
1023
- var $slider = jQuery('#zoomSlider');
1024
-
1025
- $slider.css('top', parseInt($slider.css('top'), 10) - sliderDelta);
1026
-
1027
- map.container.trigger('zoomIn');
1028
- }
1029
- };
1030
-
1031
- JQVMap.prototype.zoomOut = function () {
1032
- var map = this;
1033
- var sliderDelta = (jQuery('#zoom').innerHeight() - 6 * 2 - 15 * 2 - 3 * 2 - 7 - 6) / (this.zoomMaxStep - this.zoomCurStep);
1034
-
1035
- if (map.zoomCurStep > 1) {
1036
- map.transX += (map.width / (map.scale / map.zoomStep) - map.width / map.scale) / 2;
1037
- map.transY += (map.height / (map.scale / map.zoomStep) - map.height / map.scale) / 2;
1038
- map.setScale(map.scale / map.zoomStep);
1039
- map.zoomCurStep--;
1040
-
1041
- var $slider = jQuery('#zoomSlider');
1042
-
1043
- $slider.css('top', parseInt($slider.css('top'), 10) + sliderDelta);
1044
-
1045
- map.container.trigger('zoomOut');
1046
- }
1047
- };
1048
-
1049
- VectorCanvas.prototype.applyTransformParams = function (scale, transX, transY) {
1050
- if (this.mode === 'svg') {
1051
- this.rootGroup.setAttribute('transform', 'scale(' + scale + ') translate(' + transX + ', ' + transY + ')');
1052
- } else {
1053
- this.rootGroup.coordorigin = (this.width - transX) + ',' + (this.height - transY);
1054
- this.rootGroup.coordsize = this.width / scale + ',' + this.height / scale;
1055
- }
1056
- };
1057
-
1058
- VectorCanvas.prototype.createGroup = function (isRoot) {
1059
- var node;
1060
- if (this.mode === 'svg') {
1061
- node = this.createSvgNode('g');
1062
- } else {
1063
- node = this.createVmlNode('group');
1064
- node.style.width = this.width + 'px';
1065
- node.style.height = this.height + 'px';
1066
- node.style.left = '0px';
1067
- node.style.top = '0px';
1068
- node.coordorigin = '0 0';
1069
- node.coordsize = this.width + ' ' + this.height;
1070
- }
1071
-
1072
- if (isRoot) {
1073
- this.rootGroup = node;
1074
- }
1075
- return node;
1076
- };
1077
-
1078
- VectorCanvas.prototype.createPath = function (config) {
1079
- var node;
1080
- if (this.mode === 'svg') {
1081
- node = this.createSvgNode('path');
1082
- node.setAttribute('d', config.path);
1083
-
1084
- if (this.params.borderColor !== null) {
1085
- node.setAttribute('stroke', this.params.borderColor);
1086
- }
1087
- if (this.params.borderWidth > 0) {
1088
- node.setAttribute('stroke-width', this.params.borderWidth);
1089
- node.setAttribute('stroke-linecap', 'round');
1090
- node.setAttribute('stroke-linejoin', 'round');
1091
- }
1092
- if (this.params.borderOpacity > 0) {
1093
- node.setAttribute('stroke-opacity', this.params.borderOpacity);
1094
- }
1095
-
1096
- node.setFill = function (color) {
1097
- this.setAttribute('fill', color);
1098
- if (this.getAttribute('original') === null) {
1099
- this.setAttribute('original', color);
1100
- }
1101
- };
1102
-
1103
- node.getFill = function () {
1104
- return this.getAttribute('fill');
1105
- };
1106
-
1107
- node.getOriginalFill = function () {
1108
- return this.getAttribute('original');
1109
- };
1110
-
1111
- node.setOpacity = function (opacity) {
1112
- this.setAttribute('fill-opacity', opacity);
1113
- };
1114
- } else {
1115
- node = this.createVmlNode('shape');
1116
- node.coordorigin = '0 0';
1117
- node.coordsize = this.width + ' ' + this.height;
1118
- node.style.width = this.width + 'px';
1119
- node.style.height = this.height + 'px';
1120
- node.fillcolor = JQVMap.defaultFillColor;
1121
- node.stroked = false;
1122
- node.path = VectorCanvas.pathSvgToVml(config.path);
1123
-
1124
- var scale = this.createVmlNode('skew');
1125
- scale.on = true;
1126
- scale.matrix = '0.01,0,0,0.01,0,0';
1127
- scale.offset = '0,0';
1128
-
1129
- node.appendChild(scale);
1130
-
1131
- var fill = this.createVmlNode('fill');
1132
- node.appendChild(fill);
1133
-
1134
- node.setFill = function (color) {
1135
- this.getElementsByTagName('fill')[0].color = color;
1136
- if (this.getAttribute('original') === null) {
1137
- this.setAttribute('original', color);
1138
- }
1139
- };
1140
-
1141
- node.getFill = function () {
1142
- return this.getElementsByTagName('fill')[0].color;
1143
- };
1144
- node.getOriginalFill = function () {
1145
- return this.getAttribute('original');
1146
- };
1147
- node.setOpacity = function (opacity) {
1148
- this.getElementsByTagName('fill')[0].opacity = parseInt(opacity * 100, 10) + '%';
1149
- };
1150
- }
1151
- return node;
1152
- };
1153
-
1154
- VectorCanvas.prototype.pathSvgToVml = function (path) {
1155
- var result = '';
1156
- var cx = 0, cy = 0, ctrlx, ctrly;
1157
-
1158
- return path.replace(/([MmLlHhVvCcSs])((?:-?(?:\d+)?(?:\.\d+)?,?\s?)+)/g, function (segment, letter, coords) {
1159
- coords = coords.replace(/(\d)-/g, '$1,-').replace(/\s+/g, ',').split(',');
1160
- if (!coords[0]) {
1161
- coords.shift();
1162
- }
1163
-
1164
- for (var i = 0, l = coords.length; i < l; i++) {
1165
- coords[i] = Math.round(100 * coords[i]);
1166
- }
1167
-
1168
- switch (letter) {
1169
- case 'm':
1170
- cx += coords[0];
1171
- cy += coords[1];
1172
- result = 't' + coords.join(',');
1173
- break;
1174
-
1175
- case 'M':
1176
- cx = coords[0];
1177
- cy = coords[1];
1178
- result = 'm' + coords.join(',');
1179
- break;
1180
-
1181
- case 'l':
1182
- cx += coords[0];
1183
- cy += coords[1];
1184
- result = 'r' + coords.join(',');
1185
- break;
1186
-
1187
- case 'L':
1188
- cx = coords[0];
1189
- cy = coords[1];
1190
- result = 'l' + coords.join(',');
1191
- break;
1192
-
1193
- case 'h':
1194
- cx += coords[0];
1195
- result = 'r' + coords[0] + ',0';
1196
- break;
1197
-
1198
- case 'H':
1199
- cx = coords[0];
1200
- result = 'l' + cx + ',' + cy;
1201
- break;
1202
-
1203
- case 'v':
1204
- cy += coords[0];
1205
- result = 'r0,' + coords[0];
1206
- break;
1207
-
1208
- case 'V':
1209
- cy = coords[0];
1210
- result = 'l' + cx + ',' + cy;
1211
- break;
1212
-
1213
- case 'c':
1214
- ctrlx = cx + coords[coords.length - 4];
1215
- ctrly = cy + coords[coords.length - 3];
1216
- cx += coords[coords.length - 2];
1217
- cy += coords[coords.length - 1];
1218
- result = 'v' + coords.join(',');
1219
- break;
1220
-
1221
- case 'C':
1222
- ctrlx = coords[coords.length - 4];
1223
- ctrly = coords[coords.length - 3];
1224
- cx = coords[coords.length - 2];
1225
- cy = coords[coords.length - 1];
1226
- result = 'c' + coords.join(',');
1227
- break;
1228
-
1229
- case 's':
1230
- coords.unshift(cy - ctrly);
1231
- coords.unshift(cx - ctrlx);
1232
- ctrlx = cx + coords[coords.length - 4];
1233
- ctrly = cy + coords[coords.length - 3];
1234
- cx += coords[coords.length - 2];
1235
- cy += coords[coords.length - 1];
1236
- result = 'v' + coords.join(',');
1237
- break;
1238
-
1239
- case 'S':
1240
- coords.unshift(cy + cy - ctrly);
1241
- coords.unshift(cx + cx - ctrlx);
1242
- ctrlx = coords[coords.length - 4];
1243
- ctrly = coords[coords.length - 3];
1244
- cx = coords[coords.length - 2];
1245
- cy = coords[coords.length - 1];
1246
- result = 'c' + coords.join(',');
1247
- break;
1248
-
1249
- default:
1250
- break;
1251
- }
1252
-
1253
- return result;
1254
-
1255
- }).replace(/z/g, '');
1256
- };
1257
-
1258
- VectorCanvas.prototype.setSize = function (width, height) {
1259
- if (this.mode === 'svg') {
1260
- this.canvas.setAttribute('width', width);
1261
- this.canvas.setAttribute('height', height);
1262
- } else {
1263
- this.canvas.style.width = width + 'px';
1264
- this.canvas.style.height = height + 'px';
1265
- this.canvas.coordsize = width + ' ' + height;
1266
- this.canvas.coordorigin = '0 0';
1267
- if (this.rootGroup) {
1268
- var paths = this.rootGroup.getElementsByTagName('shape');
1269
- for (var i = 0, l = paths.length; i < l; i++) {
1270
- paths[i].coordsize = width + ' ' + height;
1271
- paths[i].style.width = width + 'px';
1272
- paths[i].style.height = height + 'px';
1273
- }
1274
- this.rootGroup.coordsize = width + ' ' + height;
1275
- this.rootGroup.style.width = width + 'px';
1276
- this.rootGroup.style.height = height + 'px';
1277
- }
1278
- }
1279
- this.width = width;
1280
- this.height = height;
1281
- };
1
+ /*!
2
+ * JQVMap: jQuery Vector Map Library
3
+ * @author JQVMap <me@peterschmalfeldt.com>
4
+ * @version 1.5.1
5
+ * @link http://jqvmap.com
6
+ * @license https://github.com/manifestinteractive/jqvmap/blob/master/LICENSE
7
+ * @builddate 2016/05/18
8
+ */
9
+
10
+ var VectorCanvas = function (width, height, params) {
11
+ this.mode = window.SVGAngle ? 'svg' : 'vml';
12
+ this.params = params;
13
+
14
+ if (this.mode === 'svg') {
15
+ this.createSvgNode = function (nodeName) {
16
+ return document.createElementNS(this.svgns, nodeName);
17
+ };
18
+ } else {
19
+ try {
20
+ if (!document.namespaces.rvml) {
21
+ document.namespaces.add('rvml', 'urn:schemas-microsoft-com:vml');
22
+ }
23
+ this.createVmlNode = function (tagName) {
24
+ return document.createElement('<rvml:' + tagName + ' class="rvml">');
25
+ };
26
+ } catch (e) {
27
+ this.createVmlNode = function (tagName) {
28
+ return document.createElement('<' + tagName + ' xmlns="urn:schemas-microsoft.com:vml" class="rvml">');
29
+ };
30
+ }
31
+
32
+ document.createStyleSheet().addRule('.rvml', 'behavior:url(#default#VML)');
33
+ }
34
+
35
+ if (this.mode === 'svg') {
36
+ this.canvas = this.createSvgNode('svg');
37
+ } else {
38
+ this.canvas = this.createVmlNode('group');
39
+ this.canvas.style.position = 'absolute';
40
+ }
41
+
42
+ this.setSize(width, height);
43
+ };
44
+
45
+ VectorCanvas.prototype = {
46
+ svgns: 'http://www.w3.org/2000/svg',
47
+ mode: 'svg',
48
+ width: 0,
49
+ height: 0,
50
+ canvas: null
51
+ };
52
+
53
+ var ColorScale = function (colors, normalizeFunction, minValue, maxValue) {
54
+ if (colors) {
55
+ this.setColors(colors);
56
+ }
57
+ if (normalizeFunction) {
58
+ this.setNormalizeFunction(normalizeFunction);
59
+ }
60
+ if (minValue) {
61
+ this.setMin(minValue);
62
+ }
63
+ if (minValue) {
64
+ this.setMax(maxValue);
65
+ }
66
+ };
67
+
68
+ ColorScale.prototype = {
69
+ colors: []
70
+ };
71
+
72
+ var JQVMap = function (params) {
73
+ params = params || {};
74
+ var map = this;
75
+ var mapData = JQVMap.maps[params.map];
76
+ var mapPins;
77
+
78
+ if( !mapData){
79
+ throw new Error('Invalid "' + params.map + '" map parameter. Please make sure you have loaded this map file in your HTML.');
80
+ }
81
+
82
+ this.selectedRegions = [];
83
+ this.multiSelectRegion = params.multiSelectRegion;
84
+
85
+ this.container = params.container;
86
+
87
+ this.defaultWidth = mapData.width;
88
+ this.defaultHeight = mapData.height;
89
+
90
+ this.color = params.color;
91
+ this.selectedColor = params.selectedColor;
92
+ this.hoverColor = params.hoverColor;
93
+ this.hoverColors = params.hoverColors;
94
+ this.hoverOpacity = params.hoverOpacity;
95
+ this.setBackgroundColor(params.backgroundColor);
96
+
97
+ this.width = params.container.width();
98
+ this.height = params.container.height();
99
+
100
+ this.resize();
101
+
102
+ jQuery(window).resize(function () {
103
+ var newWidth = params.container.width();
104
+ var newHeight = params.container.height();
105
+
106
+ if(newWidth && newHeight){
107
+ map.width = newWidth;
108
+ map.height = newHeight;
109
+ map.resize();
110
+ map.canvas.setSize(map.width, map.height);
111
+ map.applyTransform();
112
+
113
+ var resizeEvent = jQuery.Event('resize.jqvmap');
114
+ jQuery(params.container).trigger(resizeEvent, [newWidth, newHeight]);
115
+
116
+ if(mapPins){
117
+ jQuery('.jqvmap-pin').remove();
118
+ map.pinHandlers = false;
119
+ map.placePins(mapPins.pins, mapPins.mode);
120
+ }
121
+ }
122
+ });
123
+
124
+ this.canvas = new VectorCanvas(this.width, this.height, params);
125
+ params.container.append(this.canvas.canvas);
126
+
127
+ this.makeDraggable();
128
+
129
+ this.rootGroup = this.canvas.createGroup(true);
130
+
131
+ this.index = JQVMap.mapIndex;
132
+ this.label = jQuery('<div/>').addClass('jqvmap-label').appendTo(jQuery('body')).hide();
133
+
134
+ if (params.enableZoom) {
135
+ jQuery('<div/>').addClass('jqvmap-zoomin').text('+').appendTo(params.container);
136
+ jQuery('<div/>').addClass('jqvmap-zoomout').html('&#x2212;').appendTo(params.container);
137
+ }
138
+
139
+ map.countries = [];
140
+
141
+ for (var key in mapData.paths) {
142
+ var path = this.canvas.createPath({
143
+ path: mapData.paths[key].path
144
+ });
145
+
146
+ path.setFill(this.color);
147
+ path.id = map.getCountryId(key);
148
+ map.countries[key] = path;
149
+
150
+ if (this.canvas.mode === 'svg') {
151
+ path.setAttribute('class', 'jqvmap-region');
152
+ } else {
153
+ jQuery(path).addClass('jqvmap-region');
154
+ }
155
+
156
+ jQuery(this.rootGroup).append(path);
157
+ }
158
+
159
+ jQuery(params.container).delegate(this.canvas.mode === 'svg' ? 'path' : 'shape', 'mouseover mouseout', function (e) {
160
+ var containerPath = e.target,
161
+ code = e.target.id.split('_').pop(),
162
+ labelShowEvent = jQuery.Event('labelShow.jqvmap'),
163
+ regionMouseOverEvent = jQuery.Event('regionMouseOver.jqvmap');
164
+
165
+ code = code.toLowerCase();
166
+
167
+ if (e.type === 'mouseover') {
168
+ jQuery(params.container).trigger(regionMouseOverEvent, [code, mapData.paths[code].name]);
169
+ if (!regionMouseOverEvent.isDefaultPrevented()) {
170
+ map.highlight(code, containerPath);
171
+ }
172
+ if (params.showTooltip) {
173
+ map.label.text(mapData.paths[code].name);
174
+ jQuery(params.container).trigger(labelShowEvent, [map.label, code]);
175
+
176
+ if (!labelShowEvent.isDefaultPrevented()) {
177
+ map.label.show();
178
+ map.labelWidth = map.label.width();
179
+ map.labelHeight = map.label.height();
180
+ }
181
+ }
182
+ } else {
183
+ map.unhighlight(code, containerPath);
184
+
185
+ map.label.hide();
186
+ jQuery(params.container).trigger('regionMouseOut.jqvmap', [code, mapData.paths[code].name]);
187
+ }
188
+ });
189
+
190
+ jQuery(params.container).delegate(this.canvas.mode === 'svg' ? 'path' : 'shape', 'click', function (regionClickEvent) {
191
+
192
+ var targetPath = regionClickEvent.target;
193
+ var code = regionClickEvent.target.id.split('_').pop();
194
+ var mapClickEvent = jQuery.Event('regionClick.jqvmap');
195
+
196
+ code = code.toLowerCase();
197
+
198
+ jQuery(params.container).trigger(mapClickEvent, [code, mapData.paths[code].name]);
199
+
200
+ if ( !params.multiSelectRegion && !mapClickEvent.isDefaultPrevented()) {
201
+ for (var keyPath in mapData.paths) {
202
+ map.countries[keyPath].currentFillColor = map.countries[keyPath].getOriginalFill();
203
+ map.countries[keyPath].setFill(map.countries[keyPath].getOriginalFill());
204
+ }
205
+ }
206
+
207
+ if ( !mapClickEvent.isDefaultPrevented()) {
208
+ if (map.isSelected(code)) {
209
+ map.deselect(code, targetPath);
210
+ } else {
211
+ map.select(code, targetPath);
212
+ }
213
+ }
214
+ });
215
+
216
+ if (params.showTooltip) {
217
+ params.container.mousemove(function (e) {
218
+ if (map.label.is(':visible')) {
219
+ var left = e.pageX - 15 - map.labelWidth;
220
+ var top = e.pageY - 15 - map.labelHeight;
221
+
222
+ if(left < 0) {
223
+ left = e.pageX + 15;
224
+ }
225
+ if(top < 0) {
226
+ top = e.pageY + 15;
227
+ }
228
+
229
+ map.label.css({
230
+ left: left,
231
+ top: top
232
+ });
233
+ }
234
+ });
235
+ }
236
+
237
+ this.setColors(params.colors);
238
+
239
+ this.canvas.canvas.appendChild(this.rootGroup);
240
+
241
+ this.applyTransform();
242
+
243
+ this.colorScale = new ColorScale(params.scaleColors, params.normalizeFunction, params.valueMin, params.valueMax);
244
+
245
+ if (params.values) {
246
+ this.values = params.values;
247
+ this.setValues(params.values);
248
+ }
249
+
250
+ if (params.selectedRegions) {
251
+ if (params.selectedRegions instanceof Array) {
252
+ for(var k in params.selectedRegions) {
253
+ this.select(params.selectedRegions[k].toLowerCase());
254
+ }
255
+ } else {
256
+ this.select(params.selectedRegions.toLowerCase());
257
+ }
258
+ }
259
+
260
+ this.bindZoomButtons();
261
+
262
+ if(params.pins) {
263
+ mapPins = {
264
+ pins: params.pins,
265
+ mode: params.pinMode
266
+ };
267
+
268
+ this.pinHandlers = false;
269
+ this.placePins(params.pins, params.pinMode);
270
+ }
271
+
272
+ if(params.showLabels){
273
+ this.pinHandlers = false;
274
+
275
+ var pins = {};
276
+ for (key in map.countries){
277
+ if (typeof map.countries[key] !== 'function') {
278
+ if( !params.pins || !params.pins[key] ){
279
+ pins[key] = key.toUpperCase();
280
+ }
281
+ }
282
+ }
283
+
284
+ mapPins = {
285
+ pins: pins,
286
+ mode: 'content'
287
+ };
288
+
289
+ this.placePins(pins, 'content');
290
+ }
291
+
292
+ JQVMap.mapIndex++;
293
+ };
294
+
295
+ JQVMap.prototype = {
296
+ transX: 0,
297
+ transY: 0,
298
+ scale: 1,
299
+ baseTransX: 0,
300
+ baseTransY: 0,
301
+ baseScale: 1,
302
+ width: 0,
303
+ height: 0,
304
+ countries: {},
305
+ countriesColors: {},
306
+ countriesData: {},
307
+ zoomStep: 1.4,
308
+ zoomMaxStep: 4,
309
+ zoomCurStep: 1
310
+ };
311
+
312
+ JQVMap.xlink = 'http://www.w3.org/1999/xlink';
313
+ JQVMap.mapIndex = 1;
314
+ JQVMap.maps = {};
315
+
316
+ (function(){
317
+
318
+ var apiParams = {
319
+ colors: 1,
320
+ values: 1,
321
+ backgroundColor: 1,
322
+ scaleColors: 1,
323
+ normalizeFunction: 1,
324
+ enableZoom: 1,
325
+ showTooltip: 1,
326
+ borderColor: 1,
327
+ borderWidth: 1,
328
+ borderOpacity: 1,
329
+ selectedRegions: 1,
330
+ multiSelectRegion: 1
331
+ };
332
+
333
+ var apiEvents = {
334
+ onLabelShow: 'labelShow',
335
+ onLoad: 'load',
336
+ onRegionOver: 'regionMouseOver',
337
+ onRegionOut: 'regionMouseOut',
338
+ onRegionClick: 'regionClick',
339
+ onRegionSelect: 'regionSelect',
340
+ onRegionDeselect: 'regionDeselect',
341
+ onResize: 'resize'
342
+ };
343
+
344
+ jQuery.fn.vectorMap = function (options) {
345
+
346
+ var defaultParams = {
347
+ map: 'world_en',
348
+ backgroundColor: '#a5bfdd',
349
+ color: '#f4f3f0',
350
+ hoverColor: '#c9dfaf',
351
+ hoverColors: {},
352
+ selectedColor: '#c9dfaf',
353
+ scaleColors: ['#b6d6ff', '#005ace'],
354
+ normalizeFunction: 'linear',
355
+ enableZoom: true,
356
+ showTooltip: true,
357
+ borderColor: '#818181',
358
+ borderWidth: 1,
359
+ borderOpacity: 0.25,
360
+ selectedRegions: null,
361
+ multiSelectRegion: false
362
+ }, map = this.data('mapObject');
363
+
364
+ if (options === 'addMap') {
365
+ JQVMap.maps[arguments[1]] = arguments[2];
366
+ } else if (options === 'set' && apiParams[arguments[1]]) {
367
+ map['set' + arguments[1].charAt(0).toUpperCase() + arguments[1].substr(1)].apply(map, Array.prototype.slice.call(arguments, 2));
368
+ } else if (typeof options === 'string' &&
369
+ typeof map[options] === 'function') {
370
+ return map[options].apply(map, Array.prototype.slice.call(arguments, 1));
371
+ } else {
372
+ jQuery.extend(defaultParams, options);
373
+ defaultParams.container = this;
374
+ this.css({ position: 'relative', overflow: 'hidden' });
375
+
376
+ map = new JQVMap(defaultParams);
377
+
378
+ this.data('mapObject', map);
379
+
380
+ this.unbind('.jqvmap');
381
+
382
+ for (var e in apiEvents) {
383
+ if (defaultParams[e]) {
384
+ this.bind(apiEvents[e] + '.jqvmap', defaultParams[e]);
385
+ }
386
+ }
387
+
388
+ var loadEvent = jQuery.Event('load.jqvmap');
389
+ jQuery(defaultParams.container).trigger(loadEvent, map);
390
+
391
+ return map;
392
+ }
393
+ };
394
+
395
+ })(jQuery);
396
+
397
+ ColorScale.arrayToRgb = function (ar) {
398
+ var rgb = '#';
399
+ var d;
400
+ for (var i = 0; i < ar.length; i++) {
401
+ d = ar[i].toString(16);
402
+ rgb += d.length === 1 ? '0' + d : d;
403
+ }
404
+ return rgb;
405
+ };
406
+
407
+ ColorScale.prototype.getColor = function (value) {
408
+ if (typeof this.normalize === 'function') {
409
+ value = this.normalize(value);
410
+ }
411
+
412
+ var lengthes = [];
413
+ var fullLength = 0;
414
+ var l;
415
+
416
+ for (var i = 0; i < this.colors.length - 1; i++) {
417
+ l = this.vectorLength(this.vectorSubtract(this.colors[i + 1], this.colors[i]));
418
+ lengthes.push(l);
419
+ fullLength += l;
420
+ }
421
+
422
+ var c = (this.maxValue - this.minValue) / fullLength;
423
+
424
+ for (i = 0; i < lengthes.length; i++) {
425
+ lengthes[i] *= c;
426
+ }
427
+
428
+ i = 0;
429
+ value -= this.minValue;
430
+
431
+ while (value - lengthes[i] >= 0) {
432
+ value -= lengthes[i];
433
+ i++;
434
+ }
435
+
436
+ var color;
437
+ if (i === this.colors.length - 1) {
438
+ color = this.vectorToNum(this.colors[i]).toString(16);
439
+ } else {
440
+ color = (this.vectorToNum(this.vectorAdd(this.colors[i], this.vectorMult(this.vectorSubtract(this.colors[i + 1], this.colors[i]), (value) / (lengthes[i]))))).toString(16);
441
+ }
442
+
443
+ while (color.length < 6) {
444
+ color = '0' + color;
445
+ }
446
+ return '#' + color;
447
+ };
448
+
449
+ ColorScale.rgbToArray = function (rgb) {
450
+ rgb = rgb.substr(1);
451
+ return [parseInt(rgb.substr(0, 2), 16), parseInt(rgb.substr(2, 2), 16), parseInt(rgb.substr(4, 2), 16)];
452
+ };
453
+
454
+ ColorScale.prototype.setColors = function (colors) {
455
+ for (var i = 0; i < colors.length; i++) {
456
+ colors[i] = ColorScale.rgbToArray(colors[i]);
457
+ }
458
+ this.colors = colors;
459
+ };
460
+
461
+ ColorScale.prototype.setMax = function (max) {
462
+ this.clearMaxValue = max;
463
+ if (typeof this.normalize === 'function') {
464
+ this.maxValue = this.normalize(max);
465
+ } else {
466
+ this.maxValue = max;
467
+ }
468
+ };
469
+
470
+ ColorScale.prototype.setMin = function (min) {
471
+ this.clearMinValue = min;
472
+
473
+ if (typeof this.normalize === 'function') {
474
+ this.minValue = this.normalize(min);
475
+ } else {
476
+ this.minValue = min;
477
+ }
478
+ };
479
+
480
+ ColorScale.prototype.setNormalizeFunction = function (f) {
481
+ if (f === 'polynomial') {
482
+ this.normalize = function (value) {
483
+ return Math.pow(value, 0.2);
484
+ };
485
+ } else if (f === 'linear') {
486
+ delete this.normalize;
487
+ } else {
488
+ this.normalize = f;
489
+ }
490
+ this.setMin(this.clearMinValue);
491
+ this.setMax(this.clearMaxValue);
492
+ };
493
+
494
+ ColorScale.prototype.vectorAdd = function (vector1, vector2) {
495
+ var vector = [];
496
+ for (var i = 0; i < vector1.length; i++) {
497
+ vector[i] = vector1[i] + vector2[i];
498
+ }
499
+ return vector;
500
+ };
501
+
502
+ ColorScale.prototype.vectorLength = function (vector) {
503
+ var result = 0;
504
+ for (var i = 0; i < vector.length; i++) {
505
+ result += vector[i] * vector[i];
506
+ }
507
+ return Math.sqrt(result);
508
+ };
509
+
510
+ ColorScale.prototype.vectorMult = function (vector, num) {
511
+ var result = [];
512
+ for (var i = 0; i < vector.length; i++) {
513
+ result[i] = vector[i] * num;
514
+ }
515
+ return result;
516
+ };
517
+
518
+ ColorScale.prototype.vectorSubtract = function (vector1, vector2) {
519
+ var vector = [];
520
+ for (var i = 0; i < vector1.length; i++) {
521
+ vector[i] = vector1[i] - vector2[i];
522
+ }
523
+ return vector;
524
+ };
525
+
526
+ ColorScale.prototype.vectorToNum = function (vector) {
527
+ var num = 0;
528
+ for (var i = 0; i < vector.length; i++) {
529
+ num += Math.round(vector[i]) * Math.pow(256, vector.length - i - 1);
530
+ }
531
+ return num;
532
+ };
533
+
534
+ JQVMap.prototype.applyTransform = function () {
535
+ var maxTransX, maxTransY, minTransX, minTransY;
536
+ if (this.defaultWidth * this.scale <= this.width) {
537
+ maxTransX = (this.width - this.defaultWidth * this.scale) / (2 * this.scale);
538
+ minTransX = (this.width - this.defaultWidth * this.scale) / (2 * this.scale);
539
+ } else {
540
+ maxTransX = 0;
541
+ minTransX = (this.width - this.defaultWidth * this.scale) / this.scale;
542
+ }
543
+
544
+ if (this.defaultHeight * this.scale <= this.height) {
545
+ maxTransY = (this.height - this.defaultHeight * this.scale) / (2 * this.scale);
546
+ minTransY = (this.height - this.defaultHeight * this.scale) / (2 * this.scale);
547
+ } else {
548
+ maxTransY = 0;
549
+ minTransY = (this.height - this.defaultHeight * this.scale) / this.scale;
550
+ }
551
+
552
+ if (this.transY > maxTransY) {
553
+ this.transY = maxTransY;
554
+ } else if (this.transY < minTransY) {
555
+ this.transY = minTransY;
556
+ }
557
+ if (this.transX > maxTransX) {
558
+ this.transX = maxTransX;
559
+ } else if (this.transX < minTransX) {
560
+ this.transX = minTransX;
561
+ }
562
+
563
+ this.canvas.applyTransformParams(this.scale, this.transX, this.transY);
564
+ };
565
+
566
+ JQVMap.prototype.bindZoomButtons = function () {
567
+ var map = this;
568
+ this.container.find('.jqvmap-zoomin').click(function(){
569
+ map.zoomIn();
570
+ });
571
+ this.container.find('.jqvmap-zoomout').click(function(){
572
+ map.zoomOut();
573
+ });
574
+ };
575
+
576
+ JQVMap.prototype.deselect = function (cc, path) {
577
+ cc = cc.toLowerCase();
578
+ path = path || jQuery('#' + this.getCountryId(cc))[0];
579
+
580
+ if (this.isSelected(cc)) {
581
+ this.selectedRegions.splice(this.selectIndex(cc), 1);
582
+
583
+ jQuery(this.container).trigger('regionDeselect.jqvmap', [cc]);
584
+ path.currentFillColor = path.getOriginalFill();
585
+ path.setFill(path.getOriginalFill());
586
+ } else {
587
+ for (var key in this.countries) {
588
+ this.selectedRegions.splice(this.selectedRegions.indexOf(key), 1);
589
+ this.countries[key].currentFillColor = this.color;
590
+ this.countries[key].setFill(this.color);
591
+ }
592
+ }
593
+ };
594
+
595
+ JQVMap.prototype.getCountryId = function (cc) {
596
+ return 'jqvmap' + this.index + '_' + cc;
597
+ };
598
+
599
+ JQVMap.prototype.getPin = function(cc){
600
+ var pinObj = jQuery('#' + this.getPinId(cc));
601
+ return pinObj.html();
602
+ };
603
+
604
+ JQVMap.prototype.getPinId = function (cc) {
605
+ return this.getCountryId(cc) + '_pin';
606
+ };
607
+
608
+ JQVMap.prototype.getPins = function(){
609
+ var pins = this.container.find('.jqvmap-pin');
610
+ var ret = {};
611
+ jQuery.each(pins, function(index, pinObj){
612
+ pinObj = jQuery(pinObj);
613
+ var cc = pinObj.attr('for').toLowerCase();
614
+ var pinContent = pinObj.html();
615
+ ret[cc] = pinContent;
616
+ });
617
+ return JSON.stringify(ret);
618
+ };
619
+
620
+ JQVMap.prototype.highlight = function (cc, path) {
621
+ path = path || jQuery('#' + this.getCountryId(cc))[0];
622
+ if (this.hoverOpacity) {
623
+ path.setOpacity(this.hoverOpacity);
624
+ } else if (this.hoverColors && (cc in this.hoverColors)) {
625
+ path.currentFillColor = path.getFill() + '';
626
+ path.setFill(this.hoverColors[cc]);
627
+ } else if (this.hoverColor) {
628
+ path.currentFillColor = path.getFill() + '';
629
+ path.setFill(this.hoverColor);
630
+ }
631
+ };
632
+
633
+ JQVMap.prototype.isSelected = function(cc) {
634
+ return this.selectIndex(cc) >= 0;
635
+ };
636
+
637
+ JQVMap.prototype.makeDraggable = function () {
638
+ var mouseDown = false;
639
+ var oldPageX, oldPageY;
640
+ var self = this;
641
+
642
+ self.isMoving = false;
643
+ self.isMovingTimeout = false;
644
+
645
+ var lastTouchCount;
646
+ var touchCenterX;
647
+ var touchCenterY;
648
+ var touchStartDistance;
649
+ var touchStartScale;
650
+ var touchX;
651
+ var touchY;
652
+
653
+ this.container.mousemove(function (e) {
654
+
655
+ if (mouseDown) {
656
+ self.transX -= (oldPageX - e.pageX) / self.scale;
657
+ self.transY -= (oldPageY - e.pageY) / self.scale;
658
+
659
+ self.applyTransform();
660
+
661
+ oldPageX = e.pageX;
662
+ oldPageY = e.pageY;
663
+
664
+ self.isMoving = true;
665
+ if (self.isMovingTimeout) {
666
+ clearTimeout(self.isMovingTimeout);
667
+ }
668
+
669
+ self.container.trigger('drag');
670
+ }
671
+
672
+ return false;
673
+
674
+ }).mousedown(function (e) {
675
+
676
+ mouseDown = true;
677
+ oldPageX = e.pageX;
678
+ oldPageY = e.pageY;
679
+
680
+ return false;
681
+
682
+ }).mouseup(function () {
683
+
684
+ mouseDown = false;
685
+
686
+ clearTimeout(self.isMovingTimeout);
687
+ self.isMovingTimeout = setTimeout(function () {
688
+ self.isMoving = false;
689
+ }, 100);
690
+
691
+ return false;
692
+
693
+ }).mouseout(function () {
694
+
695
+ if(mouseDown && self.isMoving){
696
+
697
+ clearTimeout(self.isMovingTimeout);
698
+ self.isMovingTimeout = setTimeout(function () {
699
+ mouseDown = false;
700
+ self.isMoving = false;
701
+ }, 100);
702
+
703
+ return false;
704
+ }
705
+ });
706
+
707
+ jQuery(this.container).bind('touchmove', function (e) {
708
+
709
+ var offset;
710
+ var scale;
711
+ var touches = e.originalEvent.touches;
712
+ var transformXOld;
713
+ var transformYOld;
714
+
715
+ if (touches.length === 1) {
716
+ if (lastTouchCount === 1) {
717
+
718
+ if(touchX === touches[0].pageX && touchY === touches[0].pageY){
719
+ return;
720
+ }
721
+
722
+ transformXOld = self.transX;
723
+ transformYOld = self.transY;
724
+
725
+ self.transX -= (touchX - touches[0].pageX) / self.scale;
726
+ self.transY -= (touchY - touches[0].pageY) / self.scale;
727
+
728
+ self.applyTransform();
729
+
730
+ if (transformXOld !== self.transX || transformYOld !== self.transY) {
731
+ e.preventDefault();
732
+ }
733
+
734
+ self.isMoving = true;
735
+ if (self.isMovingTimeout) {
736
+ clearTimeout(self.isMovingTimeout);
737
+ }
738
+ }
739
+
740
+ touchX = touches[0].pageX;
741
+ touchY = touches[0].pageY;
742
+
743
+ } else if (touches.length === 2) {
744
+
745
+ if (lastTouchCount === 2) {
746
+ scale = Math.sqrt(
747
+ Math.pow(touches[0].pageX - touches[1].pageX, 2) +
748
+ Math.pow(touches[0].pageY - touches[1].pageY, 2)
749
+ ) / touchStartDistance;
750
+
751
+ self.setScale(
752
+ touchStartScale * scale,
753
+ touchCenterX,
754
+ touchCenterY
755
+ );
756
+
757
+ e.preventDefault();
758
+
759
+ } else {
760
+
761
+ offset = jQuery(self.container).offset();
762
+ if (touches[0].pageX > touches[1].pageX) {
763
+ touchCenterX = touches[1].pageX + (touches[0].pageX - touches[1].pageX) / 2;
764
+ } else {
765
+ touchCenterX = touches[0].pageX + (touches[1].pageX - touches[0].pageX) / 2;
766
+ }
767
+
768
+ if (touches[0].pageY > touches[1].pageY) {
769
+ touchCenterY = touches[1].pageY + (touches[0].pageY - touches[1].pageY) / 2;
770
+ } else {
771
+ touchCenterY = touches[0].pageY + (touches[1].pageY - touches[0].pageY) / 2;
772
+ }
773
+
774
+ touchCenterX -= offset.left;
775
+ touchCenterY -= offset.top;
776
+ touchStartScale = self.scale;
777
+
778
+ touchStartDistance = Math.sqrt(
779
+ Math.pow(touches[0].pageX - touches[1].pageX, 2) +
780
+ Math.pow(touches[0].pageY - touches[1].pageY, 2)
781
+ );
782
+ }
783
+ }
784
+
785
+ lastTouchCount = touches.length;
786
+ });
787
+
788
+ jQuery(this.container).bind('touchstart', function () {
789
+ lastTouchCount = 0;
790
+ });
791
+
792
+ jQuery(this.container).bind('touchend', function () {
793
+ lastTouchCount = 0;
794
+ });
795
+ };
796
+
797
+ JQVMap.prototype.placePins = function(pins, pinMode){
798
+ var map = this;
799
+
800
+ if(!pinMode || (pinMode !== 'content' && pinMode !== 'id')) {
801
+ pinMode = 'content';
802
+ }
803
+
804
+ if(pinMode === 'content') {//treat pin as content
805
+ jQuery.each(pins, function(index, pin){
806
+ if(jQuery('#' + map.getCountryId(index)).length === 0){
807
+ return;
808
+ }
809
+
810
+ var pinIndex = map.getPinId(index);
811
+ var $pin = jQuery('#' + pinIndex);
812
+ if($pin.length > 0){
813
+ $pin.remove();
814
+ }
815
+ map.container.append('<div id="' + pinIndex + '" for="' + index + '" class="jqvmap-pin" style="position:absolute">' + pin + '</div>');
816
+ });
817
+ } else { //treat pin as id of an html content
818
+ jQuery.each(pins, function(index, pin){
819
+ if(jQuery('#' + map.getCountryId(index)).length === 0){
820
+ return;
821
+ }
822
+ var pinIndex = map.getPinId(index);
823
+ var $pin = jQuery('#' + pinIndex);
824
+ if($pin.length > 0){
825
+ $pin.remove();
826
+ }
827
+ map.container.append('<div id="' + pinIndex + '" for="' + index + '" class="jqvmap-pin" style="position:absolute"></div>');
828
+ $pin.append(jQuery('#' + pin));
829
+ });
830
+ }
831
+
832
+ this.positionPins();
833
+ if(!this.pinHandlers){
834
+ this.pinHandlers = true;
835
+ var positionFix = function(){
836
+ map.positionPins();
837
+ };
838
+ this.container.bind('zoomIn', positionFix)
839
+ .bind('zoomOut', positionFix)
840
+ .bind('drag', positionFix);
841
+ }
842
+ };
843
+
844
+ JQVMap.prototype.positionPins = function(){
845
+ var map = this;
846
+ var pins = this.container.find('.jqvmap-pin');
847
+ jQuery.each(pins, function(index, pinObj){
848
+ pinObj = jQuery(pinObj);
849
+ var countryId = map.getCountryId(pinObj.attr('for').toLowerCase());
850
+ var countryObj = jQuery('#' + countryId);
851
+
852
+ var bbox = document.getElementById(countryId).getBBox();
853
+ var position = countryObj.position();
854
+
855
+ var scale = map.scale;
856
+
857
+ var left = position.left + (bbox.width / 2) * scale - pinObj.width() / 2,
858
+ top = position.top + (bbox.height / 2) * scale - pinObj.height() / 2;
859
+
860
+ pinObj.css('left', left).css('top', top);
861
+ });
862
+ };
863
+
864
+ JQVMap.prototype.removePin = function(cc) {
865
+ cc = cc.toLowerCase();
866
+ jQuery('#' + this.getPinId(cc)).remove();
867
+ };
868
+
869
+ JQVMap.prototype.removePins = function(){
870
+ this.container.find('.jqvmap-pin').remove();
871
+ };
872
+
873
+ JQVMap.prototype.reset = function () {
874
+ for (var key in this.countries) {
875
+ this.countries[key].setFill(this.color);
876
+ }
877
+ this.scale = this.baseScale;
878
+ this.transX = this.baseTransX;
879
+ this.transY = this.baseTransY;
880
+ this.applyTransform();
881
+ };
882
+
883
+ JQVMap.prototype.resize = function () {
884
+ var curBaseScale = this.baseScale;
885
+ if (this.width / this.height > this.defaultWidth / this.defaultHeight) {
886
+ this.baseScale = this.height / this.defaultHeight;
887
+ this.baseTransX = Math.abs(this.width - this.defaultWidth * this.baseScale) / (2 * this.baseScale);
888
+ } else {
889
+ this.baseScale = this.width / this.defaultWidth;
890
+ this.baseTransY = Math.abs(this.height - this.defaultHeight * this.baseScale) / (2 * this.baseScale);
891
+ }
892
+ this.scale *= this.baseScale / curBaseScale;
893
+ this.transX *= this.baseScale / curBaseScale;
894
+ this.transY *= this.baseScale / curBaseScale;
895
+ };
896
+
897
+ JQVMap.prototype.select = function (cc, path) {
898
+ cc = cc.toLowerCase();
899
+ path = path || jQuery('#' + this.getCountryId(cc))[0];
900
+
901
+ if (!this.isSelected(cc)) {
902
+ if (this.multiSelectRegion) {
903
+ this.selectedRegions.push(cc);
904
+ } else {
905
+ this.selectedRegions = [cc];
906
+ }
907
+
908
+ jQuery(this.container).trigger('regionSelect.jqvmap', [cc]);
909
+ if (this.selectedColor && path) {
910
+ path.currentFillColor = this.selectedColor;
911
+ path.setFill(this.selectedColor);
912
+ }
913
+ }
914
+ };
915
+
916
+ JQVMap.prototype.selectIndex = function (cc) {
917
+ cc = cc.toLowerCase();
918
+ for (var i = 0; i < this.selectedRegions.length; i++) {
919
+ if (cc === this.selectedRegions[i]) {
920
+ return i;
921
+ }
922
+ }
923
+ return -1;
924
+ };
925
+
926
+ JQVMap.prototype.setBackgroundColor = function (backgroundColor) {
927
+ this.container.css('background-color', backgroundColor);
928
+ };
929
+
930
+ JQVMap.prototype.setColors = function (key, color) {
931
+ if (typeof key === 'string') {
932
+ this.countries[key].setFill(color);
933
+ this.countries[key].setAttribute('original', color);
934
+ } else {
935
+ var colors = key;
936
+
937
+ for (var code in colors) {
938
+ if (this.countries[code]) {
939
+ this.countries[code].setFill(colors[code]);
940
+ this.countries[code].setAttribute('original', colors[code]);
941
+ }
942
+ }
943
+ }
944
+ };
945
+
946
+ JQVMap.prototype.setNormalizeFunction = function (f) {
947
+ this.colorScale.setNormalizeFunction(f);
948
+
949
+ if (this.values) {
950
+ this.setValues(this.values);
951
+ }
952
+ };
953
+
954
+ JQVMap.prototype.setScale = function (scale) {
955
+ this.scale = scale;
956
+ this.applyTransform();
957
+ };
958
+
959
+ JQVMap.prototype.setScaleColors = function (colors) {
960
+ this.colorScale.setColors(colors);
961
+
962
+ if (this.values) {
963
+ this.setValues(this.values);
964
+ }
965
+ };
966
+
967
+ JQVMap.prototype.setValues = function (values) {
968
+ var max = 0,
969
+ min = Number.MAX_VALUE,
970
+ val;
971
+
972
+ for (var cc in values) {
973
+ cc = cc.toLowerCase();
974
+ val = parseFloat(values[cc]);
975
+
976
+ if (isNaN(val)) {
977
+ continue;
978
+ }
979
+ if (val > max) {
980
+ max = values[cc];
981
+ }
982
+ if (val < min) {
983
+ min = val;
984
+ }
985
+ }
986
+
987
+ if (min === max) {
988
+ max++;
989
+ }
990
+
991
+ this.colorScale.setMin(min);
992
+ this.colorScale.setMax(max);
993
+
994
+ var colors = {};
995
+ for (cc in values) {
996
+ cc = cc.toLowerCase();
997
+ val = parseFloat(values[cc]);
998
+ colors[cc] = isNaN(val) ? this.color : this.colorScale.getColor(val);
999
+ }
1000
+ this.setColors(colors);
1001
+ this.values = values;
1002
+ };
1003
+
1004
+ JQVMap.prototype.unhighlight = function (cc, path) {
1005
+ cc = cc.toLowerCase();
1006
+ path = path || jQuery('#' + this.getCountryId(cc))[0];
1007
+ path.setOpacity(1);
1008
+ if (path.currentFillColor) {
1009
+ path.setFill(path.currentFillColor);
1010
+ }
1011
+ };
1012
+
1013
+ JQVMap.prototype.zoomIn = function () {
1014
+ var map = this;
1015
+ var sliderDelta = (jQuery('#zoom').innerHeight() - 6 * 2 - 15 * 2 - 3 * 2 - 7 - 6) / (this.zoomMaxStep - this.zoomCurStep);
1016
+
1017
+ if (map.zoomCurStep < map.zoomMaxStep) {
1018
+ map.transX -= (map.width / map.scale - map.width / (map.scale * map.zoomStep)) / 2;
1019
+ map.transY -= (map.height / map.scale - map.height / (map.scale * map.zoomStep)) / 2;
1020
+ map.setScale(map.scale * map.zoomStep);
1021
+ map.zoomCurStep++;
1022
+
1023
+ var $slider = jQuery('#zoomSlider');
1024
+
1025
+ $slider.css('top', parseInt($slider.css('top'), 10) - sliderDelta);
1026
+
1027
+ map.container.trigger('zoomIn');
1028
+ }
1029
+ };
1030
+
1031
+ JQVMap.prototype.zoomOut = function () {
1032
+ var map = this;
1033
+ var sliderDelta = (jQuery('#zoom').innerHeight() - 6 * 2 - 15 * 2 - 3 * 2 - 7 - 6) / (this.zoomMaxStep - this.zoomCurStep);
1034
+
1035
+ if (map.zoomCurStep > 1) {
1036
+ map.transX += (map.width / (map.scale / map.zoomStep) - map.width / map.scale) / 2;
1037
+ map.transY += (map.height / (map.scale / map.zoomStep) - map.height / map.scale) / 2;
1038
+ map.setScale(map.scale / map.zoomStep);
1039
+ map.zoomCurStep--;
1040
+
1041
+ var $slider = jQuery('#zoomSlider');
1042
+
1043
+ $slider.css('top', parseInt($slider.css('top'), 10) + sliderDelta);
1044
+
1045
+ map.container.trigger('zoomOut');
1046
+ }
1047
+ };
1048
+
1049
+ VectorCanvas.prototype.applyTransformParams = function (scale, transX, transY) {
1050
+ if (this.mode === 'svg') {
1051
+ this.rootGroup.setAttribute('transform', 'scale(' + scale + ') translate(' + transX + ', ' + transY + ')');
1052
+ } else {
1053
+ this.rootGroup.coordorigin = (this.width - transX) + ',' + (this.height - transY);
1054
+ this.rootGroup.coordsize = this.width / scale + ',' + this.height / scale;
1055
+ }
1056
+ };
1057
+
1058
+ VectorCanvas.prototype.createGroup = function (isRoot) {
1059
+ var node;
1060
+ if (this.mode === 'svg') {
1061
+ node = this.createSvgNode('g');
1062
+ } else {
1063
+ node = this.createVmlNode('group');
1064
+ node.style.width = this.width + 'px';
1065
+ node.style.height = this.height + 'px';
1066
+ node.style.left = '0px';
1067
+ node.style.top = '0px';
1068
+ node.coordorigin = '0 0';
1069
+ node.coordsize = this.width + ' ' + this.height;
1070
+ }
1071
+
1072
+ if (isRoot) {
1073
+ this.rootGroup = node;
1074
+ }
1075
+ return node;
1076
+ };
1077
+
1078
+ VectorCanvas.prototype.createPath = function (config) {
1079
+ var node;
1080
+ if (this.mode === 'svg') {
1081
+ node = this.createSvgNode('path');
1082
+ node.setAttribute('d', config.path);
1083
+
1084
+ if (this.params.borderColor !== null) {
1085
+ node.setAttribute('stroke', this.params.borderColor);
1086
+ }
1087
+ if (this.params.borderWidth > 0) {
1088
+ node.setAttribute('stroke-width', this.params.borderWidth);
1089
+ node.setAttribute('stroke-linecap', 'round');
1090
+ node.setAttribute('stroke-linejoin', 'round');
1091
+ }
1092
+ if (this.params.borderOpacity > 0) {
1093
+ node.setAttribute('stroke-opacity', this.params.borderOpacity);
1094
+ }
1095
+
1096
+ node.setFill = function (color) {
1097
+ this.setAttribute('fill', color);
1098
+ if (this.getAttribute('original') === null) {
1099
+ this.setAttribute('original', color);
1100
+ }
1101
+ };
1102
+
1103
+ node.getFill = function () {
1104
+ return this.getAttribute('fill');
1105
+ };
1106
+
1107
+ node.getOriginalFill = function () {
1108
+ return this.getAttribute('original');
1109
+ };
1110
+
1111
+ node.setOpacity = function (opacity) {
1112
+ this.setAttribute('fill-opacity', opacity);
1113
+ };
1114
+ } else {
1115
+ node = this.createVmlNode('shape');
1116
+ node.coordorigin = '0 0';
1117
+ node.coordsize = this.width + ' ' + this.height;
1118
+ node.style.width = this.width + 'px';
1119
+ node.style.height = this.height + 'px';
1120
+ node.fillcolor = JQVMap.defaultFillColor;
1121
+ node.stroked = false;
1122
+ node.path = VectorCanvas.pathSvgToVml(config.path);
1123
+
1124
+ var scale = this.createVmlNode('skew');
1125
+ scale.on = true;
1126
+ scale.matrix = '0.01,0,0,0.01,0,0';
1127
+ scale.offset = '0,0';
1128
+
1129
+ node.appendChild(scale);
1130
+
1131
+ var fill = this.createVmlNode('fill');
1132
+ node.appendChild(fill);
1133
+
1134
+ node.setFill = function (color) {
1135
+ this.getElementsByTagName('fill')[0].color = color;
1136
+ if (this.getAttribute('original') === null) {
1137
+ this.setAttribute('original', color);
1138
+ }
1139
+ };
1140
+
1141
+ node.getFill = function () {
1142
+ return this.getElementsByTagName('fill')[0].color;
1143
+ };
1144
+ node.getOriginalFill = function () {
1145
+ return this.getAttribute('original');
1146
+ };
1147
+ node.setOpacity = function (opacity) {
1148
+ this.getElementsByTagName('fill')[0].opacity = parseInt(opacity * 100, 10) + '%';
1149
+ };
1150
+ }
1151
+ return node;
1152
+ };
1153
+
1154
+ VectorCanvas.prototype.pathSvgToVml = function (path) {
1155
+ var result = '';
1156
+ var cx = 0, cy = 0, ctrlx, ctrly;
1157
+
1158
+ return path.replace(/([MmLlHhVvCcSs])((?:-?(?:\d+)?(?:\.\d+)?,?\s?)+)/g, function (segment, letter, coords) {
1159
+ coords = coords.replace(/(\d)-/g, '$1,-').replace(/\s+/g, ',').split(',');
1160
+ if (!coords[0]) {
1161
+ coords.shift();
1162
+ }
1163
+
1164
+ for (var i = 0, l = coords.length; i < l; i++) {
1165
+ coords[i] = Math.round(100 * coords[i]);
1166
+ }
1167
+
1168
+ switch (letter) {
1169
+ case 'm':
1170
+ cx += coords[0];
1171
+ cy += coords[1];
1172
+ result = 't' + coords.join(',');
1173
+ break;
1174
+
1175
+ case 'M':
1176
+ cx = coords[0];
1177
+ cy = coords[1];
1178
+ result = 'm' + coords.join(',');
1179
+ break;
1180
+
1181
+ case 'l':
1182
+ cx += coords[0];
1183
+ cy += coords[1];
1184
+ result = 'r' + coords.join(',');
1185
+ break;
1186
+
1187
+ case 'L':
1188
+ cx = coords[0];
1189
+ cy = coords[1];
1190
+ result = 'l' + coords.join(',');
1191
+ break;
1192
+
1193
+ case 'h':
1194
+ cx += coords[0];
1195
+ result = 'r' + coords[0] + ',0';
1196
+ break;
1197
+
1198
+ case 'H':
1199
+ cx = coords[0];
1200
+ result = 'l' + cx + ',' + cy;
1201
+ break;
1202
+
1203
+ case 'v':
1204
+ cy += coords[0];
1205
+ result = 'r0,' + coords[0];
1206
+ break;
1207
+
1208
+ case 'V':
1209
+ cy = coords[0];
1210
+ result = 'l' + cx + ',' + cy;
1211
+ break;
1212
+
1213
+ case 'c':
1214
+ ctrlx = cx + coords[coords.length - 4];
1215
+ ctrly = cy + coords[coords.length - 3];
1216
+ cx += coords[coords.length - 2];
1217
+ cy += coords[coords.length - 1];
1218
+ result = 'v' + coords.join(',');
1219
+ break;
1220
+
1221
+ case 'C':
1222
+ ctrlx = coords[coords.length - 4];
1223
+ ctrly = coords[coords.length - 3];
1224
+ cx = coords[coords.length - 2];
1225
+ cy = coords[coords.length - 1];
1226
+ result = 'c' + coords.join(',');
1227
+ break;
1228
+
1229
+ case 's':
1230
+ coords.unshift(cy - ctrly);
1231
+ coords.unshift(cx - ctrlx);
1232
+ ctrlx = cx + coords[coords.length - 4];
1233
+ ctrly = cy + coords[coords.length - 3];
1234
+ cx += coords[coords.length - 2];
1235
+ cy += coords[coords.length - 1];
1236
+ result = 'v' + coords.join(',');
1237
+ break;
1238
+
1239
+ case 'S':
1240
+ coords.unshift(cy + cy - ctrly);
1241
+ coords.unshift(cx + cx - ctrlx);
1242
+ ctrlx = coords[coords.length - 4];
1243
+ ctrly = coords[coords.length - 3];
1244
+ cx = coords[coords.length - 2];
1245
+ cy = coords[coords.length - 1];
1246
+ result = 'c' + coords.join(',');
1247
+ break;
1248
+
1249
+ default:
1250
+ break;
1251
+ }
1252
+
1253
+ return result;
1254
+
1255
+ }).replace(/z/g, '');
1256
+ };
1257
+
1258
+ VectorCanvas.prototype.setSize = function (width, height) {
1259
+ if (this.mode === 'svg') {
1260
+ this.canvas.setAttribute('width', width);
1261
+ this.canvas.setAttribute('height', height);
1262
+ } else {
1263
+ this.canvas.style.width = width + 'px';
1264
+ this.canvas.style.height = height + 'px';
1265
+ this.canvas.coordsize = width + ' ' + height;
1266
+ this.canvas.coordorigin = '0 0';
1267
+ if (this.rootGroup) {
1268
+ var paths = this.rootGroup.getElementsByTagName('shape');
1269
+ for (var i = 0, l = paths.length; i < l; i++) {
1270
+ paths[i].coordsize = width + ' ' + height;
1271
+ paths[i].style.width = width + 'px';
1272
+ paths[i].style.height = height + 'px';
1273
+ }
1274
+ this.rootGroup.coordsize = width + ' ' + height;
1275
+ this.rootGroup.style.width = width + 'px';
1276
+ this.rootGroup.style.height = height + 'px';
1277
+ }
1278
+ }
1279
+ this.width = width;
1280
+ this.height = height;
1281
+ };