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,823 +1,823 @@
1
- /**
2
- * @file Jeditable - jQuery in place edit plugin
3
- * @home https://github.com/NicolasCARPi/jquery_jeditable
4
- * @author Mika Tuupola, Dylan Verheul, Nicolas CARPi
5
- * @copyright © 2006 Mika Tuupola, Dylan Verheul, Nicolas CARPi
6
- * @licence MIT (see LICENCE file)
7
- * @name Jquery-jeditable
8
- * @type jQuery
9
- *
10
- * @param {String|Function} target - URL or Function to send edited content to. Can also be 'disable', 'enable', or 'destroy'
11
- * @param {Object} [options] - Additional options
12
- * @param {Object} [options.ajaxoptions] - jQuery Ajax options. See https://api.jquery.com/jQuery.ajax/
13
- * @param {Function} [options.before] - Function to be executed before going into edit mode
14
- * @param {Function} [options.callback] - function(result, settings, submitdata) Function to run after submitting edited content
15
- * @param {String} [options.cancel] - Cancel button value, empty means no button
16
- * @param {String} [options.cancelcssclass] - CSS class to apply to cancel button
17
- * @param {Number} [options.cols] - Number of columns if using textarea
18
- * @param {String} [options.cssclass] - CSS class to apply to input form; use 'inherit' to copy from parent
19
- * @param {String} [options.inputcssclass] - CSS class to apply to input. 'inherit' to copy from parent
20
- * @param {String|Function} [options.data] - Content loaded in the form
21
- * @param {String} [options.event='click'] - jQuery event such as 'click' of 'dblclick'. See https://api.jquery.com/category/events/
22
- * @param {String} [options.formid] - Give an id to the form that is produced
23
- * @param {String|Number} [options.height='auto'] - Height of the element in pixels or 'auto' or 'none'
24
- * @param {String} [options.id='id'] - POST parameter name of edited div id
25
- * @param {String} [options.indicator] - Indicator html to show when saving
26
- * @param {String} [options.label] - Label for the form
27
- * @param {String} [options.list] - HTML5 attribute for text input. Will suggest from a datalist with id of the list option
28
- * @param {String|Function} [options.loaddata] - Extra parameters to pass when fetching content before editing
29
- * @param {String} [options.loadtext='Loading…'] - Text to display while loading external content
30
- * @param {String} [options.loadtype='GET'] - Request type for loadurl (GET or POST)
31
- * @param {String} [options.loadurl] - URL to fetch input content before editing
32
- * @param {Number} [options.max] - Maximum value for number type
33
- * @param {String} [options.maxlength] - The maximum number of character in the text field
34
- * @param {String} [options.method] - Method to use to send edited content (POST or PUT)
35
- * @param {Number} [options.min] - Mininum value for number type
36
- * @param {Boolean} [options.multiple] - Allow multiple selections in a select input
37
- * @param {String} [options.name='value'] - POST parameter name of edited content
38
- * @param {String|Function} [options.onblur='cancel'] - Use 'cancel', 'submit', 'ignore' or function. If function returns false, the form is cancelled.
39
- * @param {Function} [options.onedit] - function triggered upon edition; will cancel edition if it returns false
40
- * @param {Function} [options.onerror] - function(settings, original, xhr) { ... } called on error
41
- * @param {Function} [options.onreset] - function(settings, original) { ... } called before reset
42
- * @param {Function} [options.onsubmit] - function(settings, original) { ... } called before submit
43
- * @param {String} [options.pattern] - HTML5 attribute for text or URL input
44
- * @param {String} [options.placeholder='Click to edit'] - Placeholder text or html to insert when element is empty
45
- * @param {Number} [options.rows] - number of rows if using textarea
46
- * @param {Boolean} [options.select] - When true text is selected
47
- * @param {Function} [options.showfn]- Function that can animate the element when switching to edit mode
48
- * @param {String} [options.size] - The size of the text field
49
- * @param {String} [options.sortselectoptions] - Sort the options of a select form
50
- * @param {Number} [options.step] - Step size for number type
51
- * @param {String} [options.style] - Style to apply to input form; 'inherit' to copy from parent
52
- * @param {String} [options.submit] - submit button value, empty means no button
53
- * @param {String} [options.submitcssclass] - CSS class to apply to submit button
54
- * @param {Object|Function} [options.submitdata] - Extra parameters to send when submitting edited content. function(revert, settings, submitdata)
55
- * @param {String} [options.tooltip] - Tooltip text that appears on hover (via title attribute)
56
- * @param {String} [options.type='text'] - text, textarea, select, email, number, url (or any 3rd party input type)
57
- * @param {String|Number} [options.width='auto'] - The width of the element in pixels or 'auto' or 'none'
58
- *
59
- * @example <caption>Simple usage example:</caption>
60
- * $(".editable").editable("save.php", {
61
- * cancel : 'Cancel',
62
- * submit : 'Save',
63
- * tooltip : "Click to edit...",
64
- * });
65
- */
66
- (function($) {
67
-
68
- 'use strict';
69
-
70
- // Keyboard accessibility/WAI-ARIA - allow users to navigate to an editable element using TAB/Shift+TAB
71
- $.fn.editableAriaShim = function () {
72
- this.attr({
73
- role: 'button',
74
- tabindex: 0
75
- });
76
- return this; // <-- object chaining.
77
- };
78
-
79
- // EDITABLE function
80
- $.fn.editable = function(target, options) {
81
-
82
- if ('disable' === target) {
83
- $(this).data('disabled.editable', true);
84
- return;
85
- }
86
- if ('enable' === target) {
87
- $(this).data('disabled.editable', false);
88
- return;
89
- }
90
- if ('destroy' === target) {
91
- $(this)
92
- .unbind($(this).data('event.editable'))
93
- .removeData('disabled.editable')
94
- .removeData('event.editable');
95
- return;
96
- }
97
- var settings = $.extend({}, $.fn.editable.defaults, {target:target}, options);
98
-
99
- /* setup some functions */
100
- var plugin = $.editable.types[settings.type].plugin || function() { };
101
- var submit = $.editable.types[settings.type].submit || function() { };
102
- var buttons = $.editable.types[settings.type].buttons || $.editable.types.defaults.buttons;
103
- var content = $.editable.types[settings.type].content || $.editable.types.defaults.content;
104
- var element = $.editable.types[settings.type].element || $.editable.types.defaults.element;
105
- var reset = $.editable.types[settings.type].reset || $.editable.types.defaults.reset;
106
- var destroy = $.editable.types[settings.type].destroy || $.editable.types.defaults.destroy;
107
- var callback = settings.callback || function() { };
108
- var intercept = settings.intercept || function(s) { return s; };
109
- var onedit = settings.onedit || function() { };
110
- var onsubmit = settings.onsubmit || function() { };
111
- var onreset = settings.onreset || function() { };
112
- var onerror = settings.onerror || reset;
113
- var before = settings.before || false;
114
-
115
- // TOOLTIP
116
- if (settings.tooltip) {
117
- $(this).attr('title', settings.tooltip);
118
- }
119
-
120
- return this.each(function() {
121
-
122
- /* Save this to self because this changes when scope changes. */
123
- var self = this;
124
-
125
- /* Save so it can be later used by $.editable('destroy') */
126
- $(this).data('event.editable', settings.event);
127
-
128
- /* If element is empty add something clickable (if requested) */
129
- if (!$.trim($(this).html())) {
130
- $(this).html(settings.placeholder);
131
- }
132
-
133
- if ('destroy' === target) {
134
- destroy.apply($(this).find('form'), [settings, self]);
135
- return;
136
- }
137
-
138
- // EVENT IS FIRED
139
- $(this).bind(settings.event, function(e) {
140
-
141
- /* Abort if element is disabled. */
142
- if (true === $(this).data('disabled.editable')) {
143
- return;
144
- }
145
-
146
- // do nothing if user press Tab again, just go to next element, not into edit mode
147
- if (e.which === 9) {
148
- return;
149
- }
150
-
151
- /* Prevent throwing an exeption if edit field is clicked again. */
152
- if (self.editing) {
153
- return;
154
- }
155
-
156
- /* Abort if onedit hook returns false. */
157
- if (false === onedit.apply(this, [settings, self, e])) {
158
- return;
159
- }
160
-
161
- /* execute the before function if any was specified */
162
- if (settings.before && jQuery.isFunction(settings.before)) {
163
- settings.before(e);
164
- } else if (settings.before && !jQuery.isFunction(settings.before)) {
165
- throw "The 'before' option needs to be provided as a function!";
166
- }
167
-
168
- /* Prevent default action and bubbling. */
169
- e.preventDefault();
170
- e.stopPropagation();
171
-
172
- /* Remove tooltip. */
173
- if (settings.tooltip) {
174
- $(self).removeAttr('title');
175
- }
176
-
177
- /* Remove placeholder text, replace is here because of IE. */
178
- if ($(this).html().toLowerCase().replace(/(;|"|\/)/g, '') ===
179
- settings.placeholder.toLowerCase().replace(/(;|"|\/)/g, '')) {
180
- $(this).html('');
181
- }
182
-
183
- self.editing = true;
184
- self.revert = $(self).text();
185
- $(self).html('');
186
-
187
- /* Create the form object. */
188
- var form = $('<form />');
189
-
190
- /* Apply css or style or both. */
191
- if (settings.cssclass) {
192
- if ('inherit' === settings.cssclass) {
193
- form.attr('class', $(self).attr('class'));
194
- } else {
195
- form.attr('class', settings.cssclass);
196
- }
197
- }
198
-
199
- if (settings.style) {
200
- if ('inherit' === settings.style) {
201
- form.attr('style', $(self).attr('style'));
202
- /* IE needs the second line or display wont be inherited. */
203
- form.css('display', $(self).css('display'));
204
- } else {
205
- form.attr('style', settings.style);
206
- }
207
- }
208
-
209
- // add a label if it exists
210
- if (settings.label) {
211
- form.append('<label>' + settings.label + '</label>');
212
- }
213
-
214
- // add an ID to the form
215
- if (settings.formid) {
216
- form.attr('id', settings.formid);
217
- }
218
-
219
- /* Add main input element to form and store it in input. */
220
- var input = element.apply(form, [settings, self]);
221
-
222
- if (settings.inputcssclass) {
223
- if ('inherit' === settings.inputcssclass) {
224
- input.attr('class', $(self).attr('class'));
225
- } else {
226
- input.attr('class', settings.inputcssclass);
227
- }
228
- }
229
-
230
- /* Set input content via POST, GET, given data or existing value. */
231
- var input_content;
232
-
233
- // timeout function
234
- var t;
235
- var isSubmitting = false;
236
-
237
- if (settings.loadurl) {
238
- t = self.setTimeout(function() {
239
- input.disabled = true;
240
- }, 100);
241
- $(self).html(settings.loadtext);
242
-
243
- var loaddata = {};
244
- loaddata[settings.id] = self.id;
245
- if ($.isFunction(settings.loaddata)) {
246
- $.extend(loaddata, settings.loaddata.apply(self, [self.revert, settings]));
247
- } else {
248
- $.extend(loaddata, settings.loaddata);
249
- }
250
- $.ajax({
251
- type : settings.loadtype,
252
- url : settings.loadurl,
253
- data : loaddata,
254
- async: false,
255
- cache : false,
256
- success: function(result) {
257
- self.clearTimeout(t);
258
- input_content = result;
259
- input.disabled = false;
260
- }
261
- });
262
- } else if (settings.data) {
263
- input_content = settings.data;
264
- if ($.isFunction(settings.data)) {
265
- input_content = settings.data.apply(self, [self.revert, settings]);
266
- }
267
- } else {
268
- input_content = self.revert;
269
- }
270
- content.apply(form, [input_content, settings, self]);
271
-
272
- input.attr('name', settings.name);
273
-
274
- /* adjust the width of the element to account for the margin/padding/border */
275
- if (settings.width !== 'none') {
276
- var adj_width = settings.width - (input.outerWidth(true) - settings.width);
277
- input.width(adj_width);
278
- }
279
-
280
- /* Add buttons to the form. */
281
- buttons.apply(form, [settings, self]);
282
-
283
- /* Add created form to self. */
284
- if (settings.showfn && $.isFunction(settings.showfn)) {
285
- form.hide();
286
- }
287
-
288
- // clear the loadtext that we put here before
289
- $(self).html('');
290
-
291
- $(self).append(form);
292
-
293
- // execute the showfn
294
- if (settings.showfn && $.isFunction(settings.showfn)) {
295
- settings.showfn(form);
296
- }
297
-
298
- /* Attach 3rd party plugin if requested. */
299
- plugin.apply(form, [settings, self]);
300
-
301
- /* Focus to first visible form element. */
302
- form.find(':input:visible:enabled:first').focus();
303
-
304
- /* Highlight input contents when requested. */
305
- if (settings.select) {
306
- input.select();
307
- }
308
-
309
- /* discard changes if pressing esc */
310
- $(this).keydown(function(e) {
311
- if (e.which === 27) {
312
- e.preventDefault();
313
- reset.apply(form, [settings, self]);
314
- }
315
- });
316
-
317
- /* Discard, submit or nothing with changes when clicking outside. */
318
- /* Do nothing is usable when navigating with tab. */
319
- if ('cancel' === settings.onblur) {
320
- input.blur(function(e) {
321
- /* Prevent canceling if submit was clicked. */
322
- t = self.setTimeout(function() {
323
- reset.apply(form, [settings, self]);
324
- }, 500);
325
- });
326
- } else if ('submit' === settings.onblur) {
327
- input.blur(function(e) {
328
- /* Prevent double submit if submit was clicked. */
329
- t = self.setTimeout(function() {
330
- form.submit();
331
- }, 200);
332
- });
333
- } else if ($.isFunction(settings.onblur)) {
334
- input.blur(function(e) {
335
- // reset the form if the onblur function returns false
336
- if (false === settings.onblur.apply(self, [input.val(), settings, form])) {
337
- reset.apply(form, [settings, self]);
338
- }
339
- });
340
- }
341
-
342
- form.submit(function(e) {
343
-
344
- /* Do no submit. */
345
- e.preventDefault();
346
- e.stopPropagation();
347
-
348
- if (isSubmitting) {
349
- // we are already submitting! Stop right here.
350
- return false;
351
- } else {
352
- isSubmitting = true;
353
- }
354
-
355
- if (t) {
356
- self.clearTimeout(t);
357
- }
358
-
359
- /* Call before submit hook. */
360
- /* If it returns false abort submitting. */
361
- isSubmitting = false !== onsubmit.apply(form, [settings, self]);
362
- if (isSubmitting) {
363
- /* Custom inputs call before submit hook. */
364
- /* If it returns false abort submitting. */
365
- isSubmitting = false !== submit.apply(form, [settings, self]);
366
- if (isSubmitting) {
367
-
368
- /* Check if given target is function */
369
- if ($.isFunction(settings.target)) {
370
- /* Callback function to handle the target reponse */
371
- var responseHandler = function(value, complete) {
372
- isSubmitting = false;
373
- if (false !== complete) {
374
- $(self).html(value);
375
- self.editing = false;
376
- callback.apply(self, [self.innerHTML, settings]);
377
- if (!$.trim($(self).html())) {
378
- $(self).html(settings.placeholder);
379
- }
380
- }
381
- };
382
- /* Call the user target function */
383
- var userTarget = settings.target.apply(self, [input.val(), settings, responseHandler]);
384
- /* Handle the target function return for compatibility */
385
- if (false !== userTarget && undefined !== userTarget) {
386
- responseHandler(userTarget, userTarget);
387
- }
388
-
389
- } else {
390
- /* Add edited content and id of edited element to POST. */
391
- var submitdata = {};
392
- submitdata[settings.name] = input.val();
393
- submitdata[settings.id] = self.id;
394
- /* Add extra data to be POST:ed. */
395
- if ($.isFunction(settings.submitdata)) {
396
- $.extend(submitdata, settings.submitdata.apply(self, [self.revert, settings, submitdata]));
397
- } else {
398
- $.extend(submitdata, settings.submitdata);
399
- }
400
-
401
- /* Quick and dirty PUT support. */
402
- if ('PUT' === settings.method) {
403
- submitdata._method = 'put';
404
- }
405
-
406
- // SHOW INDICATOR
407
- $(self).html(settings.indicator);
408
-
409
- /* Defaults for ajaxoptions. */
410
- var ajaxoptions = {
411
- type : 'POST',
412
- complete: function (xhr, status) {
413
- isSubmitting = false;
414
- },
415
- data : submitdata,
416
- dataType: 'html',
417
- url : settings.target,
418
- success : function(result, status) {
419
-
420
- // INTERCEPT
421
- result = intercept.apply(self, [result, status]);
422
-
423
- if (ajaxoptions.dataType === 'html') {
424
- $(self).html(result);
425
- }
426
- self.editing = false;
427
- callback.apply(self, [result, settings, submitdata]);
428
- if (!$.trim($(self).html())) {
429
- $(self).html(settings.placeholder);
430
- }
431
- },
432
- error : function(xhr, status, error) {
433
- onerror.apply(form, [settings, self, xhr]);
434
- }
435
- };
436
-
437
- /* Override with what is given in settings.ajaxoptions. */
438
- $.extend(ajaxoptions, settings.ajaxoptions);
439
- $.ajax(ajaxoptions);
440
- }
441
- }
442
- }
443
-
444
- /* Show tooltip again. */
445
- $(self).attr('title', settings.tooltip);
446
- return false;
447
- });
448
- });
449
-
450
- // PRIVILEGED METHODS
451
-
452
- // RESET
453
- self.reset = function(form) {
454
- /* Prevent calling reset twice when blurring. */
455
- if (self.editing) {
456
- /* Before reset hook, if it returns false abort reseting. */
457
- if (false !== onreset.apply(form, [settings, self])) {
458
- $(self).text(self.revert);
459
- self.editing = false;
460
- if (!$.trim($(self).html())) {
461
- $(self).html(settings.placeholder);
462
- }
463
- /* Show tooltip again. */
464
- if (settings.tooltip) {
465
- $(self).attr('title', settings.tooltip);
466
- }
467
- }
468
- }
469
- };
470
-
471
- // DESTROY
472
- self.destroy = function(form) {
473
- $(self)
474
- .unbind($(self).data('event.editable'))
475
- .removeData('disabled.editable')
476
- .removeData('event.editable');
477
-
478
- self.clearTimeouts();
479
-
480
- if (self.editing) {
481
- reset.apply(form, [settings, self]);
482
- }
483
- };
484
-
485
- // CLEARTIMEOUT
486
- self.clearTimeout = function(t) {
487
- var timeouts = $(self).data('timeouts');
488
- clearTimeout(t);
489
- if(timeouts) {
490
- var i = timeouts.indexOf(t);
491
- if(i > -1) {
492
- timeouts.splice(i, 1);
493
- if(timeouts.length <= 0) {
494
- $(self).removeData('timeouts');
495
- }
496
- } else {
497
- console.warn('jeditable clearTimeout could not find timeout '+t);
498
- }
499
- }
500
- };
501
-
502
- // CLEAR ALL TIMEOUTS
503
- self.clearTimeouts = function () {
504
- var timeouts = $(self).data('timeouts');
505
- if(timeouts) {
506
- for(var i = 0, n = timeouts.length; i < n; ++i) {
507
- clearTimeout(timeouts[i]);
508
- }
509
- timeouts.length = 0;
510
- $(self).removeData('timeouts');
511
- }
512
- };
513
-
514
- // SETTIMEOUT
515
- self.setTimeout = function(callback, time) {
516
- var timeouts = $(self).data('timeouts');
517
- var t = setTimeout(function() {
518
- callback();
519
- self.clearTimeout(t);
520
- }, time);
521
- if(!timeouts) {
522
- timeouts = [];
523
- $(self).data('timeouts', timeouts);
524
- }
525
- timeouts.push(t);
526
- return t;
527
- };
528
- });
529
- };
530
-
531
- var _supportInType = function (type) {
532
- var i = document.createElement('input');
533
- i.setAttribute('type', type);
534
- return i.type !== 'text' ? type : 'text';
535
- };
536
-
537
-
538
- $.editable = {
539
- types: {
540
- defaults: {
541
- element : function(settings, original) {
542
- var input = $('<input type="hidden"></input>');
543
- $(this).append(input);
544
- return(input);
545
- },
546
- content : function(string, settings, original) {
547
- $(this).find(':input:first').val(string);
548
- },
549
- reset : function(settings, original) {
550
- original.reset(this);
551
- },
552
- destroy: function(settings, original) {
553
- original.destroy(this);
554
- },
555
- buttons : function(settings, original) {
556
- var form = this;
557
- var submit;
558
- if (settings.submit) {
559
- /* If given html string use that. */
560
- if (settings.submit.match(/>$/)) {
561
- submit = $(settings.submit).click(function() {
562
- if (submit.attr('type') !== 'submit') {
563
- form.submit();
564
- }
565
- });
566
- /* Otherwise use button with given string as text. */
567
- } else {
568
- submit = $('<button type="submit" />');
569
- submit.html(settings.submit);
570
- if (settings.submitcssclass) {
571
- submit.addClass(settings.submitcssclass);
572
- }
573
- }
574
- $(this).append(submit);
575
- }
576
- if (settings.cancel) {
577
- var cancel;
578
- /* If given html string use that. */
579
- if (settings.cancel.match(/>$/)) {
580
- cancel = $(settings.cancel);
581
- /* otherwise use button with given string as text */
582
- } else {
583
- cancel = $('<button type="cancel" />');
584
- cancel.html(settings.cancel);
585
- if (settings.cancelcssclass) {
586
- cancel.addClass(settings.cancelcssclass);
587
- }
588
- }
589
- $(this).append(cancel);
590
-
591
- $(cancel).click(function(event) {
592
- var reset;
593
- if ($.isFunction($.editable.types[settings.type].reset)) {
594
- reset = $.editable.types[settings.type].reset;
595
- } else {
596
- reset = $.editable.types.defaults.reset;
597
- }
598
- reset.apply(form, [settings, original]);
599
- return false;
600
- });
601
- }
602
- }
603
- },
604
- text: {
605
- element : function(settings, original) {
606
- var input = $('<input />').attr({
607
- autocomplete: 'off',
608
- list: settings.list,
609
- maxlength: settings.maxlength,
610
- pattern: settings.pattern,
611
- placeholder: settings.placeholder,
612
- tooltip: settings.tooltip,
613
- type: 'text'
614
- });
615
-
616
- if (settings.width !== 'none') {
617
- input.css('width', settings.width);
618
- }
619
-
620
- if (settings.height !== 'none') {
621
- input.css('height', settings.height);
622
- }
623
-
624
- if (settings.size) {
625
- input.attr('size', settings.size);
626
- }
627
-
628
- if (settings.maxlength) {
629
- input.attr('maxlength', settings.maxlength);
630
- }
631
-
632
- $(this).append(input);
633
- return(input);
634
- }
635
- },
636
-
637
- // TEXTAREA
638
- textarea: {
639
- element : function(settings, original) {
640
- var textarea = $('<textarea></textarea>');
641
- if (settings.rows) {
642
- textarea.attr('rows', settings.rows);
643
- } else if (settings.height !== 'none') {
644
- textarea.height(settings.height);
645
- }
646
- if (settings.cols) {
647
- textarea.attr('cols', settings.cols);
648
- } else if (settings.width !== 'none') {
649
- textarea.width(settings.width);
650
- }
651
-
652
- if (settings.maxlength) {
653
- textarea.attr('maxlength', settings.maxlength);
654
- }
655
-
656
- $(this).append(textarea);
657
- return(textarea);
658
- }
659
- },
660
-
661
- // SELECT
662
- select: {
663
- element : function(settings, original) {
664
- var select = $('<select />');
665
-
666
- if (settings.multiple) {
667
- select.attr('multiple', 'multiple');
668
- }
669
-
670
- $(this).append(select);
671
- return(select);
672
- },
673
- content : function(data, settings, original) {
674
- var json;
675
- // If it is string assume it is json
676
- if (String === data.constructor) {
677
- json = JSON.parse(data);
678
- } else {
679
- // Otherwise assume it is a hash already
680
- json = data;
681
- }
682
-
683
- // Create tuples for sorting
684
- var tuples = [];
685
- var key;
686
-
687
- if (Array.isArray(json) && json.every(Array.isArray)) {
688
- // Process list of tuples
689
- tuples = json // JSON already contains list of [key, value]
690
- json = {};
691
- tuples.forEach(function(e) {
692
- json[e[0]] = e[1]; // Recreate json object to comply with following code
693
- });
694
- } else {
695
- // Process object
696
- for (key in json) {
697
- tuples.push([key, json[key]]); // Store: [key, value]
698
- }
699
- }
700
-
701
- if (settings.sortselectoptions) {
702
- // sort it
703
- tuples.sort(function (a, b) {
704
- a = a[1];
705
- b = b[1];
706
- return a < b ? -1 : (a > b ? 1 : 0);
707
- });
708
- }
709
- // now add the options to our select
710
- var option;
711
- for (var i = 0; i < tuples.length; i++) {
712
- key = tuples[i][0];
713
- var value = tuples[i][1];
714
-
715
- if (!json.hasOwnProperty(key)) {
716
- continue;
717
- }
718
-
719
- if (key !== 'selected') {
720
- option = $('<option />').val(key).append(value);
721
-
722
- // add the selected prop if it's the same as original or if the key is 'selected'
723
- if (json.selected === key || key === $.trim(original.revert)) {
724
- $(option).prop('selected', 'selected');
725
- }
726
-
727
- $(this).find('select').append(option);
728
- }
729
- }
730
-
731
- // submit on change if no submit button defined
732
- if (!settings.submit) {
733
- var form = this;
734
- $(this).find('select').change(function() {
735
- form.submit();
736
- });
737
- }
738
- }
739
- },
740
-
741
- // NUMBER
742
- number: {
743
- element: function (settings, original) {
744
- var input = $('<input />').attr({
745
- maxlength: settings.maxlength,
746
- placeholder: settings.placeholder,
747
- min : settings.min,
748
- max : settings.max,
749
- step: settings.step,
750
- tooltip: settings.tooltip,
751
- type: _supportInType('number')
752
- });
753
- if (settings.width !== 'none') {
754
- input.css('width', settings.width);
755
- }
756
- $(this).append(input);
757
- return input;
758
- }
759
- },
760
-
761
- // EMAIL
762
- email: {
763
- element: function (settings, original) {
764
- var input = $('<input />').attr({
765
- maxlength: settings.maxlength,
766
- placeholder: settings.placeholder,
767
- tooltip: settings.tooltip,
768
- type: _supportInType('email')
769
- });
770
- if (settings.width !== 'none') {
771
- input.css('width', settings.width);
772
- }
773
- $(this).append(input);
774
- return input;
775
- }
776
- },
777
-
778
- // URL
779
- url: {
780
- element: function (settings, original) {
781
- var input = $('<input />').attr({
782
- maxlength: settings.maxlength,
783
- pattern: settings.pattern,
784
- placeholder: settings.placeholder,
785
- tooltip: settings.tooltip,
786
- type: _supportInType('url')
787
- });
788
- if (settings.width !== 'none') {
789
- input.css('width', settings.width);
790
- }
791
- $(this).append(input);
792
- return input;
793
- }
794
- }
795
- },
796
-
797
- // add new input type
798
- addInputType: function(name, input) {
799
- $.editable.types[name] = input;
800
- }
801
- };
802
-
803
- /* Publicly accessible defaults. */
804
- $.fn.editable.defaults = {
805
- name : 'value',
806
- id : 'id',
807
- type : 'text',
808
- width : 'auto',
809
- height : 'auto',
810
- // Keyboard accessibility - use mouse click OR press any key to enable editing
811
- event : 'click.editable keydown.editable',
812
- onblur : 'cancel',
813
- tooltip : 'Click to edit',
814
- loadtype : 'GET',
815
- loadtext : 'Loading...',
816
- placeholder: 'Click to edit',
817
- sortselectoptions: false,
818
- loaddata : {},
819
- submitdata : {},
820
- ajaxoptions: {}
821
- };
822
-
823
- })(jQuery);
1
+ /**
2
+ * @file Jeditable - jQuery in place edit plugin
3
+ * @home https://github.com/NicolasCARPi/jquery_jeditable
4
+ * @author Mika Tuupola, Dylan Verheul, Nicolas CARPi
5
+ * @copyright © 2006 Mika Tuupola, Dylan Verheul, Nicolas CARPi
6
+ * @licence MIT (see LICENCE file)
7
+ * @name Jquery-jeditable
8
+ * @type jQuery
9
+ *
10
+ * @param {String|Function} target - URL or Function to send edited content to. Can also be 'disable', 'enable', or 'destroy'
11
+ * @param {Object} [options] - Additional options
12
+ * @param {Object} [options.ajaxoptions] - jQuery Ajax options. See https://api.jquery.com/jQuery.ajax/
13
+ * @param {Function} [options.before] - Function to be executed before going into edit mode
14
+ * @param {Function} [options.callback] - function(result, settings, submitdata) Function to run after submitting edited content
15
+ * @param {String} [options.cancel] - Cancel button value, empty means no button
16
+ * @param {String} [options.cancelcssclass] - CSS class to apply to cancel button
17
+ * @param {Number} [options.cols] - Number of columns if using textarea
18
+ * @param {String} [options.cssclass] - CSS class to apply to input form; use 'inherit' to copy from parent
19
+ * @param {String} [options.inputcssclass] - CSS class to apply to input. 'inherit' to copy from parent
20
+ * @param {String|Function} [options.data] - Content loaded in the form
21
+ * @param {String} [options.event='click'] - jQuery event such as 'click' of 'dblclick'. See https://api.jquery.com/category/events/
22
+ * @param {String} [options.formid] - Give an id to the form that is produced
23
+ * @param {String|Number} [options.height='auto'] - Height of the element in pixels or 'auto' or 'none'
24
+ * @param {String} [options.id='id'] - POST parameter name of edited div id
25
+ * @param {String} [options.indicator] - Indicator html to show when saving
26
+ * @param {String} [options.label] - Label for the form
27
+ * @param {String} [options.list] - HTML5 attribute for text input. Will suggest from a datalist with id of the list option
28
+ * @param {String|Function} [options.loaddata] - Extra parameters to pass when fetching content before editing
29
+ * @param {String} [options.loadtext='Loading…'] - Text to display while loading external content
30
+ * @param {String} [options.loadtype='GET'] - Request type for loadurl (GET or POST)
31
+ * @param {String} [options.loadurl] - URL to fetch input content before editing
32
+ * @param {Number} [options.max] - Maximum value for number type
33
+ * @param {String} [options.maxlength] - The maximum number of character in the text field
34
+ * @param {String} [options.method] - Method to use to send edited content (POST or PUT)
35
+ * @param {Number} [options.min] - Mininum value for number type
36
+ * @param {Boolean} [options.multiple] - Allow multiple selections in a select input
37
+ * @param {String} [options.name='value'] - POST parameter name of edited content
38
+ * @param {String|Function} [options.onblur='cancel'] - Use 'cancel', 'submit', 'ignore' or function. If function returns false, the form is cancelled.
39
+ * @param {Function} [options.onedit] - function triggered upon edition; will cancel edition if it returns false
40
+ * @param {Function} [options.onerror] - function(settings, original, xhr) { ... } called on error
41
+ * @param {Function} [options.onreset] - function(settings, original) { ... } called before reset
42
+ * @param {Function} [options.onsubmit] - function(settings, original) { ... } called before submit
43
+ * @param {String} [options.pattern] - HTML5 attribute for text or URL input
44
+ * @param {String} [options.placeholder='Click to edit'] - Placeholder text or html to insert when element is empty
45
+ * @param {Number} [options.rows] - number of rows if using textarea
46
+ * @param {Boolean} [options.select] - When true text is selected
47
+ * @param {Function} [options.showfn]- Function that can animate the element when switching to edit mode
48
+ * @param {String} [options.size] - The size of the text field
49
+ * @param {String} [options.sortselectoptions] - Sort the options of a select form
50
+ * @param {Number} [options.step] - Step size for number type
51
+ * @param {String} [options.style] - Style to apply to input form; 'inherit' to copy from parent
52
+ * @param {String} [options.submit] - submit button value, empty means no button
53
+ * @param {String} [options.submitcssclass] - CSS class to apply to submit button
54
+ * @param {Object|Function} [options.submitdata] - Extra parameters to send when submitting edited content. function(revert, settings, submitdata)
55
+ * @param {String} [options.tooltip] - Tooltip text that appears on hover (via title attribute)
56
+ * @param {String} [options.type='text'] - text, textarea, select, email, number, url (or any 3rd party input type)
57
+ * @param {String|Number} [options.width='auto'] - The width of the element in pixels or 'auto' or 'none'
58
+ *
59
+ * @example <caption>Simple usage example:</caption>
60
+ * $(".editable").editable("save.php", {
61
+ * cancel : 'Cancel',
62
+ * submit : 'Save',
63
+ * tooltip : "Click to edit...",
64
+ * });
65
+ */
66
+ (function($) {
67
+
68
+ 'use strict';
69
+
70
+ // Keyboard accessibility/WAI-ARIA - allow users to navigate to an editable element using TAB/Shift+TAB
71
+ $.fn.editableAriaShim = function () {
72
+ this.attr({
73
+ role: 'button',
74
+ tabindex: 0
75
+ });
76
+ return this; // <-- object chaining.
77
+ };
78
+
79
+ // EDITABLE function
80
+ $.fn.editable = function(target, options) {
81
+
82
+ if ('disable' === target) {
83
+ $(this).data('disabled.editable', true);
84
+ return;
85
+ }
86
+ if ('enable' === target) {
87
+ $(this).data('disabled.editable', false);
88
+ return;
89
+ }
90
+ if ('destroy' === target) {
91
+ $(this)
92
+ .unbind($(this).data('event.editable'))
93
+ .removeData('disabled.editable')
94
+ .removeData('event.editable');
95
+ return;
96
+ }
97
+ var settings = $.extend({}, $.fn.editable.defaults, {target:target}, options);
98
+
99
+ /* setup some functions */
100
+ var plugin = $.editable.types[settings.type].plugin || function() { };
101
+ var submit = $.editable.types[settings.type].submit || function() { };
102
+ var buttons = $.editable.types[settings.type].buttons || $.editable.types.defaults.buttons;
103
+ var content = $.editable.types[settings.type].content || $.editable.types.defaults.content;
104
+ var element = $.editable.types[settings.type].element || $.editable.types.defaults.element;
105
+ var reset = $.editable.types[settings.type].reset || $.editable.types.defaults.reset;
106
+ var destroy = $.editable.types[settings.type].destroy || $.editable.types.defaults.destroy;
107
+ var callback = settings.callback || function() { };
108
+ var intercept = settings.intercept || function(s) { return s; };
109
+ var onedit = settings.onedit || function() { };
110
+ var onsubmit = settings.onsubmit || function() { };
111
+ var onreset = settings.onreset || function() { };
112
+ var onerror = settings.onerror || reset;
113
+ var before = settings.before || false;
114
+
115
+ // TOOLTIP
116
+ if (settings.tooltip) {
117
+ $(this).attr('title', settings.tooltip);
118
+ }
119
+
120
+ return this.each(function() {
121
+
122
+ /* Save this to self because this changes when scope changes. */
123
+ var self = this;
124
+
125
+ /* Save so it can be later used by $.editable('destroy') */
126
+ $(this).data('event.editable', settings.event);
127
+
128
+ /* If element is empty add something clickable (if requested) */
129
+ if (!$.trim($(this).html())) {
130
+ $(this).html(settings.placeholder);
131
+ }
132
+
133
+ if ('destroy' === target) {
134
+ destroy.apply($(this).find('form'), [settings, self]);
135
+ return;
136
+ }
137
+
138
+ // EVENT IS FIRED
139
+ $(this).bind(settings.event, function(e) {
140
+
141
+ /* Abort if element is disabled. */
142
+ if (true === $(this).data('disabled.editable')) {
143
+ return;
144
+ }
145
+
146
+ // do nothing if user press Tab again, just go to next element, not into edit mode
147
+ if (e.which === 9) {
148
+ return;
149
+ }
150
+
151
+ /* Prevent throwing an exeption if edit field is clicked again. */
152
+ if (self.editing) {
153
+ return;
154
+ }
155
+
156
+ /* Abort if onedit hook returns false. */
157
+ if (false === onedit.apply(this, [settings, self, e])) {
158
+ return;
159
+ }
160
+
161
+ /* execute the before function if any was specified */
162
+ if (settings.before && jQuery.isFunction(settings.before)) {
163
+ settings.before(e);
164
+ } else if (settings.before && !jQuery.isFunction(settings.before)) {
165
+ throw "The 'before' option needs to be provided as a function!";
166
+ }
167
+
168
+ /* Prevent default action and bubbling. */
169
+ e.preventDefault();
170
+ e.stopPropagation();
171
+
172
+ /* Remove tooltip. */
173
+ if (settings.tooltip) {
174
+ $(self).removeAttr('title');
175
+ }
176
+
177
+ /* Remove placeholder text, replace is here because of IE. */
178
+ if ($(this).html().toLowerCase().replace(/(;|"|\/)/g, '') ===
179
+ settings.placeholder.toLowerCase().replace(/(;|"|\/)/g, '')) {
180
+ $(this).html('');
181
+ }
182
+
183
+ self.editing = true;
184
+ self.revert = $(self).text();
185
+ $(self).html('');
186
+
187
+ /* Create the form object. */
188
+ var form = $('<form />');
189
+
190
+ /* Apply css or style or both. */
191
+ if (settings.cssclass) {
192
+ if ('inherit' === settings.cssclass) {
193
+ form.attr('class', $(self).attr('class'));
194
+ } else {
195
+ form.attr('class', settings.cssclass);
196
+ }
197
+ }
198
+
199
+ if (settings.style) {
200
+ if ('inherit' === settings.style) {
201
+ form.attr('style', $(self).attr('style'));
202
+ /* IE needs the second line or display wont be inherited. */
203
+ form.css('display', $(self).css('display'));
204
+ } else {
205
+ form.attr('style', settings.style);
206
+ }
207
+ }
208
+
209
+ // add a label if it exists
210
+ if (settings.label) {
211
+ form.append('<label>' + settings.label + '</label>');
212
+ }
213
+
214
+ // add an ID to the form
215
+ if (settings.formid) {
216
+ form.attr('id', settings.formid);
217
+ }
218
+
219
+ /* Add main input element to form and store it in input. */
220
+ var input = element.apply(form, [settings, self]);
221
+
222
+ if (settings.inputcssclass) {
223
+ if ('inherit' === settings.inputcssclass) {
224
+ input.attr('class', $(self).attr('class'));
225
+ } else {
226
+ input.attr('class', settings.inputcssclass);
227
+ }
228
+ }
229
+
230
+ /* Set input content via POST, GET, given data or existing value. */
231
+ var input_content;
232
+
233
+ // timeout function
234
+ var t;
235
+ var isSubmitting = false;
236
+
237
+ if (settings.loadurl) {
238
+ t = self.setTimeout(function() {
239
+ input.disabled = true;
240
+ }, 100);
241
+ $(self).html(settings.loadtext);
242
+
243
+ var loaddata = {};
244
+ loaddata[settings.id] = self.id;
245
+ if ($.isFunction(settings.loaddata)) {
246
+ $.extend(loaddata, settings.loaddata.apply(self, [self.revert, settings]));
247
+ } else {
248
+ $.extend(loaddata, settings.loaddata);
249
+ }
250
+ $.ajax({
251
+ type : settings.loadtype,
252
+ url : settings.loadurl,
253
+ data : loaddata,
254
+ async: false,
255
+ cache : false,
256
+ success: function(result) {
257
+ self.clearTimeout(t);
258
+ input_content = result;
259
+ input.disabled = false;
260
+ }
261
+ });
262
+ } else if (settings.data) {
263
+ input_content = settings.data;
264
+ if ($.isFunction(settings.data)) {
265
+ input_content = settings.data.apply(self, [self.revert, settings]);
266
+ }
267
+ } else {
268
+ input_content = self.revert;
269
+ }
270
+ content.apply(form, [input_content, settings, self]);
271
+
272
+ input.attr('name', settings.name);
273
+
274
+ /* adjust the width of the element to account for the margin/padding/border */
275
+ if (settings.width !== 'none') {
276
+ var adj_width = settings.width - (input.outerWidth(true) - settings.width);
277
+ input.width(adj_width);
278
+ }
279
+
280
+ /* Add buttons to the form. */
281
+ buttons.apply(form, [settings, self]);
282
+
283
+ /* Add created form to self. */
284
+ if (settings.showfn && $.isFunction(settings.showfn)) {
285
+ form.hide();
286
+ }
287
+
288
+ // clear the loadtext that we put here before
289
+ $(self).html('');
290
+
291
+ $(self).append(form);
292
+
293
+ // execute the showfn
294
+ if (settings.showfn && $.isFunction(settings.showfn)) {
295
+ settings.showfn(form);
296
+ }
297
+
298
+ /* Attach 3rd party plugin if requested. */
299
+ plugin.apply(form, [settings, self]);
300
+
301
+ /* Focus to first visible form element. */
302
+ form.find(':input:visible:enabled:first').focus();
303
+
304
+ /* Highlight input contents when requested. */
305
+ if (settings.select) {
306
+ input.select();
307
+ }
308
+
309
+ /* discard changes if pressing esc */
310
+ $(this).keydown(function(e) {
311
+ if (e.which === 27) {
312
+ e.preventDefault();
313
+ reset.apply(form, [settings, self]);
314
+ }
315
+ });
316
+
317
+ /* Discard, submit or nothing with changes when clicking outside. */
318
+ /* Do nothing is usable when navigating with tab. */
319
+ if ('cancel' === settings.onblur) {
320
+ input.blur(function(e) {
321
+ /* Prevent canceling if submit was clicked. */
322
+ t = self.setTimeout(function() {
323
+ reset.apply(form, [settings, self]);
324
+ }, 500);
325
+ });
326
+ } else if ('submit' === settings.onblur) {
327
+ input.blur(function(e) {
328
+ /* Prevent double submit if submit was clicked. */
329
+ t = self.setTimeout(function() {
330
+ form.submit();
331
+ }, 200);
332
+ });
333
+ } else if ($.isFunction(settings.onblur)) {
334
+ input.blur(function(e) {
335
+ // reset the form if the onblur function returns false
336
+ if (false === settings.onblur.apply(self, [input.val(), settings, form])) {
337
+ reset.apply(form, [settings, self]);
338
+ }
339
+ });
340
+ }
341
+
342
+ form.submit(function(e) {
343
+
344
+ /* Do no submit. */
345
+ e.preventDefault();
346
+ e.stopPropagation();
347
+
348
+ if (isSubmitting) {
349
+ // we are already submitting! Stop right here.
350
+ return false;
351
+ } else {
352
+ isSubmitting = true;
353
+ }
354
+
355
+ if (t) {
356
+ self.clearTimeout(t);
357
+ }
358
+
359
+ /* Call before submit hook. */
360
+ /* If it returns false abort submitting. */
361
+ isSubmitting = false !== onsubmit.apply(form, [settings, self]);
362
+ if (isSubmitting) {
363
+ /* Custom inputs call before submit hook. */
364
+ /* If it returns false abort submitting. */
365
+ isSubmitting = false !== submit.apply(form, [settings, self]);
366
+ if (isSubmitting) {
367
+
368
+ /* Check if given target is function */
369
+ if ($.isFunction(settings.target)) {
370
+ /* Callback function to handle the target reponse */
371
+ var responseHandler = function(value, complete) {
372
+ isSubmitting = false;
373
+ if (false !== complete) {
374
+ $(self).html(value);
375
+ self.editing = false;
376
+ callback.apply(self, [self.innerHTML, settings]);
377
+ if (!$.trim($(self).html())) {
378
+ $(self).html(settings.placeholder);
379
+ }
380
+ }
381
+ };
382
+ /* Call the user target function */
383
+ var userTarget = settings.target.apply(self, [input.val(), settings, responseHandler]);
384
+ /* Handle the target function return for compatibility */
385
+ if (false !== userTarget && undefined !== userTarget) {
386
+ responseHandler(userTarget, userTarget);
387
+ }
388
+
389
+ } else {
390
+ /* Add edited content and id of edited element to POST. */
391
+ var submitdata = {};
392
+ submitdata[settings.name] = input.val();
393
+ submitdata[settings.id] = self.id;
394
+ /* Add extra data to be POST:ed. */
395
+ if ($.isFunction(settings.submitdata)) {
396
+ $.extend(submitdata, settings.submitdata.apply(self, [self.revert, settings, submitdata]));
397
+ } else {
398
+ $.extend(submitdata, settings.submitdata);
399
+ }
400
+
401
+ /* Quick and dirty PUT support. */
402
+ if ('PUT' === settings.method) {
403
+ submitdata._method = 'put';
404
+ }
405
+
406
+ // SHOW INDICATOR
407
+ $(self).html(settings.indicator);
408
+
409
+ /* Defaults for ajaxoptions. */
410
+ var ajaxoptions = {
411
+ type : 'POST',
412
+ complete: function (xhr, status) {
413
+ isSubmitting = false;
414
+ },
415
+ data : submitdata,
416
+ dataType: 'html',
417
+ url : settings.target,
418
+ success : function(result, status) {
419
+
420
+ // INTERCEPT
421
+ result = intercept.apply(self, [result, status]);
422
+
423
+ if (ajaxoptions.dataType === 'html') {
424
+ $(self).html(result);
425
+ }
426
+ self.editing = false;
427
+ callback.apply(self, [result, settings, submitdata]);
428
+ if (!$.trim($(self).html())) {
429
+ $(self).html(settings.placeholder);
430
+ }
431
+ },
432
+ error : function(xhr, status, error) {
433
+ onerror.apply(form, [settings, self, xhr]);
434
+ }
435
+ };
436
+
437
+ /* Override with what is given in settings.ajaxoptions. */
438
+ $.extend(ajaxoptions, settings.ajaxoptions);
439
+ $.ajax(ajaxoptions);
440
+ }
441
+ }
442
+ }
443
+
444
+ /* Show tooltip again. */
445
+ $(self).attr('title', settings.tooltip);
446
+ return false;
447
+ });
448
+ });
449
+
450
+ // PRIVILEGED METHODS
451
+
452
+ // RESET
453
+ self.reset = function(form) {
454
+ /* Prevent calling reset twice when blurring. */
455
+ if (self.editing) {
456
+ /* Before reset hook, if it returns false abort reseting. */
457
+ if (false !== onreset.apply(form, [settings, self])) {
458
+ $(self).text(self.revert);
459
+ self.editing = false;
460
+ if (!$.trim($(self).html())) {
461
+ $(self).html(settings.placeholder);
462
+ }
463
+ /* Show tooltip again. */
464
+ if (settings.tooltip) {
465
+ $(self).attr('title', settings.tooltip);
466
+ }
467
+ }
468
+ }
469
+ };
470
+
471
+ // DESTROY
472
+ self.destroy = function(form) {
473
+ $(self)
474
+ .unbind($(self).data('event.editable'))
475
+ .removeData('disabled.editable')
476
+ .removeData('event.editable');
477
+
478
+ self.clearTimeouts();
479
+
480
+ if (self.editing) {
481
+ reset.apply(form, [settings, self]);
482
+ }
483
+ };
484
+
485
+ // CLEARTIMEOUT
486
+ self.clearTimeout = function(t) {
487
+ var timeouts = $(self).data('timeouts');
488
+ clearTimeout(t);
489
+ if(timeouts) {
490
+ var i = timeouts.indexOf(t);
491
+ if(i > -1) {
492
+ timeouts.splice(i, 1);
493
+ if(timeouts.length <= 0) {
494
+ $(self).removeData('timeouts');
495
+ }
496
+ } else {
497
+ console.warn('jeditable clearTimeout could not find timeout '+t);
498
+ }
499
+ }
500
+ };
501
+
502
+ // CLEAR ALL TIMEOUTS
503
+ self.clearTimeouts = function () {
504
+ var timeouts = $(self).data('timeouts');
505
+ if(timeouts) {
506
+ for(var i = 0, n = timeouts.length; i < n; ++i) {
507
+ clearTimeout(timeouts[i]);
508
+ }
509
+ timeouts.length = 0;
510
+ $(self).removeData('timeouts');
511
+ }
512
+ };
513
+
514
+ // SETTIMEOUT
515
+ self.setTimeout = function(callback, time) {
516
+ var timeouts = $(self).data('timeouts');
517
+ var t = setTimeout(function() {
518
+ callback();
519
+ self.clearTimeout(t);
520
+ }, time);
521
+ if(!timeouts) {
522
+ timeouts = [];
523
+ $(self).data('timeouts', timeouts);
524
+ }
525
+ timeouts.push(t);
526
+ return t;
527
+ };
528
+ });
529
+ };
530
+
531
+ var _supportInType = function (type) {
532
+ var i = document.createElement('input');
533
+ i.setAttribute('type', type);
534
+ return i.type !== 'text' ? type : 'text';
535
+ };
536
+
537
+
538
+ $.editable = {
539
+ types: {
540
+ defaults: {
541
+ element : function(settings, original) {
542
+ var input = $('<input type="hidden"></input>');
543
+ $(this).append(input);
544
+ return(input);
545
+ },
546
+ content : function(string, settings, original) {
547
+ $(this).find(':input:first').val(string);
548
+ },
549
+ reset : function(settings, original) {
550
+ original.reset(this);
551
+ },
552
+ destroy: function(settings, original) {
553
+ original.destroy(this);
554
+ },
555
+ buttons : function(settings, original) {
556
+ var form = this;
557
+ var submit;
558
+ if (settings.submit) {
559
+ /* If given html string use that. */
560
+ if (settings.submit.match(/>$/)) {
561
+ submit = $(settings.submit).click(function() {
562
+ if (submit.attr('type') !== 'submit') {
563
+ form.submit();
564
+ }
565
+ });
566
+ /* Otherwise use button with given string as text. */
567
+ } else {
568
+ submit = $('<button type="submit" />');
569
+ submit.html(settings.submit);
570
+ if (settings.submitcssclass) {
571
+ submit.addClass(settings.submitcssclass);
572
+ }
573
+ }
574
+ $(this).append(submit);
575
+ }
576
+ if (settings.cancel) {
577
+ var cancel;
578
+ /* If given html string use that. */
579
+ if (settings.cancel.match(/>$/)) {
580
+ cancel = $(settings.cancel);
581
+ /* otherwise use button with given string as text */
582
+ } else {
583
+ cancel = $('<button type="cancel" />');
584
+ cancel.html(settings.cancel);
585
+ if (settings.cancelcssclass) {
586
+ cancel.addClass(settings.cancelcssclass);
587
+ }
588
+ }
589
+ $(this).append(cancel);
590
+
591
+ $(cancel).click(function(event) {
592
+ var reset;
593
+ if ($.isFunction($.editable.types[settings.type].reset)) {
594
+ reset = $.editable.types[settings.type].reset;
595
+ } else {
596
+ reset = $.editable.types.defaults.reset;
597
+ }
598
+ reset.apply(form, [settings, original]);
599
+ return false;
600
+ });
601
+ }
602
+ }
603
+ },
604
+ text: {
605
+ element : function(settings, original) {
606
+ var input = $('<input />').attr({
607
+ autocomplete: 'off',
608
+ list: settings.list,
609
+ maxlength: settings.maxlength,
610
+ pattern: settings.pattern,
611
+ placeholder: settings.placeholder,
612
+ tooltip: settings.tooltip,
613
+ type: 'text'
614
+ });
615
+
616
+ if (settings.width !== 'none') {
617
+ input.css('width', settings.width);
618
+ }
619
+
620
+ if (settings.height !== 'none') {
621
+ input.css('height', settings.height);
622
+ }
623
+
624
+ if (settings.size) {
625
+ input.attr('size', settings.size);
626
+ }
627
+
628
+ if (settings.maxlength) {
629
+ input.attr('maxlength', settings.maxlength);
630
+ }
631
+
632
+ $(this).append(input);
633
+ return(input);
634
+ }
635
+ },
636
+
637
+ // TEXTAREA
638
+ textarea: {
639
+ element : function(settings, original) {
640
+ var textarea = $('<textarea></textarea>');
641
+ if (settings.rows) {
642
+ textarea.attr('rows', settings.rows);
643
+ } else if (settings.height !== 'none') {
644
+ textarea.height(settings.height);
645
+ }
646
+ if (settings.cols) {
647
+ textarea.attr('cols', settings.cols);
648
+ } else if (settings.width !== 'none') {
649
+ textarea.width(settings.width);
650
+ }
651
+
652
+ if (settings.maxlength) {
653
+ textarea.attr('maxlength', settings.maxlength);
654
+ }
655
+
656
+ $(this).append(textarea);
657
+ return(textarea);
658
+ }
659
+ },
660
+
661
+ // SELECT
662
+ select: {
663
+ element : function(settings, original) {
664
+ var select = $('<select />');
665
+
666
+ if (settings.multiple) {
667
+ select.attr('multiple', 'multiple');
668
+ }
669
+
670
+ $(this).append(select);
671
+ return(select);
672
+ },
673
+ content : function(data, settings, original) {
674
+ var json;
675
+ // If it is string assume it is json
676
+ if (String === data.constructor) {
677
+ json = JSON.parse(data);
678
+ } else {
679
+ // Otherwise assume it is a hash already
680
+ json = data;
681
+ }
682
+
683
+ // Create tuples for sorting
684
+ var tuples = [];
685
+ var key;
686
+
687
+ if (Array.isArray(json) && json.every(Array.isArray)) {
688
+ // Process list of tuples
689
+ tuples = json // JSON already contains list of [key, value]
690
+ json = {};
691
+ tuples.forEach(function(e) {
692
+ json[e[0]] = e[1]; // Recreate json object to comply with following code
693
+ });
694
+ } else {
695
+ // Process object
696
+ for (key in json) {
697
+ tuples.push([key, json[key]]); // Store: [key, value]
698
+ }
699
+ }
700
+
701
+ if (settings.sortselectoptions) {
702
+ // sort it
703
+ tuples.sort(function (a, b) {
704
+ a = a[1];
705
+ b = b[1];
706
+ return a < b ? -1 : (a > b ? 1 : 0);
707
+ });
708
+ }
709
+ // now add the options to our select
710
+ var option;
711
+ for (var i = 0; i < tuples.length; i++) {
712
+ key = tuples[i][0];
713
+ var value = tuples[i][1];
714
+
715
+ if (!json.hasOwnProperty(key)) {
716
+ continue;
717
+ }
718
+
719
+ if (key !== 'selected') {
720
+ option = $('<option />').val(key).append(value);
721
+
722
+ // add the selected prop if it's the same as original or if the key is 'selected'
723
+ if (json.selected === key || key === $.trim(original.revert)) {
724
+ $(option).prop('selected', 'selected');
725
+ }
726
+
727
+ $(this).find('select').append(option);
728
+ }
729
+ }
730
+
731
+ // submit on change if no submit button defined
732
+ if (!settings.submit) {
733
+ var form = this;
734
+ $(this).find('select').change(function() {
735
+ form.submit();
736
+ });
737
+ }
738
+ }
739
+ },
740
+
741
+ // NUMBER
742
+ number: {
743
+ element: function (settings, original) {
744
+ var input = $('<input />').attr({
745
+ maxlength: settings.maxlength,
746
+ placeholder: settings.placeholder,
747
+ min : settings.min,
748
+ max : settings.max,
749
+ step: settings.step,
750
+ tooltip: settings.tooltip,
751
+ type: _supportInType('number')
752
+ });
753
+ if (settings.width !== 'none') {
754
+ input.css('width', settings.width);
755
+ }
756
+ $(this).append(input);
757
+ return input;
758
+ }
759
+ },
760
+
761
+ // EMAIL
762
+ email: {
763
+ element: function (settings, original) {
764
+ var input = $('<input />').attr({
765
+ maxlength: settings.maxlength,
766
+ placeholder: settings.placeholder,
767
+ tooltip: settings.tooltip,
768
+ type: _supportInType('email')
769
+ });
770
+ if (settings.width !== 'none') {
771
+ input.css('width', settings.width);
772
+ }
773
+ $(this).append(input);
774
+ return input;
775
+ }
776
+ },
777
+
778
+ // URL
779
+ url: {
780
+ element: function (settings, original) {
781
+ var input = $('<input />').attr({
782
+ maxlength: settings.maxlength,
783
+ pattern: settings.pattern,
784
+ placeholder: settings.placeholder,
785
+ tooltip: settings.tooltip,
786
+ type: _supportInType('url')
787
+ });
788
+ if (settings.width !== 'none') {
789
+ input.css('width', settings.width);
790
+ }
791
+ $(this).append(input);
792
+ return input;
793
+ }
794
+ }
795
+ },
796
+
797
+ // add new input type
798
+ addInputType: function(name, input) {
799
+ $.editable.types[name] = input;
800
+ }
801
+ };
802
+
803
+ /* Publicly accessible defaults. */
804
+ $.fn.editable.defaults = {
805
+ name : 'value',
806
+ id : 'id',
807
+ type : 'text',
808
+ width : 'auto',
809
+ height : 'auto',
810
+ // Keyboard accessibility - use mouse click OR press any key to enable editing
811
+ event : 'click.editable keydown.editable',
812
+ onblur : 'cancel',
813
+ tooltip : 'Click to edit',
814
+ loadtype : 'GET',
815
+ loadtext : 'Loading...',
816
+ placeholder: 'Click to edit',
817
+ sortselectoptions: false,
818
+ loaddata : {},
819
+ submitdata : {},
820
+ ajaxoptions: {}
821
+ };
822
+
823
+ })(jQuery);